C# Class Brod.Storage.Store

Brod persistent message store
Inheritance: IDisposable
Show file Open project: paralect/brod Class Usage Examples

Public Methods

Method Description
Append ( String topic, Int32 partition, byte payload ) : void

Append payload to specified topic and partition

Dispose ( ) : void
Flush ( ) : void

Flush to OS page cache (data will be visible for consumers)

FlushOnDisk ( ) : void

Flush on disk to store data permanently

GetNumberOfPartitionsForTopic ( String topic ) : Int32

Calculates number of partitions for specified topic

ReadMessages ( String topic, Int32 partition, Int32 offset, Int32 blockLength ) : IEnumerable

Read and parse all message that can be found in bytes, starting from byte from specified and

ReadMessagesBlock ( String topic, Int32 partition, Int32 offset, Int32 blockLength ) : MessagesBlock

Read bytes, starting from byte from specified and

Store ( BrokerConfiguration configuration ) : System

Creates Store

ValidatePartitionNumber ( String topic, Int32 partition ) : bool

Returns true of partition number is valid for current broker configuration

Private Methods

Method Description
GetTopic ( String topicName ) : Topic

Returns Topic for specified name. Will be created, if not exists.

Init ( ) : void

Builds internal cache of topics, that this storage contains

InternalFlush ( System.Boolean flushToDisk ) : void

Flush streams to page cache or disk, depending on param.

Method Details

Append() public method

Append payload to specified topic and partition
public Append ( String topic, Int32 partition, byte payload ) : void
topic String
partition System.Int32
payload byte
return void

Dispose() public method

public Dispose ( ) : void
return void

Flush() public method

Flush to OS page cache (data will be visible for consumers)
public Flush ( ) : void
return void

FlushOnDisk() public method

Flush on disk to store data permanently
public FlushOnDisk ( ) : void
return void

GetNumberOfPartitionsForTopic() public method

Calculates number of partitions for specified topic
public GetNumberOfPartitionsForTopic ( String topic ) : Int32
topic String
return System.Int32

ReadMessages() public method

Read and parse all message that can be found in bytes, starting from byte from specified and
public ReadMessages ( String topic, Int32 partition, Int32 offset, Int32 blockLength ) : IEnumerable
topic String
partition System.Int32
offset System.Int32
blockLength System.Int32
return IEnumerable

ReadMessagesBlock() public method

Read bytes, starting from byte from specified and
public ReadMessagesBlock ( String topic, Int32 partition, Int32 offset, Int32 blockLength ) : MessagesBlock
topic String
partition System.Int32
offset System.Int32
blockLength System.Int32
return Brod.Messages.MessagesBlock

Store() public method

Creates Store
public Store ( BrokerConfiguration configuration ) : System
configuration Brod.Brokers.BrokerConfiguration
return System

ValidatePartitionNumber() public method

Returns true of partition number is valid for current broker configuration
public ValidatePartitionNumber ( String topic, Int32 partition ) : bool
topic String
partition System.Int32
return bool