public abstract class AbstractSSTableSimpleWriter
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected ColumnFamily |
columnFamily |
protected CounterId |
counterid |
protected DecoratedKey |
currentKey |
protected java.nio.ByteBuffer |
currentSuperColumn |
protected java.io.File |
directory |
protected CFMetaData |
metadata |
Constructor and Description |
---|
AbstractSSTableSimpleWriter(java.io.File directory,
CFMetaData metadata,
IPartitioner partitioner) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(java.nio.ByteBuffer name,
java.nio.ByteBuffer value,
long timestamp)
Insert a new "regular" column to the current row (and super column if applicable).
|
protected void |
addColumn(Cell cell) |
void |
addCounterColumn(java.nio.ByteBuffer name,
long value)
Insert a new counter column to the current row (and super column if applicable).
|
void |
addExpiringColumn(java.nio.ByteBuffer name,
java.nio.ByteBuffer value,
long timestamp,
int ttl,
long expirationTimestampMS)
Insert a new expiring column to the current row (and super column if applicable).
|
protected abstract ColumnFamily |
getColumnFamily() |
protected SSTableWriter |
getWriter() |
protected static java.lang.String |
makeFilename(java.io.File directory,
java.lang.String keyspace,
java.lang.String columnFamily) |
void |
newRow(java.nio.ByteBuffer key)
Start a new row whose key is
key . |
void |
newSuperColumn(java.nio.ByteBuffer name)
Start a new super column with name
name . |
protected abstract void |
writeRow(DecoratedKey key,
ColumnFamily columnFamily) |
protected final java.io.File directory
protected final CFMetaData metadata
protected DecoratedKey currentKey
protected ColumnFamily columnFamily
protected java.nio.ByteBuffer currentSuperColumn
protected final CounterId counterid
public AbstractSSTableSimpleWriter(java.io.File directory, CFMetaData metadata, IPartitioner partitioner)
protected SSTableWriter getWriter()
protected static java.lang.String makeFilename(java.io.File directory, java.lang.String keyspace, java.lang.String columnFamily)
public void newRow(java.nio.ByteBuffer key) throws java.io.IOException
key
.key
- the row keyjava.io.IOException
public void newSuperColumn(java.nio.ByteBuffer name)
name
.name
- the name for the super columnprotected void addColumn(Cell cell) throws java.io.IOException
java.io.IOException
public void addColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp) throws java.io.IOException
name
- the column namevalue
- the column valuetimestamp
- the column timestampjava.io.IOException
public void addExpiringColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp, int ttl, long expirationTimestampMS) throws java.io.IOException
name
- the column namevalue
- the column valuetimestamp
- the column timestampttl
- the column time to live in secondsexpirationTimestampMS
- the local expiration timestamp in milliseconds. This is the server time timestamp used for actually
expiring the column, and as a consequence should be synchronized with the cassandra servers time. If timestamp
represents
the insertion time in microseconds (which is not required), this should be (timestamp / 1000) + (ttl * 1000)
.java.io.IOException
public void addCounterColumn(java.nio.ByteBuffer name, long value) throws java.io.IOException
name
- the column namevalue
- the value of the counterjava.io.IOException
protected abstract void writeRow(DecoratedKey key, ColumnFamily columnFamily) throws java.io.IOException
java.io.IOException
protected abstract ColumnFamily getColumnFamily() throws java.io.IOException
java.io.IOException
Copyright © 2014 The Apache Software Foundation