Class MmfIndexedMessageStorage
WARNING: Can persist message with sequence number is not greater than 178,956,969.
Inheritance
System.Object
MmfIndexedMessageStorage
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: FixAntenna.Core.dll
Syntax
public class MmfIndexedMessageStorage : AbstractFileMessageStorage, IMessageStorage, IDisposable
Constructors
MmfIndexedMessageStorage(Config)
Declaration
public MmfIndexedMessageStorage(Config config)
Parameters
Type |
Name |
Description |
Config |
config |
|
Fields
ChannelLength
Declaration
protected long ChannelLength
Field Value
Type |
Description |
System.Int64 |
|
ChannelPosition
Declaration
protected long ChannelPosition
Field Value
Type |
Description |
System.Int64 |
|
Declaration
protected byte[] DateFormattedBuffer
Field Value
Type |
Description |
System.Byte[] |
|
IndexGrowSize
Declaration
protected long IndexGrowSize
Field Value
Type |
Description |
System.Int64 |
|
MaxSeqnum
Declaration
public static readonly int MaxSeqnum
Field Value
Type |
Description |
System.Int32 |
|
StorageGrowSize
Declaration
protected long StorageGrowSize
Field Value
Type |
Description |
System.Int64 |
|
TimestampsInLogs
Declaration
protected bool TimestampsInLogs
Field Value
Type |
Description |
System.Boolean |
|
TimestampTicks
Declaration
protected long TimestampTicks
Field Value
Type |
Description |
System.Int64 |
|
Methods
AppendMessage(Byte[], Byte[])
Appends message to storage with the given formatted timestampFormatted.
Declaration
public override void AppendMessage(byte[] timestampFormatted, byte[] message)
Parameters
Type |
Name |
Description |
System.Byte[] |
timestampFormatted |
the message timestampFormatted
|
System.Byte[] |
message |
the message
|
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if error occurred.
|
AppendMessage(Byte[], Byte[], Int32, Int32)
Appends message to storage with the given formatted timestamp.
Declaration
public override void AppendMessage(byte[] timestampFormatted, byte[] message, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
timestampFormatted |
the message timestamp
|
System.Byte[] |
message |
the message
|
System.Int32 |
offset |
the initial offset
|
System.Int32 |
length |
the length
|
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if error occurred.
|
AppendMessageInternal(Byte[], Byte[], Int32, Int32)
Declaration
public virtual long AppendMessageInternal(byte[] timestampFormatted, byte[] message, int offset, int length)
Parameters
Type |
Name |
Description |
System.Byte[] |
timestampFormatted |
|
System.Byte[] |
message |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
AppendMessageInternal(Int64, Byte[], Int32, Int32)
Appends message to storage
Declaration
protected override long AppendMessageInternal(long ticks, byte[] message, int offset, int length)
Parameters
Type |
Name |
Description |
System.Int64 |
ticks |
the timestamp parameter
|
System.Byte[] |
message |
the array of bytes
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if I/O error occurred
|
AppendMessageToFile(Int64, Byte[], Byte[], Int32, Int32)
Declaration
protected virtual long AppendMessageToFile(long ticks, byte[] timestampFormatted, byte[] message, int offset, int length)
Parameters
Type |
Name |
Description |
System.Int64 |
ticks |
|
System.Byte[] |
timestampFormatted |
|
System.Byte[] |
message |
|
System.Int32 |
offset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
BackupStorageFile(String, String)
Declaration
public override void BackupStorageFile(string fullPathToStorageFile, string fullPathToDestinationBackupFile)
Parameters
Type |
Name |
Description |
System.String |
fullPathToStorageFile |
the path to file of in/out file
|
System.String |
fullPathToDestinationBackupFile |
the destination place to backup file
|
Overrides
Declaration
protected override int CalculateFormatLength()
Returns
Type |
Description |
System.Int32 |
|
Overrides
Close()
Declaration
public override void Close()
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if error occurred.
|
DeleteStorageFile(String)
Declaration
public override void DeleteStorageFile(string fullPathToStorageFile)
Parameters
Type |
Name |
Description |
System.String |
fullPathToStorageFile |
the path to in/out file
|
Overrides
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
Overrides
GetLastStoragePosition()
Declaration
public virtual long GetLastStoragePosition()
Returns
Type |
Description |
System.Int64 |
|
GetNextSequenceNumber()
Gets next sequence number.
Declaration
public override long GetNextSequenceNumber()
Returns
Type |
Description |
System.Int64 |
|
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if I/O error occurred
|
Initialize()
Opens the indexed file. Make mapped byte buffers
Declaration
public override long Initialize()
Returns
Type |
Description |
System.Int64 |
last send sequence number
|
Overrides
Exceptions
Type |
Condition |
System.IO.IOException |
if I/O errors occurred
|
See Also
ReadFromStorage(FileStream, Int64, Int32)
Declaration
public virtual byte[] ReadFromStorage(FileStream readChannel, long readFrom, int messageLength)
Parameters
Type |
Name |
Description |
System.IO.FileStream |
readChannel |
|
System.Int64 |
readFrom |
|
System.Int32 |
messageLength |
|
Returns
Type |
Description |
System.Byte[] |
|
RetrieveMessagesImplementation(Int64, Int64, IMessageStorageListener, Boolean)
Retrieves message from storage.
Declaration
protected override void RetrieveMessagesImplementation(long from, long to, IMessageStorageListener listener, bool blocking)
Parameters
Type |
Name |
Description |
System.Int64 |
from |
the start sequence position
|
System.Int64 |
to |
the end sequence position
|
IMessageStorageListener |
listener |
the callback listener
|
System.Boolean |
blocking |
if sets to true the method call not blocking
|
Overrides
Exceptions
Implements
System.IDisposable