common

package
v0.0.0-...-728477c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VINEYARD_VERSION_MAJOR = 0
	VINEYARD_VERSION_MINOR = 7
	VINEYARD_VERSION_PATCH = 2

	VINEYARD_VERSION = ((VINEYARD_VERSION_MAJOR*1000)+VINEYARD_VERSION_MINOR)*1000 +
		VINEYARD_VERSION_PATCH
)
View Source
const (
	REGISTER_REQUEST = "register_request"
	REGISTER_REPLY   = "register_reply"
	EXIT_REQUEST     = "exit_request"
	EXIT_REPLY       = "exit_reply"

	CREATE_BUFFER_REQUEST      = "create_buffer_request"
	CREATE_BUFFER_REPLY        = "create_buffer_reply"
	CREATE_DISK_BUFFER_REQUEST = "create_disk_buffer_request"
	CREATE_DISK_BUFFER_REPLY   = "create_disk_buffer_reply"
	CREATE_GPU_BUFFER_REQUEST  = "create_gpu_buffer_request"
	CREATE_GPU_BUFFER_REPLY    = "create_gpu_buffer_reply"
	SEAL_BUFFER_REQUEST        = "seal_request"
	SEAL_BUFFER_REPLY          = "seal_reply"
	GET_BUFFERS_REQUEST        = "get_buffers_request"
	GET_BUFFERS_REPLY          = "get_buffers_reply"
	GET_GPU_BUFFERS_REQUEST    = "get_gpu_buffers_request"
	GET_GPU_BUFFERS_REPLY      = "get_gpu_buffers_reply"
	DROP_BUFFER_REQUEST        = "drop_buffer_request"
	DROP_BUFFER_REPLY          = "drop_buffer_reply"

	CREATE_REMOTE_BUFFERS_REQUEST = "create_remote_buffers_request"
	CREATE_REMOTE_BUFFERS_REPLY   = "create_remote_buffers_reply"
	GET_REMOTE_BUFFERS_REQUEST    = "get_remote_buffers_request"
	GET_REMOTE_BUFFERS_REPLY      = "get_remote_buffers_reply"

	INCREASE_REFERENCE_COUNT_REQUEST = "increase_reference_count_request"
	INCREASE_REFERENCE_COUNT_REPLY   = "increase_reference_count_reply"
	RELEASE_REQUEST                  = "release_request"
	RELEASE_REPLY                    = "release_reply"
	DEL_DATA_WITH_FEEDBACK_REQUEST   = "del_data_with_feedback_request"
	DEL_DATA_WITH_FEEDBACK_REPLY     = "del_data_with_feedback_reply"

	CREATE_BUFFER_PLASMA_REQUEST = "create_buffer_by_plasma_request"
	CREATE_BUFFER_PLASMA_REPLY   = "create_buffer_by_plasma_reply"
	GET_BUFFERS_PLASMA_REQUEST   = "get_buffers_by_plasma_request"
	GET_BUFFERS_PLASMA_REPLY     = "get_buffers_by_plasma_reply"
	PLASMA_SEAL_REQUEST          = "plasma_seal_request"
	PLASMA_SEAL_REPLY            = "plasma_seal_reply"
	PLASMA_RELEASE_REQUEST       = "plasma_release_request"
	PLASMA_RELEASE_REPLY         = "plasma_release_reply"
	PLASMA_DEL_DATA_REQUEST      = "plasma_del_data_request"

	CREATE_DATA_REQUEST = "create_data_request"
	CREATE_DATA_REPLY   = "create_data_reply"
	GET_DATA_REQUEST    = "get_data_request"
	GET_DATA_REPLY      = "get_data_reply"
	LIST_DATA_REQUEST   = "list_data_request"
	LIST_DATA_REPLY     = "list_data_reply"
	DELETE_DATA_REQUEST = "del_data_request"
	DELETE_DATA_REPLY   = "del_data_reply"
	EXISTS_REQUEST      = "exists_request"
	EXISTS_REPLY        = "exists_reply"
	PERSIST_REQUEST     = "persist_request"
	PERSIST_REPLY       = "persist_reply"
	IF_PERSIST_REQUEST  = "if_persist_request"
	IF_PERSIST_REPLY    = "if_persist_reply"
	LABEL_REQUEST       = "label_request"
	LABEL_REPLY         = "label_reply"
	CLEAR_REQUEST       = "clear_request"
	CLEAR_REPLY         = "clear_reply"

	CREATE_STREAM_REQUEST          = "create_stream_request"
	CREATE_STREAM_REPLY            = "create_stream_reply"
	OPEN_STREAM_REQUEST            = "open_stream_request"
	OPEN_STREAM_REPLY              = "open_stream_reply"
	GET_NEXT_STREAM_CHUNK_REQUEST  = "get_next_stream_chunk_request"
	GET_NEXT_STREAM_CHUNK_REPLY    = "get_next_stream_chunk_reply"
	PUSH_NEXT_STREAM_CHUNK_REQUEST = "push_next_stream_chunk_request"
	PUSH_NEXT_STREAM_CHUNK_REPLY   = "push_next_stream_chunk_reply"
	PULL_NEXT_STREAM_CHUNK_REQUEST = "pull_next_stream_chunk_request"
	PULL_NEXT_STREAM_CHUNK_REPLY   = "pull_next_stream_chunk_reply"
	STOP_STREAM_REQUEST            = "stop_stream_request"
	STOP_STREAM_REPLY              = "stop_stream_reply"
	DROP_STREAM_REQUEST            = "drop_stream_request"
	DROP_STREAM_REPLY              = "drop_stream_reply"

	PUT_NAME_REQUEST  = "put_name_request"
	PUT_NAME_REPLY    = "put_name_reply"
	GET_NAME_REQUEST  = "get_name_request"
	GET_NAME_REPLY    = "get_name_reply"
	LIST_NAME_REQUEST = "list_name_request"
	LIST_NAME_REPLY   = "list_name_reply"
	DROP_NAME_REQUEST = "drop_name_request"
	DROP_NAME_REPLY   = "drop_name_reply"

	MAKE_ARENA_REQUEST     = "make_arena_request"
	MAKE_ARENA_REPLY       = "make_arena_reply"
	FINALIZE_ARENA_REQUEST = "finalize_arena_request"
	FINALIZE_ARENA_REPLY   = "finalize_arena_reply"

	NEW_SESSION_REQUEST    = "new_session_request"
	NEW_SESSION_REPLY      = "new_session_reply"
	DELETE_SESSION_REQUEST = "delete_session_request"
	DELETE_SESSION_REPLY   = "delete_session_reply"

	MOVE_BUFFERS_OWNERSHIP_REQUEST = "move_buffers_ownership_request"
	MOVE_BUFFERS_OWNERSHIP_REPLY   = "move_buffers_ownership_reply"

	EVICT_REQUEST      = "evict_request"
	EVICT_REPLY        = "evict_reply"
	LOAD_REQUEST       = "load_request"
	LOAD_REPLY         = "load_reply"
	UNPIN_REQUEST      = "unpin_request"
	UNPIN_REPLY        = "unpin_reply"
	IS_SPILLED_REQUEST = "is_spilled_request"
	IS_SPILLED_REPLY   = "is_spilled_reply"
	IS_IN_USE_REQUEST  = "is_in_use_request"
	IS_IN_USE_REPLY    = "is_in_use_reply"

	CLUSTER_META_REQUEST    = "cluster_meta"
	CLUSTER_META_REPLY      = "cluster_meta"
	INSTANCE_STATUS_REQUEST = "instance_status_request"
	INSTANCE_STATUS_REPLY   = "instance_status_reply"
	MIGRATE_OBJECT_REQUEST  = "migrate_object_request"
	MIGRATE_OBJECT_REPLY    = "migrate_object_reply"
	SHALLOW_COPY_REQUEST    = "shallow_copy_request"
	SHALLOW_COPY_REPLY      = "shallow_copy_reply"
	DEBUG_COMMAND           = "debug_command"
	DEBUG_REPLY             = "debug_reply"

	STORE_TYPE_NORMAL = "Normal"
	STORE_TYPE_PLASMA = "Plasma"
)
View Source
const (
	KOK                       = 0
	KInvalid                  = 1
	KKeyError                 = 2
	KTypeError                = 3
	KIOError                  = 4
	KEndOfFile                = 5
	KNotImplemented           = 6
	KAssertionFailed          = 7
	KUserInputError           = 8
	KObjectExists             = 11
	KObjectNotExists          = 12
	KObjectSealed             = 13
	KObjectNotSealed          = 14
	KObjectIsBlob             = 15
	KMetaTreeInvalid          = 21
	KMetaTreeTypeInvalid      = 22
	KMetaTreeTypeNotExists    = 23
	KMetaTreeNameInvalid      = 24
	KMetaTreeNameNotExists    = 25
	KMetaTreeLinKInvalid      = 26
	KMetaTreeSubtreeNotExists = 27
	KVineyardServerNotReady   = 31
	KArrowError               = 32
	KConnectionFailed         = 33
	KConnectionError          = 34
	KEtcdError                = 35
	KNotEnoughMemory          = 41
	KStreamDrained            = 42
	KStreamFailed             = 43
	KInvalidStreamState       = 44
	KStreamOpened             = 45
	KGlobalObjectInvalid      = 51
	KUnKnownError             = 255
)

Variables

View Source
var ErrCodes map[int]string

Functions

func Error

func Error(code int, message string) error

func GetBoolean

func GetBoolean(data map[string]any, key string) (bool, error)

func GetFloat32

func GetFloat32(data map[string]any, key string) (float32, error)

func GetFloat64

func GetFloat64(data map[string]any, key string) (float64, error)

func GetInt

func GetInt(data map[string]any, key string) (int, error)

func GetInt16

func GetInt16(data map[string]any, key string) (int16, error)

func GetInt32

func GetInt32(data map[string]any, key string) (int32, error)

func GetInt64

func GetInt64(data map[string]any, key string) (int64, error)

func GetInt8

func GetInt8(data map[string]any, key string) (int8, error)

func GetString

func GetString(data map[string]any, key string) (string, error)

func GetUint

func GetUint(data map[string]any, key string) (uint, error)

func GetUint16

func GetUint16(data map[string]any, key string) (uint16, error)

func GetUint32

func GetUint32(data map[string]any, key string) (uint32, error)

func GetUint64

func GetUint64(data map[string]any, key string) (uint64, error)

func GetUint8

func GetUint8(data map[string]any, key string) (uint8, error)

func NotConnected

func NotConnected() error

func ParseJson

func ParseJson(data []byte, v any) error

func ParseJsonString

func ParseJsonString(data string, v any) error

func ReplyTypeMismatch

func ReplyTypeMismatch(t string) error

func WriteClearRequest

func WriteClearRequest() []byte

func WriteClusterMetaRequest

func WriteClusterMetaRequest() []byte

func WriteCreateBufferRequest

func WriteCreateBufferRequest(size uint64) []byte

func WriteCreateDataRequest

func WriteCreateDataRequest(content map[string]any) []byte

func WriteDeleteDataRequest

func WriteDeleteDataRequest(id []types.ObjectID, fastpath bool) []byte

func WriteDropBufferRequest

func WriteDropBufferRequest(id types.ObjectID) []byte

func WriteDropNameRequest

func WriteDropNameRequest(name string) []byte

func WriteEvictRequest

func WriteEvictRequest(ids []types.ObjectID) []byte

func WriteExistsRequest

func WriteExistsRequest(id types.ObjectID) []byte

func WriteExitRequest

func WriteExitRequest() []byte

func WriteGetBuffersRequest

func WriteGetBuffersRequest(ids []types.ObjectID, unsafe bool) []byte

func WriteGetDataRequest

func WriteGetDataRequest(id []types.ObjectID, syncRemote bool, wait bool) []byte

func WriteGetNameRequest

func WriteGetNameRequest(name string, wait bool) []byte

func WriteIfPersistRequest

func WriteIfPersistRequest(id types.ObjectID) []byte

func WriteIncreaseRefCountRequest

func WriteIncreaseRefCountRequest(ids []types.ObjectID) []byte

func WriteInstanceStatusRequest

func WriteInstanceStatusRequest() []byte

func WriteIsInUseRequest

func WriteIsInUseRequest(id types.ObjectID) []byte

func WriteIsSpilledRequest

func WriteIsSpilledRequest(id types.ObjectID) []byte

func WriteLabelRequest

func WriteLabelRequest(id types.ObjectID, key string, value string) []byte

func WriteLabelsRequest

func WriteLabelsRequest(id types.ObjectID, keys []string, values []string) []byte

func WriteListDataRequest

func WriteListDataRequest(pattern string, regex bool, limit int) []byte

func WriteListNameRequest

func WriteListNameRequest(pattern string, regex bool, limit int) []byte

func WriteLoadRequest

func WriteLoadRequest(ids []types.ObjectID, pin bool) []byte

func WriteMigrateObjectRequest

func WriteMigrateObjectRequest(id types.ObjectID) []byte

func WritePersistRequest

func WritePersistRequest(id types.ObjectID) []byte

func WritePutNameRequest

func WritePutNameRequest(id types.ObjectID, name string) []byte

func WriteRegisterRequest

func WriteRegisterRequest(version string) []byte

func WriteReleaseRequest

func WriteReleaseRequest(id types.ObjectID) []byte

func WriteSealRequest

func WriteSealRequest(id types.ObjectID) []byte

func WriteUnpinRequest

func WriteUnpinRequest(ids []types.ObjectID) []byte

Types

type ClearReply

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

func (*ClearReply) Check

func (reply *ClearReply) Check() error

type ClearRequest

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

type ClusterMetaReply

type ClusterMetaReply struct {
	Meta any `json:"meta"`
	// contains filtered or unexported fields
}

func (*ClusterMetaReply) Check

func (reply *ClusterMetaReply) Check() error

type ClusterMetaRequest

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

type CreateBufferReply

type CreateBufferReply struct {
	Created types.Payload `json:"created"`
	// contains filtered or unexported fields
}

func (*CreateBufferReply) Check

func (reply *CreateBufferReply) Check() error

type CreateBufferRequest

type CreateBufferRequest struct {
	Size uint64 `json:"size"`
	// contains filtered or unexported fields
}

type CreateDataReply

type CreateDataReply struct {
	ID         types.ObjectID   `json:"id"`
	Signature  types.Signature  `json:"signature"`
	InstanceID types.InstanceID `json:"instance_id"`
	// contains filtered or unexported fields
}

func (*CreateDataReply) Check

func (reply *CreateDataReply) Check() error

type CreateDataRequest

type CreateDataRequest struct {
	Content map[string]any `json:"content"`
	// contains filtered or unexported fields
}

type DeleteDataReply

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

func (*DeleteDataReply) Check

func (reply *DeleteDataReply) Check() error

type DeleteDataRequest

type DeleteDataRequest struct {
	ID       []types.ObjectID `json:"id"`
	Fastpath bool             `json:"fastpath"`
	// contains filtered or unexported fields
}

type DropBufferReply

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

func (*DropBufferReply) Check

func (reply *DropBufferReply) Check() error

type DropBufferRequest

type DropBufferRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type DropNameReply

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

func (*DropNameReply) Check

func (reply *DropNameReply) Check() error

type DropNameRequest

type DropNameRequest struct {
	Name string `json:"name"`
	// contains filtered or unexported fields
}

type EvictReply

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

func (*EvictReply) Check

func (reply *EvictReply) Check() error

type EvictRequest

type EvictRequest struct {
	IDs []types.ObjectID `json:"ids"`
	// contains filtered or unexported fields
}

type ExistsReply

type ExistsReply struct {
	Exists bool `json:"exists"`
	// contains filtered or unexported fields
}

func (*ExistsReply) Check

func (reply *ExistsReply) Check() error

type ExistsRequest

type ExistsRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type ExitRequest

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

type GetBuffersReply

type GetBuffersReply struct {
	Fds      []int           `json:"fds"`
	Payloads []types.Payload `json:"payloads"`
	Compress bool            `json:"compress"`
	// contains filtered or unexported fields
}

func (*GetBuffersReply) Check

func (reply *GetBuffersReply) Check() error

type GetBuffersRequest

type GetBuffersRequest struct {
	IDs    []types.ObjectID `json:"ids"`
	Unsafe bool             `json:"unsafe"`
	// contains filtered or unexported fields
}

type GetDataReply

type GetDataReply struct {
	Content map[string]map[string]any `json:"content"`
	// contains filtered or unexported fields
}

func (*GetDataReply) Check

func (reply *GetDataReply) Check() error

type GetDataRequest

type GetDataRequest struct {
	ID         []types.ObjectID `json:"id"`
	SyncRemote bool             `json:"sync_remote"`
	Wait       bool             `json:"wait"`
	// contains filtered or unexported fields
}

type GetNameReply

type GetNameReply struct {
	ID types.ObjectID `json:"object_id"`
	// contains filtered or unexported fields
}

func (*GetNameReply) Check

func (reply *GetNameReply) Check() error

type GetNameRequest

type GetNameRequest struct {
	Name string `json:"name"`
	Wait bool   `json:"wait"`
	// contains filtered or unexported fields
}

type IfPersistReply

type IfPersistReply struct {
	Persist bool `json:"persist"`
	// contains filtered or unexported fields
}

func (*IfPersistReply) Check

func (reply *IfPersistReply) Check() error

type IfPersistRequest

type IfPersistRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type IncreaseRefCountReply

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

func (*IncreaseRefCountReply) Check

func (reply *IncreaseRefCountReply) Check() error

type IncreaseRefCountRequest

type IncreaseRefCountRequest struct {
	IDs []types.ObjectID `json:"ids"`
	// contains filtered or unexported fields
}

type InstanceStatusReply

type InstanceStatusReply struct {
	Meta any `json:"meta"`
	// contains filtered or unexported fields
}

func (*InstanceStatusReply) Check

func (reply *InstanceStatusReply) Check() error

type InstanceStatusRequest

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

type IsInUseReply

type IsInUseReply struct {
	InUse bool `json:"is_in_use"`
	// contains filtered or unexported fields
}

func (*IsInUseReply) Check

func (reply *IsInUseReply) Check() error

type IsInUseRequest

type IsInUseRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type IsSpilledReply

type IsSpilledReply struct {
	Spilled bool `json:"is_spilled"`
	// contains filtered or unexported fields
}

func (*IsSpilledReply) Check

func (reply *IsSpilledReply) Check() error

type IsSpilledRequest

type IsSpilledRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type LabelReply

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

func (*LabelReply) Check

func (reply *LabelReply) Check() error

type LabelRequest

type LabelRequest struct {
	ID     types.ObjectID `json:"id"`
	Keys   []string       `json:"keys"`
	Values []string       `json:"values"`
	// contains filtered or unexported fields
}

type ListDataReply

type ListDataReply struct {
	Content map[string]map[string]any `json:"content"`
	// contains filtered or unexported fields
}

func (*ListDataReply) Check

func (reply *ListDataReply) Check() error

type ListDataRequest

type ListDataRequest struct {
	Pattern string `json:"pattern"`
	Regex   bool   `json:"regex"`
	Limit   int    `json:"limit"`
	// contains filtered or unexported fields
}

type ListNameReply

type ListNameReply struct {
	Names map[string]types.ObjectID `json:"names"`
	// contains filtered or unexported fields
}

func (*ListNameReply) Check

func (reply *ListNameReply) Check() error

type ListNameRequest

type ListNameRequest struct {
	Pattern string `json:"pattern"`
	Regex   bool   `json:"regex"`
	Limit   int    `json:"limit"`
	// contains filtered or unexported fields
}

type LoadReply

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

func (*LoadReply) Check

func (reply *LoadReply) Check() error

type LoadRequest

type LoadRequest struct {
	IDs []types.ObjectID `json:"ids"`
	Pin bool             `json:"pin"`
	// contains filtered or unexported fields
}

type MigrateObjectReply

type MigrateObjectReply struct {
	ID types.ObjectID `json:"object_id"`
	// contains filtered or unexported fields
}

func (*MigrateObjectReply) Check

func (reply *MigrateObjectReply) Check() error

type MigrateObjectRequest

type MigrateObjectRequest struct {
	ID types.ObjectID `json:"object_id"`
	// contains filtered or unexported fields
}

type PersistReply

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

func (*PersistReply) Check

func (reply *PersistReply) Check() error

type PersistRequest

type PersistRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type PutNameReply

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

func (*PutNameReply) Check

func (reply *PutNameReply) Check() error

type PutNameRequest

type PutNameRequest struct {
	ID   types.ObjectID `json:"object_id"`
	Name string         `json:"name"`
	// contains filtered or unexported fields
}

type RegisterReply

type RegisterReply struct {
	IPCSocket   string           `json:"ipc_socket"`
	RPCEndpoint string           `json:"rpc_endpoint"`
	InstanceID  types.InstanceID `json:"instance_id"`
	Version     string           `json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterReply) Check

func (reply *RegisterReply) Check() error

type RegisterRequest

type RegisterRequest struct {
	Version   string `json:"version"`
	StoreType string `json:"store_type"`
	// contains filtered or unexported fields
}

type ReleaseReply

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

func (*ReleaseReply) Check

func (reply *ReleaseReply) Check() error

type ReleaseRequest

type ReleaseRequest struct {
	ID types.ObjectID `json:"id"`
	// contains filtered or unexported fields
}

type Reply

type Reply interface {
	Check() error
}

type SealReply

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

func (*SealReply) Check

func (reply *SealReply) Check() error

type SealRequest

type SealRequest struct {
	ID types.ObjectID `json:"object_id"`
	// contains filtered or unexported fields
}

type Status

type Status struct {
	Code    int
	Message string
}

func (*Status) Error

func (r *Status) Error() string

func (*Status) Wrap

func (r *Status) Wrap() error

type UnpinReply

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

func (*UnpinReply) Check

func (reply *UnpinReply) Check() error

type UnpinRequest

type UnpinRequest struct {
	IDs []types.ObjectID `json:"ids"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package log contains the global logger for the vineyard operator.
Package log contains the global logger for the vineyard operator.

Jump to

Keyboard shortcuts

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