public class Schema extends Object implements Externalizable
Constructor and Description |
---|
Schema()
De-serialization ctor.
|
Schema(String name,
String primaryKey,
KeyType primaryKeyType) |
Modifier and Type | Method and Description |
---|---|
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) |
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 Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.