Interface ClusterInfo
-
- All Superinterfaces:
StartupValidatable
- All Known Implementing Classes:
CassandraClusterInfo,CassandraClusterInfoGroup
public interface ClusterInfo extends StartupValidatable
Interface for cluster information used in bulk write operations.Serialization Architecture: This interface does NOT extend Serializable. ClusterInfo instances are never directly serialized. Driver-only implementations (
CassandraClusterInfo,CassandraClusterInfoGroup) are converted to broadcastable wrappers (BroadcastableClusterInfo,BroadcastableClusterInfoGroup) for broadcasting to executors viaBulkWriterConfig.On executors, ClusterInfo instances are reconstructed from the broadcastable wrappers using
AbstractBulkWriterContext.reconstructClusterInfoOnExecutor(IBroadcastableClusterInfo).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcheckBulkWriterIsEnabledOrThrow()default voidclose()default java.lang.StringclusterId()ID string that can uniquely identify a clusterjava.util.Map<RingInstance,WriteAvailability>clusterWriteAvailability()CassandraContextgetCassandraContext()java.lang.StringgetKeyspaceSchema(boolean cached)Return the keyspace schema string of the enclosing keyspace for bulk write in the clusterjava.lang.StringgetLowestCassandraVersion()org.apache.cassandra.spark.data.partitioner.PartitionergetPartitioner()TokenRangeMapping<RingInstance>getTokenRangeMapping(boolean cached)voidrefreshClusterInfo()org.apache.cassandra.spark.data.ReplicationFactorreplicationFactor()voidvalidateTimeSkew(com.google.common.collect.Range<java.math.BigInteger> range)Validate whether the time skew of the replicas of the range is acceptable-
Methods inherited from interface org.apache.cassandra.spark.validation.StartupValidatable
startupValidate
-
-
-
-
Method Detail
-
refreshClusterInfo
void refreshClusterInfo()
-
getTokenRangeMapping
TokenRangeMapping<RingInstance> getTokenRangeMapping(boolean cached)
-
getLowestCassandraVersion
java.lang.String getLowestCassandraVersion()
-
clusterWriteAvailability
java.util.Map<RingInstance,WriteAvailability> clusterWriteAvailability()
- Returns:
- WriteAvailability per RingInstance in the cluster
-
getPartitioner
org.apache.cassandra.spark.data.partitioner.Partitioner getPartitioner()
-
checkBulkWriterIsEnabledOrThrow
void checkBulkWriterIsEnabledOrThrow()
-
validateTimeSkew
void validateTimeSkew(com.google.common.collect.Range<java.math.BigInteger> range) throws org.apache.cassandra.spark.exception.SidecarApiCallException, org.apache.cassandra.spark.exception.TimeSkewTooLargeExceptionValidate whether the time skew of the replicas of the range is acceptable- Parameters:
range- token range used to look up the relevant replicas- Throws:
org.apache.cassandra.spark.exception.SidecarApiCallException- when fails to retrieve time skew informationorg.apache.cassandra.spark.exception.TimeSkewTooLargeException- when the time skew has exceeded the allowance
-
getKeyspaceSchema
java.lang.String getKeyspaceSchema(boolean cached)
Return the keyspace schema string of the enclosing keyspace for bulk write in the cluster- Parameters:
cached- whether using the cached schema information- Returns:
- keyspace schema string
-
replicationFactor
org.apache.cassandra.spark.data.ReplicationFactor replicationFactor()
- Returns:
- ReplicationFactor of the enclosing keyspace for bulk write in the cluster
-
getCassandraContext
CassandraContext getCassandraContext()
-
clusterId
@Nullable default java.lang.String clusterId()
ID string that can uniquely identify a clusterImplementor note: the method is optional. When writing to a single cluster, there is no requirement of assigning an ID for bulk write to proceed. When in the coordinated write mode, i.e. writing to multiple clusters, the method must be implemented and return unique string for clusters.
- Returns:
- cluster id string, null if absent
-
close
default void close()
-
-