Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenOption ¶
type OpenOption struct {
Channel types.PChannelInfo // Channel to open.
}
OpenOption is the option for allocating wal impls instance.
type OpenerBuilderImpls ¶
type OpenerBuilderImpls interface { // Name of the wal builder, should be a lowercase string. Name() string // Build build a opener impls instance. Build() (OpenerImpls, error) }
OpenerBuilderImpls is the interface for building wal opener impls.
type OpenerImpls ¶
type OpenerImpls interface { // Open open a WALImpls instance. Open(ctx context.Context, opt *OpenOption) (WALImpls, error) // Close release the resources. Close() }
OpenerImpls is the interface for build WALImpls instance.
type ReadOption ¶
type ReadOption struct { // The name of the reader. Name string // ReadAheadBufferSize sets the size of scanner read ahead queue size. // Control how many messages can be read ahead by the scanner. // Higher value could potentially increase the scanner throughput but bigger memory utilization. // 0 is the default value determined by the underlying wal implementation. ReadAheadBufferSize int // DeliverPolicy sets the deliver policy of the reader. DeliverPolicy options.DeliverPolicy }
type ScannerImpls ¶
type ScannerImpls interface { // Name returns the name of scanner. Name() string // Chan returns the channel of message. Chan() <-chan message.ImmutableMessage // Error returns the error of scanner failed. // Will block until scanner is closed or Chan is dry out. Error() error // Done returns a channel which will be closed when scanner is finished or closed. Done() <-chan struct{} // Close the scanner, release the underlying resources. // Return the error same with `Error` Close() error }
ScannerImpls is the interface for reading records from the wal.
type WALImpls ¶
type WALImpls interface { // WALName returns the name of the wal. WALName() string // Channel returns the channel assignment info of the wal. // Should be read-only. Channel() types.PChannelInfo // Append writes a record to the log. Append(ctx context.Context, msg message.MutableMessage) (message.MessageID, error) // Read returns a scanner for reading records from the wal. Read(ctx context.Context, opts ReadOption) (ScannerImpls, error) // Close closes the wal instance. Close() }
Click to show internal directories.
Click to hide internal directories.