|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public class SlicedIndexedMessageStorage
Field Summary | |
---|---|
static String |
DEFAULT_EXT
|
Fields inherited from class com.epam.fixengine.storage.file.SlicedFileMessageStorage |
---|
fileManager, maxFileSize |
Fields inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage |
---|
buffer, channelLength, channelPosition, dateFormattedBuffer, DELTA, maxBufferSize, maxStorageGrowSize, NEW_LINE, storageGrowSize, timestamp, timestampsInLogs, WRITE_BUFFER_LENGTH_DEF |
Fields inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
---|
accessFile, calendar, channel, configuration |
Constructor Summary | |
---|---|
SlicedIndexedMessageStorage(Configuration config)
|
Method Summary | |
---|---|
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. |
Methods inherited from class com.epam.fixengine.storage.file.SlicedFileMessageStorage |
---|
getMaxFileSize, initialize, setMaxFileSize |
Methods inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage |
---|
isEnabledTimestamp, retrieveSequenceNumber |
Methods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
---|
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialized, isClosed, retrieveMessage, setBackupFileLocator, setFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_EXT
Constructor Detail |
---|
public SlicedIndexedMessageStorage(Configuration config)
Method Detail |
---|
@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 blocking
java.io.IOException,
- IllegalArgumentException
IOException
- - if error occurred.FlatFileMessageStorage
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 occurred
IOException
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 file
IOException
protected void deleteStorageFile(String fullPathToStorageFile)
AbstractFileMessageStorage
deleteStorageFile
in class SlicedFileMessageStorage
fullPathToStorageFile
- the path to in/out file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |