@@ -339,6 +339,39 @@ protected static ArcusClient getInstance(ConnectionFactory cf,
339339 return new ArcusClient (cf , name , addrs );
340340 }
341341
342+ /**
343+ * Create an Arcus client for the given memcached server addresses.
344+ * Recommand only invoked with proxy arcus server.
345+ * @param addrs socket addresses for the proxy memcached servers
346+ * @param cfb connection factory builder to configure connections for this client
347+ * @return Arcus client instance
348+ * @throws IOException
349+ */
350+ public static ArcusClient createArcusClientWithProxy (List <InetSocketAddress > addrs ,
351+ ConnectionFactoryBuilder cfb )
352+ throws IOException {
353+ return new ArcusClient (cfb .build (), addrs );
354+ }
355+
356+ /**
357+ * Create an Arcus client pool for the given memcached server addresses.
358+ * Recommand only invoked with proxy arcus server.
359+ * @param addrs socket addresses for the proxy memcached servers
360+ * @param cfb connection factory builder to configure connections for this client
361+ * @param size pool size
362+ * @return Arcus client pool instance
363+ * @throws IOException
364+ */
365+ public static ArcusClientPool createArcusClientPoolWithProxy (List <InetSocketAddress > addrs ,
366+ ConnectionFactoryBuilder cfb , int size )
367+ throws IOException {
368+ ArcusClient [] clients = new ArcusClient [size ];
369+ for (int i = 0 ; i < size ; i ++) {
370+ clients [i ] = new ArcusClient (cfb .build (), addrs );
371+ }
372+ return new ArcusClientPool (size , clients );
373+ }
374+
342375 /**
343376 * Create an Arcus client for the given memcached server addresses.
344377 *
@@ -347,7 +380,7 @@ protected static ArcusClient getInstance(ConnectionFactory cf,
347380 * @param addrs socket addresses for the memcached servers
348381 * @throws IOException if connections cannot be established
349382 */
350- public ArcusClient (ConnectionFactory cf , String name , List <InetSocketAddress > addrs )
383+ private ArcusClient (ConnectionFactory cf , String name , List <InetSocketAddress > addrs )
351384 throws IOException {
352385 super (cf , name , addrs );
353386
@@ -368,7 +401,7 @@ public ArcusClient(ConnectionFactory cf, String name, List<InetSocketAddress> ad
368401 * @param addrs socket addresses for the memcached servers
369402 * @throws IOException if connections cannot be established
370403 */
371- public ArcusClient (ConnectionFactory cf , List <InetSocketAddress > addrs )
404+ private ArcusClient (ConnectionFactory cf , List <InetSocketAddress > addrs )
372405 throws IOException {
373406 this (cf , DEFAULT_ARCUS_CLIENT_NAME + "-" + CLIENT_ID .getAndIncrement (), addrs );
374407 }
0 commit comments