Show / Hide Table of Contents

Struct PersistentState.LogEntry

Represents persistent log entry.

Implements
IRaftLogEntry
ILogEntry
IDataTransferObject
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
protected struct LogEntry : IRaftLogEntry, ILogEntry, IDataTransferObject

Properties

| Improve this Doc View Source

IsSnapshot

Gets a value indicating that this log entry is 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

CopyTo(Stream, CancellationToken)

Copies the object content into the specified stream synchronously.

Declaration
public void CopyTo(Stream output, CancellationToken token)
Parameters
Type Name Description
Stream output

The output stream receiving object content.

CancellationToken token

The token that can be used to cancel asynchronous operation.

| Improve this Doc View Source

CopyToAsync(PipeWriter, CancellationToken)

Copies the log entry content into the specified pipe writer.

Declaration
public ValueTask CopyToAsync(PipeWriter output, CancellationToken token)
Parameters
Type Name Description
PipeWriter output

The writer.

CancellationToken token

The token that can be used to cancel operation.

Returns
Type Description
ValueTask

The task representing asynchronous execution of this method.

| Improve this Doc View Source

CopyToAsync(Stream, CancellationToken)

Copies the object content into the specified stream.

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

The output stream receiving object content.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task
| Improve this Doc View Source

Read(Int32)

Reads the number of bytes using the pre-allocated buffer.

Declaration
public ReadOnlySpan<byte> Read(int count)
Parameters
Type Name Description
Int32 count

The number of bytes to read.

Returns
Type Description
ReadOnlySpan<Byte>

The span of bytes representing buffer segment.

Remarks

You can use to decode the returned bytes.

| Improve this Doc View Source

ReadAsync(Int32, CancellationToken)

Reads asynchronously the number of bytes using the pre-allocated buffer.

Declaration
public Task<ReadOnlyMemory<byte>> ReadAsync(int count, CancellationToken token = null)
Parameters
Type Name Description
Int32 count

The number of bytes to read.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<ReadOnlyMemory<Byte>>

The span of bytes representing buffer segment.

Remarks

You can use to decode the returned bytes.

| Improve this Doc View Source

ReadString(Int32, DecodingContext)

Reads the string using the specified encoding.

Declaration
public string ReadString(int length, DecodingContext context)
Parameters
Type Name Description
Int32 length

The length of the string, in bytes.

DecodingContext context

The decoding context.

Returns
Type Description
String

The string decoded from the log entry content stream.

Remarks

The characters should be prefixed with the length in the underlying stream.

| Improve this Doc View Source

ReadStringAsync(Int32, DecodingContext, CancellationToken)

Reads the string asynchronously using the specified encoding.

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

The length of the string, in bytes.

DecodingContext context

The decoding context.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<String>

The string decoded from the log entry content stream.

Remarks

The characters should be prefixed with the length in the underlying stream.

Explicit Interface Implementations

| Improve this Doc View Source

IDataTransferObject.IsReusable

Declaration
bool IDataTransferObject.IsReusable { get; }
Returns
Type Description
Boolean
| Improve this Doc View Source

IDataTransferObject.Length

Declaration
long? IDataTransferObject.Length { get; }
Returns
Type Description
Nullable<Int64>

Implements

IRaftLogEntry
ILogEntry
IDataTransferObject

Extension Methods

ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX