org.apache.cassandra.config
Class DatabaseDescriptor

java.lang.Object
  extended by org.apache.cassandra.config.DatabaseDescriptor

public class DatabaseDescriptor
extends java.lang.Object


Nested Class Summary
static class DatabaseDescriptor.CommitLogSync
           
static class DatabaseDescriptor.DiskAccessMode
           
 
Field Summary
static int DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS
           
static int DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS
           
static java.lang.String ophf
           
static java.lang.String random
           
static java.lang.String STREAMING_SUBDIR
           
 
Constructor Summary
DatabaseDescriptor()
           
 
Method Summary
static void createAllDirectories()
          Creates all storage-related directories.
static java.lang.String[] getAllDataFileLocations()
           
static java.lang.String[] getAllDataFileLocationsForTable(java.lang.String table)
          Get a list of data directories for a given table
static IAuthenticator getAuthenticator()
           
static int getBMTThreshold()
           
static CFMetaData getCFMetaData(java.lang.String tableName, java.lang.String cfName)
           
static java.lang.String getClusterName()
           
static java.lang.String getColumnFamilyType(java.lang.String tableName, java.lang.String cfName)
           
static int getColumnIndexSize()
           
static java.lang.String getColumnType(java.lang.String tableName, java.lang.String cfName)
           
static DatabaseDescriptor.CommitLogSync getCommitLogSync()
           
static double getCommitLogSyncBatchWindow()
           
static int getCommitLogSyncPeriod()
           
static int getCompactionPriority()
           
static AbstractType getComparator(java.lang.String tableName, java.lang.String cfName)
           
static int getConcurrentReaders()
           
static int getConcurrentWriters()
           
static java.lang.String getConfigFileName()
           
static boolean getConsistencyCheck()
           
static int getConsistencyThreads()
           
static java.lang.String getDataFileLocationForTable(java.lang.String table, long expectedCompactedFileSize)
           
static DatabaseDescriptor.DiskAccessMode getDiskAccessMode()
           
static IEndPointSnitch getEndPointSnitch(java.lang.String table)
           
static double getFlushDataBufferSizeInMB()
           
static double getFlushIndexBufferSizeInMB()
           
static int getGcGraceInSeconds()
           
static DatabaseDescriptor.DiskAccessMode getIndexAccessMode()
           
static int getIndexedReadBufferSizeInKB()
           
static int getIndexInterval()
           
static java.lang.String getInitialToken()
           
static java.lang.String getJobJarLocation()
           
static java.lang.String getJobTrackerAddress()
           
static int getKeysCachedFor(java.lang.String tableName, java.lang.String columnFamilyName, long expectedKeys)
           
static java.net.InetAddress getListenAddress()
           
static java.lang.String getLogFileLocation()
           
static int getMemtableLifetimeMS()
           
static double getMemtableOperations()
           
static int getMemtableThroughput()
           
static java.lang.String getNextAvailableDataLocation()
           
static java.util.List<java.lang.String> getNonSystemTables()
           
static IPartitioner getPartitioner()
           
static int getPhiConvictThreshold()
           
static java.lang.Class<? extends AbstractReplicationStrategy> getReplicaPlacementStrategyClass(java.lang.String table)
           
static int getReplicationFactor(java.lang.String table)
           
static int getRowsCachedFor(java.lang.String tableName, java.lang.String columnFamilyName, long expectedRows)
           
static long getRowWarningThreshold()
           
static long getRpcTimeout()
           
static java.util.Set<java.net.InetAddress> getSeeds()
           
static java.io.File getSerializedKeyCachePath(java.lang.String ksName, java.lang.String cfName)
           
static java.io.File getSerializedRowCachePath(java.lang.String ksName, java.lang.String cfName)
           
static int getSlicedReadBufferSizeInKB()
           
static int getStoragePort()
           
static AbstractType getSubComparator(java.lang.String tableName, java.lang.String cfName)
           
static java.util.Map<java.lang.String,CFMetaData> getTableMetaData(java.lang.String tableName)
           
static java.util.Set<java.lang.String> getTables()
           
static java.net.InetAddress getThriftAddress()
           
static int getThriftPort()
           
static boolean hintedHandoffEnabled()
           
static boolean isAutoBootstrap()
           
static boolean isSnapshotBeforeCompaction()
           
static boolean isThriftFramed()
           
static void storeMetadata()
          Create the metadata tables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STREAMING_SUBDIR

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

random

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

ophf

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

DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS

public static final int DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS
See Also:
Constant Field Values

DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS

public static final int DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS
See Also:
Constant Field Values
Constructor Detail

DatabaseDescriptor

public DatabaseDescriptor()
Method Detail

getSerializedRowCachePath

public static java.io.File getSerializedRowCachePath(java.lang.String ksName,
                                                     java.lang.String cfName)

getSerializedKeyCachePath

public static java.io.File getSerializedKeyCachePath(java.lang.String ksName,
                                                     java.lang.String cfName)

getCompactionPriority

public static int getCompactionPriority()

getAuthenticator

public static IAuthenticator getAuthenticator()

isThriftFramed

public static boolean isThriftFramed()

createAllDirectories

public static void createAllDirectories()
                                 throws java.io.IOException
Creates all storage-related directories.

Throws:
java.io.IOException - when a disk problem is encountered.

storeMetadata

public static void storeMetadata()
                          throws java.io.IOException
Create the metadata tables. This table has information about the table name and the column families that make up the table. Each column family also has an associated ID which is an int.

Throws:
java.io.IOException

getGcGraceInSeconds

public static int getGcGraceInSeconds()

getPartitioner

public static IPartitioner getPartitioner()

getEndPointSnitch

public static IEndPointSnitch getEndPointSnitch(java.lang.String table)

getReplicaPlacementStrategyClass

public static java.lang.Class<? extends AbstractReplicationStrategy> getReplicaPlacementStrategyClass(java.lang.String table)

getJobTrackerAddress

public static java.lang.String getJobTrackerAddress()

getColumnIndexSize

public static int getColumnIndexSize()

getMemtableLifetimeMS

public static int getMemtableLifetimeMS()

getInitialToken

public static java.lang.String getInitialToken()

getMemtableThroughput

public static int getMemtableThroughput()

getMemtableOperations

public static double getMemtableOperations()

getConsistencyCheck

public static boolean getConsistencyCheck()

getClusterName

public static java.lang.String getClusterName()

getConfigFileName

public static java.lang.String getConfigFileName()

getJobJarLocation

public static java.lang.String getJobJarLocation()

getTableMetaData

public static java.util.Map<java.lang.String,CFMetaData> getTableMetaData(java.lang.String tableName)

getCFMetaData

public static CFMetaData getCFMetaData(java.lang.String tableName,
                                       java.lang.String cfName)

getColumnType

public static java.lang.String getColumnType(java.lang.String tableName,
                                             java.lang.String cfName)

getTables

public static java.util.Set<java.lang.String> getTables()

getNonSystemTables

public static java.util.List<java.lang.String> getNonSystemTables()

getStoragePort

public static int getStoragePort()

getThriftPort

public static int getThriftPort()

getReplicationFactor

public static int getReplicationFactor(java.lang.String table)

getRpcTimeout

public static long getRpcTimeout()

getPhiConvictThreshold

public static int getPhiConvictThreshold()

getConsistencyThreads

public static int getConsistencyThreads()

getConcurrentReaders

public static int getConcurrentReaders()

getConcurrentWriters

public static int getConcurrentWriters()

getRowWarningThreshold

public static long getRowWarningThreshold()

getAllDataFileLocations

public static java.lang.String[] getAllDataFileLocations()

getAllDataFileLocationsForTable

public static java.lang.String[] getAllDataFileLocationsForTable(java.lang.String table)
Get a list of data directories for a given table

Parameters:
table - name of the table.
Returns:
an array of path to the data directories.

getNextAvailableDataLocation

public static java.lang.String getNextAvailableDataLocation()

getLogFileLocation

public static java.lang.String getLogFileLocation()

getSeeds

public static java.util.Set<java.net.InetAddress> getSeeds()

getColumnFamilyType

public static java.lang.String getColumnFamilyType(java.lang.String tableName,
                                                   java.lang.String cfName)

getDataFileLocationForTable

public static java.lang.String getDataFileLocationForTable(java.lang.String table,
                                                           long expectedCompactedFileSize)

getComparator

public static AbstractType getComparator(java.lang.String tableName,
                                         java.lang.String cfName)

getSubComparator

public static AbstractType getSubComparator(java.lang.String tableName,
                                            java.lang.String cfName)

getKeysCachedFor

public static int getKeysCachedFor(java.lang.String tableName,
                                   java.lang.String columnFamilyName,
                                   long expectedKeys)
Returns:
The absolute number of keys that should be cached per table.

getRowsCachedFor

public static int getRowsCachedFor(java.lang.String tableName,
                                   java.lang.String columnFamilyName,
                                   long expectedRows)
Returns:
The absolute number of rows that should be cached for the columnfamily.

getListenAddress

public static java.net.InetAddress getListenAddress()

getThriftAddress

public static java.net.InetAddress getThriftAddress()

getCommitLogSyncBatchWindow

public static double getCommitLogSyncBatchWindow()

getCommitLogSyncPeriod

public static int getCommitLogSyncPeriod()

getCommitLogSync

public static DatabaseDescriptor.CommitLogSync getCommitLogSync()

getDiskAccessMode

public static DatabaseDescriptor.DiskAccessMode getDiskAccessMode()

getIndexAccessMode

public static DatabaseDescriptor.DiskAccessMode getIndexAccessMode()

getFlushDataBufferSizeInMB

public static double getFlushDataBufferSizeInMB()

getFlushIndexBufferSizeInMB

public static double getFlushIndexBufferSizeInMB()

getIndexedReadBufferSizeInKB

public static int getIndexedReadBufferSizeInKB()

getSlicedReadBufferSizeInKB

public static int getSlicedReadBufferSizeInKB()

getBMTThreshold

public static int getBMTThreshold()

isSnapshotBeforeCompaction

public static boolean isSnapshotBeforeCompaction()

isAutoBootstrap

public static boolean isAutoBootstrap()

hintedHandoffEnabled

public static boolean hintedHandoffEnabled()

getIndexInterval

public static int getIndexInterval()


Copyright © 2010 The Apache Software Foundation