public final class SystemKeyspace
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SystemKeyspace.BootstrapState |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVAILABLE_RANGES |
static CFMetaData |
Batchlog |
static java.lang.String |
BATCHLOG |
static java.lang.String |
BUILT_INDEXES |
static CFMetaData |
BuiltIndexes |
static java.lang.String |
COMPACTION_HISTORY |
static java.lang.String |
COMPACTIONS_IN_PROGRESS |
static CFMetaData |
Hints |
static java.lang.String |
HINTS |
static java.lang.String |
LOCAL |
static java.lang.String |
NAME |
static CassandraVersion |
NULL_VERSION |
static java.lang.String |
PAXOS |
static java.lang.String |
PEER_EVENTS |
static java.lang.String |
PEERS |
static java.lang.String |
RANGE_XFERS |
static java.lang.String |
SIZE_ESTIMATES |
static java.lang.String |
SSTABLE_ACTIVITY |
static CassandraVersion |
UNREADABLE_VERSION |
Constructor and Description |
---|
SystemKeyspace() |
Modifier and Type | Method and 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 |
clearSizeEstimates(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,
int generation)
Clears persisted read rates from system.sstable_activity for SSTables that have been deleted.
|
static KSMetaData |
definition() |
static void |
discardCompactionsInProgress() |
static void |
finishCompaction(java.util.UUID taskId)
Deletes the entry for this compaction from the set of compactions in progress.
|
static void |
finishStartup() |
static void |
forceBlockingFlush(java.lang.String cfname) |
static java.util.Set<Range<Token>> |
getAvailableRanges(java.lang.String keyspace,
IPartitioner partitioner) |
static SystemKeyspace.BootstrapState |
getBootstrapState() |
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, creating (and storing) one if
none exists.
|
static java.net.InetAddress |
getPreferredIP(java.net.InetAddress 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(java.net.InetAddress ep)
Get release version for given endpoint.
|
static java.util.Collection<Token> |
getSavedTokens() |
static RestorableMeter |
getSSTableReadMeter(java.lang.String keyspace,
java.lang.String table,
int generation)
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 long |
getTruncatedAt(java.util.UUID cfId) |
static ReplayPosition |
getTruncatedPosition(java.util.UUID cfId) |
static java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.Map<java.lang.Integer,java.util.UUID>> |
getUnfinishedCompactions()
Returns a Map whose keys are KS.CF pairs and whose values are maps from sstable generation numbers to the
task ID of the compaction they were participating in.
|
static int |
incrementAndGetGeneration() |
static boolean |
isIndexBuilt(java.lang.String keyspaceName,
java.lang.String indexName) |
static java.util.Map<java.net.InetAddress,java.util.Map<java.lang.String,java.lang.String>> |
loadDcRackInfo()
Return a map of IP addresses containing a map of dc and rack info
|
static java.util.Map<java.net.InetAddress,java.util.UUID> |
loadHostIds()
Return a map of store host_ids to IP addresses
|
static PaxosState |
loadPaxosState(java.nio.ByteBuffer key,
CFMetaData metadata,
long now) |
static com.google.common.collect.SetMultimap<java.net.InetAddress,Token> |
loadTokens()
Return a map of stored tokens to IP addresses
|
static int |
paxosTtl(CFMetaData metadata) |
static void |
persistLocalMetadata() |
static void |
persistSSTableReadMeter(java.lang.String keyspace,
java.lang.String table,
int generation,
RestorableMeter meter)
Writes the current read rates for a given SSTable to system.sstable_activity
|
static void |
removeEndpoint(java.net.InetAddress ep)
Remove stored tokens being used by another node
|
static void |
removeTruncationRecord(java.util.UUID cfId)
This method is used to remove information about truncation time for specified column family
|
static void |
resetAvailableRanges() |
static void |
savePaxosCommit(Commit commit) |
static void |
savePaxosPromise(Commit promise) |
static void |
savePaxosProposal(Commit proposal) |
static void |
saveTruncationRecord(ColumnFamilyStore cfs,
long truncatedAt,
ReplayPosition 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 |
snapshotOnVersionChange()
Compare the release version in the system.local table with the one included in the distro.
|
static java.util.UUID |
startCompaction(ColumnFamilyStore cfs,
java.lang.Iterable<SSTableReader> toCompact)
Write compaction log, except columfamilies under system keyspace.
|
static void |
updateAvailableRanges(java.lang.String keyspace,
java.util.Collection<Range<Token>> completedRanges) |
static void |
updateCompactionHistory(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 void |
updateHintsDropped(java.net.InetAddress ep,
java.util.UUID timePeriod,
int value) |
static void |
updatePeerInfo(java.net.InetAddress ep,
java.lang.String columnName,
java.lang.Object value) |
static void |
updatePreferredIP(java.net.InetAddress ep,
java.net.InetAddress 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_CF
|
static void |
updateTokens(java.util.Collection<Token> tokens)
This method is used to update the System Keyspace with the new tokens for this node
|
static void |
updateTokens(java.net.InetAddress ep,
java.util.Collection<Token> tokens)
Record tokens being used by another node
|
public static final CassandraVersion UNREADABLE_VERSION
public static final CassandraVersion NULL_VERSION
public static final java.lang.String NAME
public static final java.lang.String HINTS
public static final java.lang.String BATCHLOG
public static final java.lang.String PAXOS
public static final java.lang.String BUILT_INDEXES
public static final java.lang.String LOCAL
public static final java.lang.String PEERS
public static final java.lang.String PEER_EVENTS
public static final java.lang.String RANGE_XFERS
public static final java.lang.String COMPACTIONS_IN_PROGRESS
public static final java.lang.String COMPACTION_HISTORY
public static final java.lang.String SSTABLE_ACTIVITY
public static final java.lang.String SIZE_ESTIMATES
public static final java.lang.String AVAILABLE_RANGES
public static final CFMetaData Hints
public static final CFMetaData Batchlog
public static final CFMetaData BuiltIndexes
public static KSMetaData definition()
public static void finishStartup()
public static void persistLocalMetadata()
public static java.util.UUID startCompaction(ColumnFamilyStore cfs, java.lang.Iterable<SSTableReader> toCompact)
cfs
- cfs to compacttoCompact
- sstables to compactpublic static void finishCompaction(java.util.UUID taskId)
taskId
- what was returned from startCompaction
public static java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.Map<java.lang.Integer,java.util.UUID>> getUnfinishedCompactions()
public static void discardCompactionsInProgress()
public static void updateCompactionHistory(java.lang.String ksname, java.lang.String cfname, long compactedAt, long bytesIn, long bytesOut, java.util.Map<java.lang.Integer,java.lang.Long> rowsMerged)
public static javax.management.openmbean.TabularData getCompactionHistory() throws javax.management.openmbean.OpenDataException
javax.management.openmbean.OpenDataException
public static void saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, ReplayPosition position)
public static void removeTruncationRecord(java.util.UUID cfId)
public static ReplayPosition getTruncatedPosition(java.util.UUID cfId)
public static long getTruncatedAt(java.util.UUID cfId)
public static void updateTokens(java.net.InetAddress ep, java.util.Collection<Token> tokens)
public static void updatePreferredIP(java.net.InetAddress ep, java.net.InetAddress preferred_ip)
public static void updatePeerInfo(java.net.InetAddress ep, java.lang.String columnName, java.lang.Object value)
public static void updateHintsDropped(java.net.InetAddress ep, java.util.UUID timePeriod, int value)
public static void updateSchemaVersion(java.util.UUID version)
public static void removeEndpoint(java.net.InetAddress ep)
public static void updateTokens(java.util.Collection<Token> tokens)
public static void forceBlockingFlush(java.lang.String cfname)
public static com.google.common.collect.SetMultimap<java.net.InetAddress,Token> loadTokens()
public static java.util.Map<java.net.InetAddress,java.util.UUID> loadHostIds()
public static java.net.InetAddress getPreferredIP(java.net.InetAddress ep)
ep
- endpoint address to checkpublic static java.util.Map<java.net.InetAddress,java.util.Map<java.lang.String,java.lang.String>> loadDcRackInfo()
public static CassandraVersion getReleaseVersion(java.net.InetAddress ep)
ep
- endpoint address to checkpublic static void checkHealth() throws ConfigurationException
ConfigurationException
public static java.util.Collection<Token> getSavedTokens()
public static int incrementAndGetGeneration()
public static SystemKeyspace.BootstrapState getBootstrapState()
public static boolean bootstrapComplete()
public static boolean bootstrapInProgress()
public static void setBootstrapState(SystemKeyspace.BootstrapState state)
public static boolean isIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
public static void setIndexBuilt(java.lang.String keyspaceName, java.lang.String indexName)
public static void setIndexRemoved(java.lang.String keyspaceName, java.lang.String indexName)
public static java.util.UUID getLocalHostId()
public static java.util.UUID setLocalHostId(java.util.UUID hostId)
public static java.lang.String getRack()
public static java.lang.String getDatacenter()
public static PaxosState loadPaxosState(java.nio.ByteBuffer key, CFMetaData metadata, long now)
public static void savePaxosPromise(Commit promise)
public static void savePaxosProposal(Commit proposal)
public static int paxosTtl(CFMetaData metadata)
public static void savePaxosCommit(Commit commit)
public static RestorableMeter getSSTableReadMeter(java.lang.String keyspace, java.lang.String table, int generation)
keyspace
- the keyspace the sstable belongs totable
- the table the sstable belongs togeneration
- the generation number for the sstablepublic static void persistSSTableReadMeter(java.lang.String keyspace, java.lang.String table, int generation, RestorableMeter meter)
public static void clearSSTableReadMeter(java.lang.String keyspace, java.lang.String table, int generation)
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)
public static void clearSizeEstimates(java.lang.String keyspace, java.lang.String table)
public static void updateAvailableRanges(java.lang.String keyspace, java.util.Collection<Range<Token>> completedRanges)
public static java.util.Set<Range<Token>> getAvailableRanges(java.lang.String keyspace, IPartitioner partitioner)
public static void resetAvailableRanges()
public static void snapshotOnVersionChange() throws java.io.IOException
java.io.IOException
Copyright © 2019 The Apache Software Foundation