Package org.apache.cassandra.index
Class IndexStatusManager
- java.lang.Object
-
- org.apache.cassandra.index.IndexStatusManager
-
public class IndexStatusManager extends java.lang.Object
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
Fields Modifier and Type Field Description static IndexStatusManager
instance
java.util.Map<InetAddressAndPort,java.util.Map<java.lang.String,Index.Status>>
peerIndexStatus
A map of per-endpoint index statuses: the key of inner map is the identifier "keyspace.index"
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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
.Index.Status
getIndexStatus(InetAddressAndPort peer, java.lang.String keyspace, java.lang.String index)
void
propagateLocalIndexStatus(java.lang.String keyspace, java.lang.String index, Index.Status status)
Propagate a new index status to the ring.void
receivePeerIndexStatus(InetAddressAndPort endpoint, VersionedValue versionedValue)
Recieve a new index status map from a peer.
-
-
-
Field Detail
-
instance
public static final IndexStatusManager instance
-
peerIndexStatus
public final java.util.Map<InetAddressAndPort,java.util.Map<java.lang.String,Index.Status>> peerIndexStatus
A map of per-endpoint index statuses: the key of inner map is the identifier "keyspace.index"
-
-
Method Detail
-
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
public void receivePeerIndexStatus(InetAddressAndPort endpoint, VersionedValue versionedValue)
Recieve a new index status map from a peer. This will include the status for all the indexes on the peer.- Parameters:
endpoint
- theInetAddressAndPort
the index status map is coming fromversionedValue
- theVersionedValue
containing the index status map
-
propagateLocalIndexStatus
public void propagateLocalIndexStatus(java.lang.String keyspace, java.lang.String index, Index.Status status)
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
-
getIndexStatus
public Index.Status getIndexStatus(InetAddressAndPort peer, java.lang.String keyspace, java.lang.String index)
-
-