public class SlicedIndexedMessageStorage extends SlicedFileMessageStorage
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXT |
fileManager, maxFileSize
buffer, channelLength, channelPosition, dateFormattedBuffer, DELTA, maxBufferSize, maxStorageGrowSize, storageGrowSize, timestamp, timestampsInLogs, WRITE_BUFFER_LENGTH_DEF
accessFile, channel, configuration, isForcedFlush, maskedTags, NEW_LINE, storageTimestamp
Constructor and Description |
---|
SlicedIndexedMessageStorage(com.epam.fixengine.configuration.Configuration config) |
Modifier and Type | Method and Description |
---|---|
long |
appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
Appends message to storage
|
protected long |
appendMessageToFile(long timestamp,
byte[] message,
int offset,
int length) |
protected void |
backupStorageFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
Backups storage file.
|
void |
close()
Close the storage.
|
protected void |
deleteStorageFile(String fullPathToStorageFile)
Deletes storage file.
|
protected int |
getFormatLength() |
protected String |
getIndexFileName() |
protected long |
getNextSequenceNumber()
Gets next sequence number.
|
protected void |
nextChunk() |
protected void |
openStorageFile()
Opens the indexed file.
|
protected byte[] |
readFromStorage(FileChannel readChannel,
long readFrom,
int msgLen) |
void |
retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
Retrieves message from storage.
|
void |
setIndexFileExtension(String indexFileExtension)
Deprecated.
|
protected void |
setPrefixFormat(String prefixFormat)
Deprecated.
|
getMaxFileSize, initialize, setFile, setMaxFileSize
appendMessage, appendMessage, appendMessageInternal, isEnabledTimestamp, retrieveSequenceNumber
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialized, isClosed, openStorage, retrieveMessage, setBackupFileLocator, setFileLocator
public static final String DEFAULT_EXT
public SlicedIndexedMessageStorage(com.epam.fixengine.configuration.Configuration config)
@Deprecated public void setIndexFileExtension(String indexFileExtension)
@Deprecated protected void setPrefixFormat(String prefixFormat)
protected void openStorageFile() throws IOException
openStorageFile
in class FlatFileMessageStorage
IOException
- - if I/O errors occurredprotected String getIndexFileName()
protected int getFormatLength()
getFormatLength
in class AbstractFileMessageStorage
public void retrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) throws IOException
retrieveMessages
in interface MessageStorage
retrieveMessages
in class FlatFileMessageStorage
from
- the start sequence positionto
- the end sequence positionlistener
- the callback listenerblocking
- if sets to true the method call not blockingjava.io.IOException,
- IllegalArgumentExceptionIOException
- - Message retrieval is not possible for flat filesFlatFileMessageStorage
protected byte[] readFromStorage(FileChannel readChannel, long readFrom, int msgLen) throws IOException
IOException
public void close() throws IOException
close
in interface MessageStorage
close
in class AbstractFileMessageStorage
IOException
- - if I/O error occurredprotected long getNextSequenceNumber() throws IOException
AbstractFileMessageStorage
getNextSequenceNumber
in class FlatFileMessageStorage
IOException
- - if I/O error occurredAbstractFileMessageStorage.getNextSequenceNumber()
public long appendMessageInternal(long timestamp, byte[] message, int offset, int length) throws IOException
FlatFileMessageStorage
appendMessageInternal
in class SlicedFileMessageStorage
timestamp
- the timestamp parametermessage
- the array of byteslength
- @throws IOException - if I/O error occurredIOException
AbstractFileMessageStorage.appendMessageInternal(long, byte[], int, int)
protected void nextChunk() throws IOException
nextChunk
in class SlicedFileMessageStorage
IOException
protected long appendMessageToFile(long timestamp, byte[] message, int offset, int length) throws IOException
IOException
protected void backupStorageFile(String fullPathToStorageFile, String fullPathToDestinationBackupFile) throws IOException
AbstractFileMessageStorage
backupStorageFile
in class SlicedFileMessageStorage
fullPathToStorageFile
- the path to file of in/out filefullPathToDestinationBackupFile
- the destination place to backup fileIOException
protected void deleteStorageFile(String fullPathToStorageFile)
AbstractFileMessageStorage
deleteStorageFile
in class SlicedFileMessageStorage
fullPathToStorageFile
- the path to in/out fileCopyright © 2000–2022 EPAM Systems. All rights reserved.