Package com.datastax.driver.core
Class TabletMap
- java.lang.Object
-
- com.datastax.driver.core.TabletMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTabletMap.HostShardPairSimple class to hold UUID of a host and a shard number.static classTabletMap.KeyspaceTableNamePairSimple keyspace name and table name pair.static classTabletMap.TabletRepresents a single tablet created from tablets-routing-v1 custom payload.static classTabletMap.TabletSetSet of tablets bundled with ReadWriteLock to allow concurrent modification for different sets.
-
Constructor Summary
Constructors Constructor Description TabletMap(com.datastax.driver.core.Cluster.Manager cluster, ConcurrentMap<TabletMap.KeyspaceTableNamePair,TabletMap.TabletSet> mapping)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TabletMapemptyMap(com.datastax.driver.core.Cluster.Manager cluster)Map<TabletMap.KeyspaceTableNamePair,TabletMap.TabletSet>getMapping()Returns the mapping of tables to their tablets.TupleTypegetPayloadInnerTuple()TupleTypegetPayloadOuterTuple()List<Host>getReplicas(String keyspace, String table, long token)Finds hosts that have replicas for a given table and token combination.TypeCodec<TupleValue>getTabletPayloadCodec()voidremoveTableMappings(TabletMap.KeyspaceTableNamePair key)voidremoveTableMappings(String keyspace)voidremoveTableMappings(String keyspace, String table)
-
-
-
Constructor Detail
-
TabletMap
public TabletMap(com.datastax.driver.core.Cluster.Manager cluster, ConcurrentMap<TabletMap.KeyspaceTableNamePair,TabletMap.TabletSet> mapping)
-
-
Method Detail
-
emptyMap
public static TabletMap emptyMap(com.datastax.driver.core.Cluster.Manager cluster)
-
getMapping
public Map<TabletMap.KeyspaceTableNamePair,TabletMap.TabletSet> getMapping()
Returns the mapping of tables to their tablets.- Returns:
- the Map keyed by (keyspace,table) pairs with
TabletMap.TabletSetas value type.
-
getReplicas
public List<Host> getReplicas(String keyspace, String table, long token)
Finds hosts that have replicas for a given table and token combination. Meant for use in query planning. Can return empty collection if internal replica list information is determined not up to date.- Parameters:
keyspace- the keyspace that table is intable- the table nametoken- the token to look for- Returns:
- List(immutable) of Host instances that do have a tablet for the given token and table combination.
-
getPayloadOuterTuple
public TupleType getPayloadOuterTuple()
-
getPayloadInnerTuple
public TupleType getPayloadInnerTuple()
-
getTabletPayloadCodec
public TypeCodec<TupleValue> getTabletPayloadCodec()
-
removeTableMappings
public void removeTableMappings(TabletMap.KeyspaceTableNamePair key)
-
removeTableMappings
public void removeTableMappings(String keyspace)
-
-