public 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 |
BATCHLOG_CF |
static java.lang.String |
COMPACTION_LOG |
static java.lang.String |
COUNTER_ID_CF |
static java.lang.String |
HINTS_CF |
static java.lang.String |
INDEX_CF |
static java.lang.String |
LOCAL_CF |
static java.lang.String |
PAXOS_CF |
static java.lang.String |
PEER_EVENTS_CF |
static java.lang.String |
PEERS_CF |
static java.lang.String |
RANGE_XFERS_CF |
static java.lang.String |
SCHEMA_COLUMNFAMILIES_CF |
static java.lang.String |
SCHEMA_COLUMNS_CF |
static java.lang.String |
SCHEMA_KEYSPACES_CF |
static java.lang.String |
SCHEMA_TRIGGERS_CF |
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 |
discardCompactionsInProgress() |
static void |
finishCompaction(java.util.UUID taskId) |
static void |
finishStartup() |
static void |
forceBlockingFlush(java.lang.String cfname) |
static SystemKeyspace.BootstrapState |
getBootstrapState() |
static CounterId |
getCurrentLocalCounterId()
Read the current local node id from the system keyspace or null if no
such node id is recorded.
|
static java.util.UUID |
getLocalHostId()
Read the host ID from the system keyspace, creating (and storing) one if
none exists.
|
static java.util.List<CounterId.CounterIdRecord> |
getOldLocalCounterIds() |
static java.net.InetAddress |
getPreferredIP(java.net.InetAddress ep) |
static java.util.Collection<Token> |
getSavedTokens() |
static java.util.Map<DecoratedKey,ColumnFamily> |
getSchema(java.lang.String cfName) |
static java.nio.ByteBuffer |
getSchemaKSKey(java.lang.String ksName) |
static java.util.Map<java.util.UUID,Pair<ReplayPosition,java.lang.Long>> |
getTruncationRecords() |
static com.google.common.collect.SetMultimap<Pair<java.lang.String,java.lang.String>,java.lang.Integer> |
getUnfinishedCompactions() |
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) |
static com.google.common.collect.SetMultimap<java.net.InetAddress,Token> |
loadTokens()
Return a map of stored tokens to IP addresses
|
static Row |
readSchemaRow(java.lang.String ksName) |
static Row |
readSchemaRow(java.lang.String schemaCfName,
java.lang.String ksName,
java.lang.String cfName)
Fetches a subset of schema (table data, columns metadata or triggers) for the keyspace+table pair.
|
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 |
savePaxosCommit(Commit commit,
java.util.UUID inProgressBallot) |
static void |
savePaxosPromise(Commit promise) |
static void |
savePaxosProposal(Commit commit) |
static void |
saveTruncationRecord(ColumnFamilyStore cfs,
long truncatedAt,
ReplayPosition position) |
static ColumnFamilyStore |
schemaCFS(java.lang.String cfName) |
static java.util.List<Row> |
serializedSchema() |
static java.util.List<Row> |
serializedSchema(java.lang.String schemaCfName) |
static java.util.Collection<RowMutation> |
serializeSchema() |
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 |
startCompaction(ColumnFamilyStore cfs,
java.lang.Iterable<SSTableReader> toCompact)
Write compaction log, except columfamilies under system keyspace.
|
static void |
updateHintsDropped(java.net.InetAddress ep,
java.util.UUID timePeriod,
int value) |
static java.util.Collection<Token> |
updateLocalTokens(java.util.Collection<Token> addTokens,
java.util.Collection<Token> rmTokens)
Convenience method to update the list of tokens in the local system keyspace.
|
static void |
updatePeerInfo(java.net.InetAddress ep,
java.lang.String columnName,
java.lang.String value) |
static void |
updatePreferredIP(java.net.InetAddress ep,
java.net.InetAddress preferred_ip) |
static void |
updateSchemaVersion(java.util.UUID version) |
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
|
static void |
writeCurrentLocalCounterId(CounterId newCounterId,
long now)
Write a new current local node id to the system keyspace.
|
public static final java.lang.String PEERS_CF
public static final java.lang.String PEER_EVENTS_CF
public static final java.lang.String LOCAL_CF
public static final java.lang.String INDEX_CF
public static final java.lang.String COUNTER_ID_CF
public static final java.lang.String HINTS_CF
public static final java.lang.String RANGE_XFERS_CF
public static final java.lang.String BATCHLOG_CF
public static final java.lang.String SCHEMA_KEYSPACES_CF
public static final java.lang.String SCHEMA_COLUMNFAMILIES_CF
public static final java.lang.String SCHEMA_COLUMNS_CF
public static final java.lang.String SCHEMA_TRIGGERS_CF
public static final java.lang.String COMPACTION_LOG
public static final java.lang.String PAXOS_CF
public static void finishStartup()
public static java.util.UUID startCompaction(ColumnFamilyStore cfs, java.lang.Iterable<SSTableReader> toCompact)
cfs
- toCompact
- sstables to compactpublic static void finishCompaction(java.util.UUID taskId)
public static com.google.common.collect.SetMultimap<Pair<java.lang.String,java.lang.String>,java.lang.Integer> getUnfinishedCompactions()
public static void discardCompactionsInProgress()
public static void saveTruncationRecord(ColumnFamilyStore cfs, long truncatedAt, ReplayPosition position)
public static void removeTruncationRecord(java.util.UUID cfId)
public static java.util.Map<java.util.UUID,Pair<ReplayPosition,java.lang.Long>> getTruncationRecords()
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.String 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 java.util.Collection<Token> updateLocalTokens(java.util.Collection<Token> addTokens, java.util.Collection<Token> rmTokens)
addTokens
- tokens to addrmTokens
- tokens to removepublic 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)
public static java.util.Map<java.net.InetAddress,java.util.Map<java.lang.String,java.lang.String>> loadDcRackInfo()
public 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 CounterId getCurrentLocalCounterId()
public static void writeCurrentLocalCounterId(CounterId newCounterId, long now)
newCounterId
- the new current local node id to recordnow
- microsecond time stamp.public static java.util.List<CounterId.CounterIdRecord> getOldLocalCounterIds()
public static ColumnFamilyStore schemaCFS(java.lang.String cfName)
cfName
- The name of the ColumnFamily responsible for part of the schema (keyspace, ColumnFamily, columns)public static java.util.List<Row> serializedSchema()
public static java.util.List<Row> serializedSchema(java.lang.String schemaCfName)
schemaCfName
- The name of the ColumnFamily responsible for part of the schema (keyspace, ColumnFamily, columns)public static java.util.Collection<RowMutation> serializeSchema()
public static java.util.Map<DecoratedKey,ColumnFamily> getSchema(java.lang.String cfName)
public static java.nio.ByteBuffer getSchemaKSKey(java.lang.String ksName)
public static Row readSchemaRow(java.lang.String ksName)
public static Row readSchemaRow(java.lang.String schemaCfName, java.lang.String ksName, java.lang.String cfName)
schemaCfName
- the schema table to get the data from (schema_columnfamilies, schema_columns or schema_triggers)ksName
- the keyspace of the table we are interested incfName
- the table we are interested inpublic static PaxosState loadPaxosState(java.nio.ByteBuffer key, CFMetaData metadata)
public static void savePaxosPromise(Commit promise)
public static void savePaxosProposal(Commit commit)
public static void savePaxosCommit(Commit commit, java.util.UUID inProgressBallot)
Copyright © 2013 The Apache Software Foundation