com.epam.fixengine.storage.file
Class SlicedFileMessageStorage

java.lang.Object
  extended by com.epam.fixengine.storage.file.AbstractFileMessageStorage
      extended by com.epam.fixengine.storage.file.FlatFileMessageStorage
          extended by com.epam.fixengine.storage.file.SlicedFileMessageStorage
All Implemented Interfaces:
MessageStorage
Direct Known Subclasses:
SlicedIndexedMessageStorage

public class SlicedFileMessageStorage
extends FlatFileMessageStorage


Field Summary
protected  SlicedFileManager fileManager
           
protected  long 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
SlicedFileMessageStorage(Configuration config)
           
 
Method Summary
 long appendMessageInternal(long timestamp, byte[] message, int offset, int length)
          Appends message to storage
protected  void backupStorageFile(String fullPathToStorageFile, String fullPathToDestinationBackupFile)
          Backups storage file.
protected  void deleteStorageFile(String fullPathToStorageFile)
          Deletes storage file.
 long getMaxFileSize()
           
 long initialize()
          Initialize the storage.
protected  void nextChunk()
           
 void setMaxFileSize(long maxFileSize)
           
 
Methods inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage
getNextSequenceNumber, isEnabledTimestamp, openStorageFile, retrieveMessages, retrieveSequenceNumber
 
Methods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, close, deleteFile, getFile, getFormatLength, 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

maxFileSize

protected long maxFileSize

fileManager

protected SlicedFileManager fileManager
Constructor Detail

SlicedFileMessageStorage

public SlicedFileMessageStorage(Configuration config)
Method Detail

initialize

public long initialize()
                throws IOException
Description copied from class: AbstractFileMessageStorage
Initialize the storage.

Specified by:
initialize in interface MessageStorage
Overrides:
initialize in class AbstractFileMessageStorage
Returns:
the last sequence number
Throws:
IOException - - if I/O error occurred

getMaxFileSize

public long getMaxFileSize()

setMaxFileSize

public void setMaxFileSize(long maxFileSize)

appendMessageInternal

public long appendMessageInternal(long timestamp,
                                  byte[] message,
                                  int offset,
                                  int length)
                           throws IOException
Description copied from class: FlatFileMessageStorage
Appends message to storage

Overrides:
appendMessageInternal in class FlatFileMessageStorage
Parameters:
timestamp - the timestamp parameter
message - the array of bytes
length - @throws IOException - if I/O error occurred
Throws:
IOException

nextChunk

protected void nextChunk()
                  throws IOException
Throws:
IOException

backupStorageFile

protected void backupStorageFile(String fullPathToStorageFile,
                                 String fullPathToDestinationBackupFile)
                          throws IOException
Description copied from class: AbstractFileMessageStorage
Backups storage file.

Overrides:
backupStorageFile in class AbstractFileMessageStorage
Parameters:
fullPathToStorageFile - the path to file of in/out file
fullPathToDestinationBackupFile - the destination place to backup file
Throws:
IOException

deleteStorageFile

protected void deleteStorageFile(String fullPathToStorageFile)
Description copied from class: AbstractFileMessageStorage
Deletes storage file.

Overrides:
deleteStorageFile in class AbstractFileMessageStorage
Parameters:
fullPathToStorageFile - the path to in/out file


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.