Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.twitter.finagle.memcached.java;
  
  import java.util.Set;
  
  
  import  com.twitter.common.zookeeper.ZooKeeperClient;
A Java-friendly CachePoolCluster.
 
 public class CachePoolClusterUtil {

  
Cache pool based on a static list.

Parameters:
cacheNodeSet static set of cache nodes to construct the cluster
Returns:
a scala CachePoolCluster
 
       Set<CacheNodecacheNodeSet) {
     scala.collection.immutable.Set<CacheNodestaticSet =
         JavaConversions.asScalaSet(cacheNodeSet).toSet();
     return ..newStaticCluster(staticSet);
   }

  
Zookeeper based cache pool cluster. The cluster will monitor the underlying serverset changes and report the detected underlying pool size. The cluster snapshot will be updated during cache-team's managed operation, and the Future spool will be updated with corresponding changes. In case of zookeeper failure, the backup pool will be used to fill the cluster after a certain timeout.

Parameters:
zkPath the zookeeper path representing the cache pool
zkClient zookeeper client to read zookeeper
backupPool the backup static pool to use in case of ZK failure. Backup pool cannot be null and empty backup pool means the same as no backup pool.
statsReceiver the destination to report the stats to
Returns:
a scala CachePoolCluster
 
       String zkPath,
       ZooKeeperClient zkClient,
       Set<CacheNodebackupPool,
       StatsReceiver statsReceiver) {
     scala.collection.immutable.Set<CacheNodebackupSet =
         JavaConversions.asScalaSet(backupPool).toSet();
         zkPathzkClient, scala.Option.apply(backupSet), statsReceiver);
   }

  
Zookeeper based cache pool cluster. The cluster will monitor the underlying serverset changes and report the detected underlying pool size. The cluster snapshot is unmanaged in a way that any serverset change will be immediately reflected.

Parameters:
zkPath the zookeeper path representing the cache pool
zkClient zookeeper client to read zookeeper
Returns:
a Cluster<CacheNode>
 
       String zkPath, ZooKeeperClient zkClient) {
     return ..newUnmanagedZkCluster(zkPathzkClient);
   }

  
Equivalent to calling newZkCluster(String, ZooKeeperClient, Set, StatsReceiver) with a NullStatsReceiver.

Parameters:
zkPath the zookeeper path representing the cache pool
zkClient zookeeper client to read zookeeper
backupPool the backup static pool to use in case of ZK failure. Backup pool cannot be null and empty backup pool means the same as no backup pool.
Returns:
a scala CachePoolCluster
 
       String zkPath,
       ZooKeeperClient zkClient,
       Set<CacheNodebackupPool) {
     return newZkCluster(zkPathzkClientbackupPoolnew NullStatsReceiver());
   }

  
Equivalent to calling newZkCluster(String, ZooKeeperClient, Set, StatsReceiver) with no backup pool and a NullStatsReceiver. Using no backup pool means the cluster won't be ready until ZK membership is available.

Parameters:
zkPath the zookeeper path representing the cache pool
zkClient zookeeper client to read zookeeper
Returns:
a scala CachePoolCluster
 
       String zkPath,
      ZooKeeperClient zkClient) {
    return newZkCluster(zkPathzkClient, Collections.<CacheNode>emptySet());
  }
New to GrepCode? Check out our FAQ X