rsm

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 33 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterPrimitiveServer

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

Types

type Client

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

Client is a client for communicating with the storage layer

func NewClient

func NewClient(cluster cluster.Cluster, env env.DriverEnv) *Client

NewClient creates a new proxy client

func (*Client) Close

func (p *Client) Close(ctx context.Context) error

func (*Client) Connect

func (p *Client) Connect(ctx context.Context) 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
}

Partition is a proxy partition

func NewPartition

func NewPartition(partition cluster.Partition) *Partition

NewPartition creates a new proxy partition

type PartitionID

type PartitionID int

PartitionID is a partition identifier

type Picker added in v0.9.1

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

func (*Picker) Pick added in v0.9.1

func (p *Picker) Pick(info balancer.PickInfo) (balancer.PickResult, error)

type PickerBuilder added in v0.9.1

type PickerBuilder struct{}

func (*PickerBuilder) Build added in v0.9.1

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 RSMConfig added in v0.8.0

type RSMConfig struct {
	ReadSync bool `protobuf:"varint,1,opt,name=read_sync,json=readSync,proto3" json:"read_sync,omitempty"`
}

func (*RSMConfig) Descriptor added in v0.8.0

func (*RSMConfig) Descriptor() ([]byte, []int)

func (*RSMConfig) GetReadSync added in v0.8.0

func (m *RSMConfig) GetReadSync() bool

func (*RSMConfig) Marshal added in v0.8.0

func (m *RSMConfig) Marshal() (dAtA []byte, err error)

func (*RSMConfig) MarshalTo added in v0.8.0

func (m *RSMConfig) MarshalTo(dAtA []byte) (int, error)

func (*RSMConfig) MarshalToSizedBuffer added in v0.8.0

func (m *RSMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RSMConfig) ProtoMessage added in v0.8.0

func (*RSMConfig) ProtoMessage()

func (*RSMConfig) Reset added in v0.8.0

func (m *RSMConfig) Reset()

func (*RSMConfig) Size added in v0.8.0

func (m *RSMConfig) Size() (n int)

func (*RSMConfig) String added in v0.8.0

func (m *RSMConfig) String() string

func (*RSMConfig) Unmarshal added in v0.8.0

func (m *RSMConfig) Unmarshal(dAtA []byte) error

func (*RSMConfig) XXX_DiscardUnknown added in v0.8.0

func (m *RSMConfig) XXX_DiscardUnknown()

func (*RSMConfig) XXX_Marshal added in v0.8.0

func (m *RSMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RSMConfig) XXX_Merge added in v0.8.0

func (m *RSMConfig) XXX_Merge(src proto.Message)

func (*RSMConfig) XXX_Size added in v0.8.0

func (m *RSMConfig) XXX_Size() int

func (*RSMConfig) XXX_Unmarshal added in v0.8.0

func (m *RSMConfig) XXX_Unmarshal(b []byte) error

type Resolver added in v0.9.1

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

func (*Resolver) Close added in v0.9.1

func (r *Resolver) Close()

func (*Resolver) ResolveNow added in v0.9.1

func (r *Resolver) ResolveNow(resolver.ResolveNowOptions)

type ResolverBuilder added in v0.9.1

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

func (*ResolverBuilder) Build added in v0.9.1

func (*ResolverBuilder) Scheme added in v0.9.1

func (b *ResolverBuilder) Scheme() string

type Service added in v0.9.1

type Service struct {
	*Session
	// contains filtered or unexported fields
}

Service maintains the session for a primitive

func (*Service) DoCommand added in v0.9.1

func (s *Service) DoCommand(ctx context.Context, operationID rsm.OperationID, input []byte) ([]byte, error)

DoCommand submits a command to the service

func (*Service) DoCommandStream added in v0.9.1

func (s *Service) DoCommandStream(ctx context.Context, operationID rsm.OperationID, input []byte, stream streams.WriteStream) error

DoCommandStream submits a streaming command to the service

func (*Service) DoQuery added in v0.9.1

func (s *Service) DoQuery(ctx context.Context, operationID rsm.OperationID, input []byte, sync bool) ([]byte, error)

DoQuery submits a query to the service

func (*Service) DoQueryStream added in v0.9.1

func (s *Service) DoQueryStream(ctx context.Context, operationID rsm.OperationID, input []byte, stream streams.WriteStream, sync bool) error

DoQueryStream submits a streaming query to the service

type Session

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

Session maintains the session for a primitive

func NewSession

func NewSession(partition cluster.Partition, 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) GetService added in v0.9.1

func (s *Session) GetService(ctx context.Context, serviceInfo rsm.ServiceInfo) (*Service, error)

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

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.

Jump to

Keyboard shortcuts

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