storagepb

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 39

Documentation

Overview

Package storagepb contains protobuf definitions used by various storage implementations.

TODO(pavelkalinnikov, v2): SubtreeProto is used as:

a) database storage unit in multiple storage implementations;
b) data exchange format between storage and application layers;
c) nodes index data structure.

We should change it so that:

a) individual storage implementations define their own formats;
b) data structures are defined in the application layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeIDProto

type NodeIDProto struct {
	Path                 []byte   `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	PrefixLenBits        int32    `protobuf:"varint,2,opt,name=prefix_len_bits,json=prefixLenBits,proto3" json:"prefix_len_bits,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

NodeIDProto is the serialized form of NodeID. It's used only for persistence in storage. As this is long-term we prefer not to use a Go specific format.

func (*NodeIDProto) Descriptor

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

func (*NodeIDProto) GetPath

func (m *NodeIDProto) GetPath() []byte

func (*NodeIDProto) GetPrefixLenBits

func (m *NodeIDProto) GetPrefixLenBits() int32

func (*NodeIDProto) ProtoMessage

func (*NodeIDProto) ProtoMessage()

func (*NodeIDProto) Reset

func (m *NodeIDProto) Reset()

func (*NodeIDProto) String

func (m *NodeIDProto) String() string

func (*NodeIDProto) XXX_DiscardUnknown added in v1.2.1

func (m *NodeIDProto) XXX_DiscardUnknown()

func (*NodeIDProto) XXX_Marshal added in v1.2.1

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

func (*NodeIDProto) XXX_Merge added in v1.2.1

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

func (*NodeIDProto) XXX_Size added in v1.2.1

func (m *NodeIDProto) XXX_Size() int

func (*NodeIDProto) XXX_Unmarshal added in v1.2.1

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

type SubtreeProto

type SubtreeProto struct {
	// subtree's prefix (must be a multiple of 8 bits)
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// subtree's depth
	Depth    int32  `protobuf:"varint,2,opt,name=depth,proto3" json:"depth,omitempty"`
	RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"`
	// map of suffix (within subtree) to subtree-leaf node hash
	Leaves map[string][]byte `` /* 153-byte string literal not displayed */
	// Map of suffix (within subtree) to subtree-internal node hash.
	// This structure is usually used in RAM as a cache, the internal nodes of
	// the subtree are not generally stored. However internal nodes are stored for
	// partially filled log subtrees.
	InternalNodes map[string][]byte `` /* 188-byte string literal not displayed */
	// Used as a crosscheck on the internal node map by recording its expected
	// size after loading and repopulation.
	InternalNodeCount    uint32   `protobuf:"varint,6,opt,name=internal_node_count,json=internalNodeCount,proto3" json:"internal_node_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SubtreeProto contains nodes of a subtree.

func (*SubtreeProto) Descriptor

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

func (*SubtreeProto) GetDepth

func (m *SubtreeProto) GetDepth() int32

func (*SubtreeProto) GetInternalNodeCount

func (m *SubtreeProto) GetInternalNodeCount() uint32

func (*SubtreeProto) GetInternalNodes

func (m *SubtreeProto) GetInternalNodes() map[string][]byte

func (*SubtreeProto) GetLeaves

func (m *SubtreeProto) GetLeaves() map[string][]byte

func (*SubtreeProto) GetPrefix

func (m *SubtreeProto) GetPrefix() []byte

func (*SubtreeProto) GetRootHash

func (m *SubtreeProto) GetRootHash() []byte

func (*SubtreeProto) ProtoMessage

func (*SubtreeProto) ProtoMessage()

func (*SubtreeProto) Reset

func (m *SubtreeProto) Reset()

func (*SubtreeProto) String

func (m *SubtreeProto) String() string

func (*SubtreeProto) XXX_DiscardUnknown added in v1.2.1

func (m *SubtreeProto) XXX_DiscardUnknown()

func (*SubtreeProto) XXX_Marshal added in v1.2.1

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

func (*SubtreeProto) XXX_Merge added in v1.2.1

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

func (*SubtreeProto) XXX_Size added in v1.2.1

func (m *SubtreeProto) XXX_Size() int

func (*SubtreeProto) XXX_Unmarshal added in v1.2.1

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

Directories

Path Synopsis
Package convert contains helpers used by storage implementations.
Package convert contains helpers used by storage implementations.

Jump to

Keyboard shortcuts

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