client

package
v0.0.0-...-fa7f690 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VINEYARD_IPC_SOCKET_KEY   = "VINEYARD_IPC_SOCKET"
	VINEYARD_RPC_ENDPOINT_KEY = "VINEYARD_RPC_ENDPOINT"
	VINEYARD_DEFAULT_RPC_PORT = 9600
)

Variables

View Source
var NOT_CONNECTED_ERR = common.NotConnected()

Functions

func GetDefaultIPCSocket

func GetDefaultIPCSocket() string

func GetDefaultRPCEndpoint

func GetDefaultRPCEndpoint() string

func GetDefaultRPCHostAndPort

func GetDefaultRPCHostAndPort() (string, uint16)

Types

type Blob

type Blob struct {
	Object

	Size uint64
	*arrow.Buffer
}

func EmptyBlob

func EmptyBlob(client *IPCClient) Blob

func (*Blob) Construct

func (b *Blob) Construct(client *IPCClient, meta *ObjectMeta) (err error)

func (*Blob) Data

func (b *Blob) Data() ([]byte, error)

func (*Blob) Pointer

func (b *Blob) Pointer() (unsafe.Pointer, error)

type BlobWriter

type BlobWriter struct {
	Id   types.ObjectID
	Size uint64
	Meta *ObjectMeta

	*arrow.Buffer
}

func EmptyBlobWriter

func EmptyBlobWriter(client *IPCClient) BlobWriter

func (*BlobWriter) Build

func (b *BlobWriter) Build(client *IPCClient) error

func (*BlobWriter) Data

func (b *BlobWriter) Data() ([]byte, error)

func (*BlobWriter) Pointer

func (b *BlobWriter) Pointer() (unsafe.Pointer, error)

func (*BlobWriter) Reset

func (b *BlobWriter) Reset(
	id types.ObjectID,
	size uint64,
	buffer *arrow.Buffer,
	instanceId types.InstanceID,
)

func (*BlobWriter) Seal

func (b *BlobWriter) Seal(client *IPCClient) (types.ObjectID, error)

type BufferSet

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

func (*BufferSet) Contains

func (s *BufferSet) Contains(id types.ObjectID) bool

func (*BufferSet) EmplaceBuffer

func (s *BufferSet) EmplaceBuffer(id types.ObjectID, buffer *arrow.Buffer) error

func (*BufferSet) EmplaceBufferId

func (s *BufferSet) EmplaceBufferId(id types.ObjectID) error

func (*BufferSet) Get

func (s *BufferSet) Get(id types.ObjectID) (buffer *arrow.Buffer, err error)

func (*BufferSet) GetBufferIds

func (s *BufferSet) GetBufferIds() []types.ObjectID

func (*BufferSet) GetBuffers

func (s *BufferSet) GetBuffers() map[types.ObjectID]*arrow.Buffer

func (*BufferSet) Reset

func (s *BufferSet) Reset()

type ClientBase

type ClientBase struct {
	IPCSocket   string
	RPCEndpoint string

	InstanceID types.InstanceID
	// contains filtered or unexported fields
}

func (*ClientBase) CreateData

func (c *ClientBase) CreateData(
	tree map[string]any,
) (id types.ObjectID, signature types.Signature, instanceID types.InstanceID, err error)

func (*ClientBase) Delete

func (c *ClientBase) Delete(ids []types.ObjectID) error

func (*ClientBase) Disconnect

func (c *ClientBase) Disconnect()

func (*ClientBase) DropBuffer

func (c *ClientBase) DropBuffer(id types.ObjectID) error

func (*ClientBase) DropName

func (c *ClientBase) DropName(name string) error

func (*ClientBase) GetClusterMeta

func (c *ClientBase) GetClusterMeta() (map[string]any, error)

func (*ClientBase) GetData

func (c *ClientBase) GetData(
	ids []types.ObjectID,
	syncRemote bool,
	wait bool,
) (objects []map[string]any, err error)

func (*ClientBase) GetName

func (c *ClientBase) GetName(name string, wait bool) (id types.ObjectID, err error)

func (*ClientBase) IncreaseRefCount

func (c *ClientBase) IncreaseRefCount(ids []types.ObjectID) error

func (*ClientBase) Persist

func (c *ClientBase) Persist(id types.ObjectID) error

func (*ClientBase) PutName

func (c *ClientBase) PutName(id types.ObjectID, name string) error

func (*ClientBase) Release

func (c *ClientBase) Release(id types.ObjectID) error

func (*ClientBase) Seal

func (c *ClientBase) Seal(id types.ObjectID) error

func (*ClientBase) SyncMetaData

func (c *ClientBase) SyncMetaData() error

type IObject

type IObject interface {
	Construct(client *IPCClient, meta *ObjectMeta) error
}

type IObjectBuilder

type IObjectBuilder interface {
	Build(client *IPCClient) error
	Seal(client *IPCClient) (types.ObjectID, error)
}

type IPCClient

type IPCClient struct {
	*ClientBase
	// contains filtered or unexported fields
}

func NewIPCClient

func NewIPCClient(socket string) (*IPCClient, error)

Connect to IPCClient steps as follows

1. using unix socket connect to vineyard server 2. sending register request to server and get response from server

Note: you should send message's length first to server, then send message

func (*IPCClient) BuildBuffer

func (c *IPCClient) BuildBuffer(address []byte, size uint64) (types.ObjectID, error)

func (*IPCClient) CreateBuffer

func (c *IPCClient) CreateBuffer(size uint64) (blob BlobWriter, err error)

func (*IPCClient) CreateMetaData

func (c *IPCClient) CreateMetaData(metadata *ObjectMeta) (id types.ObjectID, err error)

func (*IPCClient) GetBuffer

func (c *IPCClient) GetBuffer(id types.ObjectID, unsafe bool) (Blob, error)

func (*IPCClient) GetBuffers

func (c *IPCClient) GetBuffers(
	ids []types.ObjectID,
	unsafe_ bool,
) (map[types.ObjectID]Blob, error)

func (*IPCClient) GetClusterInfo

func (c *IPCClient) GetClusterInfo() (map[string]any, error)

func (*IPCClient) GetMetaData

func (c *IPCClient) GetMetaData(id types.ObjectID, syncRemote bool) (meta *ObjectMeta, err error)

func (*IPCClient) GetObject

func (c *IPCClient) GetObject(id types.ObjectID, object IObject) error

func (*IPCClient) ListMetadata

func (c *IPCClient) ListMetadata(pattern string, regex bool, limit int) (map[string]map[string]any, error)

type MmapEntry

type MmapEntry struct {
	FD   int
	Size int64
	// contains filtered or unexported fields
}

type Object

type Object struct {
	Id   types.ObjectID
	Meta *ObjectMeta
}

func (*Object) Build

func (o *Object) Build(client *IPCClient) error

func (*Object) NBytes

func (o *Object) NBytes() uint64

func (*Object) Seal

func (o *Object) Seal(client *IPCClient) (types.ObjectID, error)

type ObjectBase

type ObjectBase interface {
	Build(client *IPCClient) error
	Seal(client *IPCClient) (types.ObjectID, error)
}

type ObjectMeta

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

func NewObjectMeta

func NewObjectMeta() *ObjectMeta

func (*ObjectMeta) AddKeyValue

func (m *ObjectMeta) AddKeyValue(key string, value any)

func (*ObjectMeta) AddMember

func (m *ObjectMeta) AddMember(key string, value *ObjectMeta)

func (*ObjectMeta) AddMemberId

func (m *ObjectMeta) AddMemberId(key string, value types.ObjectID)

func (*ObjectMeta) AddMemberObject

func (m *ObjectMeta) AddMemberObject(key string, value *Object)

func (*ObjectMeta) GetBuffer

func (m *ObjectMeta) GetBuffer(id types.ObjectID) (*arrow.Buffer, error)

func (*ObjectMeta) GetBuffers

func (m *ObjectMeta) GetBuffers() *BufferSet

func (*ObjectMeta) GetId

func (m *ObjectMeta) GetId() (types.ObjectID, error)

func (*ObjectMeta) GetInstanceId

func (m *ObjectMeta) GetInstanceId() (types.InstanceID, error)

func (*ObjectMeta) GetKeyValue

func (m *ObjectMeta) GetKeyValue(key string) (any, error)

func (*ObjectMeta) GetKeyValueBool

func (m *ObjectMeta) GetKeyValueBool(key string) (bool, error)

func (*ObjectMeta) GetKeyValueFloat32

func (m *ObjectMeta) GetKeyValueFloat32(key string) (float32, error)

func (*ObjectMeta) GetKeyValueFloat64

func (m *ObjectMeta) GetKeyValueFloat64(key string) (float64, error)

func (*ObjectMeta) GetKeyValueInt

func (m *ObjectMeta) GetKeyValueInt(key string) (int, error)

func (*ObjectMeta) GetKeyValueInt64

func (m *ObjectMeta) GetKeyValueInt64(key string) (int64, error)

func (*ObjectMeta) GetKeyValueString

func (m *ObjectMeta) GetKeyValueString(key string) (string, error)

func (*ObjectMeta) GetKeyValueUInt64

func (m *ObjectMeta) GetKeyValueUInt64(key string) (uint64, error)

func (*ObjectMeta) GetKeyValueUint

func (m *ObjectMeta) GetKeyValueUint(key string) (uint, error)

func (*ObjectMeta) GetMember

func (m *ObjectMeta) GetMember(client *IPCClient, key string, object IObject) error

func (*ObjectMeta) GetMemberMeta

func (m *ObjectMeta) GetMemberMeta(key string) (*ObjectMeta, error)

func (*ObjectMeta) GetNBytes

func (m *ObjectMeta) GetNBytes() (uint64, error)

func (*ObjectMeta) GetSignature

func (m *ObjectMeta) GetSignature() (types.Signature, error)

func (*ObjectMeta) GetTypeName

func (m *ObjectMeta) GetTypeName() (string, error)

func (*ObjectMeta) HasKey

func (m *ObjectMeta) HasKey(key string) bool

func (*ObjectMeta) InComplete

func (m *ObjectMeta) InComplete() bool

func (*ObjectMeta) Init

func (m *ObjectMeta) Init()

func (*ObjectMeta) IsGlobal

func (m *ObjectMeta) IsGlobal() bool

func (*ObjectMeta) IsLocal

func (m *ObjectMeta) IsLocal() bool

func (*ObjectMeta) IsTransient

func (m *ObjectMeta) IsTransient() bool

func (*ObjectMeta) MetaData

func (m *ObjectMeta) MetaData() map[string]any

func (*ObjectMeta) Reset

func (m *ObjectMeta) Reset()

func (*ObjectMeta) SetGlobal

func (m *ObjectMeta) SetGlobal()

func (*ObjectMeta) SetId

func (m *ObjectMeta) SetId(id types.ObjectID)

func (*ObjectMeta) SetInstanceId

func (m *ObjectMeta) SetInstanceId(id types.InstanceID)

func (*ObjectMeta) SetMetaData

func (m *ObjectMeta) SetMetaData(client *ClientBase, meta map[string]any)

func (*ObjectMeta) SetNBytes

func (m *ObjectMeta) SetNBytes(nbytes uint64)

func (*ObjectMeta) SetSignature

func (m *ObjectMeta) SetSignature(signature types.Signature)

func (*ObjectMeta) SetTransient

func (m *ObjectMeta) SetTransient(transient bool)

func (*ObjectMeta) SetTypeName

func (m *ObjectMeta) SetTypeName(typeName string)

type RPCClient

type RPCClient struct {
	*ClientBase
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(rpcEndpoint string) (*RPCClient, error)

func (*RPCClient) CreateMetaData

func (c *RPCClient) CreateMetaData(metadata *ObjectMeta) (id types.ObjectID, err error)

func (*RPCClient) GetClusterInfo

func (c *RPCClient) GetClusterInfo() (map[string]any, error)

func (*RPCClient) GetMetaData

func (c *RPCClient) GetMetaData(id types.ObjectID, syncRemote bool) (meta *ObjectMeta, err error)

func (*RPCClient) ListMetaData

func (c *RPCClient) ListMetaData(pattern string, regex bool, limit int) (map[string]map[string]any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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