Show / Hide Table of Contents

Struct PersistentState.LogEntry

Represents persistent log entry.

Implements
IRaftLogEntry
Log.ILogEntry
IAsyncBinaryReader
Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
protected struct LogEntry : IRaftLogEntry, Log.ILogEntry, IAsyncBinaryReader

Properties

| Improve this Doc View Source

IsSnapshot

Gets a value indicating that this entry is a snapshot entry.

Declaration
public bool IsSnapshot { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Length

Gets length of the log entry content, in bytes.

Declaration
public long Length { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

Term

Gets Raft term of this log entry.

Declaration
public long Term { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

Timestamp

Gets timestamp of this log entry.

Declaration
public DateTimeOffset Timestamp { get; }
Property Value
Type Description
DateTimeOffset

Methods

| Improve this Doc View Source

CopyToAsync(PipeWriter, CancellationToken)

Copies the remaining content from this log entry to the specified stream.

Declaration
public Task CopyToAsync(PipeWriter output, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
PipeWriter output

The stream used as copy destination.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
Task

The task representing state of asynchronous execution.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

| Improve this Doc View Source

CopyToAsync(Stream, CancellationToken)

Copies the remaining content from this log entry to the specified stream.

Declaration
public Task CopyToAsync(Stream output, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
Stream output

The stream used as copy destination.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
Task

The task representing state of asynchronous execution.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

| Improve this Doc View Source

ReadAsync(Memory<Byte>, CancellationToken)

Reads the data of exact size.

Declaration
public ValueTask ReadAsync(Memory<byte> output, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
Memory<Byte> output

The buffer to be modified with the data from log entry.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask

The task representing state of asynchronous execution.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

EndOfStreamException

The end of the stream is reached.

| Improve this Doc View Source

ReadAsync<T>(CancellationToken)

Reads the value of blittable type from the log entry and advances position in the underlying stream.

Declaration
public ValueTask<T> ReadAsync<T>(CancellationToken token = default(CancellationToken))

    where T : struct
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<T>

Decoded value of blittable type.

Type Parameters
Name Description
T

The type of value to read.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

EndOfStreamException

The end of the stream is reached.

| Improve this Doc View Source

ReadStringAsync(StringLengthEncoding, DecodingContext, CancellationToken)

Reads the string of the specified encoding.

Declaration
public ValueTask<string> ReadStringAsync(StringLengthEncoding lengthFormat, DecodingContext context, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
StringLengthEncoding lengthFormat

Indicates how the string length is encoded in underlying stream.

DecodingContext context

The context of string decoding.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<String>

The decoded string.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

EndOfStreamException

The end of the stream is reached.

| Improve this Doc View Source

ReadStringAsync(Int32, DecodingContext, CancellationToken)

Reads the string of the specified encoding and length.

Declaration
public ValueTask<string> ReadStringAsync(int length, DecodingContext context, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
Int32 length

The length of the string, in bytes.

DecodingContext context

The context of string decoding.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<String>

The decoded string.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

EndOfStreamException

The end of the stream is reached.

Implements

IRaftLogEntry
ILogEntry
IAsyncBinaryReader

Extension Methods

Sequence.Skip<TEnumerator, T>(ref TEnumerator, Int32)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX