org.apache.cassandra.db

## Class SystemTable

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

-     public class SystemTable
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SystemTable.BootstrapState`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `BATCHLOG_CF`
    `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` | `OLD_HINTS_CF` Deprecated.
    `static java.lang.String` | `OLD_STATUS_CF` Deprecated.
    `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`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SystemTable()`

  - ### Method Summary

    Methods
    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 table: 1.
    `static void` | `finishStartup()`
    `static void` | `forceBlockingFlush(java.lang.String cfname)`
    `static SystemTable.BootstrapState` | `getBootstrapState()`
    `static CounterId` | `getCurrentLocalCounterId()` Read the current local node id from the system table or null if no such node id is recorded.
    `static java.util.UUID` | `getLocalHostId()` Read the host ID from the system table, creating (and storing) one if none exists.
    `static java.util.List<CounterId.CounterIdRecord>` | `getOldLocalCounterIds()`
    `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 int` | `incrementAndGetGeneration()`
    `static boolean` | `isIndexBuilt(java.lang.String table, 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 com.google.common.collect.SetMultimap<java.net.InetAddress,Token>` | `loadTokens()` Return a map of stored tokens to IP addresses
    `static void` | `migrateKeyAlias()` 1.1 used a key_alias column; 1.2 changed that to key_aliases as part of CQL3
    `static Row` | `readSchemaRow(java.lang.String ksName)`
    `static Row` | `readSchemaRow(java.lang.String ksName, java.lang.String cfName)`
    `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` | `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(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 java.util.UUID` | `setLocalHostId(java.util.UUID hostId)` Sets the local host ID explicitly.
    `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 table.
    `static void` | `updatePeerInfo(java.net.InetAddress ep, java.lang.String columnName, java.lang.String value)`
    `static void` | `updateSchemaVersion(java.util.UUID version)`
    `static void` | `updateTokens(java.util.Collection<Token> tokens)` This method is used to update the System Table 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 oldCounterId, CounterId newCounterId, 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

    - #### PEERS_CF

          public static final java.lang.String PEERS_CF

      See Also:
        Constant Field Values

    - #### PEER_EVENTS_CF

          public static final java.lang.String PEER_EVENTS_CF

      See Also:
        Constant Field Values

    - #### LOCAL_CF

          public static final java.lang.String LOCAL_CF

      See Also:
        Constant Field Values

    - #### INDEX_CF

          public static final java.lang.String INDEX_CF

      See Also:
        Constant Field Values

    - #### COUNTER_ID_CF

          public static final java.lang.String COUNTER_ID_CF

      See Also:
        Constant Field Values

    - #### HINTS_CF

          public static final java.lang.String HINTS_CF

      See Also:
        Constant Field Values

    - #### RANGE_XFERS_CF

          public static final java.lang.String RANGE_XFERS_CF

      See Also:
        Constant Field Values

    - #### BATCHLOG_CF

          public static final java.lang.String BATCHLOG_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

    - #### OLD_STATUS_CF

          @Deprecated
          public static final java.lang.String OLD_STATUS_CF

      Deprecated.
      See Also:
        Constant Field Values

    - #### OLD_HINTS_CF

          @Deprecated
          public static final java.lang.String OLD_HINTS_CF

      Deprecated.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SystemTable

          public SystemTable()

  - ### Method Detail

    - #### finishStartup

          public static void finishStartup()

    - #### migrateKeyAlias

          public static void migrateKeyAlias()

      1.1 used a key_alias column; 1.2 changed that to key_aliases as part of CQL3

    - #### saveTruncationRecord

          public static void saveTruncationRecord(ColumnFamilyStore cfs,
                                  long truncatedAt,
                                  ReplayPosition position)

    - #### removeTruncationRecord

          public static void removeTruncationRecord(java.util.UUID cfId)

      This method is used to remove information about truncation time for specified column family

    - #### getTruncationRecords

          public static java.util.Map<java.util.UUID,Pair<ReplayPosition,java.lang.Long>> getTruncationRecords()

    - #### updateTokens

          public static void updateTokens(java.net.InetAddress ep,
                          java.util.Collection<Token> tokens)

      Record tokens being used by another node

    - #### updatePeerInfo

          public static void updatePeerInfo(java.net.InetAddress ep,
                            java.lang.String columnName,
                            java.lang.String value)

    - #### updateHintsDropped

          public static void updateHintsDropped(java.net.InetAddress ep,
                                java.util.UUID timePeriod,
                                int value)

    - #### updateSchemaVersion

          public static void updateSchemaVersion(java.util.UUID version)

    - #### removeEndpoint

          public static void removeEndpoint(java.net.InetAddress 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 Table with the new tokens for this node

    - #### updateLocalTokens

          public 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 table.
      Parameters:
        `addTokens` - tokens to add
        `rmTokens` - tokens to remove
      Returns:
        the collection of persisted tokens

    - #### forceBlockingFlush

          public static void forceBlockingFlush(java.lang.String cfname)

    - #### loadTokens

          public static com.google.common.collect.SetMultimap<java.net.InetAddress,Token> loadTokens()

      Return a map of stored tokens to IP addresses

    - #### loadHostIds

          public static java.util.Map<java.net.InetAddress,java.util.UUID> loadHostIds()

      Return a map of store host_ids to IP addresses

    - #### loadDcRackInfo

          public 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

    - #### checkHealth

          public static void checkHealth()
                                  throws ConfigurationException

      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`

    - #### getSavedTokens

          public static java.util.Collection<Token> getSavedTokens()

    - #### incrementAndGetGeneration

          public static int incrementAndGetGeneration()

    - #### 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)

    - #### getLocalHostId

          public static java.util.UUID getLocalHostId()

      Read the host ID from the system table, 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.

    - #### getCurrentLocalCounterId

          public static CounterId getCurrentLocalCounterId()

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

    - #### writeCurrentLocalCounterId

          public static void writeCurrentLocalCounterId(CounterId oldCounterId,
                                        CounterId newCounterId,
                                        long now)

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

    - #### getOldLocalCounterIds

          public static java.util.List<CounterId.CounterIdRecord> getOldLocalCounterIds()

    - #### 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 © 2014 The Apache Software Foundation