Package org.apache.cassandra.db
Class SystemKeyspace
- java.lang.Object
-
- org.apache.cassandra.db.SystemKeyspace
-
public final class SystemKeyspace extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSystemKeyspace.AvailableRangesstatic classSystemKeyspace.BootstrapStatestatic interfaceSystemKeyspace.TriFunction<A,B,C,D>
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAVAILABLE_RANGES_V2static TableMetadataBatchesstatic java.lang.StringBATCHESstatic java.lang.StringBUILT_INDEXESstatic java.lang.StringBUILT_VIEWSstatic java.lang.StringCOMPACTION_HISTORYstatic CassandraVersionCURRENT_VERSIONstatic java.lang.StringLEGACY_AVAILABLE_RANGESDeprecated.static java.lang.StringLEGACY_PEER_EVENTSDeprecated.static java.lang.StringLEGACY_PEERSDeprecated.static java.lang.StringLEGACY_SIZE_ESTIMATESDeprecated.static java.lang.StringLEGACY_SSTABLE_ACTIVITYDeprecated.static java.lang.StringLEGACY_TRANSFERRED_RANGESDeprecated.static java.lang.StringLOCALstatic java.lang.StringPAXOSstatic java.lang.StringPAXOS_REPAIR_HISTORYstatic java.lang.StringPEER_EVENTS_V2static java.lang.StringPEERS_V2static java.lang.StringPREPARED_STATEMENTSstatic java.lang.StringREPAIRSstatic java.lang.StringSSTABLE_ACTIVITY_V2static java.lang.StringTABLE_ESTIMATESstatic java.lang.StringTABLE_ESTIMATES_TYPE_LOCAL_PRIMARYstatic java.lang.StringTABLE_ESTIMATES_TYPE_PRIMARYstatic java.util.Set<java.lang.String>TABLES_SPLIT_ACROSS_MULTIPLE_DISKSBy default the system keyspace tables should be stored in a single data directory to allow the server to handle more gracefully disk failures.static java.lang.StringTOP_PARTITIONSstatic java.lang.StringTRANSFERRED_RANGES_V2static java.lang.StringVIEW_BUILDS_IN_PROGRESS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanbootstrapComplete()static booleanbootstrapInProgress()static voidcheckHealth()One of three things will happen if you try to read the system keyspace: 1.static voidclearAllEstimates()truncates size_estimates and table_estimates tablesstatic voidclearEstimates(java.lang.String keyspace, java.lang.String table)Clears size estimates for a table (on table drop)static voidclearSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id)Clears persisted read rates from system.sstable_activity for SSTables that have been deleted.static voidfinishViewBuildStatus(java.lang.String ksname, java.lang.String viewName)static voidflushPaxosRepairHistory()static voidforceBlockingFlush(java.lang.String... cfnames)static SystemKeyspace.AvailableRangesgetAvailableRanges(java.lang.String keyspace, IPartitioner partitioner)List of the streamed ranges, where transientness is encoded based on the source, where range was streamed from.static SystemKeyspace.BootstrapStategetBootstrapState()static java.util.List<java.lang.String>getBuiltIndexes(java.lang.String keyspaceName, java.util.Set<java.lang.String> indexNames)static javax.management.openmbean.TabularDatagetCompactionHistory()static java.lang.StringgetDatacenter()Gets the stored data center for the local node, or null if none have been set yet.static java.util.UUIDgetLocalHostId()Read the host ID from the system keyspace.static java.util.UUIDgetOrInitializeLocalHostId()Read the host ID from the system keyspace, creating (and storing) one if none exists.static InetAddressAndPortgetPreferredIP(InetAddressAndPort ep)Get preferred IP for given endpoint if it is known.static java.lang.StringgetRack()Gets the stored rack for the local node, or null if none have been set yet.static CassandraVersiongetReleaseVersion(InetAddressAndPort ep)Get release version for given endpoint.static java.util.Collection<Token>getSavedTokens()static java.util.UUIDgetSchemaVersion()Gets the schema version or null if missingstatic RestorableMetergetSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id)Returns a RestorableMeter tracking the average read rate of a particular SSTable, restoring the last-seen rate from values in system.sstable_activity if present.static TopPartitionTracker.StoredTopPartitionsgetTopPartitions(TableMetadata metadata, java.lang.String topType)static java.util.Map<InetAddressAndPort,java.util.Set<Range<Token>>>getTransferredRanges(java.lang.String description, java.lang.String keyspace, IPartitioner partitioner)static longgetTruncatedAt(TableId id)static CommitLogPositiongetTruncatedPosition(TableId id)static java.util.Map<Range<Token>,Pair<Token,java.lang.Long>>getViewBuildStatus(java.lang.String ksname, java.lang.String viewName)static intincrementAndGetGeneration()static booleanisIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)static booleanisViewBuilt(java.lang.String keyspaceName, java.lang.String viewName)static booleanisViewStatusReplicated(java.lang.String keyspaceName, java.lang.String viewName)static intlegacyPaxosTtlSec(TableMetadata metadata)static java.util.Map<InetAddressAndPort,java.util.Map<java.lang.String,java.lang.String>>loadDcRackInfo()Return a map of IP addresses containing a map of dc and rack infostatic java.util.Map<InetAddressAndPort,java.util.UUID>loadHostIds()Return a map of store host_ids to IP addressesstatic PaxosRepairHistoryloadPaxosRepairHistory(java.lang.String keyspace, java.lang.String table)static PaxosState.SnapshotloadPaxosState(DecoratedKey partitionKey, TableMetadata metadata, int nowInSec)Load the current paxos state for the table and key NOTE: nowInSec is typically provided as zero, and should not be assumed to be definitive, as the cache may apply different nowInSec filtersstatic intloadPreparedStatement(MD5Digest digest, SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,java.lang.Boolean> onLoaded)static intloadPreparedStatements(SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,QueryHandler.Prepared> onLoaded)static intloadPreparedStatements(SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,QueryHandler.Prepared> onLoaded, int pageSize)static com.google.common.collect.SetMultimap<InetAddressAndPort,Token>loadTokens()Return a map of stored tokens to IP addressesstatic KeyspaceMetadatametadata()static voidpersistLocalMetadata()static voidpersistLocalMetadata(java.util.function.Supplier<java.util.UUID> nodeIdSupplier)static voidpersistSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id, RestorableMeter meter)Writes the current read rates for a given SSTable to system.sstable_activitystatic java.util.Set<Range<Token>>rawRangesToRangeSet(java.util.Set<java.nio.ByteBuffer> rawRanges, IPartitioner partitioner)static voidremoveEndpoint(java.net.InetSocketAddress ep)Remove stored tokens being used by another nodestatic voidremovePreparedStatement(MD5Digest key)static voidremoveTruncationRecord(TableId id)This method is used to remove information about truncation time for specified column familystatic voidresetAvailableRanges()static voidresetPreparedStatements()static voidsavePaxosCommit(Commit commit)static voidsavePaxosProposal(Commit proposal)static voidsavePaxosReadPromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)static voidsavePaxosRepairHistory(java.lang.String keyspace, java.lang.String table, PaxosRepairHistory history, boolean flush)static voidsavePaxosWritePromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)static voidsaveTopPartitions(TableMetadata metadata, java.lang.String topType, java.util.Collection<TopPartitionTracker.TopPartition> topPartitions, long lastUpdate)static voidsaveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, CommitLogPosition position)static voidsetBootstrapState(SystemKeyspace.BootstrapState state)static voidsetIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)static voidsetIndexRemoved(java.lang.String keyspaceName, java.lang.String indexName)static java.util.UUIDsetLocalHostId(java.util.UUID hostId)Sets the local host ID explicitly.static voidsetViewBuilt(java.lang.String keyspaceName, java.lang.String viewName, boolean replicated)static voidsetViewBuiltReplicated(java.lang.String ksname, java.lang.String viewName)static voidsetViewRemoved(java.lang.String keyspaceName, java.lang.String viewName)static voidsnapshotOnVersionChange()Compare the release version in the system.local table with the one included in the distro.static voidupdateAvailableRanges(java.lang.String keyspace, java.util.Collection<Range<Token>> completedFullRanges, java.util.Collection<Range<Token>> completedTransientRanges)static voidupdateCompactionHistory(TimeUUID taskId, java.lang.String ksname, java.lang.String cfname, long compactedAt, long bytesIn, long bytesOut, java.util.Map<java.lang.Integer,java.lang.Long> rowsMerged)static voidupdateHintsDropped(InetAddressAndPort ep, TimeUUID timePeriod, int value)static voidupdatePeerInfo(InetAddressAndPort ep, java.lang.String columnName, java.lang.Object value)static voidupdatePeerNativeAddress(InetAddressAndPort ep, InetAddressAndPort address)static booleanupdatePreferredIP(InetAddressAndPort ep, InetAddressAndPort preferred_ip)static voidupdateSchemaVersion(java.util.UUID version)static voidupdateSizeEstimates(java.lang.String keyspace, java.lang.String table, java.util.Map<Range<Token>,Pair<java.lang.Long,java.lang.Long>> estimates)Writes the current partition count and size estimates into SIZE_ESTIMATES_CFstatic voidupdateTableEstimates(java.lang.String keyspace, java.lang.String table, java.lang.String type, java.util.Map<Range<Token>,Pair<java.lang.Long,java.lang.Long>> estimates)Writes the current partition count and size estimates into table_estimatesstatic voidupdateTokens(java.util.Collection<Token> tokens)This method is used to update the System Keyspace with the new tokens for this nodestatic voidupdateTokens(InetAddressAndPort ep, java.util.Collection<Token> tokens)Record tokens being used by another nodestatic voidupdateTransferredRanges(StreamOperation streamOperation, InetAddressAndPort peer, java.lang.String keyspace, java.util.Collection<Range<Token>> streamedRanges)static voidupdateViewBuildStatus(java.lang.String ksname, java.lang.String viewName, Range<Token> range, Token lastToken, long keysBuilt)static booleanwasDecommissioned()static voidwritePreparedStatement(java.lang.String loggedKeyspace, MD5Digest key, java.lang.String cql, long timestamp)
-
-
-
Field Detail
-
CURRENT_VERSION
public static final CassandraVersion CURRENT_VERSION
-
BATCHES
public static final java.lang.String BATCHES
- See Also:
- Constant Field Values
-
PAXOS
public static final java.lang.String PAXOS
- See Also:
- Constant Field Values
-
PAXOS_REPAIR_HISTORY
public static final java.lang.String PAXOS_REPAIR_HISTORY
- See Also:
- Constant Field Values
-
BUILT_INDEXES
public static final java.lang.String BUILT_INDEXES
- See Also:
- Constant Field Values
-
LOCAL
public static final java.lang.String LOCAL
- See Also:
- Constant Field Values
-
PEERS_V2
public static final java.lang.String PEERS_V2
- See Also:
- Constant Field Values
-
PEER_EVENTS_V2
public static final java.lang.String PEER_EVENTS_V2
- See Also:
- Constant Field Values
-
COMPACTION_HISTORY
public static final java.lang.String COMPACTION_HISTORY
- See Also:
- Constant Field Values
-
SSTABLE_ACTIVITY_V2
public static final java.lang.String SSTABLE_ACTIVITY_V2
- See Also:
- Constant Field Values
-
TABLE_ESTIMATES
public static final java.lang.String TABLE_ESTIMATES
- See Also:
- Constant Field Values
-
TABLE_ESTIMATES_TYPE_PRIMARY
public static final java.lang.String TABLE_ESTIMATES_TYPE_PRIMARY
- See Also:
- Constant Field Values
-
TABLE_ESTIMATES_TYPE_LOCAL_PRIMARY
public static final java.lang.String TABLE_ESTIMATES_TYPE_LOCAL_PRIMARY
- See Also:
- Constant Field Values
-
AVAILABLE_RANGES_V2
public static final java.lang.String AVAILABLE_RANGES_V2
- See Also:
- Constant Field Values
-
TRANSFERRED_RANGES_V2
public static final java.lang.String TRANSFERRED_RANGES_V2
- See Also:
- Constant Field Values
-
VIEW_BUILDS_IN_PROGRESS
public static final java.lang.String VIEW_BUILDS_IN_PROGRESS
- See Also:
- Constant Field Values
-
BUILT_VIEWS
public static final java.lang.String BUILT_VIEWS
- See Also:
- Constant Field Values
-
PREPARED_STATEMENTS
public static final java.lang.String PREPARED_STATEMENTS
- See Also:
- Constant Field Values
-
REPAIRS
public static final java.lang.String REPAIRS
- See Also:
- Constant Field Values
-
TOP_PARTITIONS
public static final java.lang.String TOP_PARTITIONS
- See Also:
- Constant Field Values
-
TABLES_SPLIT_ACROSS_MULTIPLE_DISKS
public static final java.util.Set<java.lang.String> TABLES_SPLIT_ACROSS_MULTIPLE_DISKS
By default the system keyspace tables should be stored in a single data directory to allow the server to handle more gracefully disk failures. Some tables through can be split accross multiple directories as the server can continue operating even if those tables lost some data.
-
LEGACY_PEERS
@Deprecated public static final java.lang.String LEGACY_PEERS
Deprecated.- See Also:
- Constant Field Values
-
LEGACY_PEER_EVENTS
@Deprecated public static final java.lang.String LEGACY_PEER_EVENTS
Deprecated.- See Also:
- Constant Field Values
-
LEGACY_TRANSFERRED_RANGES
@Deprecated public static final java.lang.String LEGACY_TRANSFERRED_RANGES
Deprecated.- See Also:
- Constant Field Values
-
LEGACY_AVAILABLE_RANGES
@Deprecated public static final java.lang.String LEGACY_AVAILABLE_RANGES
Deprecated.- See Also:
- Constant Field Values
-
LEGACY_SIZE_ESTIMATES
@Deprecated public static final java.lang.String LEGACY_SIZE_ESTIMATES
Deprecated.- See Also:
- Constant Field Values
-
LEGACY_SSTABLE_ACTIVITY
@Deprecated public static final java.lang.String LEGACY_SSTABLE_ACTIVITY
Deprecated.- See Also:
- Constant Field Values
-
Batches
public static final TableMetadata Batches
-
-
Method Detail
-
metadata
public static KeyspaceMetadata metadata()
-
persistLocalMetadata
public static void persistLocalMetadata()
-
persistLocalMetadata
public static void persistLocalMetadata(java.util.function.Supplier<java.util.UUID> nodeIdSupplier)
-
updateCompactionHistory
public static void updateCompactionHistory(TimeUUID taskId, java.lang.String ksname, java.lang.String cfname, long compactedAt, long bytesIn, long bytesOut, java.util.Map<java.lang.Integer,java.lang.Long> rowsMerged)
-
getCompactionHistory
public static javax.management.openmbean.TabularData getCompactionHistory() throws javax.management.openmbean.OpenDataException- Throws:
javax.management.openmbean.OpenDataException
-
isViewBuilt
public static boolean isViewBuilt(java.lang.String keyspaceName, java.lang.String viewName)
-
isViewStatusReplicated
public static boolean isViewStatusReplicated(java.lang.String keyspaceName, java.lang.String viewName)
-
setViewBuilt
public static void setViewBuilt(java.lang.String keyspaceName, java.lang.String viewName, boolean replicated)
-
setViewRemoved
public static void setViewRemoved(java.lang.String keyspaceName, java.lang.String viewName)
-
finishViewBuildStatus
public static void finishViewBuildStatus(java.lang.String ksname, java.lang.String viewName)
-
setViewBuiltReplicated
public static void setViewBuiltReplicated(java.lang.String ksname, java.lang.String viewName)
-
updateViewBuildStatus
public static void updateViewBuildStatus(java.lang.String ksname, java.lang.String viewName, Range<Token> range, Token lastToken, long keysBuilt)
-
getViewBuildStatus
public static java.util.Map<Range<Token>,Pair<Token,java.lang.Long>> getViewBuildStatus(java.lang.String ksname, java.lang.String viewName)
-
saveTruncationRecord
public static void saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, CommitLogPosition position)
-
removeTruncationRecord
public static void removeTruncationRecord(TableId id)
This method is used to remove information about truncation time for specified column family
-
getTruncatedPosition
public static CommitLogPosition getTruncatedPosition(TableId id)
-
getTruncatedAt
public static long getTruncatedAt(TableId id)
-
updateTokens
public static void updateTokens(InetAddressAndPort ep, java.util.Collection<Token> tokens)
Record tokens being used by another node
-
updatePreferredIP
public static boolean updatePreferredIP(InetAddressAndPort ep, InetAddressAndPort preferred_ip)
-
updatePeerInfo
public static void updatePeerInfo(InetAddressAndPort ep, java.lang.String columnName, java.lang.Object value)
-
updatePeerNativeAddress
public static void updatePeerNativeAddress(InetAddressAndPort ep, InetAddressAndPort address)
-
updateHintsDropped
public static void updateHintsDropped(InetAddressAndPort ep, TimeUUID timePeriod, int value)
-
updateSchemaVersion
public static void updateSchemaVersion(java.util.UUID version)
-
removeEndpoint
public static void removeEndpoint(java.net.InetSocketAddress ep)
Remove stored tokens being used by another node
-
updateTokens
public static void updateTokens(java.util.Collection<Token> tokens)
This method is used to update the System Keyspace with the new tokens for this node
-
forceBlockingFlush
public static void forceBlockingFlush(java.lang.String... cfnames)
-
loadTokens
public static com.google.common.collect.SetMultimap<InetAddressAndPort,Token> loadTokens()
Return a map of stored tokens to IP addresses
-
loadHostIds
public static java.util.Map<InetAddressAndPort,java.util.UUID> loadHostIds()
Return a map of store host_ids to IP addresses
-
getPreferredIP
public static InetAddressAndPort getPreferredIP(InetAddressAndPort ep)
Get preferred IP for given endpoint if it is known. Otherwise this returns given endpoint itself.- Parameters:
ep- endpoint address to check- Returns:
- Preferred IP for given endpoint if present, otherwise returns given ep
-
loadDcRackInfo
public static java.util.Map<InetAddressAndPort,java.util.Map<java.lang.String,java.lang.String>> loadDcRackInfo()
Return a map of IP addresses containing a map of dc and rack info
-
getReleaseVersion
public static CassandraVersion getReleaseVersion(InetAddressAndPort ep)
Get release version for given endpoint. If release version is unknown, then this returns null.- Parameters:
ep- endpoint address to check- Returns:
- Release version or null if version is unknown.
-
checkHealth
public static void checkHealth() throws ConfigurationExceptionOne of three things will happen if you try to read the system keyspace: 1. files are present and you can read them: great 2. no files are there: great (new node is assumed) 3. files are present but you can't read them: bad- Throws:
ConfigurationException
-
getSavedTokens
public static java.util.Collection<Token> getSavedTokens()
-
incrementAndGetGeneration
public static int incrementAndGetGeneration()
-
getBootstrapState
public static SystemKeyspace.BootstrapState getBootstrapState()
-
bootstrapComplete
public static boolean bootstrapComplete()
-
bootstrapInProgress
public static boolean bootstrapInProgress()
-
wasDecommissioned
public static boolean wasDecommissioned()
-
setBootstrapState
public static void setBootstrapState(SystemKeyspace.BootstrapState state)
-
isIndexBuilt
public static boolean isIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
-
setIndexBuilt
public static void setIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
-
setIndexRemoved
public static void setIndexRemoved(java.lang.String keyspaceName, java.lang.String indexName)
-
getBuiltIndexes
public static java.util.List<java.lang.String> getBuiltIndexes(java.lang.String keyspaceName, java.util.Set<java.lang.String> indexNames)
-
getLocalHostId
public static java.util.UUID getLocalHostId()
Read the host ID from the system keyspace.
-
getOrInitializeLocalHostId
public static java.util.UUID getOrInitializeLocalHostId()
Read the host ID from the system keyspace, creating (and storing) one if none exists.
-
setLocalHostId
public static java.util.UUID setLocalHostId(java.util.UUID hostId)
Sets the local host ID explicitly. Should only be called outside of SystemTable when replacing a node.
-
getSchemaVersion
public static java.util.UUID getSchemaVersion()
Gets the schema version or null if missing
-
getRack
public static java.lang.String getRack()
Gets the stored rack for the local node, or null if none have been set yet.
-
getDatacenter
public static java.lang.String getDatacenter()
Gets the stored data center for the local node, or null if none have been set yet.
-
loadPaxosState
public static PaxosState.Snapshot loadPaxosState(DecoratedKey partitionKey, TableMetadata metadata, int nowInSec)
Load the current paxos state for the table and key NOTE: nowInSec is typically provided as zero, and should not be assumed to be definitive, as the cache may apply different nowInSec filters
-
legacyPaxosTtlSec
public static int legacyPaxosTtlSec(TableMetadata metadata)
-
savePaxosWritePromise
public static void savePaxosWritePromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)
-
savePaxosReadPromise
public static void savePaxosReadPromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)
-
savePaxosProposal
public static void savePaxosProposal(Commit proposal)
-
savePaxosCommit
public static void savePaxosCommit(Commit commit)
-
savePaxosRepairHistory
public static void savePaxosRepairHistory(java.lang.String keyspace, java.lang.String table, PaxosRepairHistory history, boolean flush)
-
flushPaxosRepairHistory
public static void flushPaxosRepairHistory()
-
loadPaxosRepairHistory
public static PaxosRepairHistory loadPaxosRepairHistory(java.lang.String keyspace, java.lang.String table)
-
getSSTableReadMeter
public static RestorableMeter getSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id)
Returns a RestorableMeter tracking the average read rate of a particular SSTable, restoring the last-seen rate from values in system.sstable_activity if present.- Parameters:
keyspace- the keyspace the sstable belongs totable- the table the sstable belongs toid- the generation id for the sstable
-
persistSSTableReadMeter
public static void persistSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id, RestorableMeter meter)Writes the current read rates for a given SSTable to system.sstable_activity
-
clearSSTableReadMeter
public static void clearSSTableReadMeter(java.lang.String keyspace, java.lang.String table, SSTableId id)Clears persisted read rates from system.sstable_activity for SSTables that have been deleted.
-
updateSizeEstimates
public static void updateSizeEstimates(java.lang.String keyspace, java.lang.String table, java.util.Map<Range<Token>,Pair<java.lang.Long,java.lang.Long>> estimates)Writes the current partition count and size estimates into SIZE_ESTIMATES_CF
-
updateTableEstimates
public static void updateTableEstimates(java.lang.String keyspace, java.lang.String table, java.lang.String type, java.util.Map<Range<Token>,Pair<java.lang.Long,java.lang.Long>> estimates)Writes the current partition count and size estimates into table_estimates
-
clearEstimates
public static void clearEstimates(java.lang.String keyspace, java.lang.String table)Clears size estimates for a table (on table drop)
-
clearAllEstimates
public static void clearAllEstimates()
truncates size_estimates and table_estimates tables
-
updateAvailableRanges
public static void updateAvailableRanges(java.lang.String keyspace, java.util.Collection<Range<Token>> completedFullRanges, java.util.Collection<Range<Token>> completedTransientRanges)
-
getAvailableRanges
public static SystemKeyspace.AvailableRanges getAvailableRanges(java.lang.String keyspace, IPartitioner partitioner)
List of the streamed ranges, where transientness is encoded based on the source, where range was streamed from.
-
resetAvailableRanges
public static void resetAvailableRanges()
-
updateTransferredRanges
public static void updateTransferredRanges(StreamOperation streamOperation, InetAddressAndPort peer, java.lang.String keyspace, java.util.Collection<Range<Token>> streamedRanges)
-
getTransferredRanges
public static java.util.Map<InetAddressAndPort,java.util.Set<Range<Token>>> getTransferredRanges(java.lang.String description, java.lang.String keyspace, IPartitioner partitioner)
-
snapshotOnVersionChange
public static void snapshotOnVersionChange() throws java.io.IOExceptionCompare the release version in the system.local table with the one included in the distro. If they don't match, snapshot all tables in the system and schema keyspaces. This is intended to be called at startup to create a backup of the system tables during an upgrade- Throws:
java.io.IOException
-
rawRangesToRangeSet
public static java.util.Set<Range<Token>> rawRangesToRangeSet(java.util.Set<java.nio.ByteBuffer> rawRanges, IPartitioner partitioner)
-
writePreparedStatement
public static void writePreparedStatement(java.lang.String loggedKeyspace, MD5Digest key, java.lang.String cql, long timestamp)
-
removePreparedStatement
public static void removePreparedStatement(MD5Digest key)
-
resetPreparedStatements
public static void resetPreparedStatements()
-
loadPreparedStatements
public static int loadPreparedStatements(SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,QueryHandler.Prepared> onLoaded)
-
loadPreparedStatements
public static int loadPreparedStatements(SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,QueryHandler.Prepared> onLoaded, int pageSize)
-
loadPreparedStatement
public static int loadPreparedStatement(MD5Digest digest, SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,java.lang.Boolean> onLoaded)
-
saveTopPartitions
public static void saveTopPartitions(TableMetadata metadata, java.lang.String topType, java.util.Collection<TopPartitionTracker.TopPartition> topPartitions, long lastUpdate)
-
getTopPartitions
public static TopPartitionTracker.StoredTopPartitions getTopPartitions(TableMetadata metadata, java.lang.String topType)
-
-