org.apache.cassandra.config

## Class CFMetaData

- java.lang.Object
- - org.apache.cassandra.config.CFMetaData

-     public final class CFMetaData
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CFMetaData.Caching`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static CFMetaData` | `BatchlogCf`
    `java.util.UUID` | `cfId`
    `java.lang.String` | `cfName`
    `ColumnFamilyType` | `cfType`
    `java.lang.Class<? extends AbstractCompactionStrategy>` | `compactionStrategyClass`
    `java.util.Map<java.lang.String,java.lang.String>` | `compactionStrategyOptions`
    `AbstractType<?>` | `comparator`
    `CompressionParameters` | `compressionParameters`
    `static CFMetaData` | `CounterIdCf`
    `static CFMetaData.Caching` | `DEFAULT_CACHING_STRATEGY`
    `static java.lang.Class<? extends AbstractCompactionStrategy>` | `DEFAULT_COMPACTION_STRATEGY_CLASS`
    `static java.lang.String` | `DEFAULT_COMPRESSOR`
    `static double` | `DEFAULT_DCLOCAL_READ_REPAIR_CHANCE`
    `static int` | `DEFAULT_GC_GRACE_SECONDS`
    `static java.nio.ByteBuffer` | `DEFAULT_KEY_NAME`
    `static int` | `DEFAULT_MAX_COMPACTION_THRESHOLD`
    `static int` | `DEFAULT_MIN_COMPACTION_THRESHOLD`
    `static boolean` | `DEFAULT_POPULATE_IO_CACHE_ON_FLUSH`
    `static double` | `DEFAULT_READ_REPAIR_CHANCE`
    `static boolean` | `DEFAULT_REPLICATE_ON_WRITE`
    `static CFMetaData` | `HintsCf`
    `static CFMetaData` | `IndexCf`
    `java.lang.String` | `ksName`
    `static CFMetaData` | `LocalCf`
    `static CFMetaData` | `OldHintsCf` Deprecated.
    `static CFMetaData` | `OldMigrationsCf` Deprecated.
    `static CFMetaData` | `OldSchemaCf` Deprecated.
    `static CFMetaData` | `OldStatusCf` Deprecated.
    `static CFMetaData` | `PeerEventsCf`
    `static CFMetaData` | `PeersCf`
    `static CFMetaData` | `RangeXfersCf`
    `static CFMetaData` | `SchemaColumnFamiliesCf`
    `static CFMetaData` | `SchemaColumnsCf`
    `static CFMetaData` | `SchemaKeyspacesCf`
    `AbstractType<?>` | `subcolumnComparator`
    `static CFMetaData` | `TraceEventsCf`
    `static CFMetaData` | `TraceSessionsCf`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CFMetaData(java.lang.String keyspace, java.lang.String name, ColumnFamilyType type, AbstractType<?> comp, AbstractType<?> subcc)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addColumnDefinition(ColumnDefinition def)`
    `void` | `addDefaultIndexNames()` Convert a null index_name to appropriate default name according to column status
    `void` | `apply(CFMetaData cfm)` Updates CFMetaData in-place to match cf_def *Note*: This method left public only for DefsTest, don't use directly!
    `static void` | `applyImplicitDefaults(CfDef cf_def)` applies implicit defaults to cf definition.
    `CFMetaData` | `bloomFilterFpChance(java.lang.Double prop)`
    `CFMetaData` | `caching(CFMetaData.Caching prop)`
    `CFMetaData` | `clone()`
    `CFMetaData` | `columnAliases(java.util.List<java.nio.ByteBuffer> prop)`
    `CFMetaData` | `columnMetadata(java.util.Map<java.nio.ByteBuffer,ColumnDefinition> prop)`
    `CFMetaData` | `comment(java.lang.String prop)`
    `CFMetaData` | `compactionStrategyClass(java.lang.Class<? extends AbstractCompactionStrategy> prop)`
    `CFMetaData` | `compactionStrategyOptions(java.util.Map<java.lang.String,java.lang.String> prop)`
    `CompressionParameters` | `compressionParameters()`
    `CFMetaData` | `compressionParameters(CompressionParameters prop)`
    `static java.lang.Class<? extends AbstractCompactionStrategy>` | `createCompactionStrategy(java.lang.String className)`
    `AbstractCompactionStrategy` | `createCompactionStrategyInstance(ColumnFamilyStore cfs)`
    `CFMetaData` | `dcLocalReadRepairChance(double prop)`
    `CFMetaData` | `defaultValidator(AbstractType<?> prop)`
    `RowMutation` | `dropFromSchema(long timestamp)` Remove all CF attributes from schema
    `boolean` | `equals(java.lang.Object obj)`
    `static CFMetaData` | `fromSchema(UntypedResultSet.Row result)` Deserialize CF metadata from low-level representation
    `static CFMetaData` | `fromThrift(CfDef cf_def)`
    `CFMetaData` | `gcGraceSeconds(int prop)`
    `double` | `getBloomFilterFpChance()`
    `CFMetaData.Caching` | `getCaching()`
    `CFDefinition` | `getCfDef()`
    `java.util.Map<java.nio.ByteBuffer,ColumnDefinition>` | `getColumn_metadata()`
    `java.util.List<java.nio.ByteBuffer>` | `getColumnAliases()`
    `ColumnDefinition` | `getColumnDefinition(java.nio.ByteBuffer name)` Returns the ColumnDefinition for `name`.
    `AbstractType<?>` | `getColumnDefinitionComparator(ColumnDefinition def)`
    `AbstractType<?>` | `getColumnDefinitionComparator(java.lang.Integer componentIndex)`
    `ColumnDefinition` | `getColumnDefinitionForIndex(java.lang.String indexName)`
    `ColumnDefinition` | `getColumnDefinitionFromColumnName(java.nio.ByteBuffer columnName)` Returns a ColumnDefinition given a full (internal) column name.
    `IColumnSerializer` | `getColumnSerializer()`
    `java.lang.String` | `getComment()`
    `AbstractType<?>` | `getComparatorFor(java.nio.ByteBuffer superColumnName)`
    `double` | `getDcLocalReadRepair()`
    `static java.lang.String` | `getDefaultIndexName(java.lang.String cfName, AbstractType<?> comparator, java.nio.ByteBuffer columnName)`
    `AbstractType<?>` | `getDefaultValidator()`
    `int` | `getGcGraceSeconds()`
    `java.util.List<java.nio.ByteBuffer>` | `getKeyAliases()`
    `java.nio.ByteBuffer` | `getKeyName()`
    `AbstractType<?>` | `getKeyValidator()`
    `java.lang.Integer` | `getMaxCompactionThreshold()`
    `java.lang.Integer` | `getMinCompactionThreshold()`
    `OnDiskAtom.Serializer` | `getOnDiskSerializer()`
    `double` | `getReadRepairChance()`
    `boolean` | `getReplicateOnWrite()`
    `java.nio.ByteBuffer` | `getValueAlias()`
    `AbstractType<?>` | `getValueValidator(java.nio.ByteBuffer column)`
    `AbstractType<?>` | `getValueValidator(ColumnDefinition columnDefinition)`
    `int` | `hashCode()`
    `java.lang.String` | `indexColumnFamilyName(ColumnDefinition info)` generate a column family name for an index corresponding to the given column.
    `static boolean` | `isIndexNameValid(java.lang.String name)`
    `static boolean` | `isNameValid(java.lang.String name)`
    `boolean` | `isThriftIncompatible()` Returns whether this CFMetaData has information non exposed on thrift so that it cannot be correctly handled automatically by thrift clients.
    `CFMetaData` | `keyAliases(java.util.List<java.nio.ByteBuffer> prop)`
    `CFMetaData` | `keyValidator(AbstractType<?> prop)`
    `CFMetaData` | `maxCompactionThreshold(int prop)`
    `CFMetaData` | `minCompactionThreshold(int prop)`
    `static CFMetaData` | `newIndexMetadata(CFMetaData parent, ColumnDefinition info, AbstractType<?> columnComparator)`
    `ReadRepairDecision` | `newReadRepairDecision()`
    `boolean` | `populateIoCacheOnFlush()`
    `CFMetaData` | `populateIoCacheOnFlush(boolean prop)`
    `CFMetaData` | `readRepairChance(double prop)`
    `void` | `reload()`
    `CFMetaData` | `reloadSecondaryIndexMetadata(CFMetaData parent)`
    `boolean` | `removeColumnDefinition(ColumnDefinition def)`
    `static CFMetaData` | `rename(CFMetaData cfm, java.lang.String newName)`
    `CFMetaData` | `replicateOnWrite(boolean prop)`
    `RowMutation` | `toSchema(long timestamp)` Convert current metadata into schema mutation
    `void` | `toSchema(RowMutation rm, long timestamp)`
    `RowMutation` | `toSchemaUpdate(CFMetaData newState, long modificationTimestamp)` Create schema mutations to update this metadata to provided new state.
    `java.lang.String` | `toString()`
    `CfDef` | `toThrift()`
    `CFMetaData` | `validate()`
    `static void` | `validateCompactionOptions(java.lang.Class<? extends AbstractCompactionStrategy> strategyClass, java.util.Map<java.lang.String,java.lang.String> options, boolean checkUnexpected)`
    `void` | `validateCompatility(CFMetaData cfm)`
    `CFMetaData` | `valueAlias(java.nio.ByteBuffer prop)`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_READ_REPAIR_CHANCE

          public static final double DEFAULT_READ_REPAIR_CHANCE

      See Also:
        Constant Field Values

    - #### DEFAULT_DCLOCAL_READ_REPAIR_CHANCE

          public static final double DEFAULT_DCLOCAL_READ_REPAIR_CHANCE

      See Also:
        Constant Field Values

    - #### DEFAULT_REPLICATE_ON_WRITE

          public static final boolean DEFAULT_REPLICATE_ON_WRITE

      See Also:
        Constant Field Values

    - #### DEFAULT_GC_GRACE_SECONDS

          public static final int DEFAULT_GC_GRACE_SECONDS

      See Also:
        Constant Field Values

    - #### DEFAULT_MIN_COMPACTION_THRESHOLD

          public static final int DEFAULT_MIN_COMPACTION_THRESHOLD

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_COMPACTION_THRESHOLD

          public static final int DEFAULT_MAX_COMPACTION_THRESHOLD

      See Also:
        Constant Field Values

    - #### DEFAULT_COMPACTION_STRATEGY_CLASS

          public static final java.lang.Class<? extends AbstractCompactionStrategy> DEFAULT_COMPACTION_STRATEGY_CLASS

    - #### DEFAULT_KEY_NAME

          public static final java.nio.ByteBuffer DEFAULT_KEY_NAME

    - #### DEFAULT_CACHING_STRATEGY

          public static final CFMetaData.Caching DEFAULT_CACHING_STRATEGY

    - #### DEFAULT_POPULATE_IO_CACHE_ON_FLUSH

          public static final boolean DEFAULT_POPULATE_IO_CACHE_ON_FLUSH

      See Also:
        Constant Field Values

    - #### DEFAULT_COMPRESSOR

          public static final java.lang.String DEFAULT_COMPRESSOR

    - #### OldStatusCf

          @Deprecated
          public static final CFMetaData OldStatusCf

      Deprecated.

    - #### OldHintsCf

          @Deprecated
          public static final CFMetaData OldHintsCf

      Deprecated.

    - #### OldMigrationsCf

          @Deprecated
          public static final CFMetaData OldMigrationsCf

      Deprecated.

    - #### OldSchemaCf

          @Deprecated
          public static final CFMetaData OldSchemaCf

      Deprecated.

    - #### IndexCf

          public static final CFMetaData IndexCf

    - #### CounterIdCf

          public static final CFMetaData CounterIdCf

    - #### SchemaKeyspacesCf

          public static final CFMetaData SchemaKeyspacesCf

    - #### SchemaColumnFamiliesCf

          public static final CFMetaData SchemaColumnFamiliesCf

    - #### SchemaColumnsCf

          public static final CFMetaData SchemaColumnsCf

    - #### HintsCf

          public static final CFMetaData HintsCf

    - #### PeersCf

          public static final CFMetaData PeersCf

    - #### PeerEventsCf

          public static final CFMetaData PeerEventsCf

    - #### LocalCf

          public static final CFMetaData LocalCf

    - #### TraceSessionsCf

          public static final CFMetaData TraceSessionsCf

    - #### TraceEventsCf

          public static final CFMetaData TraceEventsCf

    - #### BatchlogCf

          public static final CFMetaData BatchlogCf

    - #### RangeXfersCf

          public static final CFMetaData RangeXfersCf

    - #### cfId

          public final java.util.UUID cfId

    - #### ksName

          public final java.lang.String ksName

    - #### cfName

          public final java.lang.String cfName

    - #### cfType

          public final ColumnFamilyType cfType

    - #### comparator

          public volatile AbstractType<?> comparator

    - #### subcolumnComparator

          public volatile AbstractType<?> subcolumnComparator

    - #### compactionStrategyClass

          public volatile java.lang.Class<? extends AbstractCompactionStrategy> compactionStrategyClass

    - #### compactionStrategyOptions

          public volatile java.util.Map<java.lang.String,java.lang.String> compactionStrategyOptions

    - #### compressionParameters

          public volatile CompressionParameters compressionParameters

  - ### Constructor Detail

    - #### CFMetaData

          public CFMetaData(java.lang.String keyspace,
                    java.lang.String name,
                    ColumnFamilyType type,
                    AbstractType<?> comp,
                    AbstractType<?> subcc)

  - ### Method Detail

    - #### comment

          public CFMetaData comment(java.lang.String prop)

    - #### readRepairChance

          public CFMetaData readRepairChance(double prop)

    - #### dcLocalReadRepairChance

          public CFMetaData dcLocalReadRepairChance(double prop)

    - #### replicateOnWrite

          public CFMetaData replicateOnWrite(boolean prop)

    - #### gcGraceSeconds

          public CFMetaData gcGraceSeconds(int prop)

    - #### defaultValidator

          public CFMetaData defaultValidator(AbstractType<?> prop)

    - #### keyValidator

          public CFMetaData keyValidator(AbstractType<?> prop)

    - #### minCompactionThreshold

          public CFMetaData minCompactionThreshold(int prop)

    - #### maxCompactionThreshold

          public CFMetaData maxCompactionThreshold(int prop)

    - #### keyAliases

          public CFMetaData keyAliases(java.util.List<java.nio.ByteBuffer> prop)

    - #### columnAliases

          public CFMetaData columnAliases(java.util.List<java.nio.ByteBuffer> prop)

    - #### valueAlias

          public CFMetaData valueAlias(java.nio.ByteBuffer prop)

    - #### columnMetadata

          public CFMetaData columnMetadata(java.util.Map<java.nio.ByteBuffer,ColumnDefinition> prop)

    - #### compactionStrategyClass

          public CFMetaData compactionStrategyClass(java.lang.Class<? extends AbstractCompactionStrategy> prop)

    - #### compactionStrategyOptions

          public CFMetaData compactionStrategyOptions(java.util.Map<java.lang.String,java.lang.String> prop)

    - #### compressionParameters

          public CFMetaData compressionParameters(CompressionParameters prop)

    - #### bloomFilterFpChance

          public CFMetaData bloomFilterFpChance(java.lang.Double prop)

    - #### caching

          public CFMetaData caching(CFMetaData.Caching prop)

    - #### populateIoCacheOnFlush

          public CFMetaData populateIoCacheOnFlush(boolean prop)

    - #### newIndexMetadata

          public static CFMetaData newIndexMetadata(CFMetaData parent,
                                    ColumnDefinition info,
                                    AbstractType<?> columnComparator)

    - #### reloadSecondaryIndexMetadata

          public CFMetaData reloadSecondaryIndexMetadata(CFMetaData parent)

    - #### clone

          public CFMetaData clone()

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

    - #### rename

          public static CFMetaData rename(CFMetaData cfm,
                          java.lang.String newName)

    - #### indexColumnFamilyName

          public java.lang.String indexColumnFamilyName(ColumnDefinition info)

      generate a column family name for an index corresponding to the given column. This is NOT the same as the index's name! This is only used in sstable filenames and is not exposed to users.
      Parameters:
        `info` - A definition of the column with index
      Returns:
        name of the index ColumnFamily

    - #### getComment

          public java.lang.String getComment()

    - #### getReadRepairChance

          public double getReadRepairChance()

    - #### getDcLocalReadRepair

          public double getDcLocalReadRepair()

    - #### newReadRepairDecision

          public ReadRepairDecision newReadRepairDecision()

    - #### getReplicateOnWrite

          public boolean getReplicateOnWrite()

    - #### populateIoCacheOnFlush

          public boolean populateIoCacheOnFlush()

    - #### getGcGraceSeconds

          public int getGcGraceSeconds()

    - #### getDefaultValidator

          public AbstractType<?> getDefaultValidator()

    - #### getKeyValidator

          public AbstractType<?> getKeyValidator()

    - #### getMinCompactionThreshold

          public java.lang.Integer getMinCompactionThreshold()

    - #### getMaxCompactionThreshold

          public java.lang.Integer getMaxCompactionThreshold()

    - #### getKeyName

          public java.nio.ByteBuffer getKeyName()

    - #### getKeyAliases

          public java.util.List<java.nio.ByteBuffer> getKeyAliases()

    - #### getColumnAliases

          public java.util.List<java.nio.ByteBuffer> getColumnAliases()

    - #### getValueAlias

          public java.nio.ByteBuffer getValueAlias()

    - #### compressionParameters

          public CompressionParameters compressionParameters()

    - #### getColumn_metadata

          public java.util.Map<java.nio.ByteBuffer,ColumnDefinition> getColumn_metadata()

    - #### getComparatorFor

          public AbstractType<?> getComparatorFor(java.nio.ByteBuffer superColumnName)

    - #### getBloomFilterFpChance

          public double getBloomFilterFpChance()

    - #### getCaching

          public CFMetaData.Caching getCaching()

    - #### equals

          public boolean equals(java.lang.Object obj)

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

    - #### hashCode

          public int hashCode()

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

    - #### getValueValidator

          public AbstractType<?> getValueValidator(java.nio.ByteBuffer column)

    - #### getValueValidator

          public AbstractType<?> getValueValidator(ColumnDefinition columnDefinition)

    - #### applyImplicitDefaults

          public static void applyImplicitDefaults(CfDef cf_def)

      applies implicit defaults to cf definition. useful in updates

    - #### fromThrift

          public static CFMetaData fromThrift(CfDef cf_def)
                                       throws InvalidRequestException,
                                              ConfigurationException

      Throws:
        `InvalidRequestException`
        `ConfigurationException`

    - #### reload

          public void reload()

    - #### apply

          public void apply(CFMetaData cfm)
                     throws ConfigurationException

      Updates CFMetaData in-place to match cf_def *Note*: This method left public only for DefsTest, don't use directly!
      Throws:
        `ConfigurationException` - if ks/cf names or cf ids didn't match

    - #### validateCompatility

          public void validateCompatility(CFMetaData cfm)
                                   throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### validateCompactionOptions

          public static void validateCompactionOptions(java.lang.Class<? extends AbstractCompactionStrategy> strategyClass,
                                       java.util.Map<java.lang.String,java.lang.String> options,
                                       boolean checkUnexpected)
                                                throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### createCompactionStrategy

          public static java.lang.Class<? extends AbstractCompactionStrategy> createCompactionStrategy(java.lang.String className)
                                                                                                throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### createCompactionStrategyInstance

          public AbstractCompactionStrategy createCompactionStrategyInstance(ColumnFamilyStore cfs)

    - #### toThrift

          public CfDef toThrift()

    - #### getColumnDefinition

          public ColumnDefinition getColumnDefinition(java.nio.ByteBuffer name)

      Returns the ColumnDefinition for `name`. Note that `name` correspond to the returned ColumnDefinition name, and in particular for composite cfs, it should usually be only a component of the full column name. If you have a full column name, use getColumnDefinitionFromColumnName instead.

    - #### getColumnDefinitionFromColumnName

          public ColumnDefinition getColumnDefinitionFromColumnName(java.nio.ByteBuffer columnName)

      Returns a ColumnDefinition given a full (internal) column name.

    - #### getColumnDefinitionForIndex

          public ColumnDefinition getColumnDefinitionForIndex(java.lang.String indexName)

    - #### addDefaultIndexNames

          public void addDefaultIndexNames()
                                    throws ConfigurationException

      Convert a null index_name to appropriate default name according to column status
      Throws:
        `ConfigurationException`

    - #### getDefaultIndexName

          public static java.lang.String getDefaultIndexName(java.lang.String cfName,
                                             AbstractType<?> comparator,
                                             java.nio.ByteBuffer columnName)

    - #### getColumnSerializer

          public IColumnSerializer getColumnSerializer()

    - #### getOnDiskSerializer

          public OnDiskAtom.Serializer getOnDiskSerializer()

    - #### isNameValid

          public static boolean isNameValid(java.lang.String name)

    - #### isIndexNameValid

          public static boolean isIndexNameValid(java.lang.String name)

    - #### validate

          public CFMetaData validate()
                              throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### toSchemaUpdate

          public RowMutation toSchemaUpdate(CFMetaData newState,
                                   long modificationTimestamp)

      Create schema mutations to update this metadata to provided new state.
      Parameters:
        `newState` - The new metadata (for the same CF)
        `modificationTimestamp` - Timestamp to use for mutation
      Returns:
        Difference between attributes in form of schema mutation

    - #### dropFromSchema

          public RowMutation dropFromSchema(long timestamp)

      Remove all CF attributes from schema
      Parameters:
        `timestamp` - Timestamp to use
      Returns:
        RowMutation to use to completely remove cf from schema

    - #### toSchema

          public void toSchema(RowMutation rm,
                      long timestamp)

    - #### fromSchema

          public static CFMetaData fromSchema(UntypedResultSet.Row result)

      Deserialize CF metadata from low-level representation
      Returns:
        Thrift-based metadata deserialized from schema

    - #### toSchema

          public RowMutation toSchema(long timestamp)
                               throws ConfigurationException

      Convert current metadata into schema mutation
      Parameters:
        `timestamp` - Timestamp to use
      Returns:
        Low-level representation of the CF
      Throws:
        `ConfigurationException` - if any of the attributes didn't pass validation

    - #### getColumnDefinitionComparator

          public AbstractType<?> getColumnDefinitionComparator(ColumnDefinition def)

    - #### getColumnDefinitionComparator

          public AbstractType<?> getColumnDefinitionComparator(java.lang.Integer componentIndex)

    - #### addColumnDefinition

          public void addColumnDefinition(ColumnDefinition def)

    - #### removeColumnDefinition

          public boolean removeColumnDefinition(ColumnDefinition def)

    - #### getCfDef

          public CFDefinition getCfDef()

    - #### isThriftIncompatible

          public boolean isThriftIncompatible()

      Returns whether this CFMetaData has information non exposed on thrift so that it cannot be correctly handled automatically by thrift clients.

    - #### toString

          public java.lang.String toString()

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

Copyright © 2014 The Apache Software Foundation