|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.epam.fixengine.storage.file.AbstractFileMessageStorage
com.epam.fixengine.storage.file.MMFIndexedMessageStorage
public class MMFIndexedMessageStorage
WARNING: This implementation used class which is Sun proprietary API(HotSpot VM).
WARNING: Can persist message with sequence number is not greater than 178,956,969.
User: Mykhailo_Sereda Date: 16.05.12 Time: 11:38
| Field Summary | |
|---|---|
protected long |
channelLength
|
protected long |
channelPosition
|
protected byte[] |
dateFormattedBuffer
|
protected int |
indexGrowSize
|
protected int |
storageGrowSize
|
protected long |
timestamp
|
protected boolean |
timestampsInLogs
|
| Fields inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
|---|
accessFile, calendar, channel, configuration |
| Constructor Summary | |
|---|---|
MMFIndexedMessageStorage(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 long |
getLastStoragePosition()
|
protected long |
getNextSequenceNumber()
Gets next sequence number. |
long |
initialize()
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. |
| Methods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
|---|
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialized, isClosed, openStorageFile, retrieveMessage, setBackupFileLocator, setFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long timestamp
protected byte[] dateFormattedBuffer
protected boolean timestampsInLogs
protected int storageGrowSize
protected long channelPosition
protected long channelLength
protected int indexGrowSize
| Constructor Detail |
|---|
public MMFIndexedMessageStorage(Configuration config)
| Method Detail |
|---|
public long initialize()
throws IOException
initialize in interface MessageStorageinitialize in class AbstractFileMessageStorageIOException - - if I/O errors occurredAbstractFileMessageStorage.initialize()protected int getFormatLength()
getFormatLength in class AbstractFileMessageStorage
public long appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
throws IOException
AbstractFileMessageStorage
appendMessageInternal in class AbstractFileMessageStoragetimestamp - the timestamp parametermessage - the array of byteslength - @throws IOException - if I/O error occurred
IOExceptionAbstractFileMessageStorage.appendMessageInternal(long, byte[], int, int)
public void retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
throws IOException
retrieveMessages in interface MessageStorageretrieveMessages in class AbstractFileMessageStoragefrom - 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
protected long appendMessageToFile(long timestamp,
byte[] message,
int offset,
int length)
throws IOException
IOException
protected long getNextSequenceNumber()
throws IOException
AbstractFileMessageStorage
getNextSequenceNumber in class AbstractFileMessageStorageIOException - - if I/O error occurredAbstractFileMessageStorage.getNextSequenceNumber()
protected long getLastStoragePosition()
throws IOException
IOException
protected void backupStorageFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
throws IOException
AbstractFileMessageStorage
backupStorageFile in class AbstractFileMessageStoragefullPathToStorageFile - the path to file of in/out filefullPathToDestinationBackupFile - the destination place to backup file
IOExceptionprotected void deleteStorageFile(String fullPathToStorageFile)
AbstractFileMessageStorage
deleteStorageFile in class AbstractFileMessageStoragefullPathToStorageFile - the path to in/out file
public void close()
throws IOException
close in interface MessageStorageclose in class AbstractFileMessageStorageIOException - - if I/O error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||