/
hashtree.pb.go
204 lines (178 loc) · 8.47 KB
/
hashtree.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// Code generated by protoc-gen-gogo.
// source: server/pkg/hashtree/hashtree.proto
// DO NOT EDIT!
/*
Package hashtree is a generated protocol buffer package.
It is generated from these files:
server/pkg/hashtree/hashtree.proto
It has these top-level messages:
FileNodeProto
DirectoryNodeProto
NodeProto
HashTreeProto
*/
package hashtree
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import pfs "github.com/pachyderm/pachyderm/src/client/pfs"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// FileNodeProto is a node corresponding to a file (which is also a leaf node).
type FileNodeProto struct {
// BlockRefs are references to the file's contents in block storage.
// Naturally, the blocks are ordered with respect to their position in the
// file (block with initial content is first)
BlockRefs []*pfs.BlockRef `protobuf:"bytes,3,rep,name=block_refs,json=blockRefs" json:"block_refs,omitempty"`
}
func (m *FileNodeProto) Reset() { *m = FileNodeProto{} }
func (m *FileNodeProto) String() string { return proto.CompactTextString(m) }
func (*FileNodeProto) ProtoMessage() {}
func (*FileNodeProto) Descriptor() ([]byte, []int) { return fileDescriptorHashtree, []int{0} }
func (m *FileNodeProto) GetBlockRefs() []*pfs.BlockRef {
if m != nil {
return m.BlockRefs
}
return nil
}
// DirectoryNodeProto is a node corresponding to a directory.
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" json:"children,omitempty"`
}
func (m *DirectoryNodeProto) Reset() { *m = DirectoryNodeProto{} }
func (m *DirectoryNodeProto) String() string { return proto.CompactTextString(m) }
func (*DirectoryNodeProto) ProtoMessage() {}
func (*DirectoryNodeProto) Descriptor() ([]byte, []int) { return fileDescriptorHashtree, []int{1} }
func (m *DirectoryNodeProto) GetChildren() []string {
if m != nil {
return m.Children
}
return nil
}
// NodeProto is a node in the file tree (either a file or a directory)
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" json:"file_node,omitempty"`
DirNode *DirectoryNodeProto `protobuf:"bytes,5,opt,name=dir_node,json=dirNode" json:"dir_node,omitempty"`
}
func (m *NodeProto) Reset() { *m = NodeProto{} }
func (m *NodeProto) String() string { return proto.CompactTextString(m) }
func (*NodeProto) ProtoMessage() {}
func (*NodeProto) Descriptor() ([]byte, []int) { return fileDescriptorHashtree, []int{2} }
func (m *NodeProto) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *NodeProto) GetHash() []byte {
if m != nil {
return m.Hash
}
return nil
}
func (m *NodeProto) GetSubtreeSize() int64 {
if m != nil {
return m.SubtreeSize
}
return 0
}
func (m *NodeProto) GetFileNode() *FileNodeProto {
if m != nil {
return m.FileNode
}
return nil
}
func (m *NodeProto) GetDirNode() *DirectoryNodeProto {
if m != nil {
return m.DirNode
}
return nil
}
// 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.
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 `protobuf:"bytes,2,rep,name=fs" json:"fs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *HashTreeProto) Reset() { *m = HashTreeProto{} }
func (m *HashTreeProto) String() string { return proto.CompactTextString(m) }
func (*HashTreeProto) ProtoMessage() {}
func (*HashTreeProto) Descriptor() ([]byte, []int) { return fileDescriptorHashtree, []int{3} }
func (m *HashTreeProto) GetVersion() int32 {
if m != nil {
return m.Version
}
return 0
}
func (m *HashTreeProto) GetFs() map[string]*NodeProto {
if m != nil {
return m.Fs
}
return nil
}
func init() {
proto.RegisterType((*FileNodeProto)(nil), "FileNodeProto")
proto.RegisterType((*DirectoryNodeProto)(nil), "DirectoryNodeProto")
proto.RegisterType((*NodeProto)(nil), "NodeProto")
proto.RegisterType((*HashTreeProto)(nil), "HashTreeProto")
}
func init() { proto.RegisterFile("server/pkg/hashtree/hashtree.proto", fileDescriptorHashtree) }
var fileDescriptorHashtree = []byte{
// 345 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x51, 0x4f, 0x4b, 0xfb, 0x40,
0x14, 0x64, 0x93, 0xf6, 0xd7, 0xe6, 0xa5, 0xfd, 0x21, 0xab, 0x48, 0xe8, 0x29, 0xe6, 0x20, 0x01,
0x65, 0x2b, 0xf5, 0x22, 0x82, 0x07, 0x45, 0x8b, 0x27, 0x91, 0xd5, 0x7b, 0xc9, 0x9f, 0x17, 0xb3,
0x34, 0x66, 0xcb, 0x6e, 0x5a, 0x68, 0x3f, 0x87, 0xdf, 0xc4, 0x2f, 0x28, 0xbb, 0x8d, 0x2d, 0xc5,
0x43, 0x60, 0x66, 0xf2, 0xde, 0x63, 0x66, 0x16, 0x22, 0x8d, 0x6a, 0x85, 0x6a, 0xbc, 0x98, 0x7f,
0x8c, 0xcb, 0x44, 0x97, 0x8d, 0x42, 0xdc, 0x01, 0xb6, 0x50, 0xb2, 0x91, 0xa3, 0x93, 0xac, 0x12,
0x58, 0x37, 0xe3, 0x45, 0xa1, 0xcd, 0xb7, 0x55, 0xa3, 0x3b, 0x18, 0x4e, 0x45, 0x85, 0x2f, 0x32,
0xc7, 0x57, 0x23, 0xd0, 0x4b, 0x80, 0xb4, 0x92, 0xd9, 0x7c, 0xa6, 0xb0, 0xd0, 0x81, 0x1b, 0xba,
0xb1, 0x3f, 0x19, 0x32, 0xb3, 0xf0, 0x60, 0x64, 0x8e, 0x05, 0xf7, 0xd2, 0x16, 0xe9, 0xe8, 0x0a,
0xe8, 0xa3, 0x50, 0x98, 0x35, 0x52, 0xad, 0xf7, 0x37, 0x46, 0xd0, 0xcf, 0x4a, 0x51, 0xe5, 0x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