Skip to content

What can you set into a dataSet

NYPD edited this page Feb 6, 2018 · 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
  • comment (optional) : A Comment Since the version 1.1.0.1
  • compactionStrategy (optional) : The compaction strategy for the column family. Exemple : "LeveledCompactionStrategy" Since the version 1.1.0.1
  • comptactionStrategyOptions (optional) : The comptaction strategy option for the colum family. It's a list of name/value element. Example : name : sstable_size_in_mb / value : 10. Since the version 1.1.0.1
  • gcGraceSeconds (optional) : The gc grace in seconds for the column family Since the version 1.1.0.1
  • maxCompactionThreshold (optional) : The maximum compaction threshold for the column family Since the version 1.1.0.1
  • minCompactionThreshold (optional) : The minimum compaction threshold for the column family Since the version 1.1.0.1
  • readRepairChance (optional) : The percentage of read repair chance for the column family. example : 0,1 Since the version 1.1.0.1
  • replicationOnWrite (optional) : boolean to set the replication on write. exemple : false Since the version 1.1.0.1

(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"
  • indexName (optional) : define the name of the index Since the version 1.1.0.1

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 the "defaultColumnValueType" element is set at the column Family level, the value has to be a valid regarding to the type. If not set, the value has to be a valid hexByte because the default type is "BytesType".

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