Package com.epam.fixengine.storage.file
Class SlicedIndexedMessageStorage
java.lang.Object
com.epam.fixengine.storage.file.AbstractFileMessageStorage
com.epam.fixengine.storage.file.FlatFileMessageStorage
com.epam.fixengine.storage.file.SlicedFileMessageStorage
com.epam.fixengine.storage.file.SlicedIndexedMessageStorage
- All Implemented Interfaces:
MessageStorage
-
Field Summary
FieldsFields inherited from class com.epam.fixengine.storage.file.SlicedFileMessageStorage
fileManager, maxFileSizeFields inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage
buffer, channelLength, channelPosition, dateFormattedBuffer, DELTA, maxBufferSize, maxStorageGrowSize, storageGrowSize, timestamp, timestampsInLogs, WRITE_BUFFER_LENGTH_DEFFields inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage
accessFile, channel, configuration, isForcedFlush, maskedTags, NEW_LINE, storageTimestamp -
Constructor Summary
ConstructorsConstructorDescriptionSlicedIndexedMessageStorage(com.epam.fixengine.configuration.Configuration config) -
Method Summary
Modifier and TypeMethodDescriptionlongappendMessageInternal(long timestamp, byte[] message, int offset, int length) Appends message to storageprotected longappendMessageToFile(long timestamp, byte[] message, int offset, int length) protected voidbackupStorageFile(String fullPathToStorageFile, String fullPathToDestinationBackupFile) Backups storage file.voidclose()Close the storage.protected voiddeleteStorageFile(String fullPathToStorageFile) Deletes storage file.protected intprotected Stringprotected longGets next sequence number.protected voidprotected voidOpens the indexed file.protected byte[]readFromStorage(FileChannel readChannel, long readFrom, int msgLen) voidretrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) Retrieves message from storage.voidsetIndexFileExtension(String indexFileExtension) Deprecated.protected voidsetPrefixFormat(String prefixFormat) Deprecated.Methods inherited from class com.epam.fixengine.storage.file.SlicedFileMessageStorage
getMaxFileSize, initialize, setFile, setMaxFileSizeMethods inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage
appendMessage, appendMessage, appendMessageInternal, isEnabledTimestamp, retrieveSequenceNumberMethods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialized, isClosed, openStorage, retrieveMessage, setBackupFileLocator, setFileLocator
-
Field Details
-
DEFAULT_EXT
- See Also:
-
-
Constructor Details
-
SlicedIndexedMessageStorage
public SlicedIndexedMessageStorage(com.epam.fixengine.configuration.Configuration config)
-
-
Method Details
-
setIndexFileExtension
Deprecated. -
setPrefixFormat
Deprecated. -
openStorageFile
Opens the indexed file.- Overrides:
openStorageFilein classFlatFileMessageStorage- Throws:
IOException- - if I/O errors occurred
-
getIndexFileName
-
getFormatLength
protected int getFormatLength()- Overrides:
getFormatLengthin classAbstractFileMessageStorage
-
retrieveMessages
public void retrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) throws IOException Retrieves message from storage.- Specified by:
retrieveMessagesin interfaceMessageStorage- Overrides:
retrieveMessagesin classFlatFileMessageStorage- Parameters:
from- the start sequence positionto- the end sequence positionlistener- the callback listenerblocking- if sets to true the method call not blocking- Throws:
IOException- - Message retrieval is not possible for flat files- See Also:
-
readFromStorage
protected byte[] readFromStorage(FileChannel readChannel, long readFrom, int msgLen) throws IOException - Throws:
IOException
-
close
Close the storage.- Specified by:
closein interfaceMessageStorage- Overrides:
closein classAbstractFileMessageStorage- Throws:
IOException- - if I/O error occurred
-
getNextSequenceNumber
Description copied from class:AbstractFileMessageStorageGets next sequence number.- Overrides:
getNextSequenceNumberin classFlatFileMessageStorage- Throws:
IOException- - if I/O error occurred- See Also:
-
appendMessageInternal
public long appendMessageInternal(long timestamp, byte[] message, int offset, int length) throws IOException Description copied from class:FlatFileMessageStorageAppends message to storage- Overrides:
appendMessageInternalin classSlicedFileMessageStorage- Parameters:
timestamp- the timestamp parametermessage- the array of bytes- Throws:
IOException- - if I/O error occurred- See Also:
-
nextChunk
- Overrides:
nextChunkin classSlicedFileMessageStorage- Throws:
IOException
-
appendMessageToFile
protected long appendMessageToFile(long timestamp, byte[] message, int offset, int length) throws IOException - Throws:
IOException
-
backupStorageFile
protected void backupStorageFile(String fullPathToStorageFile, String fullPathToDestinationBackupFile) throws IOException Description copied from class:AbstractFileMessageStorageBackups storage file.- Overrides:
backupStorageFilein classSlicedFileMessageStorage- Parameters:
fullPathToStorageFile- the path to file of in/out filefullPathToDestinationBackupFile- the destination place to backup file- Throws:
IOException
-
deleteStorageFile
Description copied from class:AbstractFileMessageStorageDeletes storage file.- Overrides:
deleteStorageFilein classSlicedFileMessageStorage- Parameters:
fullPathToStorageFile- the path to in/out file
-