|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.crankuptheamps.client.BlockPublishStore
public class BlockPublishStore
Nested Class Summary | |
---|---|
static interface |
BlockPublishStore.Buffer
|
static class |
BlockPublishStore.ByteSequence
|
Nested classes/interfaces inherited from interface com.crankuptheamps.client.Store |
---|
Store.StoreReplayer |
Field Summary | |
---|---|
protected BlockPublishStore.Buffer |
_buffer
|
protected static int |
HAS_EXTENDED_METADATA
|
Fields inherited from interface com.crankuptheamps.client.Store |
---|
SOWDeleteByData, SOWDeleteByFilter, SOWDeleteByKeys |
Constructor Summary | |
---|---|
protected |
BlockPublishStore(BlockPublishStore.Buffer buffer)
|
protected |
BlockPublishStore(BlockPublishStore.Buffer buffer,
int blocksPerRealloc)
|
protected |
BlockPublishStore(BlockPublishStore.Buffer buffer,
int blocksPerRealloc,
boolean isAFile)
|
Method Summary | |
---|---|
protected void |
_store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
byte[] correlationId,
long correlationIdOffset,
long correlationIdLength,
int expiration,
boolean expirationIsValid,
CommandId commandId)
|
void |
discardUpTo(long index)
Discard all operations up to the index provided. |
void |
flush()
Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return. |
void |
flush(long timeout)
Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return. |
long |
getLowestUnpersisted()
Return the oldest index in the store. |
protected void |
growFreeListIfEmpty()
|
protected void |
recover()
|
void |
replay(Store.StoreReplayer replayer)
Replay all operations in the store using the provided StoreReplayer. |
void |
replaySingle(Store.StoreReplayer replayer,
long index)
Replay the operation at the specified index. |
void |
setResizeHandler(PublishStoreResizeHandler handler)
Set the resize handler for the publish store. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
byte[] correlationId,
long correlationIdOffset,
long correlationIdLength)
Store the provided operation. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
byte[] correlationId,
long correlationIdOffset,
long correlationIdLength,
int expiration)
Store the provided operation. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
int flag,
CommandId cmdId)
Store the provided operation. |
long |
unpersistedCount()
Return the number of operations in the store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BlockPublishStore.Buffer _buffer
protected static final int HAS_EXTENDED_METADATA
Constructor Detail |
---|
protected BlockPublishStore(BlockPublishStore.Buffer buffer, int blocksPerRealloc, boolean isAFile)
protected BlockPublishStore(BlockPublishStore.Buffer buffer, int blocksPerRealloc)
protected BlockPublishStore(BlockPublishStore.Buffer buffer)
Method Detail |
---|
public void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, byte[] correlationId, long correlationIdOffset, long correlationIdLength) throws StoreException
Store
store
in interface Store
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the datacorrelationId
- the correlation ID for this messagecorrelationIdOffset
- the offset into the correlation ID array where the correlation ID beginscorrelationIdLength
- the length of the correlation ID
StoreException
public void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, byte[] correlationId, long correlationIdOffset, long correlationIdLength, int expiration) throws StoreException
Store
store
in interface Store
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the datacorrelationId
- the correlation ID for this messagecorrelationIdOffset
- the offset into the correlation ID array where the correlation ID beginscorrelationIdLength
- the length of the correlation IDexpiration
- the expiration to set on the operation
StoreException
public void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, int flag, CommandId cmdId) throws StoreException
Store
store
in interface Store
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the dataflag
- the expiration to set on the operationcmdId
- the commandId to set on the operation
StoreException
protected void _store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, byte[] correlationId, long correlationIdOffset, long correlationIdLength, int expiration, boolean expirationIsValid, CommandId commandId) throws StoreException
StoreException
public void discardUpTo(long index) throws StoreException
Store
discardUpTo
in interface Store
index
- the index number to keep -- all previous index numbers will be discarded
StoreException
public long getLowestUnpersisted()
Store
getLowestUnpersisted
in interface Store
public void replay(Store.StoreReplayer replayer) throws StoreException, DisconnectedException
Store
replay
in interface Store
replayer
- the StoreReplayer to use to replay the operations
StoreException
DisconnectedException
public void replaySingle(Store.StoreReplayer replayer, long index) throws StoreException, DisconnectedException
Store
replaySingle
in interface Store
StoreException
DisconnectedException
public long unpersistedCount()
Store
unpersistedCount
in interface Store
protected void recover() throws StoreException
StoreException
protected void growFreeListIfEmpty() throws StoreException
StoreException
public void flush() throws TimedOutException
Store
flush
in interface Store
TimedOutException
public void flush(long timeout) throws TimedOutException
Store
flush
in interface Store
timeout
- the number of milliseconds to wait for the flush
TimedOutException
public void setResizeHandler(PublishStoreResizeHandler handler)
Store
setResizeHandler
in interface Store
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |