Skip to content

What can you set into a dataSet

jsevellec edited this page Feb 7, 2012 · 11 revisions

you can see skeleton of dataset here :

A lot of elements are optionals and work with default value. Here is a description of theses elements : ##1. keyspace level :

  • name : the name of the keyspace to create
  • strategy (optional) : the strategy of the keyspace to choose between
    • "org.apache.cassandra.locator.LocalStrategy" (as default)
    • "org.apache.cassandra.locator.NetworkTopologyStrategy"
    • "org.apache.cassandra.locator.SimpleStrategy"
  • replicationFactor (optional) : the replication factor of the data in the keyspace. "1" as default.
  • columnFamily : a list of column family.

##2. columnFamily level :

  • name : the name of the Column Family
  • type (optional) : the type of the Column Family to choose between :
    • "STANDARD" (as default)
    • "SUPER"
  • keyType (optional) : The Data Type of the key to choose between :
    • "BytesType" (as default)
    • "IntegerType"
    • "LexicalUUIDType"
    • "LongType"
    • "TimeUUIDType"
    • "UTF8Type"
    • "UUIDType"
  • comparatorType (optional) : The Data Type of the Column name to choose between :
    • "BytesType" (as default)
    • "IntegerType"
    • "LexicalUUIDType"
    • "LongType"
    • "TimeUUIDType"
    • "UTF8Type"
    • "UUIDType"
  • subComparatorType (optional) : Not taken into account if your Column Family type is "STANDARD". The Data Type of the Sub Column name to choose between :
    • "BytesType" (as default)
    • "IntegerType"
    • "LexicalUUIDType"
    • "LongType"
    • "TimeUUIDType"
    • "UTF8Type"
    • "UUIDType"
  • defaultColumnValueType (optional) : The Data Type of all Column value to choose between :
    • "BytesType" (as default)
    • "IntegerType"
    • "LexicalUUIDType"
    • "LongType"
    • "TimeUUIDType"
    • "UTF8Type"
    • "UUIDType"
    • "CounterColumnType" (to define the column family as a counter column family) Since the version 0.8.0.4

(If you want to set different yype into column value, ou can use "Function for value" which is explained below.)

  • columnMetadata (optional) : a list of column metadata Since the version 1.0.1.2
  • row (optional) : a list of row

##3. colummMetadata level

  • name : the name of the column
  • validationClass : the validationClass of the column value to choose between :
    • "BytesType" (as default)
    • "IntegerType"
    • "LexicalUUIDType"
    • "LongType"
    • "TimeUUIDType"
    • "UTF8Type"
    • "UUIDType"
  • indexType (optional) : define if the column is indexed. Possible value are :
    • "KEYS"

##4. row level

  • key : the key value of the row
  • column (optional) : a list of column
  • superColumn (optional) : a list of superColumn. Not taken into account if your Column Family type is "STANDARD".

##5. superColumn level

  • name : the name of the super column
  • column (optional) : a list of column

##6. column level

  • name : the name of the column
  • value (optional): the value of the column,

If you want to set colum value with different types, with different types, into the same columnFamily, you have to read : How to set column values with different types

Function for value

It is possible to store different column value with different type into the same colum family.

  • don't set defaultValueType in the columnFamily

  • associate for each column value element a function to set the type of the data like that :

    long(1)

It allows to store different data value with different type into the same colum family. If you don't specify a function into a column value, the default type BytesType will be used to store the value.

Here is the list of available functions :

  • "bytes()"
  • "integer()"
  • "lexicaluuid()"
  • "long()"
  • "utf8()"
  • "timeuuid()"
  • uuid()"