[−][src]Struct fluvio_storage::FileReplica
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]
topic: S,
partition: Size,
base_offset: Offset,
option: &ConfigOption
) -> Result<FileReplica, StorageError> where
S: AsRef<str> + Send + 'static,
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]
&mut self,
offset: Offset
) -> Result<(), IoError>
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]
&mut self,
records: RecordSet,
update_highwatermark: bool
) -> Result<(), StorageError>
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]
P: SlicePartitionResponse,
read all uncommitted records
pub async fn read_committed_records(
&self,
start_offset: Offset,
max_len: u32,
response: &mut impl SlicePartitionResponse
)
[src]
&self,
start_offset: Offset,
max_len: u32,
response: &mut impl SlicePartitionResponse
)
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]
&self,
start_offset: Offset,
max_offset: Option<Offset>,
max_len: u32,
response: &mut P
) where
P: SlicePartitionResponse,
read record slice into response
start_offset
: start offsetsmax_offset
: max offset (exclusive)responsive
: outputmax_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_hw(&self) -> Offset
[src]
pub fn get_leo(&self) -> Offset
[src]
offset mark that beginning of uncommitted
impl Unpin for FileReplica
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FileReplica
[src]
impl Send for FileReplica
[src]
impl Sync for FileReplica
[src]
impl !UnwindSafe for FileReplica
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,