Package org.apache.cassandra.index
Class IndexStatusManager
java.lang.Object
org.apache.cassandra.index.IndexStatusManager
Handles the status of an index across the ring, updating the status per index and endpoint
in a per-endpoint map.
Peer status changes are recieved via the StorageService IEndpointStateChangeSubscriber.
Local status changes are propagated to the Gossiper using an async executor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IndexStatusManagerfinal Map<InetAddressAndPort,Map<String, Index.Status>> A map of per-endpoint index statuses: the key of inner map is the identifier "keyspace.index" -
Method Summary
Modifier and TypeMethodDescription<E extends Endpoints<E>>
EfilterForQuery(E liveEndpoints, Keyspace keyspace, Index.QueryPlan indexQueryPlan, ConsistencyLevel level) Remove endpoints whose indexes are not queryable for the specifiedIndex.QueryPlan.getIndexStatus(InetAddressAndPort peer, String keyspace, String index) voidpropagateLocalIndexStatus(String keyspace, String index, Index.Status status) Propagate a new index status to the ring.voidreceivePeerIndexStatus(InetAddressAndPort endpoint, VersionedValue versionedValue) Recieve a new index status map from a peer.static StringtoSerializedFormat(Map<String, Index.Status> indexStatusMap) Serializes as a JSON string the status of the indexes in the provided map.
-
Field Details
-
instance
-
peerIndexStatus
A map of per-endpoint index statuses: the key of inner map is the identifier "keyspace.index"
-
-
Method Details
-
filterForQuery
public <E extends Endpoints<E>> E filterForQuery(E liveEndpoints, Keyspace keyspace, Index.QueryPlan indexQueryPlan, ConsistencyLevel level) Remove endpoints whose indexes are not queryable for the specifiedIndex.QueryPlan.- Parameters:
liveEndpoints- current live endpoints where non-queryable endpoints will be removedkeyspace- to be queriedindexQueryPlan- index query plan used in the read commandlevel- consistency level of read command
-
receivePeerIndexStatus
Recieve a new index status map from a peer. This will include the status for all the indexes on the peer.- Parameters:
endpoint- theInetAddressAndPortthe index status map is coming fromversionedValue- theVersionedValuecontaining the index status map
-
propagateLocalIndexStatus
Propagate a new index status to the ring. The new index status is added to the current index status map and the whole map is sent to the ring as aVersionedValue.- Parameters:
keyspace- the keyspace name for the indexindex- the index namestatus- the newIndex.Status
-
toSerializedFormat
Serializes as a JSON string the status of the indexes in the provided map.For example, the map...
{ ks1.cf1_idx1=FULL_REBUILD_STARTED, ks1.cf1_idx2=FULL_REBUILD_STARTED, system.PaxosUncommittedIndex=BUILD_SUCCEEDED }...will be converted to the string...{ "system": {"PaxosUncommittedIndex": 3}, "ks1": {"cf1_idx1": 1, "cf1_idx2": 1} } -
getIndexStatus
-