|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.sparse.Schema
public class Schema
A schema for a sparse row store. Note that more than one schema may be used with the same index. The name of the schema is always encoded as the first component of the key.
| Constructor Summary | |
|---|---|
Schema()
De-serialization ctor. |
|
Schema(String name,
String primaryKey,
KeyType primaryKeyType)
|
|
| Method Summary | |
|---|---|
protected IKeyBuilder |
appendPrimaryKey(IKeyBuilder keyBuilder,
Object v,
boolean successor)
Helper method appends a typed value to the compound key (this is used to get the primary key into the compound key). |
protected IKeyBuilder |
fromKey(IKeyBuilder keyBuilder,
Object primaryKey)
Forms the key in #keyBuilder that should be used as the first key
(inclusive) for a range query that will visit all index entries for the
specified primary key. |
byte[] |
getKey(IKeyBuilder keyBuilder,
Object primaryKey,
String col,
long timestamp)
Encodes a key for the Schema. |
String |
getName()
The name of the schema. |
byte[] |
getPrefix(IKeyBuilder keyBuilder,
Object primaryKey)
The prefix that identifies all tuples in the logical row for this schema having the indicated value for their primary key. |
String |
getPrimaryKeyName()
The name of the column whose value is the primary key. |
KeyType |
getPrimaryKeyType()
The data type that is used for the primary key when forming the total key. |
protected byte[] |
getSchemaBytes()
The Unicode sort key encoding of the schema name. |
void |
readExternal(ObjectInput in)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Schema()
public Schema(String name,
String primaryKey,
KeyType primaryKeyType)
name - The schema name.primaryKey - The name of the column whose value is the (application
defined) primary key.primaryKeyType - The data type for the primary key.| Method Detail |
|---|
public String getName()
public String getPrimaryKeyName()
public KeyType getPrimaryKeyType()
protected final byte[] getSchemaBytes()
protected final IKeyBuilder appendPrimaryKey(IKeyBuilder keyBuilder,
Object v,
boolean successor)
Note: This automatically appends the nul terminator byte
if KeyType.isFixedLength() is false. That byte
flags the end of the primary key for variable length primary keys.
keyType - The target data type.v - The value.
#keyBuilder.KeyDecoder
protected final IKeyBuilder fromKey(IKeyBuilder keyBuilder,
Object primaryKey)
#keyBuilder that should be used as the first key
(inclusive) for a range query that will visit all index entries for the
specified primary key.
primaryKey - The primary key.
#keyBuilder, which will have the schema and the
primary key already formatted in its buffer.KeyDecoder
public final byte[] getPrefix(IKeyBuilder keyBuilder,
Object primaryKey)
primaryKey - The value of the primary key for the logical row.
public byte[] getKey(IKeyBuilder keyBuilder,
Object primaryKey,
String col,
long timestamp)
Schema.
keyBuilder - primaryKey - The primary key for the logical row (required).col - The column name (required).timestamp - The timestamp (required).
IllegalArgumentException - if keyBuilder is null.
IllegalArgumentException - if primaryKey is null.
IllegalArgumentException - if col is not valid as the name of a column.
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||