Class 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 Detail

      • 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 specified Index.QueryPlan.
        Parameters:
        liveEndpoints - current live endpoints where non-queryable endpoints will be removed
        keyspace - to be queried
        indexQueryPlan - index query plan used in the read command
        level - 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 - the InetAddressAndPort the index status map is coming from
        versionedValue - the VersionedValue 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 a VersionedValue.
        Parameters:
        keyspace - the keyspace name for the index
        index - the index name
        status - the new Index.Status