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 TypeMethodDescriptionvoid
appendMessage
(byte[] timestampFormatted, byte[] message) Appends message to storage with the given formatted timestampFormatted.void
appendMessage
(byte[] timestampFormatted, byte[] message, int offset, int length) Appends message to storage with the given formatted timestamp.long
appendMessageInternal
(byte[] timestampFormatted, byte[] message, int offset, int length) long
appendMessageInternal
(long timestamp, byte[] message, int offset, int length) Appends message to storagevoid
close()
Close the storage.protected void
deleteFile
(String fullPathToStorageFile) protected long
Gets next sequence number.protected void
void
retrieveMessages
(long from, long to, MessageStorageListener listener, boolean blocking) Retrieves message from storage.static int
trimLength
(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, setFileLocator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:MessageStorage
Retrieves message from storage.- Specified by:
retrieveMessages
in interfaceMessageStorage
- Specified by:
retrieveMessages
in 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:
openStorageFile
in classAbstractFileMessageStorage
- Throws:
IOException
-
getNextSequenceNumber
Description copied from class:AbstractFileMessageStorage
Gets next sequence number.- Specified by:
getNextSequenceNumber
in classAbstractFileMessageStorage
- Throws:
IOException
- - if I/O error occurred
-
deleteFile
- Overrides:
deleteFile
in classAbstractFileMessageStorage
-
appendMessage
public void appendMessage(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException Description copied from interface:MessageStorage
Appends message to storage with the given formatted timestamp.- Specified by:
appendMessage
in interfaceMessageStorage
- Parameters:
timestampFormatted
- the message timestampmessage
- the messageoffset
- the initial offsetlength
- the length- Throws:
IOException
- - if error occurred.
-
appendMessage
Description copied from interface:MessageStorage
Appends message to storage with the given formatted timestampFormatted.- Specified by:
appendMessage
in 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:AbstractFileMessageStorage
Appends message to storage- Specified by:
appendMessageInternal
in classAbstractFileMessageStorage
- Parameters:
timestamp
- the timestamp parametermessage
- the array of bytes- Throws:
IOException
- - if I/O error occurred
-
close
Description copied from class:AbstractFileMessageStorage
Close the storage.- Specified by:
close
in interfaceMessageStorage
- Overrides:
close
in classAbstractFileMessageStorage
- Throws:
IOException
- - if I/O error occurred
-