rsm

package
v0.6.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2021 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPrimitiveServer

func RegisterPrimitiveServer(server *grpc.Server, client *Client, env env.DriverEnv)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for communicating with the storage layer

func NewClient

func NewClient(cluster cluster.Cluster, log logging.Logger) *Client

NewClient creates a new proxy client

func (*Client) Close

func (p *Client) Close() error

func (*Client) Connect

func (p *Client) Connect() error

func (*Client) Partition

func (p *Client) Partition(partitionID PartitionID) *Partition

func (*Client) PartitionBy

func (p *Client) PartitionBy(partitionKey []byte) *Partition

func (*Client) Partitions

func (p *Client) Partitions() []*Partition

type Partition

type Partition struct {
	cluster.Partition
	*Session
	ID PartitionID
	// contains filtered or unexported fields
}

Partition is a proxy partition

func NewPartition

func NewPartition(partition cluster.Partition, log logging.Logger) *Partition

NewPartition creates a new proxy partition

func (*Partition) Close

func (p *Partition) Close() error

func (*Partition) Connect

func (p *Partition) Connect() error

type PartitionID

type PartitionID int

PartitionID is a partition identifier

type PartitionOutput

type PartitionOutput struct {
	streams.Result
	Type    rsm.SessionResponseType
	Status  rsm.SessionResponseStatus
	Context rsm.SessionResponseContext
}

PartitionOutput is a result for session-supporting servers containing session header information

type PrimitiveServer

type PrimitiveServer struct {
	*Client
	// contains filtered or unexported fields
}

func (*PrimitiveServer) Close

func (*PrimitiveServer) Create

func (*PrimitiveServer) Delete

type Protocol

type Protocol struct {
	*server.Server
	Client *Client
	Env    env.DriverEnv
	// contains filtered or unexported fields
}

Protocol is a state machine protocol

func NewProtocol

func NewProtocol(cluster cluster.Cluster, env env.DriverEnv) *Protocol

NewProtocol creates a new state machine protocol

func (*Protocol) Configure

func (n *Protocol) Configure(config protocolapi.ProtocolConfig) error

Configure configures the protocol

func (*Protocol) Name

func (n *Protocol) Name() string

Name returns the protocol name

func (*Protocol) Primitives

func (n *Protocol) Primitives() *primitive.PrimitiveTypeRegistry

Primitives returns the protocol primitives

func (*Protocol) Start

func (n *Protocol) Start() error

Start starts the node

func (*Protocol) Stop

func (n *Protocol) Stop() error

Stop stops the node

type Session

type Session struct {
	Timeout   time.Duration
	SessionID uint64
	// contains filtered or unexported fields
}

Session maintains the session for a primitive

func NewSession

func NewSession(partition cluster.Partition, log logging.Logger, opts ...SessionOption) *Session

NewSession creates a new Session for the given partition name is the name of the primitive handler is the primitive's session handler

func (*Session) Close

func (s *Session) Close() error

Close closes the session

func (*Session) DoCloseService

func (s *Session) DoCloseService(ctx context.Context, service rsm.ServiceId) error

DoCloseService closes the service

func (*Session) DoCommand

func (s *Session) DoCommand(ctx context.Context, service rsm.ServiceId, name string, input []byte) ([]byte, error)

DoCommand submits a command to the service

func (*Session) DoCommandStream

func (s *Session) DoCommandStream(ctx context.Context, service rsm.ServiceId, name string, input []byte, outStream streams.WriteStream) error

DoCommandStream submits a streaming command to the service

func (*Session) DoCreateService

func (s *Session) DoCreateService(ctx context.Context, service rsm.ServiceId) error

DoCreateService creates the service

func (*Session) DoDeleteService

func (s *Session) DoDeleteService(ctx context.Context, service rsm.ServiceId) error

DoDeleteService deletes the service

func (*Session) DoQuery

func (s *Session) DoQuery(ctx context.Context, service rsm.ServiceId, name string, input []byte) ([]byte, error)

DoQuery submits a query to the service

func (*Session) DoQueryStream

func (s *Session) DoQueryStream(ctx context.Context, service rsm.ServiceId, name string, input []byte, outStream streams.WriteStream) error

DoQueryStream submits a streaming query to the service

type SessionOption

type SessionOption interface {
	// contains filtered or unexported methods
}

SessionOption implements a session option

func WithSessionTimeout

func WithSessionTimeout(timeout time.Duration) SessionOption

WithSessionTimeout returns a session SessionOption to configure the session timeout

type SessionOutput

type SessionOutput struct {
	streams.Result
}

SessionOutput is a result for session-supporting servers containing session header information

type StreamState

type StreamState struct {
	ID uint64
	// contains filtered or unexported fields
}

StreamState manages the context for a single response stream within a session

func (*StreamState) Close

func (s *StreamState) Close()

Close closes the stream

Directories

Path Synopsis
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.
Code generated by atomix-go-framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL