org.apache.cassandra.db
Class Table

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

public class Table
extends java.lang.Object


Nested Class Summary
 class Table.IndexBuilder
           
 
Field Summary
 java.util.Map<java.lang.Integer,ColumnFamilyStore> columnFamilyStores
           
 java.lang.String name
           
static java.lang.String SYSTEM_TABLE
           
 
Method Summary
static java.lang.Iterable<Table> all()
           
 void apply(RowMutation mutation, java.lang.Object serializedMutation, boolean writeCommitLog)
          This method adds the row to the Commit Log associated with this table.
static void cleanupIndexEntry(ColumnFamilyStore cfs, java.nio.ByteBuffer key, IColumn column)
           
static Table clear(java.lang.String table)
           
 void clearSnapshot()
          Clear all the snapshots for a given table.
 Table.IndexBuilder createIndexBuilder(ColumnFamilyStore cfs, java.util.SortedSet<java.nio.ByteBuffer> columns, ReducingKeyIterator iter)
           
 void createReplicationStrategy(KSMetaData ksm)
           
 void dropCf(java.lang.Integer cfId)
           
 java.util.List<java.util.concurrent.Future<?>> flush()
           
 void forceCleanup()
          Do a cleanup of keys that do not belong locally.
 void forceCompaction()
           
 java.util.List<SSTableReader> getAllSSTables()
           
 ColumnFamilyStore getColumnFamilyStore(java.lang.String cfName)
           
 java.util.Collection<ColumnFamilyStore> getColumnFamilyStores()
           
 java.lang.String getDataFileLocation(long expectedCompactedFileSize)
           
static java.util.concurrent.locks.Lock getFlushLock()
           
 AbstractReplicationStrategy getReplicationStrategy()
           
 Row getRow(QueryFilter filter)
           
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)
           
 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)
           
 void reloadCf(java.lang.Integer cfId)
           
 void renameCf(java.lang.Integer cfId, java.lang.String newName)
          basically a combined drop and add
 void snapshot(java.lang.String clientSuppliedName)
          Take a snapshot of the entire set of column families with a given timestamp.
 void truncate(java.lang.String cfname)
          Performs a synchronous truncate operation, effectively deleting all data from the column family cfname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_TABLE

public static final java.lang.String SYSTEM_TABLE
See Also:
Constant Field Values

name

public final java.lang.String name

columnFamilyStores

public final java.util.Map<java.lang.Integer,ColumnFamilyStore> columnFamilyStores
Method Detail

open

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

getFlushLock

public static java.util.concurrent.locks.Lock getFlushLock()

clear

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

getColumnFamilyStores

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

getColumnFamilyStore

public ColumnFamilyStore getColumnFamilyStore(java.lang.String cfName)

forceCleanup

public void forceCleanup()
                  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 clientSuppliedName)
Take a snapshot of the entire set of column families with a given timestamp.

Parameters:
clientSuppliedName - the tag associated with the name of the snapshot. This value can be null.

getTimestampedSnapshotName

public static java.lang.String getTimestampedSnapshotName(java.lang.String clientSuppliedName)
Parameters:
clientSuppliedName; - may be null.
Returns:

clearSnapshot

public void clearSnapshot()
                   throws java.io.IOException
Clear all the snapshots for a given table.

Throws:
java.io.IOException

forceCompaction

public void forceCompaction()
                     throws java.io.IOException,
                            java.util.concurrent.ExecutionException,
                            java.lang.InterruptedException
Throws:
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException

getAllSSTables

public java.util.List<SSTableReader> getAllSSTables()
Returns:
A list of open SSTableReaders (TODO: ensure that the caller doesn't modify these).

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


reloadCf

public void reloadCf(java.lang.Integer cfId)
              throws java.io.IOException
Throws:
java.io.IOException

renameCf

public void renameCf(java.lang.Integer cfId,
                     java.lang.String newName)
              throws java.io.IOException
basically a combined drop and add

Throws:
java.io.IOException

getRow

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

apply

public void apply(RowMutation mutation,
                  java.lang.Object serializedMutation,
                  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

cleanupIndexEntry

public static void cleanupIndexEntry(ColumnFamilyStore cfs,
                                     java.nio.ByteBuffer key,
                                     IColumn column)

createIndexBuilder

public Table.IndexBuilder createIndexBuilder(ColumnFamilyStore cfs,
                                             java.util.SortedSet<java.nio.ByteBuffer> columns,
                                             ReducingKeyIterator iter)

getReplicationStrategy

public AbstractReplicationStrategy getReplicationStrategy()

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

getSnapshotPath

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

all

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

truncate

public void truncate(java.lang.String cfname)
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException,
                     java.io.IOException
Performs a synchronous truncate operation, effectively deleting all data from the column family cfname

Parameters:
cfname -
Throws:
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException


Copyright © 2011 The Apache Software Foundation