Package com.epam.fixengine.storage.file
Class ChronicleQueueStorage
java.lang.Object
com.epam.fixengine.storage.file.AbstractFileMessageStorage
com.epam.fixengine.storage.file.ChronicleQueueStorage
- All Implemented Interfaces:
MessageStorage
-
Field Summary
FieldsFields inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage
accessFile, channel, configuration, isForcedFlush, maskedTags, NEW_LINE, storageTimestamp -
Constructor Summary
ConstructorsConstructorDescriptionChronicleQueueStorage(com.epam.fixengine.configuration.Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendMessage(byte[] timestampFormatted, byte[] message) Appends message to storage with the given formatted timestampFormatted.voidappendMessage(byte[] timestampFormatted, byte[] message, int offset, int length) Appends message to storage with the given formatted timestamp.longappendMessageInternal(byte[] timestampFormatted, byte[] message, int offset, int length) longappendMessageInternal(long timestamp, byte[] message, int offset, int length) Appends message to storagevoidclose()Close the storage.protected voiddeleteFile(String fullPathToStorageFile) protected longGets next sequence number.protected voidvoidretrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) Retrieves message from storage.static inttrimLength(net.openhft.chronicle.bytes.Bytes bytes) Methods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, backupStorageFile, deleteStorageFile, getFile, getFormatLength, getPrefixFormat, initialize, initialized, isClosed, openStorage, retrieveMessage, setBackupFileLocator, setFile, setFileLocatorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.epam.fixengine.storage.MessageStorage
appendMessage, appendMessage, backupStorage, initialize, retrieveMessage
-
Field Details
-
WAITING_FILE_TO_REMOVE_IN_SEC
public static final int WAITING_FILE_TO_REMOVE_IN_SEC- See Also:
-
-
Constructor Details
-
ChronicleQueueStorage
public ChronicleQueueStorage(com.epam.fixengine.configuration.Configuration configuration)
-
-
Method Details
-
retrieveMessages
public void retrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) throws IOException Description copied from interface:MessageStorageRetrieves message from storage.- Specified by:
retrieveMessagesin interfaceMessageStorage- Specified by:
retrieveMessagesin classAbstractFileMessageStorage- Parameters:
from- the from sequence numberto- the to sequence numberlistener- the callback listenerblocking- if parameter is true, the execution start in current thread context, otherwise in the new thread context.- Throws:
IOException- - if error occurred.- See Also:
-
trimLength
public static int trimLength(net.openhft.chronicle.bytes.Bytes bytes) -
openStorageFile
- Overrides:
openStorageFilein classAbstractFileMessageStorage- Throws:
IOException
-
getNextSequenceNumber
Description copied from class:AbstractFileMessageStorageGets next sequence number.- Specified by:
getNextSequenceNumberin classAbstractFileMessageStorage- Throws:
IOException- - if I/O error occurred
-
deleteFile
- Overrides:
deleteFilein classAbstractFileMessageStorage
-
appendMessage
public void appendMessage(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException Description copied from interface:MessageStorageAppends message to storage with the given formatted timestamp.- Specified by:
appendMessagein interfaceMessageStorage- Parameters:
timestampFormatted- the message timestampmessage- the messageoffset- the initial offsetlength- the length- Throws:
IOException- - if error occurred.
-
appendMessage
Description copied from interface:MessageStorageAppends message to storage with the given formatted timestampFormatted.- Specified by:
appendMessagein interfaceMessageStorage- Parameters:
timestampFormatted- the message timestampFormattedmessage- the message- Throws:
IOException- - if error occurred.
-
appendMessageInternal
public long appendMessageInternal(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException - Throws:
IOException
-
appendMessageInternal
public long appendMessageInternal(long timestamp, byte[] message, int offset, int length) throws IOException Description copied from class:AbstractFileMessageStorageAppends message to storage- Specified by:
appendMessageInternalin classAbstractFileMessageStorage- Parameters:
timestamp- the timestamp parametermessage- the array of bytes- Throws:
IOException- - if I/O error occurred
-
close
Description copied from class:AbstractFileMessageStorageClose the storage.- Specified by:
closein interfaceMessageStorage- Overrides:
closein classAbstractFileMessageStorage- Throws:
IOException- - if I/O error occurred
-