public abstract class StreamConsumerStateStore extends Object implements ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>
ConsumerState for stream consumers.| Modifier and Type | Field and Description |
|---|---|
protected StreamConfig |
streamConfig |
protected Id.Stream |
streamId |
| Modifier | Constructor and Description |
|---|---|
protected |
StreamConsumerStateStore(StreamConfig streamConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
delete(byte[] row,
Set<byte[]> columns)
Deletes the set of columns from the given row.
|
protected abstract byte[] |
fetch(byte[] row,
byte[] column)
Fetches the cell value for the given row and column.
|
protected abstract void |
fetchAll(byte[] row,
byte[] columnPrefix,
Map<byte[],byte[]> result)
Fetches all values for the given row.
|
protected abstract void |
fetchAll(byte[] row,
Map<byte[],byte[]> result)
Fetches all values for the given row.
|
StreamConsumerState |
get(long groupId,
int instanceId) |
void |
getAll(Collection<? super StreamConsumerState> result) |
void |
getByGroup(long groupId,
Collection<? super StreamConsumerState> result) |
void |
remove(Iterable<? extends StreamConsumerState> states) |
void |
save(Iterable<? extends StreamConsumerState> states) |
void |
save(StreamConsumerState state) |
protected abstract void |
store(byte[] row,
byte[] column,
byte[] value)
Stores the given value to cell identified by the given row and column.
|
protected abstract void |
store(byte[] row,
Map<byte[],byte[]> values)
Stores all the values to the given row.
|
protected final StreamConfig streamConfig
protected final Id.Stream streamId
protected StreamConsumerStateStore(StreamConfig streamConfig)
public final void getAll(Collection<? super StreamConsumerState> result) throws IOException
getAll in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>IOExceptionpublic final void getByGroup(long groupId,
Collection<? super StreamConsumerState> result)
throws IOException
getByGroup in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>IOExceptionpublic final StreamConsumerState get(long groupId, int instanceId) throws IOException
get in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>null will be returned.IOExceptionpublic final void save(StreamConsumerState state) throws IOException
save in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>IOExceptionpublic final void save(Iterable<? extends StreamConsumerState> states) throws IOException
save in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>IOExceptionpublic final void remove(Iterable<? extends StreamConsumerState> states) throws IOException
remove in interface ConsumerStateStore<StreamConsumerState,Iterable<StreamFileOffset>>IOExceptionprotected abstract byte[] fetch(byte[] row,
byte[] column)
throws IOException
null should be returned.IOExceptionprotected abstract void fetchAll(byte[] row,
Map<byte[],byte[]> result)
throws IOException
row - the row to fetch from.result - a map from column to value.IOExceptionprotected abstract void fetchAll(byte[] row,
byte[] columnPrefix,
Map<byte[],byte[]> result)
throws IOException
row - the row to fetch from.columnPrefix - the column prefix.result - a map from column to value. It's valid to contains columns that don't start with columnPrefix.IOExceptionprotected abstract void store(byte[] row,
byte[] column,
byte[] value)
throws IOException
IOExceptionprotected abstract void store(byte[] row,
Map<byte[],byte[]> values)
throws IOException
row - the row to store to.values - Map from column name to value.IOExceptionprotected abstract void delete(byte[] row,
Set<byte[]> columns)
throws IOException
row - the row to act on.columns - columns to get deleted.IOExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.