|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kitesdk.data.ColumnMapping.Builder
public static class ColumnMapping.Builder
A fluent builder to aid in constructing a ColumnMapping
.
Constructor Summary | |
---|---|
ColumnMapping.Builder()
|
Method Summary | |
---|---|
ColumnMapping |
build()
Builds and returns a ColumnMapping from the fields
mappings added to this builder. |
ColumnMapping.Builder |
column(String name,
String family,
String qualifier)
Adds a mapping to store the record field name in a column using
the family and qualifier . |
ColumnMapping.Builder |
counter(String name,
String family,
String qualifier)
Adds a counter mapping to store record field name in a column
using the family and qualifier . |
ColumnMapping.Builder |
fieldMapping(FieldMapping fieldMapping)
Adds a FieldMapping . |
ColumnMapping.Builder |
fieldMappings(Collection<FieldMapping> fieldMappings)
Adds each FieldMapping from a collection. |
ColumnMapping.Builder |
key(String name)
Adds a mapping to store the record field name in the record key. |
ColumnMapping.Builder |
keyAsColumn(String name,
String family)
Adds a key-as-column mapping to store the record field name in
the given family , using its keys or fields as column qualifiers. |
ColumnMapping.Builder |
keyAsColumn(String name,
String family,
String qualifierPrefix)
Adds a key-as-column mapping to store the record field name in
the given family , using column qualifiers built from its keys or
field names appended to the qualifierPrefix . |
ColumnMapping.Builder |
occ(String name)
Adds an OCC version mapping for the record field name . |
ColumnMapping.Builder |
version(String name)
Adds an OCC version mapping for the record field name . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnMapping.Builder()
Method Detail |
---|
public ColumnMapping.Builder key(String name)
name
in the record key.
The underlying dataset's PartitionStrategy
must have an identity
partitioner for the record field name
so that the value can be
recovered.
name
- The name of a record field
public ColumnMapping.Builder column(String name, String family, String qualifier)
name
in a column using
the family
and qualifier
.
name
- The name of a record fieldfamily
- The column family for storing the record field valuequalifier
- The column qualifier for storing the record field value
public ColumnMapping.Builder keyAsColumn(String name, String family)
name
in
the given family
, using its keys or fields as column qualifiers.
The record field must be a map or a record.
name
- The name of a record fieldfamily
- The column family for storing the map or record values
public ColumnMapping.Builder keyAsColumn(String name, String family, String qualifierPrefix)
name
in
the given family
, using column qualifiers built from its keys or
field names appended to the qualifierPrefix
.
The record field must be a map or a record.
name
- The name of a record fieldfamily
- The column family for storing the map or record valuesqualifierPrefix
- A prefix to add when building column qualifiers
public ColumnMapping.Builder counter(String name, String family, String qualifier)
name
in a column
using the family
and qualifier
. The record field can be
updated atomically using
RandomAccessDataset.increment(Key, String, long)
The record field must be an int or a long.
Counters cannot be used in combination with optimistic concurrency (OCC).
name
- The name of a record fieldfamily
- The column family for storing the record counter valuequalifier
- The column qualifier for storing the record field value
public ColumnMapping.Builder occ(String name)
name
. The
record field will contain the current version number of the record.
Using this mapping enables optimistic concurrency (OCC), where the
underlying RandomAccessDataset
will only persist changes to a
record if it has not changed by another process.
The record field must be an int or a long.
Optimistic concurrency (OCC) cannot be used in combination with counters.
name
- The name of a record field to use for an OCC version
public ColumnMapping.Builder version(String name)
name
. The
record field will contain the current version number of the record.
Using this mapping enables optimistic concurrency (OCC), where the
underlying RandomAccessDataset
will only persist changes to a
record if it has not changed by another process.
The record field must be an int or a long.
Optimistic concurrency (OCC) cannot be used in combination with counters.
name
- The name of a record field to use for an OCC version
public ColumnMapping.Builder fieldMapping(FieldMapping fieldMapping)
FieldMapping
.
fieldMapping
- A FieldMapping
public ColumnMapping.Builder fieldMappings(Collection<FieldMapping> fieldMappings)
FieldMapping
from a collection.
fieldMappings
- A collection of FieldMapping
objects
public ColumnMapping build()
ColumnMapping
from the fields
mappings added to this builder.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |