[][src]Struct fluvio_storage::FileReplica

pub struct FileReplica { /* fields omitted */ }

Replica is public abstraction for commit log which are distributed. Internally it is stored as list of segments. Each segment contains finite sets of record batches.

Implementations

impl FileReplica[src]

pub const PREFER_MAX_LEN: u32[src]

pub async fn create<S>(
    topic: S,
    partition: Size,
    base_offset: Offset,
    option: &ConfigOption
) -> Result<FileReplica, StorageError> where
    S: AsRef<str> + Send + 'static, 
[src]

Construct a new replica with specified topic and partition. It can start with arbitrary offset. However, for normal replica, it is usually starts with 0.

Replica is minimum unit of logs that will can be replicated.
It is a unique pair of (topic,partition)

Replica will use base directory to create it's own directory. Directory name will encode unique replica id which is combination of topic and partition.

If there is existing directory then it will load existing logs. The logs will be validated to ensure it's safe to use it. It is possible logs can't be used because they may be corrupted.

pub async fn remove(&self) -> Result<(), StorageError>[src]

pub async fn update_high_watermark(
    &mut self,
    offset: Offset
) -> Result<(), IoError>
[src]

update committed offset (high watermark)

pub async fn update_high_watermark_to_end(&mut self) -> Result<(), IoError>[src]

update high watermark to end

pub fn get_log_start_offset(&self) -> Offset[src]

earliest offset

pub async fn send_records(
    &mut self,
    records: RecordSet,
    update_highwatermark: bool
) -> Result<(), StorageError>
[src]

write records to this replica, update high watermark if required

pub async fn read_uncommitted_records<P>(&self, max_len: u32, response: &mut P) where
    P: SlicePartitionResponse
[src]

read all uncommitted records

pub async fn read_committed_records(
    &self,
    start_offset: Offset,
    max_len: u32,
    response: &mut impl SlicePartitionResponse
)
[src]

committed records are records up to high watermark

pub async fn read_records<P>(
    &self,
    start_offset: Offset,
    max_offset: Option<Offset>,
    max_len: u32,
    response: &mut P
) where
    P: SlicePartitionResponse
[src]

read record slice into response

  • start_offset: start offsets
  • max_offset: max offset (exclusive)
  • responsive: output
  • max_len: max length of the slice

pub async fn send(&mut self, item: DefaultBatch) -> Result<(), StorageError>[src]

Trait Implementations

impl Debug for FileReplica[src]

impl ReplicaStorage for FileReplica[src]

pub fn get_leo(&self) -> Offset[src]

offset mark that beginning of uncommitted

impl Unpin for FileReplica[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.