org.apache.cassandra.config
Class ColumnDefinition
java.lang.Object
org.apache.cassandra.config.ColumnDefinition
public class ColumnDefinition
- extends java.lang.Object
Field Summary |
java.nio.ByteBuffer |
name
|
Constructor Summary |
ColumnDefinition(java.nio.ByteBuffer name,
AbstractType<?> validator,
IndexType index_type,
java.util.Map<java.lang.String,java.lang.String> index_options,
java.lang.String index_name)
|
Method Summary |
static void |
addToSchema(RowMutation mutation,
java.lang.String cfName,
AbstractType comparator,
ColumnDef columnDef,
long timestamp)
Add new/update column to/in the schema. |
static void |
deleteFromSchema(RowMutation mutation,
java.lang.String cfName,
AbstractType comparator,
java.nio.ByteBuffer columnName,
long timestamp)
Drop specified column from the schema using given row mutation. |
boolean |
equals(java.lang.Object o)
|
static ColumnDefinition |
fromAvro(org.apache.cassandra.db.migration.avro.ColumnDef cd)
Deprecated. |
static java.util.List<ColumnDef> |
fromSchema(ColumnFamily columns)
Deserialize columns from low-level representation |
static ColumnDefinition |
fromThrift(ColumnDef thriftColumnDef)
|
static java.util.Map<java.nio.ByteBuffer,ColumnDefinition> |
fromThrift(java.util.List<ColumnDef> thriftDefs)
|
java.lang.String |
getIndexName()
|
java.util.Map<java.lang.String,java.lang.String> |
getIndexOptions()
|
IndexType |
getIndexType()
|
static java.util.Map<java.lang.String,java.lang.String> |
getStringMap(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> charMap)
|
AbstractType<?> |
getValidator()
|
int |
hashCode()
|
static ColumnFamily |
readSchema(java.lang.String ksName,
java.lang.String cfName)
|
void |
setIndexName(java.lang.String s)
|
void |
setIndexType(IndexType index_type,
java.util.Map<java.lang.String,java.lang.String> index_options)
|
void |
setValidator(AbstractType<?> validator)
|
static java.util.Map<java.nio.ByteBuffer,ColumnDef> |
toMap(java.util.List<ColumnDef> columnDefs)
|
java.lang.String |
toString()
|
ColumnDef |
toThrift()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
name
public final java.nio.ByteBuffer name
ColumnDefinition
public ColumnDefinition(java.nio.ByteBuffer name,
AbstractType<?> validator,
IndexType index_type,
java.util.Map<java.lang.String,java.lang.String> index_options,
java.lang.String index_name)
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
fromAvro
@Deprecated
public static ColumnDefinition fromAvro(org.apache.cassandra.db.migration.avro.ColumnDef cd)
- Deprecated.
toThrift
public ColumnDef toThrift()
fromThrift
public static ColumnDefinition fromThrift(ColumnDef thriftColumnDef)
throws ConfigurationException
- Throws:
ConfigurationException
fromThrift
public static java.util.Map<java.nio.ByteBuffer,ColumnDefinition> fromThrift(java.util.List<ColumnDef> thriftDefs)
throws ConfigurationException
- Throws:
ConfigurationException
toMap
public static java.util.Map<java.nio.ByteBuffer,ColumnDef> toMap(java.util.List<ColumnDef> columnDefs)
deleteFromSchema
public static void deleteFromSchema(RowMutation mutation,
java.lang.String cfName,
AbstractType comparator,
java.nio.ByteBuffer columnName,
long timestamp)
- Drop specified column from the schema using given row mutation.
- Parameters:
mutation
- The schema row mutationcfName
- The name of the parent ColumnFamilycomparator
- The comparator to serialize column name in human-readable formatcolumnName
- The column name as Stringtimestamp
- The timestamp to use for column modification
addToSchema
public static void addToSchema(RowMutation mutation,
java.lang.String cfName,
AbstractType comparator,
ColumnDef columnDef,
long timestamp)
- Add new/update column to/in the schema.
- Parameters:
mutation
- The schema row mutationcfName
- The name of the parent ColumnFamilycomparator
- The comparator to serialize column name in human-readable formatcolumnDef
- The Thrift-based column definition that contains all attributestimestamp
- The timestamp to use for column modification
readSchema
public static ColumnFamily readSchema(java.lang.String ksName,
java.lang.String cfName)
fromSchema
public static java.util.List<ColumnDef> fromSchema(ColumnFamily columns)
- Deserialize columns from low-level representation
- Returns:
- Thrift-based deserialized representation of the column
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getIndexName
public java.lang.String getIndexName()
setIndexName
public void setIndexName(java.lang.String s)
setIndexType
public void setIndexType(IndexType index_type,
java.util.Map<java.lang.String,java.lang.String> index_options)
getIndexType
public IndexType getIndexType()
getIndexOptions
public java.util.Map<java.lang.String,java.lang.String> getIndexOptions()
getValidator
public AbstractType<?> getValidator()
setValidator
public void setValidator(AbstractType<?> validator)
getStringMap
public static java.util.Map<java.lang.String,java.lang.String> getStringMap(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> charMap)
Copyright © 2012 The Apache Software Foundation