public class ZkStateReader extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE |
static String |
ALIASES |
static String |
BASE_URL_PROP |
static String |
CLUSTER_STATE |
static String |
COLLECTION_PROP |
static String |
COLLECTIONS_ZKNODE |
static String |
CORE_NAME_PROP |
static String |
CORE_NODE_NAME_PROP |
static String |
DOWN |
static String |
LEADER_ELECT_ZKNODE |
static String |
LEADER_PROP |
static String |
LIVE_NODES_ZKNODE |
static String |
NODE_NAME_PROP |
static String |
NUM_SHARDS_PROP |
static String |
RECOVERING |
static String |
RECOVERY_FAILED |
static String |
REPLICA_PROP |
static String |
ROLES_PROP |
static String |
SHARD_ID_PROP |
static String |
SHARD_LEADERS_ZKNODE |
static String |
SHARD_PARENT_PROP |
static String |
SHARD_RANGE_PROP |
static String |
SHARD_STATE_PROP |
static String |
STATE_PROP |
static String |
SYNC |
Constructor and Description |
---|
ZkStateReader(SolrZkClient zkClient) |
ZkStateReader(String zkServerAddress,
int zkClientTimeout,
int zkClientConnectTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
createClusterStateWatchersAndUpdate() |
static Object |
fromJSON(byte[] utf8) |
Aliases |
getAliases() |
ClusterState |
getClusterState() |
Replica |
getLeaderRetry(String collection,
String shard)
Get shard leader properties, with retry if none exist.
|
Replica |
getLeaderRetry(String collection,
String shard,
int timeout)
Get shard leader properties, with retry if none exist.
|
String |
getLeaderUrl(String collection,
String shard,
int timeout) |
List<ZkCoreNodeProps> |
getReplicaProps(String collection,
String shardId,
String thisCoreNodeName,
String coreName) |
List<ZkCoreNodeProps> |
getReplicaProps(String collection,
String shardId,
String thisCoreNodeName,
String coreName,
String mustMatchStateFilter) |
List<ZkCoreNodeProps> |
getReplicaProps(String collection,
String shardId,
String thisCoreNodeName,
String coreName,
String mustMatchStateFilter,
String mustNotMatchStateFilter) |
static String |
getShardLeadersPath(String collection,
String shardId)
Get path where shard leader properties live in zookeeper.
|
Object |
getUpdateLock() |
SolrZkClient |
getZkClient() |
static byte[] |
toJSON(Object o) |
static byte[] |
toUTF8(org.noggit.CharArr out) |
void |
updateAliases() |
void |
updateClusterState(boolean immediate) |
void |
updateLiveNodes() |
public static final String BASE_URL_PROP
public static final String NODE_NAME_PROP
public static final String CORE_NODE_NAME_PROP
public static final String ROLES_PROP
public static final String STATE_PROP
public static final String CORE_NAME_PROP
public static final String COLLECTION_PROP
public static final String SHARD_ID_PROP
public static final String REPLICA_PROP
public static final String SHARD_RANGE_PROP
public static final String SHARD_STATE_PROP
public static final String SHARD_PARENT_PROP
public static final String NUM_SHARDS_PROP
public static final String LEADER_PROP
public static final String COLLECTIONS_ZKNODE
public static final String LIVE_NODES_ZKNODE
public static final String ALIASES
public static final String CLUSTER_STATE
public static final String RECOVERING
public static final String RECOVERY_FAILED
public static final String ACTIVE
public static final String DOWN
public static final String SYNC
public static final String LEADER_ELECT_ZKNODE
public static final String SHARD_LEADERS_ZKNODE
public ZkStateReader(SolrZkClient zkClient)
public ZkStateReader(String zkServerAddress, int zkClientTimeout, int zkClientConnectTimeout) throws InterruptedException, TimeoutException, IOException
public static byte[] toJSON(Object o)
public static byte[] toUTF8(org.noggit.CharArr out)
public static Object fromJSON(byte[] utf8)
public void updateClusterState(boolean immediate) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public void updateLiveNodes() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public Aliases getAliases()
public void createClusterStateWatchersAndUpdate() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public ClusterState getClusterState()
public Object getUpdateLock()
public void close()
public String getLeaderUrl(String collection, String shard, int timeout) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedException
org.apache.zookeeper.KeeperException
public Replica getLeaderRetry(String collection, String shard) throws InterruptedException
InterruptedException
public Replica getLeaderRetry(String collection, String shard, int timeout) throws InterruptedException
InterruptedException
public static String getShardLeadersPath(String collection, String shardId)
public List<ZkCoreNodeProps> getReplicaProps(String collection, String shardId, String thisCoreNodeName, String coreName)
public List<ZkCoreNodeProps> getReplicaProps(String collection, String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter)
public List<ZkCoreNodeProps> getReplicaProps(String collection, String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter, String mustNotMatchStateFilter)
public SolrZkClient getZkClient()
public void updateAliases() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.