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 class
SystemKeyspace.AvailableRanges
static class
SystemKeyspace.BootstrapState
static interface
SystemKeyspace.TriFunction<A,B,C,D>
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.String>
ALL_TABLE_NAMES
static java.lang.String
AVAILABLE_RANGES_V2
static TableMetadata
Batches
static java.lang.String
BATCHES
static java.lang.String
BUILT_INDEXES
static java.lang.String
BUILT_VIEWS
static java.lang.String
COMPACTION_HISTORY
static CassandraVersion
CURRENT_VERSION
static java.lang.String
LEGACY_AVAILABLE_RANGES
Deprecated.See CASSANDRA-14404static java.lang.String
LEGACY_PEER_EVENTS
Deprecated.See CASSANDRA-7544static java.lang.String
LEGACY_PEERS
Deprecated.See CASSANDRA-7544static java.lang.String
LEGACY_SIZE_ESTIMATES
Deprecated.See CASSANDRA-15637static java.lang.String
LEGACY_SSTABLE_ACTIVITY
Deprecated.See CASSANDRA-17048static java.lang.String
LEGACY_TRANSFERRED_RANGES
Deprecated.See CASSANDRA-7544static java.lang.String
LOCAL
static java.lang.String
PAXOS
static java.lang.String
PAXOS_REPAIR_HISTORY
static java.lang.String
PAXOS_REPAIR_STATE
static java.lang.String
PEER_EVENTS_V2
static java.lang.String
PEERS_V2
static java.lang.String
PREPARED_STATEMENTS
static java.lang.String
REPAIRS
static java.lang.String
SSTABLE_ACTIVITY_V2
static java.lang.String
TABLE_ESTIMATES
static java.lang.String
TABLE_ESTIMATES_TYPE_LOCAL_PRIMARY
static java.lang.String
TABLE_ESTIMATES_TYPE_PRIMARY
static java.util.Set<java.lang.String>
TABLE_NAMES
static 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.static java.lang.String
TOP_PARTITIONS
static java.lang.String
TRANSFERRED_RANGES_V2
static java.lang.String
VIEW_BUILDS_IN_PROGRESS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
bootstrapComplete()
static boolean
bootstrapInProgress()
static void
checkHealth()
One of three things will happen if you try to read the system keyspace: 1.static void
clearAllEstimates()
truncates size_estimates and table_estimates tablesstatic void
clearEstimates(java.lang.String keyspace, java.lang.String table)
Clears size estimates for a table (on table drop)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.static void
finishViewBuildStatus(java.lang.String ksname, java.lang.String viewName)
static void
flushPaxosRepairHistory()
static void
forceBlockingFlush(java.lang.String... cfnames)
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.static SystemKeyspace.BootstrapState
getBootstrapState()
static java.util.List<java.lang.String>
getBuiltIndexes(java.lang.String keyspaceName, java.util.Set<java.lang.String> indexNames)
static javax.management.openmbean.TabularData
getCompactionHistory()
static java.lang.String
getDatacenter()
Gets the stored data center for the local node, or null if none have been set yet.static java.util.UUID
getLocalHostId()
Read the host ID from the system keyspace.static java.util.UUID
getOrInitializeLocalHostId()
Read the host ID from the system keyspace, creating (and storing) one if none exists.static InetAddressAndPort
getPreferredIP(InetAddressAndPort ep)
Get preferred IP for given endpoint if it is known.static java.lang.String
getRack()
Gets the stored rack for the local node, or null if none have been set yet.static CassandraVersion
getReleaseVersion(InetAddressAndPort ep)
Get release version for given endpoint.static java.util.Collection<Token>
getSavedTokens()
static java.util.UUID
getSchemaVersion()
Gets the schema version or null if missingstatic 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.static TopPartitionTracker.StoredTopPartitions
getTopPartitions(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 long
getTruncatedAt(TableId id)
static CommitLogPosition
getTruncatedPosition(TableId id)
static java.util.Map<Range<Token>,Pair<Token,java.lang.Long>>
getViewBuildStatus(java.lang.String ksname, java.lang.String viewName)
static int
incrementAndGetGeneration()
static boolean
isIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
static boolean
isViewBuilt(java.lang.String keyspaceName, java.lang.String viewName)
static boolean
isViewStatusReplicated(java.lang.String keyspaceName, java.lang.String viewName)
static int
legacyPaxosTtlSec(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 PaxosRepairHistory
loadPaxosRepairHistory(java.lang.String keyspace, java.lang.String table)
static PaxosState.Snapshot
loadPaxosState(DecoratedKey partitionKey, TableMetadata metadata, long 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 int
loadPreparedStatement(MD5Digest digest, SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,java.lang.Boolean> onLoaded)
static int
loadPreparedStatements(SystemKeyspace.TriFunction<MD5Digest,java.lang.String,java.lang.String,java.lang.Boolean> onLoaded)
static com.google.common.collect.SetMultimap<InetAddressAndPort,Token>
loadTokens()
Return a map of stored tokens to IP addressesstatic KeyspaceMetadata
metadata()
static void
persistLocalMetadata()
static void
persistLocalMetadata(java.util.function.Supplier<java.util.UUID> nodeIdSupplier)
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_activitystatic java.nio.ByteBuffer
rangeToBytes(Range<Token> range)
static java.util.Set<Range<Token>>
rawRangesToRangeSet(java.util.Set<java.nio.ByteBuffer> rawRanges, IPartitioner partitioner)
static UntypedResultSet
readSSTableActivity(java.lang.String keyspace, java.lang.String table, SSTableId id)
static void
removeEndpoint(java.net.InetSocketAddress ep)
Remove stored tokens being used by another nodestatic void
removePreparedStatement(MD5Digest key)
static void
removeTruncationRecord(TableId id)
This method is used to remove information about truncation time for specified column familystatic void
resetAvailableStreamedRanges()
static void
resetAvailableStreamedRangesForKeyspace(java.lang.String keyspace)
static void
resetPreparedStatements()
static void
savePaxosCommit(Commit commit)
static void
savePaxosProposal(Commit proposal)
static void
savePaxosReadPromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)
static void
savePaxosRepairHistory(java.lang.String keyspace, java.lang.String table, PaxosRepairHistory history, boolean flush)
static void
savePaxosWritePromise(DecoratedKey key, TableMetadata metadata, Ballot ballot)
static void
saveTopPartitions(TableMetadata metadata, java.lang.String topType, java.util.Collection<TopPartitionTracker.TopPartition> topPartitions, long lastUpdate)
static void
saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, CommitLogPosition position)
static void
setBootstrapState(SystemKeyspace.BootstrapState state)
static void
setIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
static void
setIndexRemoved(java.lang.String keyspaceName, java.lang.String indexName)
static java.util.UUID
setLocalHostId(java.util.UUID hostId)
Sets the local host ID explicitly.static void
setViewBuilt(java.lang.String keyspaceName, java.lang.String viewName, boolean replicated)
static void
setViewBuiltReplicated(java.lang.String ksname, java.lang.String viewName)
static void
setViewRemoved(java.lang.String keyspaceName, java.lang.String viewName)
static void
snapshotOnVersionChange()
Compare the release version in the system.local table with the one included in the distro.static void
updateAvailableRanges(java.lang.String keyspace, java.util.Collection<Range<Token>> completedFullRanges, java.util.Collection<Range<Token>> completedTransientRanges)
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, java.util.Map<java.lang.String,java.lang.String> compactionProperties)
static void
updateHintsDropped(InetAddressAndPort ep, TimeUUID timePeriod, int value)
static void
updatePeerInfo(InetAddressAndPort ep, java.lang.String columnName, java.lang.Object value)
static void
updatePeerNativeAddress(InetAddressAndPort ep, InetAddressAndPort address)
static boolean
updatePreferredIP(InetAddressAndPort ep, InetAddressAndPort preferred_ip)
static void
updateSchemaVersion(java.util.UUID version)
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_CFstatic 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_estimatesstatic void
updateTokens(java.util.Collection<Token> tokens)
This method is used to update the System Keyspace with the new tokens for this nodestatic void
updateTokens(InetAddressAndPort ep, java.util.Collection<Token> tokens)
Record tokens being used by another nodestatic void
updateTransferredRanges(StreamOperation streamOperation, InetAddressAndPort peer, java.lang.String keyspace, java.util.Collection<Range<Token>> streamedRanges)
static void
updateViewBuildStatus(java.lang.String ksname, java.lang.String viewName, Range<Token> range, Token lastToken, long keysBuilt)
static boolean
wasDecommissioned()
static void
writePreparedStatement(java.lang.String loggedKeyspace, MD5Digest key, java.lang.String cql)
-
-
-
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
-
PAXOS_REPAIR_STATE
public static final java.lang.String PAXOS_REPAIR_STATE
- 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(since="4.0") public static final java.lang.String LEGACY_PEERS
Deprecated.See CASSANDRA-7544- See Also:
- Constant Field Values
-
LEGACY_PEER_EVENTS
@Deprecated(since="4.0") public static final java.lang.String LEGACY_PEER_EVENTS
Deprecated.See CASSANDRA-7544- See Also:
- Constant Field Values
-
LEGACY_TRANSFERRED_RANGES
@Deprecated(since="4.0") public static final java.lang.String LEGACY_TRANSFERRED_RANGES
Deprecated.See CASSANDRA-7544- See Also:
- Constant Field Values
-
LEGACY_AVAILABLE_RANGES
@Deprecated(since="4.0") public static final java.lang.String LEGACY_AVAILABLE_RANGES
Deprecated.See CASSANDRA-14404- See Also:
- Constant Field Values
-
LEGACY_SIZE_ESTIMATES
@Deprecated(since="4.0") public static final java.lang.String LEGACY_SIZE_ESTIMATES
Deprecated.See CASSANDRA-15637- See Also:
- Constant Field Values
-
LEGACY_SSTABLE_ACTIVITY
@Deprecated(since="4.1") public static final java.lang.String LEGACY_SSTABLE_ACTIVITY
Deprecated.See CASSANDRA-17048- See Also:
- Constant Field Values
-
ALL_TABLE_NAMES
public static final java.util.Set<java.lang.String> ALL_TABLE_NAMES
-
TABLE_NAMES
public static final java.util.Set<java.lang.String> TABLE_NAMES
-
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, java.util.Map<java.lang.String,java.lang.String> compactionProperties)
-
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 ConfigurationException
One 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, long 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
-
readSSTableActivity
public static UntypedResultSet readSSTableActivity(java.lang.String keyspace, java.lang.String table, SSTableId id)
-
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.
-
resetAvailableStreamedRanges
public static void resetAvailableStreamedRanges()
-
resetAvailableStreamedRangesForKeyspace
public static void resetAvailableStreamedRangesForKeyspace(java.lang.String keyspace)
-
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.IOException
Compare 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)
-
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,java.lang.Boolean> onLoaded)
-
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)
-
-