Table (apache-cassandra API)
Date: 2012-05-04

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cassandra.db
Class Table

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

    public class Table

extends java.lang.Object

It represents a Keyspace.

Field Summary
`java.lang.String` | `name`
`static java.lang.String` | `SNAPSHOT_SUBDIR_NAME`
`static java.util.concurrent.locks.ReentrantReadWriteLock` | `switchLock` accesses to CFS.memtable should acquire this for thread safety.
`static java.lang.String` | `SYSTEM_TABLE`

Method Summary
`static java.lang.Iterable<Table>` | `all()`
`void` | `apply(RowMutation mutation, boolean writeCommitLog)` This method adds the row to the Commit Log associated with this table.
`static Table` | `clear(java.lang.String table)`
`static Table` | `clear(java.lang.String table, Schema schema)`
`void` | `clearSnapshot(java.lang.String tag)` Clear all the snapshots for a given table.
`void` | `createReplicationStrategy(KSMetaData ksm)`
`void` | `dropCf(java.lang.Integer cfId)`
`java.util.List<java.util.concurrent.Future<?>>` | `flush()`
`void` | `forceCleanup(NodeId.OneShotRenewer renewer)` Do a cleanup of keys that do not belong locally.
`java.util.List<SSTableReader>` | `getAllSSTables()`
`ColumnFamilyStore` | `getColumnFamilyStore(java.lang.Integer id)`
`ColumnFamilyStore` | `getColumnFamilyStore(java.lang.String cfName)`
`java.util.Collection<ColumnFamilyStore>` | `getColumnFamilyStores()`
`java.lang.String` | `getDataFileLocation(long expectedSize)`
`AbstractReplicationStrategy` | `getReplicationStrategy()`
`Row` | `getRow(QueryFilter filter)`
`static java.lang.String` | `getSnapshotPath(java.lang.String tableDirectory, java.lang.String snapshotName)`
`static java.lang.String` | `getSnapshotPath(java.lang.String dataDirPath, java.lang.String tableName, java.lang.String snapshotName)`
`static java.lang.String` | `getTimestampedSnapshotName(java.lang.String clientSuppliedName)`
`static void` | `indexRow(DecoratedKey<?> key, ColumnFamilyStore cfs, java.util.SortedSet<java.nio.ByteBuffer> indexedColumns)`
`void` | `initCf(java.lang.Integer cfId, java.lang.String cfName)` adds a cf to internal structures, ends up creating disk files).
`static Table` | `open(java.lang.String table)`
`static Table` | `open(java.lang.String table, Schema schema)`
`void` | `snapshot(java.lang.String snapshotName)` Take a snapshot of the entire set of column families with a given timestamp
`boolean` | `snapshotExists(java.lang.String snapshotName)` ? Clear snapshots for this table.
`java.lang.String` | `toString()`

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

Field Detail

### SYSTEM_TABLE

    public static final java.lang.String SYSTEM_TABLE

See Also:
  Constant Field Values

### SNAPSHOT_SUBDIR_NAME

    public static final java.lang.String SNAPSHOT_SUBDIR_NAME

See Also:
  Constant Field Values

### switchLock

    public static final java.util.concurrent.locks.ReentrantReadWriteLock switchLock

  accesses to CFS.memtable should acquire this for thread safety. CFS.maybeSwitchMemtable should aquire the writeLock; see that method for the full explanation. (Enabling fairness in the RRWL is observed to decrease throughput, so we leave it off.)

### name

    public final java.lang.String name

Method Detail

### open

    public static Table open(java.lang.String table)

### open

    public static Table open(java.lang.String table,
                             Schema schema)

### clear

    public static Table clear(java.lang.String table)
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### clear

    public static Table clear(java.lang.String table,
                              Schema schema)
                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### getColumnFamilyStores

    public java.util.Collection<ColumnFamilyStore> getColumnFamilyStores()

### getColumnFamilyStore

    public ColumnFamilyStore getColumnFamilyStore(java.lang.String cfName)

### getColumnFamilyStore

    public ColumnFamilyStore getColumnFamilyStore(java.lang.Integer id)

### forceCleanup

    public void forceCleanup(NodeId.OneShotRenewer renewer)
                      throws java.io.IOException,
                             java.util.concurrent.ExecutionException,
                             java.lang.InterruptedException

  Do a cleanup of keys that do not belong locally.

  Throws:
    `java.io.IOException`
    `java.util.concurrent.ExecutionException`
    `java.lang.InterruptedException`

### snapshot

    public void snapshot(java.lang.String snapshotName)

  Take a snapshot of the entire set of column families with a given timestamp

  Parameters:
    `snapshotName` - the tag associated with the name of the snapshot. This value may not be null

### getTimestampedSnapshotName

    public static java.lang.String getTimestampedSnapshotName(java.lang.String clientSuppliedName)

  Parameters:
    `clientSuppliedName` - may be null.
  Returns:

### snapshotExists

    public boolean snapshotExists(java.lang.String snapshotName)

  ? Clear snapshots for this table. If no tag is given we will clear all snapshots

  Parameters:
    `snapshotName` - the user supplied snapshot name
  Returns:
    true if the snapshot exists

### clearSnapshot

    public void clearSnapshot(java.lang.String tag)
                       throws java.io.IOException

  Clear all the snapshots for a given table.

  Throws:
    `java.io.IOException`

### getAllSSTables

    public java.util.List<SSTableReader> getAllSSTables()

  Returns:
    A list of open SSTableReaders

### createReplicationStrategy

    public void createReplicationStrategy(KSMetaData ksm)
                                   throws ConfigurationException

  Throws:
    `ConfigurationException`

### dropCf

    public void dropCf(java.lang.Integer cfId)
                throws java.io.IOException

  Throws:
    `java.io.IOException`

### initCf

    public void initCf(java.lang.Integer cfId,
                       java.lang.String cfName)

  adds a cf to internal structures, ends up creating disk files).

### getRow

    public Row getRow(QueryFilter filter)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### apply

    public void apply(RowMutation mutation,
                      boolean writeCommitLog)
               throws java.io.IOException

  This method adds the row to the Commit Log associated with this table. Once this happens the data associated with the individual column families is also written to the column family store's memtable.

  Throws:
    `java.io.IOException`

### getReplicationStrategy

    public AbstractReplicationStrategy getReplicationStrategy()

### indexRow

    public static void indexRow(DecoratedKey<?> key,
                                ColumnFamilyStore cfs,
                                java.util.SortedSet<java.nio.ByteBuffer> indexedColumns)

### flush

    public java.util.List<java.util.concurrent.Future<?>> flush()
                                                         throws java.io.IOException

  Throws:
    `java.io.IOException`

### getDataFileLocation

    public java.lang.String getDataFileLocation(long expectedSize)

### getSnapshotPath

    public static java.lang.String getSnapshotPath(java.lang.String dataDirPath,
                                                   java.lang.String tableName,
                                                   java.lang.String snapshotName)

### getSnapshotPath

    public static java.lang.String getSnapshotPath(java.lang.String tableDirectory,
                                                   java.lang.String snapshotName)

### all

    public static java.lang.Iterable<Table> all()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 The Apache Software Foundation