hashtree

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthHashtree = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHashtree   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type DirectoryNodeProto

type DirectoryNodeProto struct {
	// Children of this directory. Note that paths are relative, so if "/foo/bar"
	// has a child "baz", that means that there is a file at "/foo/bar/baz".
	//
	// 'Children' is ordered alphabetically, to quickly check if a new file is
	// overwriting an existing one.
	Children             []string    `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
	Header               *pfs.Object `protobuf:"bytes,4,opt,name=header,proto3" json:"header,omitempty"`
	Footer               *pfs.Object `protobuf:"bytes,5,opt,name=footer,proto3" json:"footer,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

DirectoryNodeProto is a node corresponding to a directory.

func (*DirectoryNodeProto) Descriptor

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

func (*DirectoryNodeProto) GetChildren

func (m *DirectoryNodeProto) GetChildren() []string

func (*DirectoryNodeProto) GetFooter

func (m *DirectoryNodeProto) GetFooter() *pfs.Object

func (*DirectoryNodeProto) GetHeader

func (m *DirectoryNodeProto) GetHeader() *pfs.Object

func (*DirectoryNodeProto) Marshal

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

func (*DirectoryNodeProto) MarshalTo

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

func (*DirectoryNodeProto) ProtoMessage

func (*DirectoryNodeProto) ProtoMessage()

func (*DirectoryNodeProto) Reset

func (m *DirectoryNodeProto) Reset()

func (*DirectoryNodeProto) Size

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

func (*DirectoryNodeProto) String

func (m *DirectoryNodeProto) String() string

func (*DirectoryNodeProto) Unmarshal

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

func (*DirectoryNodeProto) XXX_DiscardUnknown

func (m *DirectoryNodeProto) XXX_DiscardUnknown()

func (*DirectoryNodeProto) XXX_Marshal

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

func (*DirectoryNodeProto) XXX_Merge

func (dst *DirectoryNodeProto) XXX_Merge(src proto.Message)

func (*DirectoryNodeProto) XXX_Size

func (m *DirectoryNodeProto) XXX_Size() int

func (*DirectoryNodeProto) XXX_Unmarshal

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

type FileNodeProto

type FileNodeProto struct {
	// Object references an object in the object store which contains the content
	// of the data.
	Objects              []*pfs.Object `protobuf:"bytes,4,rep,name=objects,proto3" json:"objects,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

FileNodeProto is a node corresponding to a file (which is also a leaf node).

func (*FileNodeProto) Descriptor

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

func (*FileNodeProto) GetObjects

func (m *FileNodeProto) GetObjects() []*pfs.Object

func (*FileNodeProto) Marshal

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

func (*FileNodeProto) MarshalTo

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

func (*FileNodeProto) ProtoMessage

func (*FileNodeProto) ProtoMessage()

func (*FileNodeProto) Reset

func (m *FileNodeProto) Reset()

func (*FileNodeProto) Size

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

func (*FileNodeProto) String

func (m *FileNodeProto) String() string

func (*FileNodeProto) Unmarshal

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

func (*FileNodeProto) XXX_DiscardUnknown

func (m *FileNodeProto) XXX_DiscardUnknown()

func (*FileNodeProto) XXX_Marshal

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

func (*FileNodeProto) XXX_Merge

func (dst *FileNodeProto) XXX_Merge(src proto.Message)

func (*FileNodeProto) XXX_Size

func (m *FileNodeProto) XXX_Size() int

func (*FileNodeProto) XXX_Unmarshal

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

type HashTreeProto

type HashTreeProto struct {
	// Version is an arbitrary version number, set by the corresponding library
	// in hashtree.go.  This ensures that if the hash function used to create
	// these trees is changed, we won't run into errors when deserializing old
	// trees. The current version is 1.
	Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// Fs maps each node's path to the NodeProto with that node's details.
	// See "Potential Optimizations" at the end for a compression scheme that
	// could be useful if this map gets too large.
	//
	// Note that the key must end in "/" if an only if the value has .dir_node set
	// (i.e. iff the path points to a directory).
	Fs                   map[string]*NodeProto `` /* 145-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

HashTreeProto is a tree corresponding to the complete file contents of a pachyderm repo at a given commit (based on a Merkle Tree). We store one HashTree for every PFS commit.

func (*HashTreeProto) Descriptor

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

func (*HashTreeProto) GetFs

func (m *HashTreeProto) GetFs() map[string]*NodeProto

func (*HashTreeProto) GetVersion

func (m *HashTreeProto) GetVersion() int32

func (*HashTreeProto) Marshal

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

func (*HashTreeProto) MarshalTo

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

func (*HashTreeProto) ProtoMessage

func (*HashTreeProto) ProtoMessage()

func (*HashTreeProto) Reset

func (m *HashTreeProto) Reset()

func (*HashTreeProto) Size

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

func (*HashTreeProto) String

func (m *HashTreeProto) String() string

func (*HashTreeProto) Unmarshal

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

func (*HashTreeProto) XXX_DiscardUnknown

func (m *HashTreeProto) XXX_DiscardUnknown()

func (*HashTreeProto) XXX_Marshal

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

func (*HashTreeProto) XXX_Merge

func (dst *HashTreeProto) XXX_Merge(src proto.Message)

func (*HashTreeProto) XXX_Size

func (m *HashTreeProto) XXX_Size() int

func (*HashTreeProto) XXX_Unmarshal

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

type NodeProto

type NodeProto struct {
	// Name is the name (not path) of the file/directory (e.g. /lib).
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Hash is a hash of the node's name and contents (which includes the
	// BlockRefs of a file and the Children of a directory). This can be used to
	// detect if the name or contents have changed between versions.
	Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// subtree_size is the of the subtree under node; i.e. if this is a directory,
	// subtree_size includes all children.
	SubtreeSize int64 `protobuf:"varint,3,opt,name=subtree_size,json=subtreeSize,proto3" json:"subtree_size,omitempty"`
	// Exactly one of the following fields must be set. The type of this node will
	// be determined by which field is set.
	FileNode             *FileNodeProto      `protobuf:"bytes,4,opt,name=file_node,json=fileNode,proto3" json:"file_node,omitempty"`
	DirNode              *DirectoryNodeProto `protobuf:"bytes,5,opt,name=dir_node,json=dirNode,proto3" json:"dir_node,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

NodeProto is a node in the file tree (either a file or a directory)

func (*NodeProto) Descriptor

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

func (*NodeProto) GetDirNode

func (m *NodeProto) GetDirNode() *DirectoryNodeProto

func (*NodeProto) GetFileNode

func (m *NodeProto) GetFileNode() *FileNodeProto

func (*NodeProto) GetHash

func (m *NodeProto) GetHash() []byte

func (*NodeProto) GetName

func (m *NodeProto) GetName() string

func (*NodeProto) GetSubtreeSize

func (m *NodeProto) GetSubtreeSize() int64

func (*NodeProto) Marshal

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

func (*NodeProto) MarshalTo

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

func (*NodeProto) ProtoMessage

func (*NodeProto) ProtoMessage()

func (*NodeProto) Reset

func (m *NodeProto) Reset()

func (*NodeProto) Size

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

func (*NodeProto) String

func (m *NodeProto) String() string

func (*NodeProto) Unmarshal

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

func (*NodeProto) XXX_DiscardUnknown

func (m *NodeProto) XXX_DiscardUnknown()

func (*NodeProto) XXX_Marshal

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

func (*NodeProto) XXX_Merge

func (dst *NodeProto) XXX_Merge(src proto.Message)

func (*NodeProto) XXX_Size

func (m *NodeProto) XXX_Size() int

func (*NodeProto) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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