## org.apache.cassandra.db
Class SystemTable

    java.lang.Object
      org.apache.cassandra.db.SystemTable

    public class SystemTable

extends java.lang.Object

Nested Class Summary
`static class` `SystemTable.BootstrapState`

Field Summary
`static java.lang.String` `INDEX_CF`
`static java.lang.String` `NODE_ID_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` `STATUS_CF`
`static java.lang.String` `VERSION_CF`

Constructor Summary
`SystemTable()`

Method Summary
`static boolean` `bootstrapComplete()`
`static boolean` `bootstrapInProgress()`
`static void` `checkHealth()` One of three things will happen if you try to read the system table: 1.
`static void` `finishStartup()`
`static SystemTable.BootstrapState` `getBootstrapState()`
`static NodeId` `getCurrentLocalNodeId()` Read the current local node id from the system table or null if no such node id is recorded.
`static java.util.List<NodeId.NodeIdRecord>` `getOldLocalNodeIds()`
`static Token` `getSavedToken()`
`static java.util.Map<DecoratedKey,ColumnFamily>` `getSchema(java.lang.String cfName)`
`static java.nio.ByteBuffer` `getSchemaKSKey(java.lang.String ksName)`
`static int` `incrementAndGetGeneration()`
`static boolean` `isIndexBuilt(java.lang.String table, java.lang.String indexName)`
`static java.util.HashMap<Token,java.net.InetAddress>` `loadTokens()` Return a map of stored tokens to IP addresses
`static Row` `readSchemaRow(java.lang.String ksName)`
`static Row` `readSchemaRow(java.lang.String ksName, java.lang.String cfName)`
`static void` `removeToken(Token token)` Remove stored token being used by another node
`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(SystemTable.BootstrapState state)`
`static void` `setIndexBuilt(java.lang.String table, java.lang.String indexName)`
`static void` `setIndexRemoved(java.lang.String table, java.lang.String indexName)`
`static void` `updateToken(java.net.InetAddress ep, Token token)` Record token being used by another node
`static void` `updateToken(Token token)` This method is used to update the System Table with the new token for this node
`static void` `writeCurrentLocalNodeId(NodeId oldNodeId, NodeId newNodeId, long now)` Write a new current local node id to the system table.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### STATUS_CF

    public static final java.lang.String STATUS_CF

See Also:
  Constant Field Values

### INDEX_CF

    public static final java.lang.String INDEX_CF

See Also:
  Constant Field Values

### NODE_ID_CF

    public static final java.lang.String NODE_ID_CF

See Also:
  Constant Field Values

### VERSION_CF

    public static final java.lang.String VERSION_CF

See Also:
  Constant Field Values

### SCHEMA_KEYSPACES_CF

    public static final java.lang.String SCHEMA_KEYSPACES_CF

See Also:
  Constant Field Values

### SCHEMA_COLUMNFAMILIES_CF

    public static final java.lang.String SCHEMA_COLUMNFAMILIES_CF

See Also:
  Constant Field Values

### SCHEMA_COLUMNS_CF

    public static final java.lang.String SCHEMA_COLUMNS_CF

See Also:
  Constant Field Values

Constructor Detail

### SystemTable

    public SystemTable()

Method Detail

### finishStartup

    public static void finishStartup()
                              throws java.io.IOException

  Throws:
    `java.io.IOException`

### updateToken

    public static void updateToken(java.net.InetAddress ep,
                                   Token token)

  Record token being used by another node

### removeToken

    public static void removeToken(Token token)

  Remove stored token being used by another node

### updateToken

    public static void updateToken(Token token)

  This method is used to update the System Table with the new token for this node

### loadTokens

    public static java.util.HashMap<Token,java.net.InetAddress> loadTokens()

  Return a map of stored tokens to IP addresses

### checkHealth

    public static void checkHealth()
                            throws ConfigurationException,
                                   java.io.IOException

  One of three things will happen if you try to read the system table: 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`
    `java.io.IOException`

### getSavedToken

    public static Token getSavedToken()

### incrementAndGetGeneration

    public static int incrementAndGetGeneration()
                                         throws java.io.IOException

  Throws:
    `java.io.IOException`

### getBootstrapState

    public static SystemTable.BootstrapState getBootstrapState()

### bootstrapComplete

    public static boolean bootstrapComplete()

### bootstrapInProgress

    public static boolean bootstrapInProgress()

### setBootstrapState

    public static void setBootstrapState(SystemTable.BootstrapState state)

### isIndexBuilt

    public static boolean isIndexBuilt(java.lang.String table,
                                       java.lang.String indexName)

### setIndexBuilt

    public static void setIndexBuilt(java.lang.String table,
                                     java.lang.String indexName)

### setIndexRemoved

    public static void setIndexRemoved(java.lang.String table,
                                       java.lang.String indexName)

### getCurrentLocalNodeId

    public static NodeId getCurrentLocalNodeId()

  Read the current local node id from the system table or null if no such node id is recorded.

### writeCurrentLocalNodeId

    public static void writeCurrentLocalNodeId(NodeId oldNodeId,
                                               NodeId newNodeId,
                                               long now)

  Write a new current local node id to the system table.

  Parameters:
    `oldNodeId` - the previous local node id (that `newNodeId` replace) or null if no such node id exists (new node or removed system table)
    `newNodeId` - the new current local node id to record
    `now` - microsecond time stamp.

### getOldLocalNodeIds

    public static java.util.List<NodeId.NodeIdRecord> getOldLocalNodeIds()

### schemaCFS

    public static ColumnFamilyStore schemaCFS(java.lang.String cfName)

  Parameters:
    `cfName` - The name of the ColumnFamily responsible for part of the schema (keyspace, ColumnFamily, columns)
  Returns:
    CFS responsible to hold low-level serialized schema

### serializedSchema

    public static java.util.List<Row> serializedSchema()

### serializedSchema

    public static java.util.List<Row> serializedSchema(java.lang.String schemaCfName)

  Parameters:
    `schemaCfName` - The name of the ColumnFamily responsible for part of the schema (keyspace, ColumnFamily, columns)
  Returns:
    low-level schema representation (each row represents individual Keyspace or ColumnFamily)

### serializeSchema

    public static java.util.Collection<RowMutation> serializeSchema()

### getSchema

    public static java.util.Map<DecoratedKey,ColumnFamily> getSchema(java.lang.String cfName)

### getSchemaKSKey

    public static java.nio.ByteBuffer getSchemaKSKey(java.lang.String ksName)

### readSchemaRow

    public static Row readSchemaRow(java.lang.String ksName)

### readSchemaRow

    public static Row readSchemaRow(java.lang.String ksName,
                                    java.lang.String cfName)

Copyright © 2013 The Apache Software Foundation