From 25fbff5d52f0c74bd0ee55802ee20e80e0359f44 Mon Sep 17 00:00:00 2001 From: "cheng.li01" Date: Mon, 10 Aug 2020 16:37:47 +0800 Subject: [PATCH 01/81] fix bug: two same volumeId in different collections 1, there will be two leader when master server startup in a few seconds 2, raft server will get a leader even there is only one master, so there is no need to do hard code to set the server to be leader --- weed/topology/topology.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/weed/topology/topology.go b/weed/topology/topology.go index 993f444a7..f93d2179c 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -5,6 +5,7 @@ import ( "fmt" "math/rand" "sync" + "time" "github.com/chrislusf/raft" @@ -65,26 +66,26 @@ func (t *Topology) IsLeader() bool { if t.RaftServer.State() == raft.Leader { return true } - if t.RaftServer.Leader() == "" { - return true - } } return false } func (t *Topology) Leader() (string, error) { l := "" - if t.RaftServer != nil { - l = t.RaftServer.Leader() - } else { - return "", errors.New("Raft Server not ready yet!") + count := 3 + for count > 0 { + if t.RaftServer != nil { + l = t.RaftServer.Leader() + } else { + return "", errors.New("Raft Server not ready yet!") + } + if l != "" { + break + } else { + time.Sleep(time.Duration(5-count) * time.Second) + } + count -= 1 } - - if l == "" { - // We are a single node cluster, we are the leader - return t.RaftServer.Name(), nil - } - return l, nil } From 152a6cbc2b1b5586df9fc3a47a7631ea7a7ae1a6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 10 Aug 2020 20:42:27 -0700 Subject: [PATCH 02/81] minor adjustments --- weed/topology/topology.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/weed/topology/topology.go b/weed/topology/topology.go index f93d2179c..a11a1bac6 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -72,8 +72,7 @@ func (t *Topology) IsLeader() bool { func (t *Topology) Leader() (string, error) { l := "" - count := 3 - for count > 0 { + for count := 0; count < 3; count++ { if t.RaftServer != nil { l = t.RaftServer.Leader() } else { @@ -82,15 +81,14 @@ func (t *Topology) Leader() (string, error) { if l != "" { break } else { - time.Sleep(time.Duration(5-count) * time.Second) + time.Sleep(time.Duration(5+count) * time.Second) } - count -= 1 } return l, nil } func (t *Topology) Lookup(collection string, vid needle.VolumeId) (dataNodes []*DataNode) { - //maybe an issue if lots of collections? + // maybe an issue if lots of collections? if collection == "" { for _, c := range t.collectionMap.Items() { if list := c.(*Collection).Lookup(vid); list != nil { From 83cad3da798ded5ad30356e8a783a5b1f9ba1256 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 11 Aug 2020 20:30:11 -0700 Subject: [PATCH 03/81] add retry file upload --- weed/operation/upload_content.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 6fd8a60d1..e1914f20a 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -63,7 +63,7 @@ var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"") // Upload sends a POST request to a volume server to upload the content with adjustable compression level func UploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputCompressed bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) { - uploadResult, err = doUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) + uploadResult, err = retriedUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) return } @@ -79,10 +79,22 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader, err = fmt.Errorf("read input: %v", err) return } - uploadResult, uploadErr := doUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) + uploadResult, uploadErr := retriedUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) return uploadResult, uploadErr, data } +func retriedUploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputCompressed bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) { + for i:=0; i< 3; i++ { + uploadResult, err = doUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) + if err == nil { + return + } else { + glog.Warningf("uploading to %s: %v", uploadUrl, err) + } + } + return +} + func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputCompressed bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) { contentIsGzipped := isInputCompressed shouldGzipNow := false From 8824a9755c95fc986c13da3cfa33f427bb42b691 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 12 Aug 2020 13:11:04 -0700 Subject: [PATCH 04/81] remove directory cache --- weed/filer2/filer.go | 63 +-------------------- weed/filer2/filer_delete_entry.go | 5 +- weed/filer2/leveldb/leveldb_store_test.go | 2 - weed/filer2/leveldb2/leveldb2_store_test.go | 2 - 4 files changed, 4 insertions(+), 68 deletions(-) diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index dd4c38857..3e275beb2 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -9,8 +9,6 @@ import ( "google.golang.org/grpc" - "github.com/karlseguin/ccache" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" @@ -27,7 +25,6 @@ var ( type Filer struct { Store *FilerStoreWrapper - directoryCache *ccache.Cache MasterClient *wdclient.MasterClient fileIdDeletionQueue *util.UnboundedQueue GrpcDialOption grpc.DialOption @@ -44,7 +41,6 @@ type Filer struct { func NewFiler(masters []string, grpcDialOption grpc.DialOption, filerHost string, filerGrpcPort uint32, collection string, replication string, notifyFn func()) *Filer { f := &Filer{ - directoryCache: ccache.New(ccache.Configure().MaxSize(1000).ItemsToPrune(100)), MasterClient: wdclient.NewMasterClient(grpcDialOption, "filer", filerHost, filerGrpcPort, masters), fileIdDeletionQueue: util.NewUnboundedQueue(), GrpcDialOption: grpcDialOption, @@ -77,10 +73,6 @@ func (f *Filer) GetStore() (store FilerStore) { return f.Store } -func (f *Filer) DisableDirectoryCache() { - f.directoryCache = nil -} - func (fs *Filer) GetMaster() string { return fs.MasterClient.GetMaster() } @@ -117,16 +109,9 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFr dirPath := "/" + util.Join(dirParts[:i]...) // fmt.Printf("%d directory: %+v\n", i, dirPath) - // first check local cache - dirEntry := f.cacheGetDirectory(dirPath) - - // not found, check the store directly - if dirEntry == nil { - glog.V(4).Infof("find uncached directory: %s", dirPath) - dirEntry, _ = f.FindEntry(ctx, util.FullPath(dirPath)) - } else { - // glog.V(4).Infof("found cached directory: %s", dirPath) - } + // check the store directly, skipping cached directories + glog.V(4).Infof("find uncached directory: %s", dirPath) + dirEntry, _ := f.FindEntry(ctx, util.FullPath(dirPath)) // no such existing directory if dirEntry == nil { @@ -166,9 +151,6 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFr return fmt.Errorf("%s is a file", dirPath) } - // cache the directory entry - f.cacheSetDirectory(dirPath, dirEntry, i) - // remember the direct parent directory entry if i == len(dirParts)-1 { lastDirectoryEntry = dirEntry @@ -295,45 +277,6 @@ func (f *Filer) doListDirectoryEntries(ctx context.Context, p util.FullPath, sta return } -func (f *Filer) cacheDelDirectory(dirpath string) { - - if dirpath == "/" { - return - } - - if f.directoryCache == nil { - return - } - f.directoryCache.Delete(dirpath) - return -} - -func (f *Filer) cacheGetDirectory(dirpath string) *Entry { - - if f.directoryCache == nil { - return nil - } - item := f.directoryCache.Get(dirpath) - if item == nil { - return nil - } - return item.Value().(*Entry) -} - -func (f *Filer) cacheSetDirectory(dirpath string, dirEntry *Entry, level int) { - - if f.directoryCache == nil { - return - } - - minutes := 60 - if level < 10 { - minutes -= level * 6 - } - - f.directoryCache.Set(dirpath, dirEntry, time.Duration(minutes)*time.Minute) -} - func (f *Filer) Shutdown() { f.LocalMetaLogBuffer.Shutdown() f.Store.Shutdown() diff --git a/weed/filer2/filer_delete_entry.go b/weed/filer2/filer_delete_entry.go index 35099a472..a528f9152 100644 --- a/weed/filer2/filer_delete_entry.go +++ b/weed/filer2/filer_delete_entry.go @@ -73,7 +73,6 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry var dirChunks []*filer_pb.FileChunk if sub.IsDirectory() { dirChunks, err = f.doBatchDeleteFolderMetaAndData(ctx, sub, isRecursive, ignoreRecursiveError, shouldDeleteChunks, false) - f.cacheDelDirectory(string(sub.FullPath)) chunks = append(chunks, dirChunks...) } else { f.NotifyUpdateEvent(ctx, sub, nil, shouldDeleteChunks, isFromOtherCluster) @@ -107,9 +106,7 @@ func (f *Filer) doDeleteEntryMetaAndData(ctx context.Context, entry *Entry, shou if storeDeletionErr := f.Store.DeleteEntry(ctx, entry.FullPath); storeDeletionErr != nil { return fmt.Errorf("filer store delete: %v", storeDeletionErr) } - if entry.IsDirectory() { - f.cacheDelDirectory(string(entry.FullPath)) - } else { + if !entry.IsDirectory() { f.NotifyUpdateEvent(ctx, entry, nil, shouldDeleteChunks, isFromOtherCluster) } diff --git a/weed/filer2/leveldb/leveldb_store_test.go b/weed/filer2/leveldb/leveldb_store_test.go index 77df07a9b..81c761f56 100644 --- a/weed/filer2/leveldb/leveldb_store_test.go +++ b/weed/filer2/leveldb/leveldb_store_test.go @@ -17,7 +17,6 @@ func TestCreateAndFind(t *testing.T) { store := &LevelDBStore{} store.initialize(dir) filer.SetStore(store) - filer.DisableDirectoryCache() fullpath := util.FullPath("/home/chris/this/is/one/file1.jpg") @@ -72,7 +71,6 @@ func TestEmptyRoot(t *testing.T) { store := &LevelDBStore{} store.initialize(dir) filer.SetStore(store) - filer.DisableDirectoryCache() ctx := context.Background() diff --git a/weed/filer2/leveldb2/leveldb2_store_test.go b/weed/filer2/leveldb2/leveldb2_store_test.go index b211d86e4..27c1c954b 100644 --- a/weed/filer2/leveldb2/leveldb2_store_test.go +++ b/weed/filer2/leveldb2/leveldb2_store_test.go @@ -17,7 +17,6 @@ func TestCreateAndFind(t *testing.T) { store := &LevelDB2Store{} store.initialize(dir, 2) filer.SetStore(store) - filer.DisableDirectoryCache() fullpath := util.FullPath("/home/chris/this/is/one/file1.jpg") @@ -72,7 +71,6 @@ func TestEmptyRoot(t *testing.T) { store := &LevelDB2Store{} store.initialize(dir, 2) filer.SetStore(store) - filer.DisableDirectoryCache() ctx := context.Background() From f735d579d3b89114636b1e16ec2b1ae40c409c3c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 12 Aug 2020 13:22:19 -0700 Subject: [PATCH 05/81] adjust comment --- weed/filer2/filer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index 3e275beb2..d3dfa5a6f 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -109,7 +109,7 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFr dirPath := "/" + util.Join(dirParts[:i]...) // fmt.Printf("%d directory: %+v\n", i, dirPath) - // check the store directly, skipping cached directories + // check the store directly glog.V(4).Infof("find uncached directory: %s", dirPath) dirEntry, _ := f.FindEntry(ctx, util.FullPath(dirPath)) From d43129d27fec49244689b37e511937d037cf89be Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 12 Aug 2020 23:52:13 -0700 Subject: [PATCH 06/81] add back handles lock --- weed/filesys/dir_rename.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go index da4f1b232..573706b21 100644 --- a/weed/filesys/dir_rename.go +++ b/weed/filesys/dir_rename.go @@ -63,6 +63,9 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector // fmt.Printf("rename path: %v => %v\n", oldPath, newPath) dir.wfs.fsNodeCache.Move(oldPath, newPath) + + wfs.handlesLock.Lock() + defer wfs.handlesLock.Unlock() delete(dir.wfs.handles, oldPath.AsInode()) return err From 090612492cba03243ed86b8d47ad705f26d9451d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 13 Aug 2020 00:07:56 -0700 Subject: [PATCH 07/81] fix compilation --- weed/filesys/dir_rename.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go index 573706b21..c2ff6f407 100644 --- a/weed/filesys/dir_rename.go +++ b/weed/filesys/dir_rename.go @@ -64,8 +64,8 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector // fmt.Printf("rename path: %v => %v\n", oldPath, newPath) dir.wfs.fsNodeCache.Move(oldPath, newPath) - wfs.handlesLock.Lock() - defer wfs.handlesLock.Unlock() + dir.wfs.handlesLock.Lock() + defer dir.wfs.handlesLock.Unlock() delete(dir.wfs.handles, oldPath.AsInode()) return err From 0983060a9080e69dc7edf58f172ab170755c3511 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 13 Aug 2020 09:07:22 -0700 Subject: [PATCH 08/81] increase default volume file size limit to 1024 avoid possible large chunk size set on mount or filer --- weed/command/server.go | 2 +- weed/command/volume.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/command/server.go b/weed/command/server.go index 565563c77..d16095075 100644 --- a/weed/command/server.go +++ b/weed/command/server.go @@ -96,7 +96,7 @@ func init() { serverOptions.v.fixJpgOrientation = cmdServer.Flag.Bool("volume.images.fix.orientation", false, "Adjust jpg orientation when uploading.") serverOptions.v.readRedirect = cmdServer.Flag.Bool("volume.read.redirect", true, "Redirect moved or non-local volumes.") serverOptions.v.compactionMBPerSecond = cmdServer.Flag.Int("volume.compactionMBps", 0, "limit compaction speed in mega bytes per second") - serverOptions.v.fileSizeLimitMB = cmdServer.Flag.Int("volume.fileSizeLimitMB", 256, "limit file size to avoid out of memory") + serverOptions.v.fileSizeLimitMB = cmdServer.Flag.Int("volume.fileSizeLimitMB", 1024, "limit file size to avoid out of memory") serverOptions.v.publicUrl = cmdServer.Flag.String("volume.publicUrl", "", "publicly accessible address") serverOptions.v.pprof = &False diff --git a/weed/command/volume.go b/weed/command/volume.go index 4f04a467d..6fb7447e7 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -76,7 +76,7 @@ func init() { v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file") v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file") v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second") - v.fileSizeLimitMB = cmdVolume.Flag.Int("fileSizeLimitMB", 256, "limit file size to avoid out of memory") + v.fileSizeLimitMB = cmdVolume.Flag.Int("fileSizeLimitMB", 1024, "limit file size to avoid out of memory") v.pprof = cmdVolume.Flag.Bool("pprof", false, "enable pprof http handlers. precludes --memprofile and --cpuprofile") } From edfa73782fe934ebda68fda1db490c964ca52028 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Aug 2020 00:22:21 -0700 Subject: [PATCH 09/81] adjust log level --- weed/filer2/reader_at.go | 2 +- weed/filesys/dir.go | 6 +++--- weed/filesys/dir_link.go | 4 ++-- weed/filesys/dirty_page.go | 4 ++-- weed/filesys/file.go | 12 ++++++------ weed/filesys/filehandle.go | 8 ++++---- weed/filesys/meta_cache/meta_cache_init.go | 2 +- weed/pb/filer_pb/filer_client.go | 3 ++- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 568d94267..2f65761cc 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -117,7 +117,7 @@ func (c *ChunkReadAt) fetchChunkData(chunkView *ChunkView) (data []byte, err err hasDataInCache := false chunkData := c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { - glog.V(3).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) + glog.V(4).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) hasDataInCache = true } else { chunkData, err = c.doFetchFullChunkData(chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 08332d967..818e85fd6 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -265,7 +265,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { - glog.V(3).Infof("dir ReadDirAll %s", dir.FullPath()) + glog.V(4).Infof("dir ReadDirAll %s", dir.FullPath()) processEachEntryFn := func(entry *filer_pb.Entry, isLast bool) error { fullpath := util.NewFullPath(dir.FullPath(), entry.Name) @@ -354,7 +354,7 @@ func (dir *Dir) removeFolder(req *fuse.RemoveRequest) error { func (dir *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error { - glog.V(3).Infof("%v dir setattr %+v", dir.FullPath(), req) + glog.V(4).Infof("%v dir setattr %+v", dir.FullPath(), req) if err := dir.maybeLoadEntry(); err != nil { return err @@ -429,7 +429,7 @@ func (dir *Dir) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp } func (dir *Dir) Forget() { - glog.V(3).Infof("Forget dir %s", dir.FullPath()) + glog.V(4).Infof("Forget dir %s", dir.FullPath()) dir.wfs.fsNodeCache.DeleteFsNode(util.FullPath(dir.FullPath())) } diff --git a/weed/filesys/dir_link.go b/weed/filesys/dir_link.go index 4990e743c..bd564f413 100644 --- a/weed/filesys/dir_link.go +++ b/weed/filesys/dir_link.go @@ -18,7 +18,7 @@ var _ = fs.NodeReadlinker(&File{}) func (dir *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (fs.Node, error) { - glog.V(3).Infof("Symlink: %v/%v to %v", dir.FullPath(), req.NewName, req.Target) + glog.V(4).Infof("Symlink: %v/%v to %v", dir.FullPath(), req.NewName, req.Target) request := &filer_pb.CreateEntryRequest{ Directory: dir.FullPath(), @@ -63,7 +63,7 @@ func (file *File) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (stri return "", fuse.Errno(syscall.EINVAL) } - glog.V(3).Infof("Readlink: %v/%v => %v", file.dir.FullPath(), file.Name, file.entry.Attributes.SymlinkTarget) + glog.V(4).Infof("Readlink: %v/%v => %v", file.dir.FullPath(), file.Name, file.entry.Attributes.SymlinkTarget) return file.entry.Attributes.SymlinkTarget, nil diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index 46d20e466..2af3e905a 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -35,7 +35,7 @@ func (pages *ContinuousDirtyPages) AddPage(offset int64, data []byte) (chunks [] pages.lock.Lock() defer pages.lock.Unlock() - glog.V(3).Infof("%s AddPage [%d,%d)", pages.f.fullpath(), offset, offset+int64(len(data))) + glog.V(4).Infof("%s AddPage [%d,%d)", pages.f.fullpath(), offset, offset+int64(len(data))) if len(data) > int(pages.f.wfs.option.ChunkSizeLimit) { // this is more than what buffer can hold. @@ -125,7 +125,7 @@ func (pages *ContinuousDirtyPages) saveExistingLargestPageToStorage() (chunk *fi chunk, err = pages.saveToStorage(maxList.ToReader(), maxList.Offset(), maxList.Size()) if err == nil { hasSavedData = true - glog.V(3).Infof("%s saveToStorage [%d,%d) %s", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+maxList.Size(), chunk.FileId) + glog.V(4).Infof("%s saveToStorage [%d,%d) %s", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+maxList.Size(), chunk.FileId) return } else { glog.V(0).Infof("%s saveToStorage [%d,%d): %v", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+maxList.Size(), err) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index dcda93522..dbfd7fd1a 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -91,7 +91,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op resp.Handle = fuse.HandleID(handle.handle) - glog.V(3).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) + glog.V(4).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) return handle, nil @@ -99,7 +99,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error { - glog.V(3).Infof("%v file setattr %+v, old:%+v", file.fullpath(), req, file.entry.Attributes) + glog.V(4).Infof("%v file setattr %+v, old:%+v", file.fullpath(), req, file.entry.Attributes) if err := file.maybeLoadEntry(ctx); err != nil { return err @@ -107,7 +107,7 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f if req.Valid.Size() { - glog.V(3).Infof("%v file setattr set size=%v", file.fullpath(), req.Size) + glog.V(4).Infof("%v file setattr set size=%v", file.fullpath(), req.Size) if req.Size < filer2.TotalSize(file.entry.Chunks) { // fmt.Printf("truncate %v \n", fullPath) var chunks []*filer_pb.FileChunk @@ -205,14 +205,14 @@ func (file *File) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, res func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error { // fsync works at OS level // write the file chunks to the filerGrpcAddress - glog.V(3).Infof("%s/%s fsync file %+v", file.dir.FullPath(), file.Name, req) + glog.V(4).Infof("%s/%s fsync file %+v", file.dir.FullPath(), file.Name, req) return nil } func (file *File) Forget() { t := util.NewFullPath(file.dir.FullPath(), file.Name) - glog.V(3).Infof("Forget file %s", t) + glog.V(4).Infof("Forget file %s", t) file.wfs.fsNodeCache.DeleteFsNode(t) } @@ -246,7 +246,7 @@ func (file *File) addChunks(chunks []*filer_pb.FileChunk) { file.reader = nil - glog.V(3).Infof("%s existing %d chunks adds %d more", file.fullpath(), len(file.entry.Chunks), len(chunks)) + glog.V(4).Infof("%s existing %d chunks adds %d more", file.fullpath(), len(file.entry.Chunks), len(chunks)) file.entry.Chunks = append(file.entry.Chunks, chunks...) } diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index b9d224fb2..680500c75 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -126,7 +126,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f copy(data, req.Data) fh.f.entry.Attributes.FileSize = uint64(max(req.Offset+int64(len(data)), int64(fh.f.entry.Attributes.FileSize))) - // glog.V(0).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) + glog.V(4).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) chunks, err := fh.dirtyPages.AddPage(req.Offset, data) if err != nil { @@ -212,9 +212,9 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { Entry: fh.f.entry, } - glog.V(3).Infof("%s set chunks: %v", fh.f.fullpath(), len(fh.f.entry.Chunks)) + glog.V(4).Infof("%s set chunks: %v", fh.f.fullpath(), len(fh.f.entry.Chunks)) for i, chunk := range fh.f.entry.Chunks { - glog.V(3).Infof("%s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) + glog.V(4).Infof("%s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) } chunks, garbages := filer2.CompactFileChunks(filer2.LookupFn(fh.f.wfs), fh.f.entry.Chunks) @@ -239,7 +239,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { fh.f.wfs.deleteFileChunks(garbages) for i, chunk := range garbages { - glog.V(3).Infof("garbage %s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) + glog.V(4).Infof("garbage %s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) } return nil diff --git a/weed/filesys/meta_cache/meta_cache_init.go b/weed/filesys/meta_cache/meta_cache_init.go index e119ebff5..662a60fe0 100644 --- a/weed/filesys/meta_cache/meta_cache_init.go +++ b/weed/filesys/meta_cache/meta_cache_init.go @@ -14,7 +14,7 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full mc.visitedBoundary.EnsureVisited(dirPath, func(path util.FullPath) (childDirectories []string, err error) { - glog.V(2).Infof("ReadDirAllEntries %s ...", path) + glog.V(4).Infof("ReadDirAllEntries %s ...", path) err = filer_pb.ReadDirAllEntries(client, dirPath, "", func(pbEntry *filer_pb.Entry, isLast bool) error { entry := filer2.FromPbEntry(string(dirPath), pbEntry) diff --git a/weed/pb/filer_pb/filer_client.go b/weed/pb/filer_pb/filer_client.go index 535a3c247..d12c55289 100644 --- a/weed/pb/filer_pb/filer_client.go +++ b/weed/pb/filer_pb/filer_client.go @@ -7,6 +7,7 @@ import ( "io" "math" "os" + "strings" "time" "github.com/chrislusf/seaweedfs/weed/glog" @@ -82,7 +83,7 @@ func doList(filerClient FilerClient, fullDirPath util.FullPath, prefix string, f InclusiveStartFrom: inclusive, } - glog.V(3).Infof("read directory: %v", request) + glog.V(4).Infof("read directory: %v", request) ctx, cancel := context.WithCancel(context.Background()) stream, err := client.ListEntries(ctx, request) if err != nil { From a7f669044eed395ed9ca86c534c504e11af8d3e0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Aug 2020 00:22:49 -0700 Subject: [PATCH 10/81] rename also applies to open file handle --- weed/filesys/dir_rename.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.go index c2ff6f407..0e417e0ab 100644 --- a/weed/filesys/dir_rename.go +++ b/weed/filesys/dir_rename.go @@ -64,9 +64,16 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector // fmt.Printf("rename path: %v => %v\n", oldPath, newPath) dir.wfs.fsNodeCache.Move(oldPath, newPath) + // change file handle dir.wfs.handlesLock.Lock() defer dir.wfs.handlesLock.Unlock() - delete(dir.wfs.handles, oldPath.AsInode()) + inodeId := oldPath.AsInode() + existingHandle, found := dir.wfs.handles[inodeId] + if !found || existingHandle == nil { + return err + } + delete(dir.wfs.handles, inodeId) + dir.wfs.handles[newPath.AsInode()] = existingHandle return err } From eb493283ddb1d6492d7ede5381c824ec800c025d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Aug 2020 00:23:01 -0700 Subject: [PATCH 11/81] deletion error report --- weed/pb/filer_pb/filer_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/weed/pb/filer_pb/filer_client.go b/weed/pb/filer_pb/filer_client.go index d12c55289..6605202e0 100644 --- a/weed/pb/filer_pb/filer_client.go +++ b/weed/pb/filer_pb/filer_client.go @@ -225,9 +225,15 @@ func Remove(filerClient FilerClient, parentDirectoryPath, name string, isDeleteD IgnoreRecursiveError: ignoreRecursiveErr, IsFromOtherCluster: isFromOtherCluster, }); err != nil { + if strings.Contains(err.Error(), ErrNotFound.Error()){ + return nil + } return err } else { if resp.Error != "" { + if strings.Contains(resp.Error, ErrNotFound.Error()){ + return nil + } return errors.New(resp.Error) } } From c03bb180eb5fc96e79324f0aa5ec7cd9b674f901 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Aug 2020 00:44:02 -0700 Subject: [PATCH 12/81] fix error reporting --- weed/storage/idx/walk.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/storage/idx/walk.go b/weed/storage/idx/walk.go index 44140d142..db3b4cd96 100644 --- a/weed/storage/idx/walk.go +++ b/weed/storage/idx/walk.go @@ -14,6 +14,9 @@ func WalkIndexFile(r io.ReaderAt, fn func(key types.NeedleId, offset types.Offse var readerOffset int64 bytes := make([]byte, types.NeedleMapEntrySize*RowsToRead) count, e := r.ReadAt(bytes, readerOffset) + if count == 0 && e == io.EOF { + return nil + } glog.V(3).Infof("readerOffset %d count %d err: %v", readerOffset, count, e) readerOffset += int64(count) var ( From c647deace16ec1a3f0c11d92dc5fa15ec30012e4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 09:32:47 -0700 Subject: [PATCH 13/81] file size support set file length use Attr.FileSize and TotalChunkSize to determine file size --- weed/filer2/entry.go | 10 ++++++- weed/filer2/entry_codec.go | 2 ++ weed/filer2/filechunks.go | 4 +++ weed/filesys/dirty_page.go | 18 ++++++++++--- weed/filesys/file.go | 27 +++++++++++++------ weed/filesys/filehandle.go | 23 ++++++++-------- weed/replication/sink/azuresink/azure_sink.go | 2 +- weed/replication/sink/b2sink/b2_sink.go | 2 +- weed/replication/sink/gcssink/gcs_sink.go | 2 +- weed/replication/sink/s3sink/s3_sink.go | 2 +- weed/s3api/filer_multipart.go | 2 +- weed/s3api/s3api_objects_list_handlers.go | 2 +- weed/server/filer_server_handlers_read.go | 4 +-- weed/server/webdav_server.go | 4 +-- weed/shell/command_fs_du.go | 6 ++--- weed/shell/command_fs_ls.go | 2 +- 16 files changed, 73 insertions(+), 39 deletions(-) diff --git a/weed/filer2/entry.go b/weed/filer2/entry.go index 00b9b132d..fedfde40d 100644 --- a/weed/filer2/entry.go +++ b/weed/filer2/entry.go @@ -22,6 +22,7 @@ type Attr struct { GroupNames []string SymlinkTarget string Md5 []byte + FileSize uint64 } func (attr Attr) IsDirectory() bool { @@ -39,7 +40,7 @@ type Entry struct { } func (entry *Entry) Size() uint64 { - return TotalSize(entry.Chunks) + return maxUint64(TotalSize(entry.Chunks), entry.FileSize) } func (entry *Entry) Timestamp() time.Time { @@ -81,3 +82,10 @@ func FromPbEntry(dir string, entry *filer_pb.Entry) *Entry { Chunks: entry.Chunks, } } + +func maxUint64(x, y uint64) uint64 { + if x > y { + return x + } + return y +} diff --git a/weed/filer2/entry_codec.go b/weed/filer2/entry_codec.go index 47c911011..4d615194f 100644 --- a/weed/filer2/entry_codec.go +++ b/weed/filer2/entry_codec.go @@ -53,6 +53,7 @@ func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes { GroupName: entry.Attr.GroupNames, SymlinkTarget: entry.Attr.SymlinkTarget, Md5: entry.Attr.Md5, + FileSize: entry.Attr.FileSize, } } @@ -73,6 +74,7 @@ func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr { t.GroupNames = attr.GroupName t.SymlinkTarget = attr.SymlinkTarget t.Md5 = attr.Md5 + t.FileSize = attr.FileSize return t } diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index ea7772b4a..9de888d50 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -20,6 +20,10 @@ func TotalSize(chunks []*filer_pb.FileChunk) (size uint64) { return } +func FileSize(entry *filer_pb.Entry) (size uint64) { + return maxUint64(TotalSize(entry.Chunks), entry.Attributes.FileSize) +} + func ETag(entry *filer_pb.Entry) (etag string) { if entry.Attributes == nil || entry.Attributes.Md5 == nil { return ETagChunks(entry.Chunks) diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index 2af3e905a..8b7d92ffb 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -35,7 +35,7 @@ func (pages *ContinuousDirtyPages) AddPage(offset int64, data []byte) (chunks [] pages.lock.Lock() defer pages.lock.Unlock() - glog.V(4).Infof("%s AddPage [%d,%d)", pages.f.fullpath(), offset, offset+int64(len(data))) + glog.V(4).Infof("%s AddPage [%d,%d) of %d bytes", pages.f.fullpath(), offset, offset+int64(len(data)), pages.f.entry.Attributes.FileSize) if len(data) > int(pages.f.wfs.option.ChunkSizeLimit) { // this is more than what buffer can hold. @@ -121,14 +121,16 @@ func (pages *ContinuousDirtyPages) saveExistingLargestPageToStorage() (chunk *fi return nil, false, nil } + fileSize := int64(pages.f.entry.Attributes.FileSize) for { - chunk, err = pages.saveToStorage(maxList.ToReader(), maxList.Offset(), maxList.Size()) + chunkSize := min(maxList.Size(), fileSize-maxList.Offset()) + chunk, err = pages.saveToStorage(maxList.ToReader(), maxList.Offset(), chunkSize) if err == nil { hasSavedData = true - glog.V(4).Infof("%s saveToStorage [%d,%d) %s", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+maxList.Size(), chunk.FileId) + glog.V(4).Infof("%s saveToStorage %s [%d,%d) of %d bytes", pages.f.fullpath(), chunk.FileId, maxList.Offset(), maxList.Offset()+chunkSize, fileSize) return } else { - glog.V(0).Infof("%s saveToStorage [%d,%d): %v", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+maxList.Size(), err) + glog.V(0).Infof("%s saveToStorage [%d,%d): %v", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+chunkSize, err) time.Sleep(5 * time.Second) } } @@ -139,6 +141,7 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64, dir, _ := pages.f.fullpath().DirAndName() + reader = io.LimitReader(reader, size) chunk, collection, replication, err := pages.f.wfs.saveDataAsChunk(dir)(reader, pages.f.Name, offset) if err != nil { return nil, err @@ -149,6 +152,13 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64, } +func maxUint64(x, y uint64) uint64 { + if x > y { + return x + } + return y +} + func max(x, y int64) int64 { if x > y { return x diff --git a/weed/filesys/file.go b/weed/filesys/file.go index dbfd7fd1a..83f6950bd 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -7,12 +7,13 @@ import ( "sort" "time" + "github.com/seaweedfs/fuse" + "github.com/seaweedfs/fuse/fs" + "github.com/chrislusf/seaweedfs/weed/filer2" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" - "github.com/seaweedfs/fuse" - "github.com/seaweedfs/fuse/fs" ) const blockSize = 512 @@ -35,6 +36,7 @@ type File struct { entryViewCache []filer2.VisibleInterval isOpen int reader io.ReaderAt + dirtyMetadata bool } func (file *File) fullpath() util.FullPath { @@ -43,7 +45,7 @@ func (file *File) fullpath() util.FullPath { func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error { - glog.V(4).Infof("file Attr %s, open:%v, existing attr: %+v", file.fullpath(), file.isOpen, attr) + glog.V(5).Infof("file Attr %s, open:%v, existing attr: %+v", file.fullpath(), file.isOpen, attr) if file.isOpen <= 0 { if err := file.maybeLoadEntry(ctx); err != nil { @@ -54,7 +56,7 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Inode = file.fullpath().AsInode() attr.Valid = time.Second attr.Mode = os.FileMode(file.entry.Attributes.FileMode) - attr.Size = filer2.TotalSize(file.entry.Chunks) + attr.Size = filer2.FileSize(file.entry) if file.isOpen > 0 { attr.Size = file.entry.Attributes.FileSize glog.V(4).Infof("file Attr %s, open:%v, size: %d", file.fullpath(), file.isOpen, attr.Size) @@ -107,22 +109,31 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f if req.Valid.Size() { - glog.V(4).Infof("%v file setattr set size=%v", file.fullpath(), req.Size) + glog.V(4).Infof("%v file setattr set size=%v chunks=%d", file.fullpath(), req.Size, len(file.entry.Chunks)) if req.Size < filer2.TotalSize(file.entry.Chunks) { // fmt.Printf("truncate %v \n", fullPath) var chunks []*filer_pb.FileChunk + var truncatedChunks []*filer_pb.FileChunk for _, chunk := range file.entry.Chunks { int64Size := int64(chunk.Size) if chunk.Offset+int64Size > int64(req.Size) { + // this chunk is truncated int64Size = int64(req.Size) - chunk.Offset - } - if int64Size > 0 { - chunks = append(chunks, chunk) + if int64Size > 0 { + chunks = append(chunks, chunk) + glog.V(4).Infof("truncated chunk %+v from %d to %d\n", chunk, chunk.Size, int64Size) + chunk.Size = uint64(int64Size) + } else { + glog.V(4).Infof("truncated whole chunk %+v\n", chunk) + truncatedChunks = append(truncatedChunks, chunk) + } } } + file.wfs.deleteFileChunks(truncatedChunks) file.entry.Chunks = chunks file.entryViewCache = nil file.reader = nil + file.dirtyMetadata = true } file.entry.Attributes.FileSize = req.Size } diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 680500c75..42a0b2446 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -19,10 +19,9 @@ import ( type FileHandle struct { // cache file has been written to - dirtyPages *ContinuousDirtyPages - contentType string - dirtyMetadata bool - handle uint64 + dirtyPages *ContinuousDirtyPages + contentType string + handle uint64 f *File RequestId fuse.RequestID // unique ID for request @@ -40,7 +39,7 @@ func newFileHandle(file *File, uid, gid uint32) *FileHandle { Gid: gid, } if fh.f.entry != nil { - fh.f.entry.Attributes.FileSize = filer2.TotalSize(fh.f.entry.Chunks) + fh.f.entry.Attributes.FileSize = filer2.FileSize(fh.f.entry) } return fh } @@ -55,7 +54,7 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(4).Infof("%s read fh %d: [%d,%d)", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size)) + glog.V(2).Infof("%s read fh %d: [%d,%d)", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size)) buff := make([]byte, req.Size) @@ -126,7 +125,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f copy(data, req.Data) fh.f.entry.Attributes.FileSize = uint64(max(req.Offset+int64(len(data)), int64(fh.f.entry.Attributes.FileSize))) - glog.V(4).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) + glog.V(2).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) chunks, err := fh.dirtyPages.AddPage(req.Offset, data) if err != nil { @@ -139,14 +138,14 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f if req.Offset == 0 { // detect mime type fh.contentType = http.DetectContentType(data) - fh.dirtyMetadata = true + fh.f.dirtyMetadata = true } if len(chunks) > 0 { fh.f.addChunks(chunks) - fh.dirtyMetadata = true + fh.f.dirtyMetadata = true } return nil @@ -181,10 +180,10 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { if len(chunks) > 0 { fh.f.addChunks(chunks) - fh.dirtyMetadata = true + fh.f.dirtyMetadata = true } - if !fh.dirtyMetadata { + if !fh.f.dirtyMetadata { return nil } @@ -246,7 +245,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { }) if err == nil { - fh.dirtyMetadata = false + fh.f.dirtyMetadata = false } if err != nil { diff --git a/weed/replication/sink/azuresink/azure_sink.go b/weed/replication/sink/azuresink/azure_sink.go index fa229de22..3240b705a 100644 --- a/weed/replication/sink/azuresink/azure_sink.go +++ b/weed/replication/sink/azuresink/azure_sink.go @@ -95,7 +95,7 @@ func (g *AzureSink) CreateEntry(key string, entry *filer_pb.Entry) error { return nil } - totalSize := filer2.TotalSize(entry.Chunks) + totalSize := filer2.FileSize(entry) chunkViews := filer2.ViewFromChunks(g.filerSource.LookupFileId, entry.Chunks, 0, int64(totalSize)) // Create a URL that references a to-be-created blob in your diff --git a/weed/replication/sink/b2sink/b2_sink.go b/weed/replication/sink/b2sink/b2_sink.go index bf8632827..8532c0231 100644 --- a/weed/replication/sink/b2sink/b2_sink.go +++ b/weed/replication/sink/b2sink/b2_sink.go @@ -84,7 +84,7 @@ func (g *B2Sink) CreateEntry(key string, entry *filer_pb.Entry) error { return nil } - totalSize := filer2.TotalSize(entry.Chunks) + totalSize := filer2.FileSize(entry) chunkViews := filer2.ViewFromChunks(g.filerSource.LookupFileId, entry.Chunks, 0, int64(totalSize)) bucket, err := g.client.Bucket(context.Background(), g.bucket) diff --git a/weed/replication/sink/gcssink/gcs_sink.go b/weed/replication/sink/gcssink/gcs_sink.go index 4b58160db..35a7dd9f7 100644 --- a/weed/replication/sink/gcssink/gcs_sink.go +++ b/weed/replication/sink/gcssink/gcs_sink.go @@ -89,7 +89,7 @@ func (g *GcsSink) CreateEntry(key string, entry *filer_pb.Entry) error { return nil } - totalSize := filer2.TotalSize(entry.Chunks) + totalSize := filer2.FileSize(entry) chunkViews := filer2.ViewFromChunks(g.filerSource.LookupFileId, entry.Chunks, 0, int64(totalSize)) wc := g.client.Bucket(g.bucket).Object(key).NewWriter(context.Background()) diff --git a/weed/replication/sink/s3sink/s3_sink.go b/weed/replication/sink/s3sink/s3_sink.go index 625cf406c..56fc1930d 100644 --- a/weed/replication/sink/s3sink/s3_sink.go +++ b/weed/replication/sink/s3sink/s3_sink.go @@ -107,7 +107,7 @@ func (s3sink *S3Sink) CreateEntry(key string, entry *filer_pb.Entry) error { return err } - totalSize := filer2.TotalSize(entry.Chunks) + totalSize := filer2.FileSize(entry) chunkViews := filer2.ViewFromChunks(s3sink.filerSource.LookupFileId, entry.Chunks, 0, int64(totalSize)) parts := make([]*s3.CompletedPart, len(chunkViews)) diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.go index 31ac850b1..24bbafe1d 100644 --- a/weed/s3api/filer_multipart.go +++ b/weed/s3api/filer_multipart.go @@ -208,7 +208,7 @@ func (s3a *S3ApiServer) listObjectParts(input *s3.ListPartsInput) (output *ListP output.Parts = append(output.Parts, &s3.Part{ PartNumber: aws.Int64(int64(partNumber)), LastModified: aws.Time(time.Unix(entry.Attributes.Mtime, 0).UTC()), - Size: aws.Int64(int64(filer2.TotalSize(entry.Chunks))), + Size: aws.Int64(int64(filer2.FileSize(entry))), ETag: aws.String("\"" + filer2.ETag(entry) + "\""), }) } diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index 311442551..46d5b90c7 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -141,7 +141,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m Key: fmt.Sprintf("%s%s", dir[len(bucketPrefix):], entry.Name), LastModified: time.Unix(entry.Attributes.Mtime, 0).UTC(), ETag: "\"" + filer2.ETag(entry) + "\"", - Size: int64(filer2.TotalSize(entry.Chunks)), + Size: int64(filer2.FileSize(entry)), Owner: CanonicalUser{ ID: fmt.Sprintf("%x", entry.Attributes.Uid), DisplayName: entry.Attributes.UserName, diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 657158c2f..449b9f1a0 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/weed/server/filer_server_handlers_read.go @@ -105,11 +105,11 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, adjustHeaderContentDisposition(w, r, filename) if r.Method == "HEAD" { - w.Header().Set("Content-Length", strconv.FormatInt(int64(filer2.TotalSize(entry.Chunks)), 10)) + w.Header().Set("Content-Length", strconv.FormatInt(int64(entry.Size()), 10)) return } - totalSize := int64(filer2.TotalSize(entry.Chunks)) + totalSize := int64(entry.Size()) if rangeReq := r.Header.Get("Range"); rangeReq == "" { ext := filepath.Ext(filename) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index 8655daf70..e9f7b23fd 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -338,7 +338,7 @@ func (fs *WebDavFileSystem) stat(ctx context.Context, fullFilePath string) (os.F if err != nil { return nil, err } - fi.size = int64(filer2.TotalSize(entry.GetChunks())) + fi.size = int64(filer2.FileSize(entry)) fi.name = string(fullpath) fi.mode = os.FileMode(entry.Attributes.FileMode) fi.modifiledTime = time.Unix(entry.Attributes.Mtime, 0) @@ -507,7 +507,7 @@ func (f *WebDavFile) Readdir(count int) (ret []os.FileInfo, err error) { err = filer_pb.ReadDirAllEntries(f.fs, util.FullPath(dir), "", func(entry *filer_pb.Entry, isLast bool) error { fi := FileInfo{ - size: int64(filer2.TotalSize(entry.GetChunks())), + size: int64(filer2.FileSize(entry)), name: entry.Name, mode: os.FileMode(entry.Attributes.FileMode), modifiledTime: time.Unix(entry.Attributes.Mtime, 0), diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go index 96551dd5a..5404b0cdb 100644 --- a/weed/shell/command_fs_du.go +++ b/weed/shell/command_fs_du.go @@ -70,9 +70,9 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir } } else { fileBlockCount = uint64(len(entry.Chunks)) - fileByteCount = filer2.TotalSize(entry.Chunks) - blockCount += uint64(len(entry.Chunks)) - byteCount += filer2.TotalSize(entry.Chunks) + fileByteCount = filer2.FileSize(entry) + blockCount += fileBlockCount + byteCount += fileByteCount } if name != "" && !entry.IsDirectory { diff --git a/weed/shell/command_fs_ls.go b/weed/shell/command_fs_ls.go index 36133992f..4110c7b8d 100644 --- a/weed/shell/command_fs_ls.go +++ b/weed/shell/command_fs_ls.go @@ -95,7 +95,7 @@ func (c *commandFsLs) Do(args []string, commandEnv *CommandEnv, writer io.Writer fmt.Fprintf(writer, "%s %3d %s %s %6d %s/%s\n", fileMode, len(entry.Chunks), userName, groupName, - filer2.TotalSize(entry.Chunks), dir, entry.Name) + filer2.FileSize(entry), dir, entry.Name) } else { fmt.Fprintf(writer, "%s\n", entry.Name) } From 5b43bddf20cb8b184d6defa29a8e9001f1708a12 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 09:33:41 -0700 Subject: [PATCH 14/81] proper deletion ordering delete central file store first, then delete local cache --- weed/filer2/filer_delete_entry.go | 1 + weed/filesys/dir.go | 20 +++++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/weed/filer2/filer_delete_entry.go b/weed/filer2/filer_delete_entry.go index a528f9152..d6a72e830 100644 --- a/weed/filer2/filer_delete_entry.go +++ b/weed/filer2/filer_delete_entry.go @@ -65,6 +65,7 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry } if lastFileName == "" && !isRecursive && len(entries) > 0 { // only for first iteration in the loop + glog.Errorf("deleting a folder %s has children: %+v", entry.FullPath, entries) return nil, fmt.Errorf("fail to delete non-empty folder: %s", entry.FullPath) } diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 818e85fd6..50ca6df5d 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -218,7 +218,7 @@ func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, err func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fs.Node, err error) { - glog.V(4).Infof("dir Lookup %s: %s by %s", dir.FullPath(), req.Name, req.Header.String()) + glog.V(5).Infof("dir Lookup %s: %s by %s", dir.FullPath(), req.Name, req.Header.String()) fullFilePath := util.NewFullPath(dir.FullPath(), req.Name) dirPath := util.FullPath(dir.FullPath()) @@ -316,10 +316,6 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error { dir.wfs.deleteFileChunks(entry.Chunks) - dir.wfs.fsNodeCache.DeleteFsNode(filePath) - - dir.wfs.metaCache.DeleteEntry(context.Background(), filePath) - glog.V(3).Infof("remove file: %v", req) err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, false, false, false, false) if err != nil { @@ -327,27 +323,29 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error { return fuse.ENOENT } + dir.wfs.metaCache.DeleteEntry(context.Background(), filePath) + dir.wfs.fsNodeCache.DeleteFsNode(filePath) + return nil } func (dir *Dir) removeFolder(req *fuse.RemoveRequest) error { - t := util.NewFullPath(dir.FullPath(), req.Name) - dir.wfs.fsNodeCache.DeleteFsNode(t) - - dir.wfs.metaCache.DeleteEntry(context.Background(), t) - glog.V(3).Infof("remove directory entry: %v", req) err := filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, true, false, false, false) if err != nil { - glog.V(3).Infof("remove %s/%s: %v", dir.FullPath(), req.Name, err) + glog.V(0).Infof("remove %s/%s: %v", dir.FullPath(), req.Name, err) if strings.Contains(err.Error(), "non-empty"){ return fuse.EEXIST } return fuse.ENOENT } + t := util.NewFullPath(dir.FullPath(), req.Name) + dir.wfs.metaCache.DeleteEntry(context.Background(), t) + dir.wfs.fsNodeCache.DeleteFsNode(t) + return nil } From 0d60e678166b59d59d32af31bfefdafe92581823 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 14:15:07 -0700 Subject: [PATCH 15/81] ensure meta data changes are updated --- weed/filesys/file.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 83f6950bd..519e12c59 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -139,22 +139,31 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f } if req.Valid.Mode() { file.entry.Attributes.FileMode = uint32(req.Mode) + file.dirtyMetadata = true } if req.Valid.Uid() { file.entry.Attributes.Uid = req.Uid + file.dirtyMetadata = true } if req.Valid.Gid() { file.entry.Attributes.Gid = req.Gid + file.dirtyMetadata = true } if req.Valid.Crtime() { file.entry.Attributes.Crtime = req.Crtime.Unix() + file.dirtyMetadata = true } if req.Valid.Mtime() { file.entry.Attributes.Mtime = req.Mtime.Unix() + file.dirtyMetadata = true + } + + if req.Valid.Handle() { + // fmt.Printf("file handle => %d\n", req.Handle) } if file.isOpen > 0 { From 24bfd267193175afeebb2a19e0f77c75c1f28006 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 14:37:07 -0700 Subject: [PATCH 16/81] make it easy to test randome access file --- other/java/random_access/pom.xml | 58 ++ .../btree/BTreePersistentIndexedCache.java | 753 ++++++++++++++++++ .../java/seaweedfs/client/btree/Block.java | 59 ++ .../seaweedfs/client/btree/BlockPayload.java | 51 ++ .../seaweedfs/client/btree/BlockPointer.java | 75 ++ .../seaweedfs/client/btree/BlockStore.java | 68 ++ .../seaweedfs/client/btree/BufferCaster.java | 30 + .../seaweedfs/client/btree/ByteInput.java | 74 ++ .../seaweedfs/client/btree/ByteOutput.java | 74 ++ .../client/btree/CachingBlockStore.java | 129 +++ .../client/btree/CorruptedCacheException.java | 22 + .../client/btree/FileBackedBlockStore.java | 274 +++++++ .../client/btree/FreeListBlockStore.java | 283 +++++++ .../seaweedfs/client/btree/KeyHasher.java | 75 ++ .../btree/RandomAccessFileInputStream.java | 54 ++ .../btree/RandomAccessFileOutputStream.java | 48 ++ .../client/btree/StateCheckBlockStore.java | 87 ++ .../client/btree/StreamByteBuffer.java | 526 ++++++++++++ .../client/btree/UncheckedException.java | 88 ++ .../client/btree/UncheckedIOException.java | 36 + .../btree/serialize/AbstractDecoder.java | 133 ++++ .../btree/serialize/AbstractEncoder.java | 101 +++ .../btree/serialize/AbstractSerializer.java | 40 + .../client/btree/serialize/Cast.java | 79 ++ .../ClassLoaderObjectInputStream.java | 43 + .../client/btree/serialize/Decoder.java | 140 ++++ .../btree/serialize/DefaultSerializer.java | 73 ++ .../client/btree/serialize/Encoder.java | 110 +++ .../btree/serialize/FlushableEncoder.java | 31 + .../client/btree/serialize/ObjectReader.java | 28 + .../client/btree/serialize/ObjectWriter.java | 21 + .../client/btree/serialize/Serializer.java | 33 + .../btree/serialize/StatefulSerializer.java | 33 + .../serialize/kryo/KryoBackedDecoder.java | 210 +++++ .../serialize/kryo/KryoBackedEncoder.java | 134 ++++ .../StringDeduplicatingKryoBackedDecoder.java | 188 +++++ .../StringDeduplicatingKryoBackedEncoder.java | 128 +++ .../serialize/kryo/TypeSafeSerializer.java | 51 ++ .../BTreePersistentIndexedCacheTest.java | 476 +++++++++++ 39 files changed, 4916 insertions(+) create mode 100644 other/java/random_access/pom.xml create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java create mode 100644 other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java create mode 100644 other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java diff --git a/other/java/random_access/pom.xml b/other/java/random_access/pom.xml new file mode 100644 index 000000000..6c5c90eea --- /dev/null +++ b/other/java/random_access/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + com.seaweedfs.test + random_access + jar + 1.0-SNAPSHOT + + + 28.0-jre + + + + + com.google.guava + guava + ${guava.version} + + + org.slf4j + slf4j-api + 1.7.25 + + + junit + junit + 4.12 + test + + + com.esotericsoftware.kryo + kryo + 2.24.0 + + + + + + + kr.motd.maven + os-maven-plugin + 1.6.2 + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + + diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java new file mode 100644 index 000000000..8409c40b3 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java @@ -0,0 +1,753 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import com.google.common.collect.ImmutableSet; +import seaweedfs.client.btree.serialize.Serializer; +import seaweedfs.client.btree.serialize.kryo.KryoBackedDecoder; +import seaweedfs.client.btree.serialize.kryo.KryoBackedEncoder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +// todo - stream serialised value to file +// todo - handle hash collisions (properly, this time) +// todo - don't store null links to child blocks in leaf index blocks +// todo - align block boundaries +// todo - thread safety control +// todo - merge small values into a single data block +// todo - discard when file corrupt +// todo - include data directly in index entry when serializer can guarantee small fixed sized data +// todo - free list leaks disk space +// todo - merge adjacent free blocks +// todo - use more efficient lookup for free block with nearest size +@SuppressWarnings("unchecked") +public class BTreePersistentIndexedCache { + private static final Logger LOGGER = LoggerFactory.getLogger(BTreePersistentIndexedCache.class); + private final File cacheFile; + private final KeyHasher keyHasher; + private final Serializer serializer; + private final short maxChildIndexEntries; + private final int minIndexChildNodes; + private final StateCheckBlockStore store; + private HeaderBlock header; + + public BTreePersistentIndexedCache(File cacheFile, Serializer keySerializer, Serializer valueSerializer) { + this(cacheFile, keySerializer, valueSerializer, (short) 512, 512); + } + + public BTreePersistentIndexedCache(File cacheFile, Serializer keySerializer, Serializer valueSerializer, + short maxChildIndexEntries, int maxFreeListEntries) { + this.cacheFile = cacheFile; + this.keyHasher = new KeyHasher(keySerializer); + this.serializer = valueSerializer; + this.maxChildIndexEntries = maxChildIndexEntries; + this.minIndexChildNodes = maxChildIndexEntries / 2; + BlockStore cachingStore = new CachingBlockStore(new FileBackedBlockStore(cacheFile), ImmutableSet.of(IndexBlock.class, FreeListBlockStore.FreeListBlock.class)); + this.store = new StateCheckBlockStore(new FreeListBlockStore(cachingStore, maxFreeListEntries)); + try { + open(); + } catch (Exception e) { + throw new UncheckedIOException(String.format("Could not open %s.", this), e); + } + } + + @Override + public String toString() { + return "cache " + cacheFile.getName() + " (" + cacheFile + ")"; + } + + private void open() throws Exception { + LOGGER.debug("Opening {}", this); + try { + doOpen(); + } catch (CorruptedCacheException e) { + rebuild(); + } + } + + private void doOpen() throws Exception { + BlockStore.Factory factory = new BlockStore.Factory() { + @Override + public Object create(Class type) { + if (type == HeaderBlock.class) { + return new HeaderBlock(); + } + if (type == IndexBlock.class) { + return new IndexBlock(); + } + if (type == DataBlock.class) { + return new DataBlock(); + } + throw new UnsupportedOperationException(); + } + }; + Runnable initAction = new Runnable() { + @Override + public void run() { + header = new HeaderBlock(); + store.write(header); + header.index.newRoot(); + store.flush(); + } + }; + + store.open(initAction, factory); + header = store.readFirst(HeaderBlock.class); + } + + public V get(K key) { + try { + try { + DataBlock block = header.getRoot().get(key); + if (block != null) { + return block.getValue(); + } + return null; + } catch (CorruptedCacheException e) { + rebuild(); + return null; + } + } catch (Exception e) { + throw new UncheckedIOException(String.format("Could not read entry '%s' from %s.", key, this), e); + } + } + + public void put(K key, V value) { + try { + long hashCode = keyHasher.getHashCode(key); + Lookup lookup = header.getRoot().find(hashCode); + DataBlock newBlock = null; + if (lookup.entry != null) { + DataBlock block = store.read(lookup.entry.dataBlock, DataBlock.class); + DataBlockUpdateResult updateResult = block.useNewValue(value); + if (updateResult.isFailed()) { + store.remove(block); + newBlock = new DataBlock(value, updateResult.getSerializedValue()); + } + } else { + newBlock = new DataBlock(value); + } + if (newBlock != null) { + store.write(newBlock); + lookup.indexBlock.put(hashCode, newBlock.getPos()); + } + store.flush(); + } catch (Exception e) { + throw new UncheckedIOException(String.format("Could not add entry '%s' to %s.", key, this), e); + } + } + + public void remove(K key) { + try { + Lookup lookup = header.getRoot().find(key); + if (lookup.entry == null) { + return; + } + lookup.indexBlock.remove(lookup.entry); + DataBlock block = store.read(lookup.entry.dataBlock, DataBlock.class); + store.remove(block); + store.flush(); + } catch (Exception e) { + throw new UncheckedIOException(String.format("Could not remove entry '%s' from %s.", key, this), e); + } + } + + private IndexBlock load(BlockPointer pos, IndexRoot root, IndexBlock parent, int index) { + IndexBlock block = store.read(pos, IndexBlock.class); + block.root = root; + block.parent = parent; + block.parentEntryIndex = index; + return block; + } + + public void reset() { + close(); + try { + open(); + } catch (Exception e) { + throw new UncheckedIOException(e); + } + } + + public void close() { + LOGGER.debug("Closing {}", this); + try { + store.close(); + } catch (Exception e) { + throw new UncheckedIOException(e); + } + } + + public boolean isOpen() { + return store.isOpen(); + } + + private void rebuild() { + LOGGER.warn("{} is corrupt. Discarding.", this); + try { + clear(); + } catch (Exception e) { + LOGGER.warn("{} couldn't be rebuilt. Closing.", this); + close(); + } + } + + public void verify() { + try { + doVerify(); + } catch (Exception e) { + throw new UncheckedIOException(String.format("Some problems were found when checking the integrity of %s.", + this), e); + } + } + + private void doVerify() throws Exception { + List blocks = new ArrayList(); + + HeaderBlock header = store.readFirst(HeaderBlock.class); + blocks.add(header); + verifyTree(header.getRoot(), "", blocks, Long.MAX_VALUE, true); + + Collections.sort(blocks, new Comparator() { + @Override + public int compare(BlockPayload block, BlockPayload block1) { + return block.getPos().compareTo(block1.getPos()); + } + }); + + for (int i = 0; i < blocks.size() - 1; i++) { + Block b1 = blocks.get(i).getBlock(); + Block b2 = blocks.get(i + 1).getBlock(); + if (b1.getPos().getPos() + b1.getSize() > b2.getPos().getPos()) { + throw new IOException(String.format("%s overlaps with %s", b1, b2)); + } + } + } + + private void verifyTree(IndexBlock current, String prefix, Collection blocks, long maxValue, + boolean loadData) throws Exception { + blocks.add(current); + + if (!prefix.equals("") && current.entries.size() < maxChildIndexEntries / 2) { + throw new IOException(String.format("Too few entries found in %s", current)); + } + if (current.entries.size() > maxChildIndexEntries) { + throw new IOException(String.format("Too many entries found in %s", current)); + } + + boolean isLeaf = current.entries.size() == 0 || current.entries.get(0).childIndexBlock.isNull(); + if (isLeaf ^ current.tailPos.isNull()) { + throw new IOException(String.format("Mismatched leaf/tail-node in %s", current)); + } + + long min = Long.MIN_VALUE; + for (IndexEntry entry : current.entries) { + if (isLeaf ^ entry.childIndexBlock.isNull()) { + throw new IOException(String.format("Mismatched leaf/non-leaf entry in %s", current)); + } + if (entry.hashCode >= maxValue || entry.hashCode <= min) { + throw new IOException(String.format("Out-of-order key in %s", current)); + } + min = entry.hashCode; + if (!entry.childIndexBlock.isNull()) { + IndexBlock child = store.read(entry.childIndexBlock, IndexBlock.class); + verifyTree(child, " " + prefix, blocks, entry.hashCode, loadData); + } + if (loadData) { + DataBlock block = store.read(entry.dataBlock, DataBlock.class); + blocks.add(block); + } + } + if (!current.tailPos.isNull()) { + IndexBlock tail = store.read(current.tailPos, IndexBlock.class); + verifyTree(tail, " " + prefix, blocks, maxValue, loadData); + } + } + + public void clear() { + store.clear(); + close(); + try { + doOpen(); + } catch (Exception e) { + throw new UncheckedIOException(e); + } + } + + private class IndexRoot { + private BlockPointer rootPos = BlockPointer.start(); + private HeaderBlock owner; + + private IndexRoot(HeaderBlock owner) { + this.owner = owner; + } + + public void setRootPos(BlockPointer rootPos) { + this.rootPos = rootPos; + store.write(owner); + } + + public IndexBlock getRoot() { + return load(rootPos, this, null, 0); + } + + public IndexBlock newRoot() { + IndexBlock block = new IndexBlock(); + store.write(block); + setRootPos(block.getPos()); + return block; + } + } + + private class HeaderBlock extends BlockPayload { + private IndexRoot index; + + private HeaderBlock() { + index = new IndexRoot(this); + } + + @Override + protected byte getType() { + return 0x55; + } + + @Override + protected int getSize() { + return Block.LONG_SIZE + Block.SHORT_SIZE; + } + + @Override + protected void read(DataInputStream instr) throws Exception { + index.rootPos = BlockPointer.pos(instr.readLong()); + + short actualChildIndexEntries = instr.readShort(); + if (actualChildIndexEntries != maxChildIndexEntries) { + throw blockCorruptedException(); + } + } + + @Override + protected void write(DataOutputStream outstr) throws Exception { + outstr.writeLong(index.rootPos.getPos()); + outstr.writeShort(maxChildIndexEntries); + } + + public IndexBlock getRoot() throws Exception { + return index.getRoot(); + } + } + + private class IndexBlock extends BlockPayload { + private final List entries = new ArrayList(); + private BlockPointer tailPos = BlockPointer.start(); + // Transient fields + private IndexBlock parent; + private int parentEntryIndex; + private IndexRoot root; + + @Override + protected byte getType() { + return 0x77; + } + + @Override + protected int getSize() { + return Block.INT_SIZE + Block.LONG_SIZE + (3 * Block.LONG_SIZE) * maxChildIndexEntries; + } + + @Override + public void read(DataInputStream instr) throws IOException { + int count = instr.readInt(); + entries.clear(); + for (int i = 0; i < count; i++) { + IndexEntry entry = new IndexEntry(); + entry.hashCode = instr.readLong(); + entry.dataBlock = BlockPointer.pos(instr.readLong()); + entry.childIndexBlock = BlockPointer.pos(instr.readLong()); + entries.add(entry); + } + tailPos = BlockPointer.pos(instr.readLong()); + } + + @Override + public void write(DataOutputStream outstr) throws IOException { + outstr.writeInt(entries.size()); + for (IndexEntry entry : entries) { + outstr.writeLong(entry.hashCode); + outstr.writeLong(entry.dataBlock.getPos()); + outstr.writeLong(entry.childIndexBlock.getPos()); + } + outstr.writeLong(tailPos.getPos()); + } + + public void put(long hashCode, BlockPointer pos) throws Exception { + int index = Collections.binarySearch(entries, new IndexEntry(hashCode)); + IndexEntry entry; + if (index >= 0) { + entry = entries.get(index); + } else { + assert tailPos.isNull(); + entry = new IndexEntry(); + entry.hashCode = hashCode; + entry.childIndexBlock = BlockPointer.start(); + index = -index - 1; + entries.add(index, entry); + } + + entry.dataBlock = pos; + store.write(this); + + maybeSplit(); + } + + private void maybeSplit() throws Exception { + if (entries.size() > maxChildIndexEntries) { + int splitPos = entries.size() / 2; + IndexEntry splitEntry = entries.remove(splitPos); + if (parent == null) { + parent = root.newRoot(); + } + IndexBlock sibling = new IndexBlock(); + store.write(sibling); + List siblingEntries = entries.subList(splitPos, entries.size()); + sibling.entries.addAll(siblingEntries); + siblingEntries.clear(); + sibling.tailPos = tailPos; + tailPos = splitEntry.childIndexBlock; + splitEntry.childIndexBlock = BlockPointer.start(); + parent.add(this, splitEntry, sibling); + } + } + + private void add(IndexBlock left, IndexEntry entry, IndexBlock right) throws Exception { + int index = left.parentEntryIndex; + if (index < entries.size()) { + IndexEntry parentEntry = entries.get(index); + assert parentEntry.childIndexBlock.equals(left.getPos()); + parentEntry.childIndexBlock = right.getPos(); + } else { + assert index == entries.size() && (tailPos.isNull() || tailPos.equals(left.getPos())); + tailPos = right.getPos(); + } + entries.add(index, entry); + entry.childIndexBlock = left.getPos(); + store.write(this); + + maybeSplit(); + } + + public DataBlock get(K key) throws Exception { + Lookup lookup = find(key); + if (lookup.entry == null) { + return null; + } + + return store.read(lookup.entry.dataBlock, DataBlock.class); + } + + public Lookup find(K key) throws Exception { + long checksum = keyHasher.getHashCode(key); + return find(checksum); + } + + private Lookup find(long hashCode) throws Exception { + int index = Collections.binarySearch(entries, new IndexEntry(hashCode)); + if (index >= 0) { + return new Lookup(this, entries.get(index)); + } + + index = -index - 1; + BlockPointer childBlockPos; + if (index == entries.size()) { + childBlockPos = tailPos; + } else { + childBlockPos = entries.get(index).childIndexBlock; + } + if (childBlockPos.isNull()) { + return new Lookup(this, null); + } + + IndexBlock childBlock = load(childBlockPos, root, this, index); + return childBlock.find(hashCode); + } + + public void remove(IndexEntry entry) throws Exception { + int index = entries.indexOf(entry); + assert index >= 0; + entries.remove(index); + store.write(this); + + if (entry.childIndexBlock.isNull()) { + maybeMerge(); + } else { + // Not a leaf node. Move up an entry from a leaf node, then possibly merge the leaf node + IndexBlock leafBlock = load(entry.childIndexBlock, root, this, index); + leafBlock = leafBlock.findHighestLeaf(); + IndexEntry highestEntry = leafBlock.entries.remove(leafBlock.entries.size() - 1); + highestEntry.childIndexBlock = entry.childIndexBlock; + entries.add(index, highestEntry); + store.write(leafBlock); + leafBlock.maybeMerge(); + } + } + + private void maybeMerge() throws Exception { + if (parent == null) { + // This is the root block. Can have any number of children <= maxChildIndexEntries + if (entries.size() == 0 && !tailPos.isNull()) { + // This is an empty root block, discard it + header.index.setRootPos(tailPos); + store.remove(this); + } + return; + } + + // This is not the root block. Must have children >= minIndexChildNodes + if (entries.size() >= minIndexChildNodes) { + return; + } + + // Attempt to merge with the left sibling + IndexBlock left = parent.getPrevious(this); + if (left != null) { + assert entries.size() + left.entries.size() <= maxChildIndexEntries * 2; + if (left.entries.size() > minIndexChildNodes) { + // There are enough entries in this block and the left sibling to make up 2 blocks, so redistribute + // the entries evenly between them + left.mergeFrom(this); + left.maybeSplit(); + return; + } else { + // There are only enough entries to make up 1 block, so move the entries of the left sibling into + // this block and discard the left sibling. Might also need to merge the parent + left.mergeFrom(this); + parent.maybeMerge(); + return; + } + } + + // Attempt to merge with the right sibling + IndexBlock right = parent.getNext(this); + if (right != null) { + assert entries.size() + right.entries.size() <= maxChildIndexEntries * 2; + if (right.entries.size() > minIndexChildNodes) { + // There are enough entries in this block and the right sibling to make up 2 blocks, so redistribute + // the entries evenly between them + mergeFrom(right); + maybeSplit(); + return; + } else { + // There are only enough entries to make up 1 block, so move the entries of the right sibling into + // this block and discard this block. Might also need to merge the parent + mergeFrom(right); + parent.maybeMerge(); + return; + } + } + + // Should not happen + throw new IllegalStateException(String.format("%s does not have any siblings.", getBlock())); + } + + private void mergeFrom(IndexBlock right) throws Exception { + IndexEntry newChildEntry = parent.entries.remove(parentEntryIndex); + if (right.getPos().equals(parent.tailPos)) { + parent.tailPos = getPos(); + } else { + IndexEntry newParentEntry = parent.entries.get(parentEntryIndex); + assert newParentEntry.childIndexBlock.equals(right.getPos()); + newParentEntry.childIndexBlock = getPos(); + } + entries.add(newChildEntry); + entries.addAll(right.entries); + newChildEntry.childIndexBlock = tailPos; + tailPos = right.tailPos; + store.write(parent); + store.write(this); + store.remove(right); + } + + private IndexBlock getNext(IndexBlock indexBlock) throws Exception { + int index = indexBlock.parentEntryIndex + 1; + if (index > entries.size()) { + return null; + } + if (index == entries.size()) { + return load(tailPos, root, this, index); + } + return load(entries.get(index).childIndexBlock, root, this, index); + } + + private IndexBlock getPrevious(IndexBlock indexBlock) throws Exception { + int index = indexBlock.parentEntryIndex - 1; + if (index < 0) { + return null; + } + return load(entries.get(index).childIndexBlock, root, this, index); + } + + private IndexBlock findHighestLeaf() throws Exception { + if (tailPos.isNull()) { + return this; + } + return load(tailPos, root, this, entries.size()).findHighestLeaf(); + } + } + + private static class IndexEntry implements Comparable { + long hashCode; + BlockPointer dataBlock; + BlockPointer childIndexBlock; + + private IndexEntry() { + } + + private IndexEntry(long hashCode) { + this.hashCode = hashCode; + } + + @Override + public int compareTo(IndexEntry indexEntry) { + if (hashCode > indexEntry.hashCode) { + return 1; + } + if (hashCode < indexEntry.hashCode) { + return -1; + } + return 0; + } + } + + private class Lookup { + final IndexBlock indexBlock; + final IndexEntry entry; + + private Lookup(IndexBlock indexBlock, IndexEntry entry) { + this.indexBlock = indexBlock; + this.entry = entry; + } + } + + private class DataBlock extends BlockPayload { + private int size; + private StreamByteBuffer buffer; + private V value; + + private DataBlock() { + } + + public DataBlock(V value) throws Exception { + this.value = value; + setValue(value); + size = buffer.totalBytesUnread(); + } + + public DataBlock(V value, StreamByteBuffer buffer) throws Exception { + this.value = value; + this.buffer = buffer; + size = buffer.totalBytesUnread(); + } + + public void setValue(V value) throws Exception { + buffer = StreamByteBuffer.createWithChunkSizeInDefaultRange(size); + KryoBackedEncoder encoder = new KryoBackedEncoder(buffer.getOutputStream()); + serializer.write(encoder, value); + encoder.flush(); + } + + public V getValue() throws Exception { + if (value == null) { + value = serializer.read(new KryoBackedDecoder(buffer.getInputStream())); + buffer = null; + } + return value; + } + + @Override + protected byte getType() { + return 0x33; + } + + @Override + protected int getSize() { + return 2 * Block.INT_SIZE + size; + } + + @Override + public void read(DataInputStream instr) throws Exception { + size = instr.readInt(); + int bytes = instr.readInt(); + buffer = StreamByteBuffer.of(instr, bytes); + } + + @Override + public void write(DataOutputStream outstr) throws Exception { + outstr.writeInt(size); + outstr.writeInt(buffer.totalBytesUnread()); + buffer.writeTo(outstr); + buffer = null; + } + + public DataBlockUpdateResult useNewValue(V value) throws Exception { + setValue(value); + boolean ok = buffer.totalBytesUnread() <= size; + if (ok) { + this.value = value; + store.write(this); + return DataBlockUpdateResult.success(); + } else { + return DataBlockUpdateResult.failed(buffer); + } + } + } + + private static class DataBlockUpdateResult { + private static final DataBlockUpdateResult SUCCESS = new DataBlockUpdateResult(true, null); + private final boolean success; + private final StreamByteBuffer serializedValue; + + private DataBlockUpdateResult(boolean success, StreamByteBuffer serializedValue) { + this.success = success; + this.serializedValue = serializedValue; + } + + static DataBlockUpdateResult success() { + return SUCCESS; + } + + static DataBlockUpdateResult failed(StreamByteBuffer serializedValue) { + return new DataBlockUpdateResult(false, serializedValue); + } + + public boolean isFailed() { + return !success; + } + + public StreamByteBuffer getSerializedValue() { + return serializedValue; + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java new file mode 100644 index 000000000..f3ecb2421 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +public abstract class Block { + static final int LONG_SIZE = 8; + static final int INT_SIZE = 4; + static final int SHORT_SIZE = 2; + + private BlockPayload payload; + + protected Block(BlockPayload payload) { + this.payload = payload; + payload.setBlock(this); + } + + public BlockPayload getPayload() { + return payload; + } + + protected void detach() { + payload.setBlock(null); + payload = null; + } + + public abstract BlockPointer getPos(); + + public abstract int getSize(); + + public abstract RuntimeException blockCorruptedException(); + + @Override + public String toString() { + return payload.getClass().getSimpleName() + " " + getPos(); + } + + public BlockPointer getNextPos() { + return BlockPointer.pos(getPos().getPos() + getSize()); + } + + public abstract boolean hasPos(); + + public abstract void setPos(BlockPointer pos); + + public abstract void setSize(int size); +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java new file mode 100644 index 000000000..d14af26c7 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java @@ -0,0 +1,51 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.DataInputStream; +import java.io.DataOutputStream; + +public abstract class BlockPayload { + private Block block; + + public Block getBlock() { + return block; + } + + public void setBlock(Block block) { + this.block = block; + } + + public BlockPointer getPos() { + return getBlock().getPos(); + } + + public BlockPointer getNextPos() { + return getBlock().getNextPos(); + } + + protected abstract int getSize(); + + protected abstract byte getType(); + + protected abstract void read(DataInputStream inputStream) throws Exception; + + protected abstract void write(DataOutputStream outputStream) throws Exception; + + protected RuntimeException blockCorruptedException() { + return getBlock().blockCorruptedException(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java new file mode 100644 index 000000000..38bff7d97 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java @@ -0,0 +1,75 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import com.google.common.primitives.Longs; + +public class BlockPointer implements Comparable { + + private static final BlockPointer NULL = new BlockPointer(-1); + + public static BlockPointer start() { + return NULL; + } + + public static BlockPointer pos(long pos) { + if (pos < -1) { + throw new CorruptedCacheException("block pointer must be >= -1, but was" + pos); + } + if (pos == -1) { + return NULL; + } + return new BlockPointer(pos); + } + + private final long pos; + + private BlockPointer(long pos) { + this.pos = pos; + } + + public boolean isNull() { + return pos < 0; + } + + public long getPos() { + return pos; + } + + @Override + public String toString() { + return String.valueOf(pos); + } + + @Override + public boolean equals(Object obj) { + if (obj == null || obj.getClass() != getClass()) { + return false; + } + BlockPointer other = (BlockPointer) obj; + return pos == other.pos; + } + + @Override + public int hashCode() { + return Longs.hashCode(pos); + } + + @Override + public int compareTo(BlockPointer o) { + return Longs.compare(pos, o.pos); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java new file mode 100644 index 000000000..141eb70fe --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java @@ -0,0 +1,68 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +public interface BlockStore { + /** + * Opens this store, calling the given action if the store is empty. + */ + void open(Runnable initAction, Factory factory); + + /** + * Closes this store. + */ + void close(); + + /** + * Discards all blocks from this store. + */ + void clear(); + + /** + * Removes the given block from this store. + */ + void remove(BlockPayload block); + + /** + * Reads the first block from this store. + */ + T readFirst(Class payloadType); + + /** + * Reads a block from this store. + */ + T read(BlockPointer pos, Class payloadType); + + /** + * Writes a block to this store, adding the block if required. + */ + void write(BlockPayload block); + + /** + * Adds a new block to this store. Allocates space for the block, but does not write the contents of the block + * until {@link #write(BlockPayload)} is called. + */ + void attach(BlockPayload block); + + /** + * Flushes any pending updates for this store. + */ + void flush(); + + interface Factory { + Object create(Class type); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java new file mode 100644 index 000000000..a43160211 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java @@ -0,0 +1,30 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree; + +import java.nio.Buffer; + +public class BufferCaster { + /** + * Without this cast, when the code compiled by Java 9+ is executed on Java 8, it will throw + * java.lang.NoSuchMethodError: Method flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer + */ + @SuppressWarnings("RedundantCast") + public static Buffer cast(T byteBuffer) { + return (Buffer) byteBuffer; + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java new file mode 100644 index 000000000..2030a8cde --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java @@ -0,0 +1,74 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree; + +import com.google.common.io.CountingInputStream; + +import java.io.BufferedInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; + +/** + * Allows a stream of bytes to be read from a particular location of some backing byte stream. + */ +class ByteInput { + private final RandomAccessFile file; + private final ResettableBufferedInputStream bufferedInputStream; + private CountingInputStream countingInputStream; + + public ByteInput(RandomAccessFile file) { + this.file = file; + bufferedInputStream = new ResettableBufferedInputStream(new RandomAccessFileInputStream(file)); + } + + /** + * Starts reading from the given offset. + */ + public DataInputStream start(long offset) throws IOException { + file.seek(offset); + bufferedInputStream.clear(); + countingInputStream = new CountingInputStream(bufferedInputStream); + return new DataInputStream(countingInputStream); + } + + /** + * Returns the number of bytes read since {@link #start(long)} was called. + */ + public long getBytesRead() { + return countingInputStream.getCount(); + } + + /** + * Finishes reading, resetting any buffered state. + */ + public void done() { + countingInputStream = null; + } + + private static class ResettableBufferedInputStream extends BufferedInputStream { + ResettableBufferedInputStream(InputStream input) { + super(input); + } + + void clear() { + count = 0; + pos = 0; + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java new file mode 100644 index 000000000..dfb24cfd0 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java @@ -0,0 +1,74 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree; + +import com.google.common.io.CountingOutputStream; + +import java.io.BufferedOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.RandomAccessFile; + +/** + * Allows a stream of bytes to be written to a particular location of some backing byte stream. + */ +class ByteOutput { + private final RandomAccessFile file; + private final ResettableBufferedOutputStream bufferedOutputStream; + private CountingOutputStream countingOutputStream; + + public ByteOutput(RandomAccessFile file) { + this.file = file; + bufferedOutputStream = new ResettableBufferedOutputStream(new RandomAccessFileOutputStream(file)); + } + + /** + * Starts writing to the given offset. Can be beyond the current length of the file. + */ + public DataOutputStream start(long offset) throws IOException { + file.seek(offset); + bufferedOutputStream.clear(); + countingOutputStream = new CountingOutputStream(bufferedOutputStream); + return new DataOutputStream(countingOutputStream); + } + + /** + * Returns the number of byte written since {@link #start(long)} was called. + */ + public long getBytesWritten() { + return countingOutputStream.getCount(); + } + + /** + * Finishes writing, flushing and resetting any buffered state + */ + public void done() throws IOException { + countingOutputStream.flush(); + countingOutputStream = null; + } + + private static class ResettableBufferedOutputStream extends BufferedOutputStream { + ResettableBufferedOutputStream(OutputStream output) { + super(output); + } + + void clear() { + count = 0; + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java new file mode 100644 index 000000000..308838b1d --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java @@ -0,0 +1,129 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.ImmutableSet; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; + +public class CachingBlockStore implements BlockStore { + private final BlockStore store; + private final Map dirty = new LinkedHashMap(); + private final Cache indexBlockCache = CacheBuilder.newBuilder().maximumSize(100).concurrencyLevel(1).build(); + private final ImmutableSet> cacheableBlockTypes; + + public CachingBlockStore(BlockStore store, Collection> cacheableBlockTypes) { + this.store = store; + this.cacheableBlockTypes = ImmutableSet.copyOf(cacheableBlockTypes); + } + + @Override + public void open(Runnable initAction, Factory factory) { + store.open(initAction, factory); + } + + @Override + public void close() { + flush(); + indexBlockCache.invalidateAll(); + store.close(); + } + + @Override + public void clear() { + dirty.clear(); + indexBlockCache.invalidateAll(); + store.clear(); + } + + @Override + public void flush() { + Iterator iterator = dirty.values().iterator(); + while (iterator.hasNext()) { + BlockPayload block = iterator.next(); + iterator.remove(); + store.write(block); + } + store.flush(); + } + + @Override + public void attach(BlockPayload block) { + store.attach(block); + } + + @Override + public void remove(BlockPayload block) { + dirty.remove(block.getPos()); + if (isCacheable(block)) { + indexBlockCache.invalidate(block.getPos()); + } + store.remove(block); + } + + @Override + public T readFirst(Class payloadType) { + T block = store.readFirst(payloadType); + maybeCache(block); + return block; + } + + @Override + public T read(BlockPointer pos, Class payloadType) { + T block = payloadType.cast(dirty.get(pos)); + if (block != null) { + return block; + } + block = maybeGetFromCache(pos, payloadType); + if (block != null) { + return block; + } + block = store.read(pos, payloadType); + maybeCache(block); + return block; + } + + @Nullable + private T maybeGetFromCache(BlockPointer pos, Class payloadType) { + if (cacheableBlockTypes.contains(payloadType)) { + return payloadType.cast(indexBlockCache.getIfPresent(pos)); + } + return null; + } + + @Override + public void write(BlockPayload block) { + store.attach(block); + maybeCache(block); + dirty.put(block.getPos(), block); + } + + private void maybeCache(T block) { + if (isCacheable(block)) { + indexBlockCache.put(block.getPos(), block); + } + } + + private boolean isCacheable(T block) { + return cacheableBlockTypes.contains(block.getClass()); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java new file mode 100644 index 000000000..8f9ac1240 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java @@ -0,0 +1,22 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +class CorruptedCacheException extends RuntimeException { + CorruptedCacheException(String message) { + super(message); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java new file mode 100644 index 000000000..556db3647 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java @@ -0,0 +1,274 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; + +public class FileBackedBlockStore implements BlockStore { + private final File cacheFile; + private RandomAccessFile file; + private ByteOutput output; + private ByteInput input; + private long nextBlock; + private Factory factory; + private long currentFileSize; + + public FileBackedBlockStore(File cacheFile) { + this.cacheFile = cacheFile; + } + + @Override + public String toString() { + return "cache '" + cacheFile + "'"; + } + + @Override + public void open(Runnable runnable, Factory factory) { + this.factory = factory; + try { + cacheFile.getParentFile().mkdirs(); + file = openRandomAccessFile(); + output = new ByteOutput(file); + input = new ByteInput(file); + currentFileSize = file.length(); + nextBlock = currentFileSize; + if (currentFileSize == 0) { + runnable.run(); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private RandomAccessFile openRandomAccessFile() throws FileNotFoundException { + try { + return randomAccessFile("rw"); + } catch (FileNotFoundException e) { + return randomAccessFile("r"); + } + } + + private RandomAccessFile randomAccessFile(String mode) throws FileNotFoundException { + return new RandomAccessFile(cacheFile, mode); + } + + @Override + public void close() { + try { + file.close(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @Override + public void clear() { + try { + file.setLength(0); + currentFileSize = 0; + } catch (IOException e) { + throw new UncheckedIOException(e); + } + nextBlock = 0; + } + + @Override + public void attach(BlockPayload block) { + if (block.getBlock() == null) { + block.setBlock(new BlockImpl(block)); + } + } + + @Override + public void remove(BlockPayload block) { + BlockImpl blockImpl = (BlockImpl) block.getBlock(); + blockImpl.detach(); + } + + @Override + public void flush() { + } + + @Override + public T readFirst(Class payloadType) { + return read(BlockPointer.pos(0), payloadType); + } + + @Override + public T read(BlockPointer pos, Class payloadType) { + assert !pos.isNull(); + try { + T payload = payloadType.cast(factory.create(payloadType)); + BlockImpl block = new BlockImpl(payload, pos); + block.read(); + return payload; + } catch (CorruptedCacheException e) { + throw e; + } catch (Exception e) { + throw new UncheckedIOException(e); + } + } + + @Override + public void write(BlockPayload block) { + BlockImpl blockImpl = (BlockImpl) block.getBlock(); + try { + blockImpl.write(); + } catch (CorruptedCacheException e) { + throw e; + } catch (Exception e) { + throw new UncheckedIOException(e); + } + } + + private long alloc(long length) { + long pos = nextBlock; + nextBlock += length; + return pos; + } + + private final class BlockImpl extends Block { + private static final int HEADER_SIZE = 1 + INT_SIZE; // type, payload size + private static final int TAIL_SIZE = INT_SIZE; + + private BlockPointer pos; + private int payloadSize; + + private BlockImpl(BlockPayload payload, BlockPointer pos) { + this(payload); + setPos(pos); + } + + public BlockImpl(BlockPayload payload) { + super(payload); + pos = null; + payloadSize = -1; + } + + @Override + public boolean hasPos() { + return pos != null; + } + + @Override + public BlockPointer getPos() { + if (pos == null) { + pos = BlockPointer.pos(alloc(getSize())); + } + return pos; + } + + @Override + public void setPos(BlockPointer pos) { + assert this.pos == null && !pos.isNull(); + this.pos = pos; + } + + @Override + public int getSize() { + if (payloadSize < 0) { + payloadSize = getPayload().getSize(); + } + return payloadSize + HEADER_SIZE + TAIL_SIZE; + } + + @Override + public void setSize(int size) { + int newPayloadSize = size - HEADER_SIZE - TAIL_SIZE; + assert newPayloadSize >= payloadSize; + payloadSize = newPayloadSize; + } + + public void write() throws Exception { + long pos = getPos().getPos(); + + DataOutputStream outputStream = output.start(pos); + + BlockPayload payload = getPayload(); + + // Write header + outputStream.writeByte(payload.getType()); + outputStream.writeInt(payloadSize); + long finalSize = pos + HEADER_SIZE + TAIL_SIZE + payloadSize; + + // Write body + payload.write(outputStream); + + // Write count + long bytesWritten = output.getBytesWritten(); + if (bytesWritten > Integer.MAX_VALUE) { + throw new IllegalArgumentException("Block payload exceeds maximum size"); + } + outputStream.writeInt((int) bytesWritten); + output.done(); + + // System.out.println(String.format("wrote [%d,%d)", pos, pos + bytesWritten + 4)); + + // Pad + if (currentFileSize < finalSize) { + // System.out.println(String.format("pad length %d => %d", currentFileSize, finalSize)); + file.setLength(finalSize); + currentFileSize = finalSize; + } + } + + public void read() throws Exception { + long pos = getPos().getPos(); + assert pos >= 0; + if (pos + HEADER_SIZE >= currentFileSize) { + throw blockCorruptedException(); + } + + DataInputStream inputStream = input.start(pos); + + BlockPayload payload = getPayload(); + + // Read header + byte type = inputStream.readByte(); + if (type != payload.getType()) { + throw blockCorruptedException(); + } + + // Read body + payloadSize = inputStream.readInt(); + if (pos + HEADER_SIZE + TAIL_SIZE + payloadSize > currentFileSize) { + throw blockCorruptedException(); + } + payload.read(inputStream); + + // Read and verify count + long actualCount = input.getBytesRead(); + long count = inputStream.readInt(); + if (actualCount != count) { + System.out.println(String.format("read expected %d actual %d, pos %d payloadSize %d currentFileSize %d", count, actualCount, pos, payloadSize, currentFileSize)); + throw blockCorruptedException(); + } + input.done(); + } + + @Override + public RuntimeException blockCorruptedException() { + return new CorruptedCacheException(String.format("Corrupted %s found in %s.", this, + FileBackedBlockStore.this)); + } + } + +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java new file mode 100644 index 000000000..c2cd640f9 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java @@ -0,0 +1,283 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class FreeListBlockStore implements BlockStore { + private final BlockStore store; + private final BlockStore freeListStore; + private final int maxBlockEntries; + private FreeListBlock freeListBlock; + + public FreeListBlockStore(BlockStore store, int maxBlockEntries) { + this.store = store; + freeListStore = this; + this.maxBlockEntries = maxBlockEntries; + } + + @Override + public void open(final Runnable initAction, final Factory factory) { + Runnable freeListInitAction = new Runnable() { + @Override + public void run() { + freeListBlock = new FreeListBlock(); + store.write(freeListBlock); + store.flush(); + initAction.run(); + } + }; + Factory freeListFactory = new Factory() { + @Override + public Object create(Class type) { + if (type == FreeListBlock.class) { + return new FreeListBlock(); + } + return factory.create(type); + } + }; + + store.open(freeListInitAction, freeListFactory); + freeListBlock = store.readFirst(FreeListBlock.class); + } + + @Override + public void close() { + freeListBlock = null; + store.close(); + } + + @Override + public void clear() { + store.clear(); + } + + @Override + public void remove(BlockPayload block) { + Block container = block.getBlock(); + store.remove(block); + freeListBlock.add(container.getPos(), container.getSize()); + } + + @Override + public T readFirst(Class payloadType) { + return store.read(freeListBlock.getNextPos(), payloadType); + } + + @Override + public T read(BlockPointer pos, Class payloadType) { + return store.read(pos, payloadType); + } + + @Override + public void write(BlockPayload block) { + attach(block); + store.write(block); + } + + @Override + public void attach(BlockPayload block) { + store.attach(block); + freeListBlock.alloc(block.getBlock()); + } + + @Override + public void flush() { + store.flush(); + } + + private void verify() { + FreeListBlock block = store.readFirst(FreeListBlock.class); + verify(block, Integer.MAX_VALUE); + } + + private void verify(FreeListBlock block, int maxValue) { + if (block.largestInNextBlock > maxValue) { + throw new RuntimeException("corrupt free list"); + } + int current = 0; + for (FreeListEntry entry : block.entries) { + if (entry.size > maxValue) { + throw new RuntimeException("corrupt free list"); + } + if (entry.size < block.largestInNextBlock) { + throw new RuntimeException("corrupt free list"); + } + if (entry.size < current) { + throw new RuntimeException("corrupt free list"); + } + current = entry.size; + } + if (!block.nextBlock.isNull()) { + verify(store.read(block.nextBlock, FreeListBlock.class), block.largestInNextBlock); + } + } + + public class FreeListBlock extends BlockPayload { + private List entries = new ArrayList(); + private int largestInNextBlock; + private BlockPointer nextBlock = BlockPointer.start(); + // Transient fields + private FreeListBlock prev; + private FreeListBlock next; + + @Override + protected int getSize() { + return Block.LONG_SIZE + Block.INT_SIZE + Block.INT_SIZE + maxBlockEntries * (Block.LONG_SIZE + + Block.INT_SIZE); + } + + @Override + protected byte getType() { + return 0x44; + } + + @Override + protected void read(DataInputStream inputStream) throws Exception { + nextBlock = BlockPointer.pos(inputStream.readLong()); + largestInNextBlock = inputStream.readInt(); + int count = inputStream.readInt(); + for (int i = 0; i < count; i++) { + BlockPointer pos = BlockPointer.pos(inputStream.readLong()); + int size = inputStream.readInt(); + entries.add(new FreeListEntry(pos, size)); + } + } + + @Override + protected void write(DataOutputStream outputStream) throws Exception { + outputStream.writeLong(nextBlock.getPos()); + outputStream.writeInt(largestInNextBlock); + outputStream.writeInt(entries.size()); + for (FreeListEntry entry : entries) { + outputStream.writeLong(entry.pos.getPos()); + outputStream.writeInt(entry.size); + } + } + + public void add(BlockPointer pos, int size) { + assert !pos.isNull() && size >= 0; + if (size == 0) { + return; + } + + if (size < largestInNextBlock) { + FreeListBlock next = getNextBlock(); + next.add(pos, size); + return; + } + + FreeListEntry entry = new FreeListEntry(pos, size); + int index = Collections.binarySearch(entries, entry); + if (index < 0) { + index = -index - 1; + } + entries.add(index, entry); + + if (entries.size() > maxBlockEntries) { + FreeListBlock newBlock = new FreeListBlock(); + newBlock.largestInNextBlock = largestInNextBlock; + newBlock.nextBlock = nextBlock; + newBlock.prev = this; + newBlock.next = next; + next = newBlock; + + List newBlockEntries = entries.subList(0, entries.size() / 2); + newBlock.entries.addAll(newBlockEntries); + newBlockEntries.clear(); + largestInNextBlock = newBlock.entries.get(newBlock.entries.size() - 1).size; + freeListStore.write(newBlock); + nextBlock = newBlock.getPos(); + } + + freeListStore.write(this); + } + + private FreeListBlock getNextBlock() { + if (next == null) { + next = freeListStore.read(nextBlock, FreeListBlock.class); + next.prev = this; + } + return next; + } + + public void alloc(Block block) { + if (block.hasPos()) { + return; + } + + int requiredSize = block.getSize(); + + if (entries.isEmpty() || requiredSize <= largestInNextBlock) { + if (nextBlock.isNull()) { + return; + } + getNextBlock().alloc(block); + return; + } + + int index = Collections.binarySearch(entries, new FreeListEntry(null, requiredSize)); + if (index < 0) { + index = -index - 1; + } + if (index == entries.size()) { + // Largest free block is too small + return; + } + + FreeListEntry entry = entries.remove(index); + block.setPos(entry.pos); + block.setSize(entry.size); + freeListStore.write(this); + + if (entries.size() == 0 && prev != null) { + prev.nextBlock = nextBlock; + prev.largestInNextBlock = largestInNextBlock; + prev.next = next; + if (next != null) { + next.prev = prev; + } + freeListStore.write(prev); + freeListStore.remove(this); + } + } + } + + private static class FreeListEntry implements Comparable { + final BlockPointer pos; + final int size; + + private FreeListEntry(BlockPointer pos, int size) { + this.pos = pos; + this.size = size; + } + + @Override + public int compareTo(FreeListEntry o) { + if (size > o.size) { + return 1; + } + if (size < o.size) { + return -1; + } + return 0; + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java new file mode 100644 index 000000000..bdc78dde2 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java @@ -0,0 +1,75 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree; + +import seaweedfs.client.btree.serialize.Serializer; +import seaweedfs.client.btree.serialize.kryo.KryoBackedEncoder; + +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +class KeyHasher { + private final Serializer serializer; + private final MessageDigestStream digestStream = new MessageDigestStream(); + private final KryoBackedEncoder encoder = new KryoBackedEncoder(digestStream); + + public KeyHasher(Serializer serializer) { + this.serializer = serializer; + } + + long getHashCode(K key) throws Exception { + serializer.write(encoder, key); + encoder.flush(); + return digestStream.getChecksum(); + } + + private static class MessageDigestStream extends OutputStream { + MessageDigest messageDigest; + + private MessageDigestStream() { + try { + messageDigest = MessageDigest.getInstance("MD5"); + } catch (NoSuchAlgorithmException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + @Override + public void write(int b) throws IOException { + messageDigest.update((byte) b); + } + + @Override + public void write(byte[] b) throws IOException { + messageDigest.update(b); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + messageDigest.update(b, off, len); + } + + long getChecksum() { + byte[] digest = messageDigest.digest(); + assert digest.length == 16; + return new BigInteger(digest).longValue(); + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java new file mode 100644 index 000000000..5f876989f --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java @@ -0,0 +1,54 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; + +/** + * Reads from a {@link RandomAccessFile}. Each operation reads from and advances the current position of the file. + * + *

Closing this stream does not close the underlying file. + */ +public class RandomAccessFileInputStream extends InputStream { + private final RandomAccessFile file; + + public RandomAccessFileInputStream(RandomAccessFile file) { + this.file = file; + } + + @Override + public long skip(long n) throws IOException { + file.seek(file.getFilePointer() + n); + return n; + } + + @Override + public int read(byte[] bytes) throws IOException { + return file.read(bytes); + } + + @Override + public int read() throws IOException { + return file.read(); + } + + @Override + public int read(byte[] bytes, int offset, int length) throws IOException { + return file.read(bytes, offset, length); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java new file mode 100644 index 000000000..3327fe3c6 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java @@ -0,0 +1,48 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.RandomAccessFile; + +/** + * Writes to a {@link RandomAccessFile}. Each operation writes to and advances the current position of the file. + * + *

Closing this stream does not close the underlying file. Flushing this stream does nothing. + */ +public class RandomAccessFileOutputStream extends OutputStream { + private final RandomAccessFile file; + + public RandomAccessFileOutputStream(RandomAccessFile file) { + this.file = file; + } + + @Override + public void write(int i) throws IOException { + file.write(i); + } + + @Override + public void write(byte[] bytes) throws IOException { + file.write(bytes); + } + + @Override + public void write(byte[] bytes, int offset, int length) throws IOException { + file.write(bytes, offset, length); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java new file mode 100644 index 000000000..f720ebb2e --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java @@ -0,0 +1,87 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +public class StateCheckBlockStore implements BlockStore { + private final BlockStore blockStore; + private boolean open; + + public StateCheckBlockStore(BlockStore blockStore) { + this.blockStore = blockStore; + } + + @Override + public void open(Runnable initAction, Factory factory) { + assert !open; + open = true; + blockStore.open(initAction, factory); + } + + public boolean isOpen() { + return open; + } + + @Override + public void close() { + if (!open) { + return; + } + open = false; + blockStore.close(); + } + + @Override + public void clear() { + assert open; + blockStore.clear(); + } + + @Override + public void remove(BlockPayload block) { + assert open; + blockStore.remove(block); + } + + @Override + public T readFirst(Class payloadType) { + assert open; + return blockStore.readFirst(payloadType); + } + + @Override + public T read(BlockPointer pos, Class payloadType) { + assert open; + return blockStore.read(pos, payloadType); + } + + @Override + public void write(BlockPayload block) { + assert open; + blockStore.write(block); + } + + @Override + public void attach(BlockPayload block) { + assert open; + blockStore.attach(block); + } + + @Override + public void flush() { + assert open; + blockStore.flush(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java new file mode 100644 index 000000000..8af6e14d8 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java @@ -0,0 +1,526 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; +import java.nio.charset.CodingErrorAction; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + + +/** + * An in-memory buffer that provides OutputStream and InputStream interfaces. + * + * This is more efficient than using ByteArrayOutputStream/ByteArrayInputStream + * + * Reading the buffer will clear the buffer. + * This is not thread-safe, it is intended to be used by a single Thread. + */ +public class StreamByteBuffer { + private static final int DEFAULT_CHUNK_SIZE = 4096; + private static final int MAX_CHUNK_SIZE = 1024 * 1024; + private LinkedList chunks = new LinkedList(); + private StreamByteBufferChunk currentWriteChunk; + private StreamByteBufferChunk currentReadChunk; + private int chunkSize; + private int nextChunkSize; + private int maxChunkSize; + private StreamByteBufferOutputStream output; + private StreamByteBufferInputStream input; + private int totalBytesUnreadInList; + + public StreamByteBuffer() { + this(DEFAULT_CHUNK_SIZE); + } + + public StreamByteBuffer(int chunkSize) { + this.chunkSize = chunkSize; + this.nextChunkSize = chunkSize; + this.maxChunkSize = Math.max(chunkSize, MAX_CHUNK_SIZE); + currentWriteChunk = new StreamByteBufferChunk(nextChunkSize); + output = new StreamByteBufferOutputStream(); + input = new StreamByteBufferInputStream(); + } + + public static StreamByteBuffer of(InputStream inputStream) throws IOException { + StreamByteBuffer buffer = new StreamByteBuffer(chunkSizeInDefaultRange(inputStream.available())); + buffer.readFully(inputStream); + return buffer; + } + + public static StreamByteBuffer of(InputStream inputStream, int len) throws IOException { + StreamByteBuffer buffer = new StreamByteBuffer(chunkSizeInDefaultRange(len)); + buffer.readFrom(inputStream, len); + return buffer; + } + + public static StreamByteBuffer createWithChunkSizeInDefaultRange(int value) { + return new StreamByteBuffer(chunkSizeInDefaultRange(value)); + } + + static int chunkSizeInDefaultRange(int value) { + return valueInRange(value, DEFAULT_CHUNK_SIZE, MAX_CHUNK_SIZE); + } + + private static int valueInRange(int value, int min, int max) { + return Math.min(Math.max(value, min), max); + } + + public OutputStream getOutputStream() { + return output; + } + + public InputStream getInputStream() { + return input; + } + + public void writeTo(OutputStream target) throws IOException { + while (prepareRead() != -1) { + currentReadChunk.writeTo(target); + } + } + + public void readFrom(InputStream inputStream, int len) throws IOException { + int bytesLeft = len; + while (bytesLeft > 0) { + int spaceLeft = allocateSpace(); + int limit = Math.min(spaceLeft, bytesLeft); + int readBytes = currentWriteChunk.readFrom(inputStream, limit); + if (readBytes == -1) { + throw new EOFException("Unexpected EOF"); + } + bytesLeft -= readBytes; + } + } + + public void readFully(InputStream inputStream) throws IOException { + while (true) { + int len = allocateSpace(); + int readBytes = currentWriteChunk.readFrom(inputStream, len); + if (readBytes == -1) { + break; + } + } + } + + public byte[] readAsByteArray() { + byte[] buf = new byte[totalBytesUnread()]; + input.readImpl(buf, 0, buf.length); + return buf; + } + + public List readAsListOfByteArrays() { + List listOfByteArrays = new ArrayList(chunks.size() + 1); + byte[] buf; + while ((buf = input.readNextBuffer()) != null) { + if (buf.length > 0) { + listOfByteArrays.add(buf); + } + } + return listOfByteArrays; + } + + public String readAsString(String encoding) { + Charset charset = Charset.forName(encoding); + return readAsString(charset); + } + + public String readAsString() { + return readAsString(Charset.defaultCharset()); + } + + public String readAsString(Charset charset) { + try { + return doReadAsString(charset); + } catch (CharacterCodingException e) { + throw new UncheckedIOException(e); + } + } + + private String doReadAsString(Charset charset) throws CharacterCodingException { + int unreadSize = totalBytesUnread(); + if (unreadSize > 0) { + return readAsCharBuffer(charset).toString(); + } + return ""; + } + + private CharBuffer readAsCharBuffer(Charset charset) throws CharacterCodingException { + CharsetDecoder decoder = charset.newDecoder().onMalformedInput( + CodingErrorAction.REPLACE).onUnmappableCharacter( + CodingErrorAction.REPLACE); + CharBuffer charbuffer = CharBuffer.allocate(totalBytesUnread()); + ByteBuffer buf = null; + boolean wasUnderflow = false; + ByteBuffer nextBuf = null; + boolean needsFlush = false; + while (hasRemaining(nextBuf) || hasRemaining(buf) || prepareRead() != -1) { + if (hasRemaining(buf)) { + // handle decoding underflow, multi-byte unicode character at buffer chunk boundary + if (!wasUnderflow) { + throw new IllegalStateException("Unexpected state. Buffer has remaining bytes without underflow in decoding."); + } + if (!hasRemaining(nextBuf) && prepareRead() != -1) { + nextBuf = currentReadChunk.readToNioBuffer(); + } + // copy one by one until the underflow has been resolved + buf = ByteBuffer.allocate(buf.remaining() + 1).put(buf); + buf.put(nextBuf.get()); + BufferCaster.cast(buf).flip(); + } else { + if (hasRemaining(nextBuf)) { + buf = nextBuf; + } else if (prepareRead() != -1) { + buf = currentReadChunk.readToNioBuffer(); + if (!hasRemaining(buf)) { + throw new IllegalStateException("Unexpected state. Buffer is empty."); + } + } + nextBuf = null; + } + boolean endOfInput = !hasRemaining(nextBuf) && prepareRead() == -1; + int bufRemainingBefore = buf.remaining(); + CoderResult result = decoder.decode(buf, charbuffer, false); + if (bufRemainingBefore > buf.remaining()) { + needsFlush = true; + } + if (endOfInput) { + result = decoder.decode(ByteBuffer.allocate(0), charbuffer, true); + if (!result.isUnderflow()) { + result.throwException(); + } + break; + } + wasUnderflow = result.isUnderflow(); + } + if (needsFlush) { + CoderResult result = decoder.flush(charbuffer); + if (!result.isUnderflow()) { + result.throwException(); + } + } + clear(); + // push back remaining bytes of multi-byte unicode character + while (hasRemaining(buf)) { + byte b = buf.get(); + try { + getOutputStream().write(b); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + BufferCaster.cast(charbuffer).flip(); + return charbuffer; + } + + private boolean hasRemaining(ByteBuffer nextBuf) { + return nextBuf != null && nextBuf.hasRemaining(); + } + + public int totalBytesUnread() { + int total = totalBytesUnreadInList; + if (currentReadChunk != null) { + total += currentReadChunk.bytesUnread(); + } + if (currentWriteChunk != currentReadChunk && currentWriteChunk != null) { + total += currentWriteChunk.bytesUnread(); + } + return total; + } + + protected int allocateSpace() { + int spaceLeft = currentWriteChunk.spaceLeft(); + if (spaceLeft == 0) { + addChunk(currentWriteChunk); + currentWriteChunk = new StreamByteBufferChunk(nextChunkSize); + if (nextChunkSize < maxChunkSize) { + nextChunkSize = Math.min(nextChunkSize * 2, maxChunkSize); + } + spaceLeft = currentWriteChunk.spaceLeft(); + } + return spaceLeft; + } + + protected int prepareRead() { + int bytesUnread = (currentReadChunk != null) ? currentReadChunk.bytesUnread() : 0; + if (bytesUnread == 0) { + if (!chunks.isEmpty()) { + currentReadChunk = chunks.removeFirst(); + bytesUnread = currentReadChunk.bytesUnread(); + totalBytesUnreadInList -= bytesUnread; + } else if (currentReadChunk != currentWriteChunk) { + currentReadChunk = currentWriteChunk; + bytesUnread = currentReadChunk.bytesUnread(); + } else { + bytesUnread = -1; + } + } + return bytesUnread; + } + + public static StreamByteBuffer of(List listOfByteArrays) { + StreamByteBuffer buffer = new StreamByteBuffer(); + buffer.addChunks(listOfByteArrays); + return buffer; + } + + private void addChunks(List listOfByteArrays) { + for (byte[] buf : listOfByteArrays) { + addChunk(new StreamByteBufferChunk(buf)); + } + } + + private void addChunk(StreamByteBufferChunk chunk) { + chunks.add(chunk); + totalBytesUnreadInList += chunk.bytesUnread(); + } + + static class StreamByteBufferChunk { + private int pointer; + private byte[] buffer; + private int size; + private int used; + + public StreamByteBufferChunk(int size) { + this.size = size; + buffer = new byte[size]; + } + + public StreamByteBufferChunk(byte[] buf) { + this.size = buf.length; + this.buffer = buf; + this.used = buf.length; + } + + public ByteBuffer readToNioBuffer() { + if (pointer < used) { + ByteBuffer result; + if (pointer > 0 || used < size) { + result = ByteBuffer.wrap(buffer, pointer, used - pointer); + } else { + result = ByteBuffer.wrap(buffer); + } + pointer = used; + return result; + } + + return null; + } + + public boolean write(byte b) { + if (used < size) { + buffer[used++] = b; + return true; + } + + return false; + } + + public void write(byte[] b, int off, int len) { + System.arraycopy(b, off, buffer, used, len); + used = used + len; + } + + public void read(byte[] b, int off, int len) { + System.arraycopy(buffer, pointer, b, off, len); + pointer = pointer + len; + } + + public void writeTo(OutputStream target) throws IOException { + if (pointer < used) { + target.write(buffer, pointer, used - pointer); + pointer = used; + } + } + + public void reset() { + pointer = 0; + } + + public int bytesUsed() { + return used; + } + + public int bytesUnread() { + return used - pointer; + } + + public int read() { + if (pointer < used) { + return buffer[pointer++] & 0xff; + } + + return -1; + } + + public int spaceLeft() { + return size - used; + } + + public int readFrom(InputStream inputStream, int len) throws IOException { + int readBytes = inputStream.read(buffer, used, len); + if(readBytes > 0) { + used += readBytes; + } + return readBytes; + } + + public void clear() { + used = pointer = 0; + } + + public byte[] readBuffer() { + if (used == buffer.length && pointer == 0) { + pointer = used; + return buffer; + } else if (pointer < used) { + byte[] buf = new byte[used - pointer]; + read(buf, 0, used - pointer); + return buf; + } else { + return new byte[0]; + } + } + } + + class StreamByteBufferOutputStream extends OutputStream { + private boolean closed; + + @Override + public void write(byte[] b, int off, int len) throws IOException { + if (b == null) { + throw new NullPointerException(); + } + + if ((off < 0) || (off > b.length) || (len < 0) + || ((off + len) > b.length) || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(); + } + + if (len == 0) { + return; + } + + int bytesLeft = len; + int currentOffset = off; + while (bytesLeft > 0) { + int spaceLeft = allocateSpace(); + int writeBytes = Math.min(spaceLeft, bytesLeft); + currentWriteChunk.write(b, currentOffset, writeBytes); + bytesLeft -= writeBytes; + currentOffset += writeBytes; + } + } + + @Override + public void close() throws IOException { + closed = true; + } + + public boolean isClosed() { + return closed; + } + + @Override + public void write(int b) throws IOException { + allocateSpace(); + currentWriteChunk.write((byte) b); + } + + public StreamByteBuffer getBuffer() { + return StreamByteBuffer.this; + } + } + + class StreamByteBufferInputStream extends InputStream { + @Override + public int read() throws IOException { + prepareRead(); + return currentReadChunk.read(); + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + return readImpl(b, off, len); + } + + int readImpl(byte[] b, int off, int len) { + if (b == null) { + throw new NullPointerException(); + } + + if ((off < 0) || (off > b.length) || (len < 0) + || ((off + len) > b.length) || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(); + } + + if (len == 0) { + return 0; + } + + int bytesLeft = len; + int currentOffset = off; + int bytesUnread = prepareRead(); + int totalBytesRead = 0; + while (bytesLeft > 0 && bytesUnread != -1) { + int readBytes = Math.min(bytesUnread, bytesLeft); + currentReadChunk.read(b, currentOffset, readBytes); + bytesLeft -= readBytes; + currentOffset += readBytes; + totalBytesRead += readBytes; + bytesUnread = prepareRead(); + } + if (totalBytesRead > 0) { + return totalBytesRead; + } + + return -1; + } + + @Override + public int available() throws IOException { + return totalBytesUnread(); + } + + public StreamByteBuffer getBuffer() { + return StreamByteBuffer.this; + } + + public byte[] readNextBuffer() { + if (prepareRead() != -1) { + return currentReadChunk.readBuffer(); + } + return null; + } + } + + public void clear() { + chunks.clear(); + currentReadChunk = null; + totalBytesUnreadInList = 0; + currentWriteChunk.clear(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java new file mode 100644 index 000000000..ab57d8c95 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.Callable; + +/** + * Wraps a checked exception. Carries no other context. + */ +public final class UncheckedException extends RuntimeException { + private UncheckedException(Throwable cause) { + super(cause); + } + + private UncheckedException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Note: always throws the failure in some form. The return value is to keep the compiler happy. + */ + public static RuntimeException throwAsUncheckedException(Throwable t) { + return throwAsUncheckedException(t, false); + } + + /** + * Note: always throws the failure in some form. The return value is to keep the compiler happy. + */ + public static RuntimeException throwAsUncheckedException(Throwable t, boolean preserveMessage) { + if (t instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + if (t instanceof Error) { + throw (Error) t; + } + if (t instanceof IOException) { + if (preserveMessage) { + throw new UncheckedIOException(t.getMessage(), t); + } else { + throw new UncheckedIOException(t); + } + } + if (preserveMessage) { + throw new UncheckedException(t.getMessage(), t); + } else { + throw new UncheckedException(t); + } + } + + public static T callUnchecked(Callable callable) { + try { + return callable.call(); + } catch (Exception e) { + throw throwAsUncheckedException(e); + } + } + + /** + * Unwraps passed InvocationTargetException hence making the stack of exceptions cleaner without losing information. + * + * Note: always throws the failure in some form. The return value is to keep the compiler happy. + * + * @param e to be unwrapped + * @return an instance of RuntimeException based on the target exception of the parameter. + */ + public static RuntimeException unwrapAndRethrow(InvocationTargetException e) { + return UncheckedException.throwAsUncheckedException(e.getTargetException()); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java new file mode 100644 index 000000000..1cf30df7a --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +/** + * UncheckedIOException is used to wrap an {@link java.io.IOException} into an unchecked exception. + */ +public class UncheckedIOException extends RuntimeException { + public UncheckedIOException() { + } + + public UncheckedIOException(String message) { + super(message); + } + + public UncheckedIOException(String message, Throwable cause) { + super(message, cause); + } + + public UncheckedIOException(Throwable cause) { + super(cause); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java new file mode 100644 index 000000000..d805f4654 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import javax.annotation.Nullable; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +public abstract class AbstractDecoder implements Decoder { + private DecoderStream stream; + + @Override + public InputStream getInputStream() { + if (stream == null) { + stream = new DecoderStream(); + } + return stream; + } + + @Override + public void readBytes(byte[] buffer) throws IOException { + readBytes(buffer, 0, buffer.length); + } + + @Override + public byte[] readBinary() throws EOFException, IOException { + int size = readSmallInt(); + byte[] result = new byte[size]; + readBytes(result); + return result; + } + + @Override + public int readSmallInt() throws EOFException, IOException { + return readInt(); + } + + @Override + public long readSmallLong() throws EOFException, IOException { + return readLong(); + } + + @Nullable + @Override + public Integer readNullableSmallInt() throws IOException { + if (readBoolean()) { + return readSmallInt(); + } else { + return null; + } + } + + @Override + public String readNullableString() throws EOFException, IOException { + if (readBoolean()) { + return readString(); + } else { + return null; + } + } + + @Override + public void skipBytes(long count) throws EOFException, IOException { + long remaining = count; + while (remaining > 0) { + long skipped = maybeSkip(remaining); + if (skipped <= 0) { + break; + } + remaining -= skipped; + } + if (remaining > 0) { + throw new EOFException(); + } + } + + @Override + public T decodeChunked(DecodeAction decodeAction) throws EOFException, Exception { + throw new UnsupportedOperationException(); + } + + @Override + public void skipChunked() throws EOFException, IOException { + throw new UnsupportedOperationException(); + } + + protected abstract int maybeReadBytes(byte[] buffer, int offset, int count) throws IOException; + + protected abstract long maybeSkip(long count) throws IOException; + + private class DecoderStream extends InputStream { + byte[] buffer = new byte[1]; + + @Override + public long skip(long n) throws IOException { + return maybeSkip(n); + } + + @Override + public int read() throws IOException { + int read = maybeReadBytes(buffer, 0, 1); + if (read <= 0) { + return read; + } + return buffer[0] & 0xff; + } + + @Override + public int read(byte[] buffer) throws IOException { + return maybeReadBytes(buffer, 0, buffer.length); + } + + @Override + public int read(byte[] buffer, int offset, int count) throws IOException { + return maybeReadBytes(buffer, offset, count); + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java new file mode 100644 index 000000000..4caf3461d --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.io.OutputStream; + +public abstract class AbstractEncoder implements Encoder { + private EncoderStream stream; + + @Override + public OutputStream getOutputStream() { + if (stream == null) { + stream = new EncoderStream(); + } + return stream; + } + + @Override + public void writeBytes(byte[] bytes) throws IOException { + writeBytes(bytes, 0, bytes.length); + } + + @Override + public void writeBinary(byte[] bytes) throws IOException { + writeBinary(bytes, 0, bytes.length); + } + + @Override + public void writeBinary(byte[] bytes, int offset, int count) throws IOException { + writeSmallInt(count); + writeBytes(bytes, offset, count); + } + + @Override + public void encodeChunked(EncodeAction writeAction) throws Exception { + throw new UnsupportedOperationException(); + } + + @Override + public void writeSmallInt(int value) throws IOException { + writeInt(value); + } + + @Override + public void writeSmallLong(long value) throws IOException { + writeLong(value); + } + + @Override + public void writeNullableSmallInt(@Nullable Integer value) throws IOException { + if (value == null) { + writeBoolean(false); + } else { + writeBoolean(true); + writeSmallInt(value); + } + } + + @Override + public void writeNullableString(@Nullable CharSequence value) throws IOException { + if (value == null) { + writeBoolean(false); + } else { + writeBoolean(true); + writeString(value.toString()); + } + } + + private class EncoderStream extends OutputStream { + @Override + public void write(byte[] buffer) throws IOException { + writeBytes(buffer); + } + + @Override + public void write(byte[] buffer, int offset, int length) throws IOException { + writeBytes(buffer, offset, length); + } + + @Override + public void write(int b) throws IOException { + writeByte((byte) b); + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java new file mode 100644 index 000000000..a60980354 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import com.google.common.base.Objects; + +/** + * This abstract class provide a sensible default implementation for {@code Serializer} equality. This equality + * implementation is required to enable cache instance reuse within the same Gradle runtime. Serializers are used + * as cache parameter which need to be compared to determine compatible cache. + */ +public abstract class AbstractSerializer implements Serializer { + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + + return Objects.equal(obj.getClass(), getClass()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getClass()); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java new file mode 100644 index 000000000..4f962cea6 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java @@ -0,0 +1,79 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import javax.annotation.Nullable; + +public abstract class Cast { + + /** + * Casts the given object to the given type, providing a better error message than the default. + * + * The standard {@link Class#cast(Object)} method produces unsatisfactory error messages on some platforms + * when it fails. All this method does is provide a better, consistent, error message. + * + * This should be used whenever there is a chance the cast could fail. If in doubt, use this. + * + * @param outputType The type to cast the input to + * @param object The object to be cast (must not be {@code null}) + * @param The type to be cast to + * @param The type of the object to be vast + * @return The input object, cast to the output type + */ + public static O cast(Class outputType, I object) { + try { + return outputType.cast(object); + } catch (ClassCastException e) { + throw new ClassCastException(String.format( + "Failed to cast object %s of type %s to target type %s", object, object.getClass().getName(), outputType.getName() + )); + } + } + + /** + * Casts the given object to the given type, providing a better error message than the default. + * + * The standard {@link Class#cast(Object)} method produces unsatisfactory error messages on some platforms + * when it fails. All this method does is provide a better, consistent, error message. + * + * This should be used whenever there is a chance the cast could fail. If in doubt, use this. + * + * @param outputType The type to cast the input to + * @param object The object to be cast + * @param The type to be cast to + * @param The type of the object to be vast + * @return The input object, cast to the output type + */ + @Nullable + public static O castNullable(Class outputType, @Nullable I object) { + if (object == null) { + return null; + } + return cast(outputType, object); + } + + @SuppressWarnings("unchecked") + @Nullable + public static T uncheckedCast(@Nullable Object object) { + return (T) object; + } + + @SuppressWarnings("unchecked") + public static T uncheckedNonnullCast(Object object) { + return (T) object; + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java new file mode 100644 index 000000000..5f9cb3052 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree.serialize; + +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectStreamClass; + +public class ClassLoaderObjectInputStream extends ObjectInputStream { + private final ClassLoader loader; + + public ClassLoaderObjectInputStream(InputStream in, ClassLoader loader) throws IOException { + super(in); + this.loader = loader; + } + + public ClassLoader getClassLoader() { + return loader; + } + + @Override + protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { + try { + return Class.forName(desc.getName(), false, loader); + } catch (ClassNotFoundException e) { + return super.resolveClass(desc); + } + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java new file mode 100644 index 000000000..e5251b8c2 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import javax.annotation.Nullable; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +/** + * Provides a way to decode structured data from a backing byte stream. Implementations may buffer incoming bytes read + * from the backing stream prior to decoding. + */ +public interface Decoder { + /** + * Returns an InputStream which can be used to read raw bytes. + */ + InputStream getInputStream(); + + /** + * Reads a signed 64 bit long value. Can read any value that was written using {@link Encoder#writeLong(long)}. + * + * @throws EOFException when the end of the byte stream is reached before the long value can be fully read. + */ + long readLong() throws EOFException, IOException; + + /** + * Reads a signed 64 bit int value. Can read any value that was written using {@link Encoder#writeSmallLong(long)}. + * + * @throws EOFException when the end of the byte stream is reached before the int value can be fully read. + */ + long readSmallLong() throws EOFException, IOException; + + /** + * Reads a signed 32 bit int value. Can read any value that was written using {@link Encoder#writeInt(int)}. + * + * @throws EOFException when the end of the byte stream is reached before the int value can be fully read. + */ + int readInt() throws EOFException, IOException; + + /** + * Reads a signed 32 bit int value. Can read any value that was written using {@link Encoder#writeSmallInt(int)}. + * + * @throws EOFException when the end of the byte stream is reached before the int value can be fully read. + */ + int readSmallInt() throws EOFException, IOException; + + /** + * Reads a nullable signed 32 bit int value. + * + * @see #readSmallInt() + */ + @Nullable + Integer readNullableSmallInt() throws EOFException, IOException; + + /** + * Reads a boolean value. Can read any value that was written using {@link Encoder#writeBoolean(boolean)}. + * + * @throws EOFException when the end of the byte stream is reached before the boolean value can be fully read. + */ + boolean readBoolean() throws EOFException, IOException; + + /** + * Reads a non-null string value. Can read any value that was written using {@link Encoder#writeString(CharSequence)}. + * + * @throws EOFException when the end of the byte stream is reached before the string can be fully read. + */ + String readString() throws EOFException, IOException; + + /** + * Reads a nullable string value. Can reads any value that was written using {@link Encoder#writeNullableString(CharSequence)}. + * + * @throws EOFException when the end of the byte stream is reached before the string can be fully read. + */ + @Nullable + String readNullableString() throws EOFException, IOException; + + /** + * Reads a byte value. Can read any byte value that was written using one of the raw byte methods on {@link Encoder}, such as {@link Encoder#writeByte(byte)} or {@link Encoder#getOutputStream()} + * + * @throws EOFException when the end of the byte stream is reached. + */ + byte readByte() throws EOFException, IOException; + + /** + * Reads bytes into the given buffer, filling the buffer. Can read any byte values that were written using one of the raw byte methods on {@link Encoder}, such as {@link + * Encoder#writeBytes(byte[])} or {@link Encoder#getOutputStream()} + * + * @throws EOFException when the end of the byte stream is reached before the buffer is full. + */ + void readBytes(byte[] buffer) throws EOFException, IOException; + + /** + * Reads the specified number of bytes into the given buffer. Can read any byte values that were written using one of the raw byte methods on {@link Encoder}, such as {@link + * Encoder#writeBytes(byte[])} or {@link Encoder#getOutputStream()} + * + * @throws EOFException when the end of the byte stream is reached before the specified number of bytes were read. + */ + void readBytes(byte[] buffer, int offset, int count) throws EOFException, IOException; + + /** + * Reads a byte array. Can read any byte array written using {@link Encoder#writeBinary(byte[])} or {@link Encoder#writeBinary(byte[], int, int)}. + * + * @throws EOFException when the end of the byte stream is reached before the byte array was fully read. + */ + byte[] readBinary() throws EOFException, IOException; + + /** + * Skips the given number of bytes. Can skip over any byte values that were written using one of the raw byte methods on {@link Encoder}. + */ + void skipBytes(long count) throws EOFException, IOException; + + /** + * Reads a byte stream written using {@link Encoder#encodeChunked(Encoder.EncodeAction)}. + */ + T decodeChunked(DecodeAction decodeAction) throws EOFException, Exception; + + /** + * Skips over a byte stream written using {@link Encoder#encodeChunked(Encoder.EncodeAction)}, discarding its content. + */ + void skipChunked() throws EOFException, IOException; + + interface DecodeAction { + OUT read(IN source) throws Exception; + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java new file mode 100644 index 000000000..15ba1c592 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java @@ -0,0 +1,73 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree.serialize; + +import com.google.common.base.Objects; + +import java.io.IOException; +import java.io.ObjectOutputStream; +import java.io.StreamCorruptedException; + +public class DefaultSerializer extends AbstractSerializer { + private ClassLoader classLoader; + + public DefaultSerializer() { + classLoader = getClass().getClassLoader(); + } + + public DefaultSerializer(ClassLoader classLoader) { + this.classLoader = classLoader != null ? classLoader : getClass().getClassLoader(); + } + + public ClassLoader getClassLoader() { + return classLoader; + } + + public void setClassLoader(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + @Override + public T read(Decoder decoder) throws Exception { + try { + return Cast.uncheckedNonnullCast(new ClassLoaderObjectInputStream(decoder.getInputStream(), classLoader).readObject()); + } catch (StreamCorruptedException e) { + return null; + } + } + + @Override + public void write(Encoder encoder, T value) throws IOException { + ObjectOutputStream objectStr = new ObjectOutputStream(encoder.getOutputStream()); + objectStr.writeObject(value); + objectStr.flush(); + } + + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + + DefaultSerializer rhs = (DefaultSerializer) obj; + return Objects.equal(classLoader, rhs.classLoader); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), classLoader); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java new file mode 100644 index 000000000..1cdea10af --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.io.OutputStream; + +/** + * Provides a way to encode structured data to a backing byte stream. Implementations may buffer outgoing encoded bytes prior + * to writing to the backing byte stream. + */ +public interface Encoder { + /** + * Returns an {@link OutputStream) that can be used to write raw bytes to the stream. + */ + OutputStream getOutputStream(); + + /** + * Writes a raw byte value to the stream. + */ + void writeByte(byte value) throws IOException; + + /** + * Writes the given raw bytes to the stream. Does not encode any length information. + */ + void writeBytes(byte[] bytes) throws IOException; + + /** + * Writes the given raw bytes to the stream. Does not encode any length information. + */ + void writeBytes(byte[] bytes, int offset, int count) throws IOException; + + /** + * Writes the given byte array to the stream. Encodes the bytes and length information. + */ + void writeBinary(byte[] bytes) throws IOException; + + /** + * Writes the given byte array to the stream. Encodes the bytes and length information. + */ + void writeBinary(byte[] bytes, int offset, int count) throws IOException; + + /** + * Appends an encoded stream to this stream. Encodes the stream as a series of chunks with length information. + */ + void encodeChunked(EncodeAction writeAction) throws Exception; + + /** + * Writes a signed 64 bit long value. The implementation may encode the value as a variable number of bytes, not necessarily as 8 bytes. + */ + void writeLong(long value) throws IOException; + + /** + * Writes a signed 64 bit long value whose value is likely to be small and positive but may not be. The implementation may encode the value in a way that is more efficient for small positive + * values. + */ + void writeSmallLong(long value) throws IOException; + + /** + * Writes a signed 32 bit int value. The implementation may encode the value as a variable number of bytes, not necessarily as 4 bytes. + */ + void writeInt(int value) throws IOException; + + /** + * Writes a signed 32 bit int value whose value is likely to be small and positive but may not be. The implementation may encode the value in a way that + * is more efficient for small positive values. + */ + void writeSmallInt(int value) throws IOException; + + /** + * Writes a nullable signed 32 bit int value whose value is likely to be small and positive but may not be. + * + * @see #writeSmallInt(int) + */ + void writeNullableSmallInt(@Nullable Integer value) throws IOException; + + /** + * Writes a boolean value. + */ + void writeBoolean(boolean value) throws IOException; + + /** + * Writes a non-null string value. + */ + void writeString(CharSequence value) throws IOException; + + /** + * Writes a nullable string value. + */ + void writeNullableString(@Nullable CharSequence value) throws IOException; + + interface EncodeAction { + void write(T target) throws Exception; + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java new file mode 100644 index 000000000..ddef9f5c6 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import java.io.Flushable; +import java.io.IOException; + +/** + * Represents an {@link Encoder} that buffers encoded data prior to writing to the backing stream. + */ +public interface FlushableEncoder extends Encoder, Flushable { + /** + * Ensures that all buffered data has been written to the backing stream. Does not flush the backing stream. + */ + @Override + void flush() throws IOException; +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java new file mode 100644 index 000000000..fdea08191 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java @@ -0,0 +1,28 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +import java.io.EOFException; + +public interface ObjectReader { + /** + * Reads the next object from the stream. + * + * @throws EOFException When the next object cannot be fully read due to reaching the end of stream. + */ + T read() throws EOFException, Exception; +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java new file mode 100644 index 000000000..482bdd0f8 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java @@ -0,0 +1,21 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +public interface ObjectWriter { + void write(T value) throws Exception; +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java new file mode 100644 index 000000000..b474ba3ac --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java @@ -0,0 +1,33 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree.serialize; + +import java.io.EOFException; + +public interface Serializer { + /** + * Reads the next object from the given stream. The implementation must not perform any buffering, so that it reads only those bytes from the input stream that are + * required to deserialize the next object. + * + * @throws EOFException When the next object cannot be fully read due to reaching the end of stream. + */ + T read(Decoder decoder) throws EOFException, Exception; + + /** + * Writes the given object to the given stream. The implementation must not perform any buffering. + */ + void write(Encoder encoder, T value) throws Exception; +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java new file mode 100644 index 000000000..ea677d2c0 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java @@ -0,0 +1,33 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize; + +/** + * Implementations must allow concurrent reading and writing, so that a thread can read and a thread can write at the same time. + * Implementations do not need to support multiple read threads or multiple write threads. + */ +public interface StatefulSerializer { + /** + * Should not perform any buffering + */ + ObjectReader newReader(Decoder decoder); + + /** + * Should not perform any buffering + */ + ObjectWriter newWriter(Encoder encoder); +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java new file mode 100644 index 000000000..d8e44a0dc --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java @@ -0,0 +1,210 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize.kryo; + +import com.esotericsoftware.kryo.KryoException; +import com.esotericsoftware.kryo.io.Input; +import seaweedfs.client.btree.serialize.AbstractDecoder; +import seaweedfs.client.btree.serialize.Decoder; + +import java.io.Closeable; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +/** + * Note that this decoder uses buffering, so will attempt to read beyond the end of the encoded data. This means you should use this type only when this decoder will be used to decode the entire + * stream. + */ +public class KryoBackedDecoder extends AbstractDecoder implements Decoder, Closeable { + private final Input input; + private final InputStream inputStream; + private long extraSkipped; + private KryoBackedDecoder nested; + + public KryoBackedDecoder(InputStream inputStream) { + this(inputStream, 4096); + } + + public KryoBackedDecoder(InputStream inputStream, int bufferSize) { + this.inputStream = inputStream; + input = new Input(this.inputStream, bufferSize); + } + + @Override + protected int maybeReadBytes(byte[] buffer, int offset, int count) { + return input.read(buffer, offset, count); + } + + @Override + protected long maybeSkip(long count) throws IOException { + // Work around some bugs in Input.skip() + int remaining = input.limit() - input.position(); + if (remaining == 0) { + long skipped = inputStream.skip(count); + if (skipped > 0) { + extraSkipped += skipped; + } + return skipped; + } else if (count <= remaining) { + input.setPosition(input.position() + (int) count); + return count; + } else { + input.setPosition(input.limit()); + return remaining; + } + } + + private RuntimeException maybeEndOfStream(KryoException e) throws EOFException { + if (e.getMessage().equals("Buffer underflow.")) { + throw (EOFException) (new EOFException().initCause(e)); + } + throw e; + } + + @Override + public byte readByte() throws EOFException { + try { + return input.readByte(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public void readBytes(byte[] buffer, int offset, int count) throws EOFException { + try { + input.readBytes(buffer, offset, count); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public long readLong() throws EOFException { + try { + return input.readLong(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public long readSmallLong() throws EOFException, IOException { + try { + return input.readLong(true); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public int readInt() throws EOFException { + try { + return input.readInt(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public int readSmallInt() throws EOFException { + try { + return input.readInt(true); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public boolean readBoolean() throws EOFException { + try { + return input.readBoolean(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public String readString() throws EOFException { + return readNullableString(); + } + + @Override + public String readNullableString() throws EOFException { + try { + return input.readString(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public void skipChunked() throws EOFException, IOException { + while (true) { + int count = readSmallInt(); + if (count == 0) { + break; + } + skipBytes(count); + } + } + + @Override + public T decodeChunked(DecodeAction decodeAction) throws EOFException, Exception { + if (nested == null) { + nested = new KryoBackedDecoder(new InputStream() { + @Override + public int read() throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public int read(byte[] buffer, int offset, int length) throws IOException { + int count = readSmallInt(); + if (count == 0) { + // End of stream has been reached + return -1; + } + if (count > length) { + // For now, assume same size buffers used to read and write + throw new UnsupportedOperationException(); + } + readBytes(buffer, offset, count); + return count; + } + }); + } + T value = decodeAction.read(nested); + if (readSmallInt() != 0) { + throw new IllegalStateException("Expecting the end of nested stream."); + } + return value; + } + + /** + * Returns the total number of bytes consumed by this decoder. Some additional bytes may also be buffered by this decoder but have not been consumed. + */ + public long getReadPosition() { + return input.total() + extraSkipped; + } + + @Override + public void close() throws IOException { + input.close(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java new file mode 100644 index 000000000..6de3c4db5 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize.kryo; + +import com.esotericsoftware.kryo.io.Output; +import seaweedfs.client.btree.serialize.AbstractEncoder; +import seaweedfs.client.btree.serialize.Encoder; +import seaweedfs.client.btree.serialize.FlushableEncoder; + +import javax.annotation.Nullable; +import java.io.Closeable; +import java.io.IOException; +import java.io.OutputStream; + +public class KryoBackedEncoder extends AbstractEncoder implements FlushableEncoder, Closeable { + private final Output output; + private KryoBackedEncoder nested; + + public KryoBackedEncoder(OutputStream outputStream) { + this(outputStream, 4096); + } + + public KryoBackedEncoder(OutputStream outputStream, int bufferSize) { + output = new Output(outputStream, bufferSize); + } + + @Override + public void writeByte(byte value) { + output.writeByte(value); + } + + @Override + public void writeBytes(byte[] bytes, int offset, int count) { + output.writeBytes(bytes, offset, count); + } + + @Override + public void writeLong(long value) { + output.writeLong(value); + } + + @Override + public void writeSmallLong(long value) { + output.writeLong(value, true); + } + + @Override + public void writeInt(int value) { + output.writeInt(value); + } + + @Override + public void writeSmallInt(int value) { + output.writeInt(value, true); + } + + @Override + public void writeBoolean(boolean value) { + output.writeBoolean(value); + } + + @Override + public void writeString(CharSequence value) { + if (value == null) { + throw new IllegalArgumentException("Cannot encode a null string."); + } + output.writeString(value); + } + + @Override + public void writeNullableString(@Nullable CharSequence value) { + output.writeString(value); + } + + @Override + public void encodeChunked(EncodeAction writeAction) throws Exception { + if (nested == null) { + nested = new KryoBackedEncoder(new OutputStream() { + @Override + public void write(byte[] buffer, int offset, int length) { + if (length == 0) { + return; + } + writeSmallInt(length); + writeBytes(buffer, offset, length); + } + + @Override + public void write(byte[] buffer) throws IOException { + write(buffer, 0, buffer.length); + } + + @Override + public void write(int b) { + throw new UnsupportedOperationException(); + } + }); + } + writeAction.write(nested); + nested.flush(); + writeSmallInt(0); + } + + /** + * Returns the total number of bytes written by this encoder, some of which may still be buffered. + */ + public long getWritePosition() { + return output.total(); + } + + @Override + public void flush() { + output.flush(); + } + + @Override + public void close() { + output.close(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java new file mode 100644 index 000000000..f323daf43 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize.kryo; + +import com.esotericsoftware.kryo.KryoException; +import com.esotericsoftware.kryo.io.Input; +import seaweedfs.client.btree.serialize.AbstractDecoder; +import seaweedfs.client.btree.serialize.Decoder; + +import java.io.Closeable; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; + +/** + * Note that this decoder uses buffering, so will attempt to read beyond the end of the encoded data. This means you should use this type only when this decoder will be used to decode the entire + * stream. + */ +public class StringDeduplicatingKryoBackedDecoder extends AbstractDecoder implements Decoder, Closeable { + public static final int INITIAL_CAPACITY = 32; + private final Input input; + private final InputStream inputStream; + private String[] strings; + private long extraSkipped; + + public StringDeduplicatingKryoBackedDecoder(InputStream inputStream) { + this(inputStream, 4096); + } + + public StringDeduplicatingKryoBackedDecoder(InputStream inputStream, int bufferSize) { + this.inputStream = inputStream; + input = new Input(this.inputStream, bufferSize); + } + + @Override + protected int maybeReadBytes(byte[] buffer, int offset, int count) { + return input.read(buffer, offset, count); + } + + @Override + protected long maybeSkip(long count) throws IOException { + // Work around some bugs in Input.skip() + int remaining = input.limit() - input.position(); + if (remaining == 0) { + long skipped = inputStream.skip(count); + if (skipped > 0) { + extraSkipped += skipped; + } + return skipped; + } else if (count <= remaining) { + input.setPosition(input.position() + (int) count); + return count; + } else { + input.setPosition(input.limit()); + return remaining; + } + } + + private RuntimeException maybeEndOfStream(KryoException e) throws EOFException { + if (e.getMessage().equals("Buffer underflow.")) { + throw (EOFException) (new EOFException().initCause(e)); + } + throw e; + } + + @Override + public byte readByte() throws EOFException { + try { + return input.readByte(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public void readBytes(byte[] buffer, int offset, int count) throws EOFException { + try { + input.readBytes(buffer, offset, count); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public long readLong() throws EOFException { + try { + return input.readLong(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public long readSmallLong() throws EOFException, IOException { + try { + return input.readLong(true); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public int readInt() throws EOFException { + try { + return input.readInt(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public int readSmallInt() throws EOFException { + try { + return input.readInt(true); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public boolean readBoolean() throws EOFException { + try { + return input.readBoolean(); + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + @Override + public String readString() throws EOFException { + return readNullableString(); + } + + @Override + public String readNullableString() throws EOFException { + try { + int idx = readInt(); + if (idx == -1) { + return null; + } + if (strings == null) { + strings = new String[INITIAL_CAPACITY]; + } + String string = null; + if (idx >= strings.length) { + String[] grow = new String[strings.length * 3 / 2]; + System.arraycopy(strings, 0, grow, 0, strings.length); + strings = grow; + } else { + string = strings[idx]; + } + if (string == null) { + string = input.readString(); + strings[idx] = string; + } + return string; + } catch (KryoException e) { + throw maybeEndOfStream(e); + } + } + + /** + * Returns the total number of bytes consumed by this decoder. Some additional bytes may also be buffered by this decoder but have not been consumed. + */ + public long getReadPosition() { + return input.total() + extraSkipped; + } + + @Override + public void close() throws IOException { + strings = null; + input.close(); + } +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java new file mode 100644 index 000000000..140933660 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize.kryo; + +import com.esotericsoftware.kryo.io.Output; +import com.google.common.collect.Maps; +import seaweedfs.client.btree.serialize.AbstractEncoder; +import seaweedfs.client.btree.serialize.FlushableEncoder; + +import javax.annotation.Nullable; +import java.io.Closeable; +import java.io.OutputStream; +import java.util.Map; + +public class StringDeduplicatingKryoBackedEncoder extends AbstractEncoder implements FlushableEncoder, Closeable { + private Map strings; + + private final Output output; + + public StringDeduplicatingKryoBackedEncoder(OutputStream outputStream) { + this(outputStream, 4096); + } + + public StringDeduplicatingKryoBackedEncoder(OutputStream outputStream, int bufferSize) { + output = new Output(outputStream, bufferSize); + } + + @Override + public void writeByte(byte value) { + output.writeByte(value); + } + + @Override + public void writeBytes(byte[] bytes, int offset, int count) { + output.writeBytes(bytes, offset, count); + } + + @Override + public void writeLong(long value) { + output.writeLong(value); + } + + @Override + public void writeSmallLong(long value) { + output.writeLong(value, true); + } + + @Override + public void writeInt(int value) { + output.writeInt(value); + } + + @Override + public void writeSmallInt(int value) { + output.writeInt(value, true); + } + + @Override + public void writeBoolean(boolean value) { + output.writeBoolean(value); + } + + @Override + public void writeString(CharSequence value) { + if (value == null) { + throw new IllegalArgumentException("Cannot encode a null string."); + } + writeNullableString(value); + } + + @Override + public void writeNullableString(@Nullable CharSequence value) { + if (value == null) { + output.writeInt(-1); + return; + } else { + if (strings == null) { + strings = Maps.newHashMapWithExpectedSize(1024); + } + } + String key = value.toString(); + Integer index = strings.get(key); + if (index == null) { + index = strings.size(); + output.writeInt(index); + strings.put(key, index); + output.writeString(key); + } else { + output.writeInt(index); + } + } + + /** + * Returns the total number of bytes written by this encoder, some of which may still be buffered. + */ + public long getWritePosition() { + return output.total(); + } + + @Override + public void flush() { + output.flush(); + } + + @Override + public void close() { + output.close(); + } + + public void done() { + strings = null; + } + +} diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java new file mode 100644 index 000000000..16c00cdf4 --- /dev/null +++ b/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java @@ -0,0 +1,51 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package seaweedfs.client.btree.serialize.kryo; + +import seaweedfs.client.btree.serialize.*; + +public class TypeSafeSerializer implements StatefulSerializer { + private final Class type; + private final StatefulSerializer serializer; + + public TypeSafeSerializer(Class type, StatefulSerializer serializer) { + this.type = type; + this.serializer = serializer; + } + + @Override + public ObjectReader newReader(Decoder decoder) { + final ObjectReader reader = serializer.newReader(decoder); + return new ObjectReader() { + @Override + public Object read() throws Exception { + return reader.read(); + } + }; + } + + @Override + public ObjectWriter newWriter(Encoder encoder) { + final ObjectWriter writer = serializer.newWriter(encoder); + return new ObjectWriter() { + @Override + public void write(Object value) throws Exception { + writer.write(type.cast(value)); + } + }; + } +} diff --git a/other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java b/other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java new file mode 100644 index 000000000..796c7f0f5 --- /dev/null +++ b/other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java @@ -0,0 +1,476 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package seaweedfs.client.btree; + +import seaweedfs.client.btree.serialize.DefaultSerializer; +import seaweedfs.client.btree.serialize.Serializer; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.assertNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; + +public class BTreePersistentIndexedCacheTest { + private final Serializer stringSerializer = new DefaultSerializer(); + private final Serializer integerSerializer = new DefaultSerializer(); + private BTreePersistentIndexedCache cache; + private File cacheFile; + + @Before + public void setup() { + cacheFile = tmpDirFile("cache.bin"); + } + + public File tmpDirFile(String filename) { + File f = new File("/Users/chris/tmp/mm/dev/btree_test"); + // File f = new File("/tmp/btree_test"); + f.mkdirs(); + return new File(f, filename); + } + + private void createCache() { + cache = new BTreePersistentIndexedCache(cacheFile, stringSerializer, integerSerializer, (short) 4, 100); + } + + private void verifyAndCloseCache() { + cache.verify(); + cache.close(); + } + + @Test + public void getReturnsNullWhenEntryDoesNotExist() { + createCache(); + assertNull(cache.get("unknown")); + verifyAndCloseCache(); + } + + @Test + public void persistsAddedEntries() { + createCache(); + checkAdds(1, 2, 3, 4, 5); + verifyAndCloseCache(); + } + + @Test + public void persistsAddedEntriesInReverseOrder() { + createCache(); + checkAdds(5, 4, 3, 2, 1); + verifyAndCloseCache(); + } + + @Test + public void persistsAddedEntriesOverMultipleIndexBlocks() { + createCache(); + checkAdds(3, 2, 11, 5, 7, 1, 10, 8, 9, 4, 6, 0); + verifyAndCloseCache(); + } + + @Test + public void persistsUpdates() { + createCache(); + checkUpdates(3, 2, 11, 5, 7, 1, 10, 8, 9, 4, 6, 0); + verifyAndCloseCache(); + } + + @Test + public void handlesUpdatesWhenBlockSizeDecreases() { + BTreePersistentIndexedCache> cache = + new BTreePersistentIndexedCache>( + tmpDirFile("listcache.bin"), stringSerializer, + new DefaultSerializer>(), (short) 4, 100); + + List values = Arrays.asList(3, 2, 11, 5, 7, 1, 10, 8, 9, 4, 6, 0); + Map> updated = new LinkedHashMap>(); + + for (int i = 10; i > 0; i--) { + for (Integer value : values) { + String key = String.format("key_%d", value); + List newValue = new ArrayList(i); + for (int j = 0; j < i * 2; j++) { + newValue.add(j); + } + cache.put(key, newValue); + updated.put(value, newValue); + } + + checkListEntries(cache, updated); + } + + cache.reset(); + + checkListEntries(cache, updated); + + cache.verify(); + cache.close(); + } + + private void checkListEntries(BTreePersistentIndexedCache> cache, Map> updated) { + for (Map.Entry> entry : updated.entrySet()) { + String key = String.format("key_%d", entry.getKey()); + assertThat(cache.get(key), equalTo(entry.getValue())); + } + } + + @Test + public void handlesUpdatesWhenBlockSizeIncreases() { + BTreePersistentIndexedCache> cache = + new BTreePersistentIndexedCache>( + tmpDirFile("listcache.bin"), stringSerializer, + new DefaultSerializer>(), (short) 4, 100); + + List values = Arrays.asList(3, 2, 11, 5, 7, 1, 10, 8, 9, 4, 6, 0); + Map> updated = new LinkedHashMap>(); + + for (int i = 1; i < 10; i++) { + for (Integer value : values) { + String key = String.format("key_%d", value); + List newValue = new ArrayList(i); + for (int j = 0; j < i * 2; j++) { + newValue.add(j); + } + cache.put(key, newValue); + updated.put(value, newValue); + } + + checkListEntries(cache, updated); + } + + cache.reset(); + + checkListEntries(cache, updated); + + cache.verify(); + cache.close(); + } + + @Test + public void persistsAddedEntriesAfterReopen() { + createCache(); + + checkAdds(1, 2, 3, 4); + + cache.reset(); + + checkAdds(5, 6, 7, 8); + verifyAndCloseCache(); + } + + @Test + public void persistsReplacedEntries() { + createCache(); + + cache.put("key_1", 1); + cache.put("key_2", 2); + cache.put("key_3", 3); + cache.put("key_4", 4); + cache.put("key_5", 5); + + cache.put("key_1", 1); + cache.put("key_4", 12); + + assertThat(cache.get("key_1"), equalTo(1)); + assertThat(cache.get("key_2"), equalTo(2)); + assertThat(cache.get("key_3"), equalTo(3)); + assertThat(cache.get("key_4"), equalTo(12)); + assertThat(cache.get("key_5"), equalTo(5)); + + cache.reset(); + + assertThat(cache.get("key_1"), equalTo(1)); + assertThat(cache.get("key_2"), equalTo(2)); + assertThat(cache.get("key_3"), equalTo(3)); + assertThat(cache.get("key_4"), equalTo(12)); + assertThat(cache.get("key_5"), equalTo(5)); + + verifyAndCloseCache(); + } + + @Test + public void reusesEmptySpaceWhenPuttingEntries() { + BTreePersistentIndexedCache cache = new BTreePersistentIndexedCache(cacheFile, stringSerializer, stringSerializer, (short) 4, 100); + + long beforeLen = cacheFile.length(); + if (beforeLen>0){ + System.out.println(String.format("cache %s: %s", "key_new", cache.get("key_new"))); + } + + cache.put("key_1", "abcd"); + cache.put("key_2", "abcd"); + cache.put("key_3", "abcd"); + cache.put("key_4", "abcd"); + cache.put("key_5", "abcd"); + + long len = cacheFile.length(); + assertTrue(len > 0L); + + System.out.println(String.format("cache file size %d => %d", beforeLen, len)); + + cache.put("key_1", "1234"); + assertThat(cacheFile.length(), equalTo(len)); + + cache.remove("key_1"); + cache.put("key_new", "a1b2"); + assertThat(cacheFile.length(), equalTo(len)); + + cache.put("key_new", "longer value assertThat(cacheFile.length(), equalTo(len))"); + System.out.println(String.format("cache file size %d beforeLen %d", cacheFile.length(), len)); + // assertTrue(cacheFile.length() > len); + len = cacheFile.length(); + + cache.put("key_1", "1234"); + assertThat(cacheFile.length(), equalTo(len)); + + cache.close(); + } + + @Test + public void canHandleLargeNumberOfEntries() { + createCache(); + int count = 2000; + List values = new ArrayList(); + for (int i = 0; i < count; i++) { + values.add(i); + } + + checkAddsAndRemoves(null, values); + + long len = cacheFile.length(); + + checkAddsAndRemoves(Collections.reverseOrder(), values); + + // need to make this better + assertTrue(cacheFile.length() < (long)(1.4 * len)); + + checkAdds(values); + + // need to make this better + assertTrue(cacheFile.length() < (long) (1.4 * 1.4 * len)); + + cache.close(); + } + + @Test + public void persistsRemovalOfEntries() { + createCache(); + checkAddsAndRemoves(1, 2, 3, 4, 5); + verifyAndCloseCache(); + } + + @Test + public void persistsRemovalOfEntriesInReverse() { + createCache(); + checkAddsAndRemoves(Collections.reverseOrder(), 1, 2, 3, 4, 5); + verifyAndCloseCache(); + } + + @Test + public void persistsRemovalOfEntriesOverMultipleIndexBlocks() { + createCache(); + checkAddsAndRemoves(4, 12, 9, 1, 3, 10, 11, 7, 8, 2, 5, 6); + verifyAndCloseCache(); + } + + @Test + public void removalRedistributesRemainingEntriesWithLeftSibling() { + createCache(); + // Ends up with: 1 2 3 -> 4 <- 5 6 + checkAdds(1, 2, 5, 6, 4, 3); + cache.verify(); + cache.remove("key_5"); + verifyAndCloseCache(); + } + + @Test + public void removalMergesRemainingEntriesIntoLeftSibling() { + createCache(); + // Ends up with: 1 2 -> 3 <- 4 5 + checkAdds(1, 2, 4, 5, 3); + cache.verify(); + cache.remove("key_4"); + verifyAndCloseCache(); + } + + @Test + public void removalRedistributesRemainingEntriesWithRightSibling() { + createCache(); + // Ends up with: 1 2 -> 3 <- 4 5 6 + checkAdds(1, 2, 4, 5, 3, 6); + cache.verify(); + cache.remove("key_2"); + verifyAndCloseCache(); + } + + @Test + public void removalMergesRemainingEntriesIntoRightSibling() { + createCache(); + // Ends up with: 1 2 -> 3 <- 4 5 + checkAdds(1, 2, 4, 5, 3); + cache.verify(); + cache.remove("key_2"); + verifyAndCloseCache(); + } + + @Test + public void handlesOpeningATruncatedCacheFile() throws IOException { + BTreePersistentIndexedCache cache = new BTreePersistentIndexedCache(cacheFile, stringSerializer, integerSerializer); + + assertNull(cache.get("key_1")); + cache.put("key_1", 99); + + RandomAccessFile file = new RandomAccessFile(cacheFile, "rw"); + file.setLength(file.length() - 10); + file.close(); + + cache.reset(); + + assertNull(cache.get("key_1")); + cache.verify(); + + cache.close(); + } + + @Test + public void canUseFileAsKey() { + BTreePersistentIndexedCache cache = new BTreePersistentIndexedCache(cacheFile, new DefaultSerializer(), integerSerializer); + + cache.put(new File("file"), 1); + cache.put(new File("dir/file"), 2); + cache.put(new File("File"), 3); + + assertThat(cache.get(new File("file")), equalTo(1)); + assertThat(cache.get(new File("dir/file")), equalTo(2)); + assertThat(cache.get(new File("File")), equalTo(3)); + + cache.close(); + } + + @Test + public void handlesKeysWithSameHashCode() { + createCache(); + + String key1 = new String(new byte[]{2, 31}); + String key2 = new String(new byte[]{1, 62}); + cache.put(key1, 1); + cache.put(key2, 2); + + assertThat(cache.get(key1), equalTo(1)); + assertThat(cache.get(key2), equalTo(2)); + + cache.close(); + } + + private void checkAdds(Integer... values) { + checkAdds(Arrays.asList(values)); + } + + private Map checkAdds(Iterable values) { + Map added = new LinkedHashMap(); + + for (Integer value : values) { + String key = String.format("key_%d", value); + cache.put(key, value); + added.put(String.format("key_%d", value), value); + } + + for (Map.Entry entry : added.entrySet()) { + assertThat(cache.get(entry.getKey()), equalTo(entry.getValue())); + } + + cache.reset(); + + for (Map.Entry entry : added.entrySet()) { + assertThat(cache.get(entry.getKey()), equalTo(entry.getValue())); + } + + return added; + } + + private void checkUpdates(Integer... values) { + checkUpdates(Arrays.asList(values)); + } + + private Map checkUpdates(Iterable values) { + Map updated = new LinkedHashMap(); + + for (int i = 0; i < 10; i++) { + for (Integer value : values) { + String key = String.format("key_%d", value); + int newValue = value + (i * 100); + cache.put(key, newValue); + updated.put(value, newValue); + } + + for (Map.Entry entry : updated.entrySet()) { + String key = String.format("key_%d", entry.getKey()); + assertThat(cache.get(key), equalTo(entry.getValue())); + } + } + + cache.reset(); + + for (Map.Entry entry : updated.entrySet()) { + String key = String.format("key_%d", entry.getKey()); + assertThat(cache.get(key), equalTo(entry.getValue())); + } + + return updated; + } + + private void checkAddsAndRemoves(Integer... values) { + checkAddsAndRemoves(null, values); + } + + private void checkAddsAndRemoves(Comparator comparator, Integer... values) { + checkAddsAndRemoves(comparator, Arrays.asList(values)); + } + + private void checkAddsAndRemoves(Comparator comparator, Collection values) { + checkAdds(values); + + List deleteValues = new ArrayList(values); + Collections.sort(deleteValues, comparator); + for (Integer value : deleteValues) { + String key = String.format("key_%d", value); + assertThat(cache.get(key), notNullValue()); + cache.remove(key); + assertThat(cache.get(key), nullValue()); + } + + cache.reset(); + cache.verify(); + + for (Integer value : deleteValues) { + String key = String.format("key_%d", value); + assertThat(cache.get(key), nullValue()); + } + } + +} From a22ee3059687237dfe4d645313a3907cd5f13fcd Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 17:01:42 -0700 Subject: [PATCH 17/81] fix nil --- weed/filesys/dir.go | 9 ++++++--- weed/filesys/fscache.go | 13 +++++++++---- weed/filesys/fscache_test.go | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 50ca6df5d..7d099c395 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -101,7 +101,7 @@ func (dir *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) error { } func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node { - return dir.wfs.fsNodeCache.EnsureFsNode(util.NewFullPath(dir.FullPath(), name), func() fs.Node { + f := dir.wfs.fsNodeCache.EnsureFsNode(util.NewFullPath(dir.FullPath(), name), func() fs.Node { return &File{ Name: name, dir: dir, @@ -110,14 +110,17 @@ func (dir *Dir) newFile(name string, entry *filer_pb.Entry) fs.Node { entryViewCache: nil, } }) + f.(*File).dir = dir // in case dir node was created later + return f } func (dir *Dir) newDirectory(fullpath util.FullPath, entry *filer_pb.Entry) fs.Node { - return dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node { + d := dir.wfs.fsNodeCache.EnsureFsNode(fullpath, func() fs.Node { return &Dir{name: entry.Name, wfs: dir.wfs, entry: entry, parent: dir} }) - + d.(*Dir).parent = dir // in case dir node was created later + return d } func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, diff --git a/weed/filesys/fscache.go b/weed/filesys/fscache.go index b146f0615..fdec8253c 100644 --- a/weed/filesys/fscache.go +++ b/weed/filesys/fscache.go @@ -3,8 +3,9 @@ package filesys import ( "sync" - "github.com/chrislusf/seaweedfs/weed/util" "github.com/seaweedfs/fuse/fs" + + "github.com/chrislusf/seaweedfs/weed/util" ) type FsCache struct { @@ -118,7 +119,6 @@ func (c *FsCache) Move(oldPath util.FullPath, newPath util.FullPath) *FsNode { target = target.ensureChild(p) } parent := target.parent - src.name = target.name if dir, ok := src.node.(*Dir); ok { dir.name = target.name // target is not Dir, but a shortcut } @@ -132,6 +132,7 @@ func (c *FsCache) Move(oldPath util.FullPath, newPath util.FullPath) *FsNode { target.deleteSelf() + src.name = target.name src.connectToParent(parent) return src @@ -144,10 +145,14 @@ func (n *FsNode) connectToParent(parent *FsNode) { oldNode.deleteSelf() } if dir, ok := n.node.(*Dir); ok { - dir.parent = parent.node.(*Dir) + if parent.node != nil { + dir.parent = parent.node.(*Dir) + } } if f, ok := n.node.(*File); ok { - f.dir = parent.node.(*Dir) + if parent.node != nil { + f.dir = parent.node.(*Dir) + } } n.childrenLock.Lock() parent.children[n.name] = n diff --git a/weed/filesys/fscache_test.go b/weed/filesys/fscache_test.go index 67f9aacc8..8bfae1472 100644 --- a/weed/filesys/fscache_test.go +++ b/weed/filesys/fscache_test.go @@ -94,3 +94,24 @@ func TestFsCacheMove(t *testing.T) { } } + + +func TestFsCacheMove2(t *testing.T) { + + cache := newFsCache(nil) + + cache.SetFsNode(util.FullPath("/a/b/d"), &File{Name: "dd"}) + cache.SetFsNode(util.FullPath("/a/b/e"), &File{Name: "ee"}) + + cache.Move(util.FullPath("/a/b/d"), util.FullPath("/a/b/e")) + + d := cache.GetFsNode(util.FullPath("/a/b/e")) + if d == nil { + t.Errorf("unexpected nil node!") + } + if d.(*File).Name != "e" { + t.Errorf("unexpected node!") + } + +} + From 3e1395b767f1ec4e5c12362342f5a34bde827012 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 17:06:16 -0700 Subject: [PATCH 18/81] adjust log message --- weed/filer2/filer_deletion.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/filer2/filer_deletion.go b/weed/filer2/filer_deletion.go index a6b229771..2ff9dac63 100644 --- a/weed/filer2/filer_deletion.go +++ b/weed/filer2/filer_deletion.go @@ -1,6 +1,7 @@ package filer2 import ( + "strings" "time" "github.com/chrislusf/seaweedfs/weed/glog" @@ -50,15 +51,14 @@ func (f *Filer) loopProcessingDeletion() { fileIds = fileIds[:0] } deletionCount = len(toDeleteFileIds) - deleteResults, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc) + _, err := operation.DeleteFilesWithLookupVolumeId(f.GrpcDialOption, toDeleteFileIds, lookupFunc) if err != nil { - glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err) + if !strings.Contains(err.Error(), "already deleted") { + glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err) + } } else { glog.V(1).Infof("deleting fileIds len=%d", deletionCount) } - if len(deleteResults) != deletionCount { - glog.V(0).Infof("delete %d fileIds actual %d", deletionCount, len(deleteResults)) - } } }) From 6ee8d952d24181e3b0b590aef77e96b289d49f73 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 18:24:35 -0700 Subject: [PATCH 19/81] adjust log level --- weed/filesys/dir.go | 4 ++-- weed/filesys/file.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 7d099c395..0bfb009f0 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -63,7 +63,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Gid = dir.entry.Attributes.Gid attr.Uid = dir.entry.Attributes.Uid - glog.V(4).Infof("dir Attr %s, attr: %+v", dir.FullPath(), attr) + glog.V(5).Infof("dir Attr %s, attr: %+v", dir.FullPath(), attr) return nil } @@ -430,7 +430,7 @@ func (dir *Dir) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp } func (dir *Dir) Forget() { - glog.V(4).Infof("Forget dir %s", dir.FullPath()) + glog.V(5).Infof("Forget dir %s", dir.FullPath()) dir.wfs.fsNodeCache.DeleteFsNode(util.FullPath(dir.FullPath())) } diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 519e12c59..b6242c774 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -232,7 +232,7 @@ func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error { func (file *File) Forget() { t := util.NewFullPath(file.dir.FullPath(), file.Name) - glog.V(4).Infof("Forget file %s", t) + glog.V(5).Infof("Forget file %s", t) file.wfs.fsNodeCache.DeleteFsNode(t) } From 003d48da21b0ecd0758d79bfed234cb2bf820398 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 19:55:28 -0700 Subject: [PATCH 20/81] adjust logs --- weed/filer2/reader_at.go | 4 ++-- weed/filesys/dir.go | 4 ++-- weed/filesys/dirty_page.go | 4 ++-- weed/filesys/file.go | 10 +++++----- weed/filesys/filehandle.go | 12 ++++++------ weed/filesys/meta_cache/meta_cache_init.go | 2 +- weed/filesys/wfs.go | 11 +++++------ weed/filesys/wfs_deletion.go | 2 +- weed/operation/upload_content.go | 4 +++- weed/pb/filer_pb/filer_client.go | 2 +- weed/pb/filer_pb/filer_pb_helper.go | 6 +++--- weed/pb/filer_pb/filer_pb_helper_test.go | 2 +- weed/util/chunk_cache/chunk_cache.go | 2 +- 13 files changed, 33 insertions(+), 32 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 2f65761cc..aee631705 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -112,12 +112,12 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { func (c *ChunkReadAt) fetchChunkData(chunkView *ChunkView) (data []byte, err error) { - glog.V(4).Infof("fetchChunkData %s [%d,%d)\n", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) + glog.V(5).Infof("fetchChunkData %s [%d,%d)\n", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) hasDataInCache := false chunkData := c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { - glog.V(4).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) + glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) hasDataInCache = true } else { chunkData, err = c.doFetchFullChunkData(chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 0bfb009f0..578c40014 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -240,7 +240,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. return nil, fuse.ENOENT } } else { - glog.V(4).Infof("dir Lookup cache hit %s", fullFilePath) + glog.V(5).Infof("dir Lookup cache hit %s", fullFilePath) } if entry != nil { @@ -268,7 +268,7 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { - glog.V(4).Infof("dir ReadDirAll %s", dir.FullPath()) + glog.V(5).Infof("dir ReadDirAll %s", dir.FullPath()) processEachEntryFn := func(entry *filer_pb.Entry, isLast bool) error { fullpath := util.NewFullPath(dir.FullPath(), entry.Name) diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index 8b7d92ffb..ba8f7ec41 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -35,7 +35,7 @@ func (pages *ContinuousDirtyPages) AddPage(offset int64, data []byte) (chunks [] pages.lock.Lock() defer pages.lock.Unlock() - glog.V(4).Infof("%s AddPage [%d,%d) of %d bytes", pages.f.fullpath(), offset, offset+int64(len(data)), pages.f.entry.Attributes.FileSize) + glog.V(5).Infof("%s AddPage [%d,%d) of %d bytes", pages.f.fullpath(), offset, offset+int64(len(data)), pages.f.entry.Attributes.FileSize) if len(data) > int(pages.f.wfs.option.ChunkSizeLimit) { // this is more than what buffer can hold. @@ -127,7 +127,7 @@ func (pages *ContinuousDirtyPages) saveExistingLargestPageToStorage() (chunk *fi chunk, err = pages.saveToStorage(maxList.ToReader(), maxList.Offset(), chunkSize) if err == nil { hasSavedData = true - glog.V(4).Infof("%s saveToStorage %s [%d,%d) of %d bytes", pages.f.fullpath(), chunk.FileId, maxList.Offset(), maxList.Offset()+chunkSize, fileSize) + glog.V(4).Infof("saveToStorage %s %s [%d,%d) of %d bytes", pages.f.fullpath(), chunk.GetFileIdString(), maxList.Offset(), maxList.Offset()+chunkSize, fileSize) return } else { glog.V(0).Infof("%s saveToStorage [%d,%d): %v", pages.f.fullpath(), maxList.Offset(), maxList.Offset()+chunkSize, err) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index b6242c774..ec7ece604 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -85,7 +85,7 @@ func (file *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) { - glog.V(4).Infof("file %v open %+v", file.fullpath(), req) + glog.V(5).Infof("file %v open %+v", file.fullpath(), req) file.isOpen++ @@ -93,7 +93,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op resp.Handle = fuse.HandleID(handle.handle) - glog.V(4).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) + glog.V(5).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) return handle, nil @@ -101,7 +101,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error { - glog.V(4).Infof("%v file setattr %+v, old:%+v", file.fullpath(), req, file.entry.Attributes) + glog.V(5).Infof("%v file setattr %+v, old:%+v", file.fullpath(), req, file.entry.Attributes) if err := file.maybeLoadEntry(ctx); err != nil { return err @@ -121,10 +121,10 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f int64Size = int64(req.Size) - chunk.Offset if int64Size > 0 { chunks = append(chunks, chunk) - glog.V(4).Infof("truncated chunk %+v from %d to %d\n", chunk, chunk.Size, int64Size) + glog.V(4).Infof("truncated chunk %+v from %d to %d\n", chunk.GetFileIdString(), chunk.Size, int64Size) chunk.Size = uint64(int64Size) } else { - glog.V(4).Infof("truncated whole chunk %+v\n", chunk) + glog.V(4).Infof("truncated whole chunk %+v\n", chunk.GetFileIdString()) truncatedChunks = append(truncatedChunks, chunk) } } diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 42a0b2446..94029f61c 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -54,7 +54,7 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(2).Infof("%s read fh %d: [%d,%d)", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size)) + glog.V(5).Infof("%s read fh %d: [%d,%d)", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size)) buff := make([]byte, req.Size) @@ -125,7 +125,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f copy(data, req.Data) fh.f.entry.Attributes.FileSize = uint64(max(req.Offset+int64(len(data)), int64(fh.f.entry.Attributes.FileSize))) - glog.V(2).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) + glog.V(5).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) chunks, err := fh.dirtyPages.AddPage(req.Offset, data) if err != nil { @@ -153,7 +153,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) error { - glog.V(4).Infof("%v release fh %d", fh.f.fullpath(), fh.handle) + glog.V(4).Infof("Release %v fh %d", fh.f.fullpath(), fh.handle) fh.f.isOpen-- @@ -170,7 +170,7 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { // fflush works at fh level // send the data to the OS - glog.V(4).Infof("%s fh %d flush %v", fh.f.fullpath(), fh.handle, req) + glog.V(5).Infof("Flush %s fh %d %v", fh.f.fullpath(), fh.handle, req) chunks, err := fh.dirtyPages.FlushToStorage() if err != nil { @@ -213,7 +213,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { glog.V(4).Infof("%s set chunks: %v", fh.f.fullpath(), len(fh.f.entry.Chunks)) for i, chunk := range fh.f.entry.Chunks { - glog.V(4).Infof("%s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) + glog.V(4).Infof("%s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.GetFileIdString(), chunk.Offset, chunk.Offset+int64(chunk.Size)) } chunks, garbages := filer2.CompactFileChunks(filer2.LookupFn(fh.f.wfs), fh.f.entry.Chunks) @@ -238,7 +238,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { fh.f.wfs.deleteFileChunks(garbages) for i, chunk := range garbages { - glog.V(4).Infof("garbage %s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size)) + glog.V(4).Infof("garbage %s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.GetFileIdString(), chunk.Offset, chunk.Offset+int64(chunk.Size)) } return nil diff --git a/weed/filesys/meta_cache/meta_cache_init.go b/weed/filesys/meta_cache/meta_cache_init.go index 662a60fe0..cd98f4a7c 100644 --- a/weed/filesys/meta_cache/meta_cache_init.go +++ b/weed/filesys/meta_cache/meta_cache_init.go @@ -14,7 +14,7 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full mc.visitedBoundary.EnsureVisited(dirPath, func(path util.FullPath) (childDirectories []string, err error) { - glog.V(4).Infof("ReadDirAllEntries %s ...", path) + glog.V(5).Infof("ReadDirAllEntries %s ...", path) err = filer_pb.ReadDirAllEntries(client, dirPath, "", func(pbEntry *filer_pb.Entry, isLast bool) error { entry := filer2.FromPbEntry(string(dirPath), pbEntry) diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 22f0b655a..eb7042663 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -113,7 +113,7 @@ func (wfs *WFS) Root() (fs.Node, error) { func (wfs *WFS) AcquireHandle(file *File, uid, gid uint32) (fileHandle *FileHandle) { fullpath := file.fullpath() - glog.V(4).Infof("%s AcquireHandle uid=%d gid=%d", fullpath, uid, gid) + glog.V(4).Infof("AcquireHandle %s uid=%d gid=%d", fullpath, uid, gid) wfs.handlesLock.Lock() defer wfs.handlesLock.Unlock() @@ -127,7 +127,6 @@ func (wfs *WFS) AcquireHandle(file *File, uid, gid uint32) (fileHandle *FileHand fileHandle = newFileHandle(file, uid, gid) wfs.handles[inodeId] = fileHandle fileHandle.handle = inodeId - glog.V(4).Infof("%s new fh %d", fullpath, fileHandle.handle) return } @@ -136,7 +135,7 @@ func (wfs *WFS) ReleaseHandle(fullpath util.FullPath, handleId fuse.HandleID) { wfs.handlesLock.Lock() defer wfs.handlesLock.Unlock() - glog.V(4).Infof("%s ReleaseHandle id %d current handles length %d", fullpath, handleId, len(wfs.handles)) + glog.V(5).Infof("%s ReleaseHandle id %d current handles length %d", fullpath, handleId, len(wfs.handles)) delete(wfs.handles, fullpath.AsInode()) @@ -146,7 +145,7 @@ func (wfs *WFS) ReleaseHandle(fullpath util.FullPath, handleId fuse.HandleID) { // Statfs is called to obtain file system metadata. Implements fuse.FSStatfser func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error { - glog.V(4).Infof("reading fs stats: %+v", req) + glog.V(5).Infof("reading fs stats: %+v", req) if wfs.stats.lastChecked < time.Now().Unix()-20 { @@ -158,13 +157,13 @@ func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse. Ttl: fmt.Sprintf("%ds", wfs.option.TtlSec), } - glog.V(4).Infof("reading filer stats: %+v", request) + glog.V(5).Infof("reading filer stats: %+v", request) resp, err := client.Statistics(context.Background(), request) if err != nil { glog.V(0).Infof("reading filer stats %v: %v", request, err) return err } - glog.V(4).Infof("read filer stats: %+v", resp) + glog.V(5).Infof("read filer stats: %+v", resp) wfs.stats.TotalSize = resp.TotalSize wfs.stats.UsedSize = resp.UsedSize diff --git a/weed/filesys/wfs_deletion.go b/weed/filesys/wfs_deletion.go index bf21b1808..203ebdad1 100644 --- a/weed/filesys/wfs_deletion.go +++ b/weed/filesys/wfs_deletion.go @@ -38,7 +38,7 @@ func (wfs *WFS) deleteFileIds(grpcDialOption grpc.DialOption, client filer_pb.Se m := make(map[string]operation.LookupResult) - glog.V(4).Infof("remove file lookup volume id locations: %v", vids) + glog.V(5).Infof("deleteFileIds lookup volume id locations: %v", vids) resp, err := client.LookupVolume(context.Background(), &filer_pb.LookupVolumeRequest{ VolumeIds: vids, }) diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index e1914f20a..f59c7e1a9 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -33,6 +33,7 @@ type UploadResult struct { } func (uploadResult *UploadResult) ToPbFileChunk(fileId string, offset int64) *filer_pb.FileChunk { + fid, _ := filer_pb.ToFileIdObject(fileId) return &filer_pb.FileChunk{ FileId: fileId, Offset: offset, @@ -41,6 +42,7 @@ func (uploadResult *UploadResult) ToPbFileChunk(fileId string, offset int64) *fi ETag: uploadResult.ETag, CipherKey: uploadResult.CipherKey, IsCompressed: uploadResult.Gzip > 0, + Fid: fid, } } @@ -84,7 +86,7 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader, } func retriedUploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputCompressed bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) { - for i:=0; i< 3; i++ { + for i := 0; i < 3; i++ { uploadResult, err = doUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt) if err == nil { return diff --git a/weed/pb/filer_pb/filer_client.go b/weed/pb/filer_pb/filer_client.go index 6605202e0..c5a8c311a 100644 --- a/weed/pb/filer_pb/filer_client.go +++ b/weed/pb/filer_pb/filer_client.go @@ -83,7 +83,7 @@ func doList(filerClient FilerClient, fullDirPath util.FullPath, prefix string, f InclusiveStartFrom: inclusive, } - glog.V(4).Infof("read directory: %v", request) + glog.V(5).Infof("read directory: %v", request) ctx, cancel := context.WithCancel(context.Background()) stream, err := client.ListEntries(ctx, request) if err != nil { diff --git a/weed/pb/filer_pb/filer_pb_helper.go b/weed/pb/filer_pb/filer_pb_helper.go index 96ab2154f..2dc1ebaf8 100644 --- a/weed/pb/filer_pb/filer_pb_helper.go +++ b/weed/pb/filer_pb/filer_pb_helper.go @@ -10,7 +10,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/storage/needle" ) -func toFileIdObject(fileIdStr string) (*FileId, error) { +func ToFileIdObject(fileIdStr string) (*FileId, error) { t, err := needle.ParseFileIdFromString(fileIdStr) if err != nil { return nil, err @@ -43,14 +43,14 @@ func BeforeEntrySerialization(chunks []*FileChunk) { for _, chunk := range chunks { if chunk.FileId != "" { - if fid, err := toFileIdObject(chunk.FileId); err == nil { + if fid, err := ToFileIdObject(chunk.FileId); err == nil { chunk.Fid = fid chunk.FileId = "" } } if chunk.SourceFileId != "" { - if fid, err := toFileIdObject(chunk.SourceFileId); err == nil { + if fid, err := ToFileIdObject(chunk.SourceFileId); err == nil { chunk.SourceFid = fid chunk.SourceFileId = "" } diff --git a/weed/pb/filer_pb/filer_pb_helper_test.go b/weed/pb/filer_pb/filer_pb_helper_test.go index d4468c011..0009afdbe 100644 --- a/weed/pb/filer_pb/filer_pb_helper_test.go +++ b/weed/pb/filer_pb/filer_pb_helper_test.go @@ -9,7 +9,7 @@ import ( func TestFileIdSize(t *testing.T) { fileIdStr := "11745,0293434534cbb9892b" - fid, _ := toFileIdObject(fileIdStr) + fid, _ := ToFileIdObject(fileIdStr) bytes, _ := proto.Marshal(fid) println(len(fileIdStr)) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index 17b64fb6c..b54b40dbb 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -89,7 +89,7 @@ func (c *ChunkCache) SetChunk(fileId string, data []byte) { c.Lock() defer c.Unlock() - glog.V(4).Infof("SetChunk %s size %d\n", fileId, len(data)) + glog.V(5).Infof("SetChunk %s size %d\n", fileId, len(data)) c.doSetChunk(fileId, data) } From e0bfd3161a5199b393d671ccb4c0a7e2ebba553d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 19:56:24 -0700 Subject: [PATCH 21/81] update metadata only if changed --- weed/filesys/file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index ec7ece604..644dd0347 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -170,6 +170,10 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f return nil } + if !file.dirtyMetadata { + return nil + } + return file.saveEntry() } From 5d80fc2ec7b07aa6281eb7990f40552baed0df94 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 15 Aug 2020 21:09:31 -0700 Subject: [PATCH 22/81] adjust logs --- weed/filesys/file.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 644dd0347..8db892447 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -101,7 +101,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error { - glog.V(5).Infof("%v file setattr %+v, old:%+v", file.fullpath(), req, file.entry.Attributes) + glog.V(5).Infof("%v file setattr %+v", file.fullpath(), req) if err := file.maybeLoadEntry(ctx); err != nil { return err @@ -133,10 +133,11 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f file.entry.Chunks = chunks file.entryViewCache = nil file.reader = nil - file.dirtyMetadata = true } file.entry.Attributes.FileSize = req.Size + file.dirtyMetadata = true } + if req.Valid.Mode() { file.entry.Attributes.FileMode = uint32(req.Mode) file.dirtyMetadata = true @@ -289,7 +290,7 @@ func (file *File) saveEntry() error { Entry: file.entry, } - glog.V(1).Infof("save file entry: %v", request) + glog.V(4).Infof("save file entry: %v", request) _, err := client.UpdateEntry(context.Background(), request) if err != nil { glog.V(0).Infof("UpdateEntry file %s/%s: %v", file.dir.FullPath(), file.Name, err) From aec7f32b02c04aee315f67922cdb3813dbe7af72 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 00:49:08 -0700 Subject: [PATCH 23/81] fix reader_at --- weed/filer2/reader_at.go | 30 ++++++++++++++++++++---------- weed/filesys/filehandle.go | 10 ++++++---- weed/server/webdav_server.go | 5 +++-- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index aee631705..b5bd85cbb 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -19,6 +19,7 @@ type ChunkReadAt struct { bufferOffset int64 lookupFileId func(fileId string) (targetUrl string, err error) readerLock sync.Mutex + fileSize int64 chunkCache *chunk_cache.ChunkCache } @@ -54,13 +55,14 @@ func LookupFn(filerClient filer_pb.FilerClient) LookupFileIdFunctionType { } } -func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.ChunkCache) *ChunkReadAt { +func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.ChunkCache, fileSize int64) *ChunkReadAt { return &ChunkReadAt{ chunkViews: chunkViews, lookupFileId: LookupFn(filerClient), bufferOffset: -1, chunkCache: chunkCache, + fileSize: fileSize, } } @@ -73,9 +75,6 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { readCount, readErr := c.doReadAt(p[n:], offset+int64(n)) n += readCount err = readErr - if readCount == 0 { - return n, io.EOF - } } return } @@ -83,8 +82,11 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { var found bool + var chunkStart, chunkStop int64 for _, chunk := range c.chunkViews { - if chunk.LogicOffset <= offset && offset < chunk.LogicOffset+int64(chunk.Size) { + // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d), %v && %v\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size), chunk.LogicOffset <= offset, offset < chunk.LogicOffset+int64(chunk.Size)) + chunkStart, chunkStop = max(chunk.LogicOffset, offset), min(chunk.LogicOffset+int64(chunk.Size), offset+int64(len(p))) + if chunkStart < chunkStop { found = true if c.bufferOffset != chunk.LogicOffset { c.buffer, err = c.fetchChunkData(chunk) @@ -96,15 +98,23 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { break } } - if !found { - return 0, io.EOF + + // fmt.Printf("> doReadAt [%d,%d), buffer:[%d,%d), found:%v, err:%v\n", offset, offset+int64(len(p)), c.bufferOffset, c.bufferOffset+int64(len(c.buffer)), found, err) + + if err != nil { + return } - if err == nil { - n = copy(p, c.buffer[offset-c.bufferOffset:]) + if found { + n = int(chunkStart-offset) + copy(p[chunkStart-offset:chunkStop-offset], c.buffer[chunkStart-c.bufferOffset:chunkStop-c.bufferOffset]) + return } - // fmt.Printf("> doReadAt [%d,%d), buffer:[%d,%d)\n", offset, offset+int64(n), c.bufferOffset, c.bufferOffset+int64(len(c.buffer))) + n = len(p) + if offset+int64(n) >= c.fileSize { + err = io.EOF + n = int(c.fileSize - offset) + } return diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 94029f61c..362013697 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -82,10 +82,11 @@ func (fh *FileHandle) readFromDirtyPages(buff []byte, startOffset int64) (offset func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { - // this value should come from the filer instead of the old f - if len(fh.f.entry.Chunks) == 0 { + fileSize := int64(filer2.FileSize(fh.f.entry)) + + if fileSize == 0 { glog.V(1).Infof("empty fh %v", fh.f.fullpath()) - return 0, nil + return 0, io.EOF } var chunkResolveErr error @@ -98,8 +99,9 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { } if fh.f.reader == nil { + glog.V(1).Infof("entryViewCache %d", len(fh.f.entryViewCache)) chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt32) - fh.f.reader = filer2.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache) + fh.f.reader = filer2.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache, fileSize) } totalRead, err := fh.f.reader.ReadAt(buff, offset) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index e9f7b23fd..277e261f0 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -470,7 +470,8 @@ func (f *WebDavFile) Read(p []byte) (readSize int, err error) { if err != nil { return 0, err } - if len(f.entry.Chunks) == 0 { + fileSize := int64(filer2.FileSize(f.entry)) + if fileSize == 0 { return 0, io.EOF } if f.entryViewCache == nil { @@ -479,7 +480,7 @@ func (f *WebDavFile) Read(p []byte) (readSize int, err error) { } if f.reader == nil { chunkViews := filer2.ViewFromVisibleIntervals(f.entryViewCache, 0, math.MaxInt32) - f.reader = filer2.NewChunkReaderAtFromClient(f.fs, chunkViews, f.fs.chunkCache) + f.reader = filer2.NewChunkReaderAtFromClient(f.fs, chunkViews, f.fs.chunkCache, fileSize) } readSize, err = f.reader.ReadAt(p, f.off) From 1d9ea30b7254a11232acfb265fe25954345333e6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 00:49:26 -0700 Subject: [PATCH 24/81] fix ViewFromVisibleIntervals --- weed/filer2/filechunks.go | 19 ++++++++++++++----- weed/filer2/filechunks_test.go | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 9de888d50..1d546bad0 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -7,6 +7,7 @@ import ( "sort" "sync" + "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" ) @@ -134,17 +135,19 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int for _, chunk := range visibles { - if chunk.start <= offset && offset < chunk.stop && offset < stop { + glog.V(1).Infof("visible [%d,%d)", chunk.start, chunk.stop) + chunkStart, chunkStop := max(offset, chunk.start), min(stop, chunk.stop) + + if chunkStart < chunkStop { views = append(views, &ChunkView{ FileId: chunk.fileId, - Offset: offset - chunk.start, // offset is the data starting location in this file id - Size: uint64(min(chunk.stop, stop) - offset), - LogicOffset: offset, + Offset: chunkStart-chunk.start, + Size: uint64(chunkStop - chunkStart), + LogicOffset: chunk.start, ChunkSize: chunk.chunkSize, CipherKey: chunk.cipherKey, IsGzipped: chunk.isGzipped, }) - offset = min(chunk.stop, stop) } } @@ -266,3 +269,9 @@ func min(x, y int64) int64 { } return y } +func max(x, y int64) int64 { + if x <= y { + return y + } + return x +} diff --git a/weed/filer2/filechunks_test.go b/weed/filer2/filechunks_test.go index bfee59198..c1b0427a4 100644 --- a/weed/filer2/filechunks_test.go +++ b/weed/filer2/filechunks_test.go @@ -2,9 +2,13 @@ package filer2 import ( "log" + "math" "testing" "fmt" + + "github.com/stretchr/testify/assert" + "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" ) @@ -418,3 +422,30 @@ func BenchmarkCompactFileChunks(b *testing.B) { CompactFileChunks(nil, chunks) } } + +func TestViewFromVisibleIntervals(t *testing.T) { + visibles := []VisibleInterval{ + { + start: 0, + stop: 25, + fileId: "fid1", + }, + { + start: 4096, + stop: 8192, + fileId: "fid2", + }, + { + start: 16384, + stop: 18551, + fileId: "fid3", + }, + } + + views := ViewFromVisibleIntervals(visibles, 0, math.MaxInt32) + + if len(views) != len(visibles) { + assert.Equal(t, len(visibles), len(views), "ViewFromVisibleIntervals error") + } + +} \ No newline at end of file From b71df82292767ef5276fa991715af23de6f1643c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 00:57:28 -0700 Subject: [PATCH 25/81] 1.89 --- k8s/seaweedfs/Chart.yaml | 2 +- k8s/seaweedfs/values.yaml | 2 +- weed/util/constants.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/seaweedfs/Chart.yaml b/k8s/seaweedfs/Chart.yaml index 73d9a67e4..14b927d2c 100644 --- a/k8s/seaweedfs/Chart.yaml +++ b/k8s/seaweedfs/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: SeaweedFS name: seaweedfs -version: 1.88 \ No newline at end of file +version: 1.89 \ No newline at end of file diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml index 6fb25e0a3..6ddb1953c 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -4,7 +4,7 @@ global: registry: "" repository: "" imageName: chrislusf/seaweedfs - imageTag: "1.88" + imageTag: "1.89" imagePullPolicy: IfNotPresent imagePullSecrets: imagepullsecret restartPolicy: Always diff --git a/weed/util/constants.go b/weed/util/constants.go index 10955acde..69cf57216 100644 --- a/weed/util/constants.go +++ b/weed/util/constants.go @@ -5,7 +5,7 @@ import ( ) var ( - VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 88) + VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 89) COMMIT = "" ) From 8c9e6eaacd8e5712458c0f43617d896ea9b1b411 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 01:35:52 -0700 Subject: [PATCH 26/81] fix tests --- weed/filer2/filechunks.go | 2 +- weed/filer2/filechunks_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 1d546bad0..5d1d5fbe7 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -143,7 +143,7 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int FileId: chunk.fileId, Offset: chunkStart-chunk.start, Size: uint64(chunkStop - chunkStart), - LogicOffset: chunk.start, + LogicOffset: chunkStart, ChunkSize: chunk.chunkSize, CipherKey: chunk.cipherKey, IsGzipped: chunk.isGzipped, diff --git a/weed/filer2/filechunks_test.go b/weed/filer2/filechunks_test.go index c1b0427a4..2390d4fb2 100644 --- a/weed/filer2/filechunks_test.go +++ b/weed/filer2/filechunks_test.go @@ -290,7 +290,7 @@ func TestChunksReading(t *testing.T) { Size: 400, Expected: []*ChunkView{ {Offset: 0, Size: 200, FileId: "asdf", LogicOffset: 0}, - // {Offset: 0, Size: 150, FileId: "xxxx"}, // missing intervals should not happen + {Offset: 0, Size: 150, FileId: "xxxx", LogicOffset: 250}, }, }, // case 5: updates overwrite full chunks From 4a77f0820a4169af4de2ff882edb60ca345c3045 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 01:37:50 -0700 Subject: [PATCH 27/81] clean up logs --- weed/filer2/filechunks.go | 1 - weed/filesys/filehandle.go | 1 - 2 files changed, 2 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 5d1d5fbe7..9fd2fcbd2 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -135,7 +135,6 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int for _, chunk := range visibles { - glog.V(1).Infof("visible [%d,%d)", chunk.start, chunk.stop) chunkStart, chunkStop := max(offset, chunk.start), min(stop, chunk.stop) if chunkStart < chunkStop { diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 362013697..550aec5fb 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -99,7 +99,6 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { } if fh.f.reader == nil { - glog.V(1).Infof("entryViewCache %d", len(fh.f.entryViewCache)) chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt32) fh.f.reader = filer2.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache, fileSize) } From 6111b265e738fa383741569bdd2935a35fec15e6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 01:38:16 -0700 Subject: [PATCH 28/81] fix compilation --- weed/filer2/filechunks.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 9fd2fcbd2..d7c31bf0f 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -7,7 +7,6 @@ import ( "sort" "sync" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" ) @@ -140,7 +139,7 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int if chunkStart < chunkStop { views = append(views, &ChunkView{ FileId: chunk.fileId, - Offset: chunkStart-chunk.start, + Offset: chunkStart - chunk.start, Size: uint64(chunkStop - chunkStart), LogicOffset: chunkStart, ChunkSize: chunk.chunkSize, From 20e0bae5d1d36eb52e47a5bfa045d4b91be4e4a6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 09:03:18 -0700 Subject: [PATCH 29/81] add for testing --- {other/java => test}/random_access/pom.xml | 0 .../java/seaweedfs/client/btree/BTreePersistentIndexedCache.java | 0 .../random_access/src/main/java/seaweedfs/client/btree/Block.java | 0 .../src/main/java/seaweedfs/client/btree/BlockPayload.java | 0 .../src/main/java/seaweedfs/client/btree/BlockPointer.java | 0 .../src/main/java/seaweedfs/client/btree/BlockStore.java | 0 .../src/main/java/seaweedfs/client/btree/BufferCaster.java | 0 .../src/main/java/seaweedfs/client/btree/ByteInput.java | 0 .../src/main/java/seaweedfs/client/btree/ByteOutput.java | 0 .../src/main/java/seaweedfs/client/btree/CachingBlockStore.java | 0 .../main/java/seaweedfs/client/btree/CorruptedCacheException.java | 0 .../main/java/seaweedfs/client/btree/FileBackedBlockStore.java | 0 .../src/main/java/seaweedfs/client/btree/FreeListBlockStore.java | 0 .../src/main/java/seaweedfs/client/btree/KeyHasher.java | 0 .../java/seaweedfs/client/btree/RandomAccessFileInputStream.java | 0 .../java/seaweedfs/client/btree/RandomAccessFileOutputStream.java | 0 .../main/java/seaweedfs/client/btree/StateCheckBlockStore.java | 0 .../src/main/java/seaweedfs/client/btree/StreamByteBuffer.java | 0 .../src/main/java/seaweedfs/client/btree/UncheckedException.java | 0 .../main/java/seaweedfs/client/btree/UncheckedIOException.java | 0 .../java/seaweedfs/client/btree/serialize/AbstractDecoder.java | 0 .../java/seaweedfs/client/btree/serialize/AbstractEncoder.java | 0 .../java/seaweedfs/client/btree/serialize/AbstractSerializer.java | 0 .../src/main/java/seaweedfs/client/btree/serialize/Cast.java | 0 .../client/btree/serialize/ClassLoaderObjectInputStream.java | 0 .../src/main/java/seaweedfs/client/btree/serialize/Decoder.java | 0 .../java/seaweedfs/client/btree/serialize/DefaultSerializer.java | 0 .../src/main/java/seaweedfs/client/btree/serialize/Encoder.java | 0 .../java/seaweedfs/client/btree/serialize/FlushableEncoder.java | 0 .../main/java/seaweedfs/client/btree/serialize/ObjectReader.java | 0 .../main/java/seaweedfs/client/btree/serialize/ObjectWriter.java | 0 .../main/java/seaweedfs/client/btree/serialize/Serializer.java | 0 .../java/seaweedfs/client/btree/serialize/StatefulSerializer.java | 0 .../seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java | 0 .../seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java | 0 .../serialize/kryo/StringDeduplicatingKryoBackedDecoder.java | 0 .../serialize/kryo/StringDeduplicatingKryoBackedEncoder.java | 0 .../seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java | 0 .../seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java | 0 39 files changed, 0 insertions(+), 0 deletions(-) rename {other/java => test}/random_access/pom.xml (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/Block.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java (100%) rename {other/java => test}/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java (100%) rename {other/java => test}/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java (100%) diff --git a/other/java/random_access/pom.xml b/test/random_access/pom.xml similarity index 100% rename from other/java/random_access/pom.xml rename to test/random_access/pom.xml diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java b/test/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java rename to test/random_access/src/main/java/seaweedfs/client/btree/BTreePersistentIndexedCache.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java b/test/random_access/src/main/java/seaweedfs/client/btree/Block.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/Block.java rename to test/random_access/src/main/java/seaweedfs/client/btree/Block.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java b/test/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java rename to test/random_access/src/main/java/seaweedfs/client/btree/BlockPayload.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java b/test/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/BlockPointer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java b/test/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java rename to test/random_access/src/main/java/seaweedfs/client/btree/BlockStore.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java b/test/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java rename to test/random_access/src/main/java/seaweedfs/client/btree/BufferCaster.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java b/test/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java rename to test/random_access/src/main/java/seaweedfs/client/btree/ByteInput.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java b/test/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java rename to test/random_access/src/main/java/seaweedfs/client/btree/ByteOutput.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java b/test/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java rename to test/random_access/src/main/java/seaweedfs/client/btree/CachingBlockStore.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java b/test/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java rename to test/random_access/src/main/java/seaweedfs/client/btree/CorruptedCacheException.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java b/test/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java rename to test/random_access/src/main/java/seaweedfs/client/btree/FileBackedBlockStore.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java b/test/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java rename to test/random_access/src/main/java/seaweedfs/client/btree/FreeListBlockStore.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java b/test/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java rename to test/random_access/src/main/java/seaweedfs/client/btree/KeyHasher.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java b/test/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java rename to test/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileInputStream.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java b/test/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java rename to test/random_access/src/main/java/seaweedfs/client/btree/RandomAccessFileOutputStream.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java b/test/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java rename to test/random_access/src/main/java/seaweedfs/client/btree/StateCheckBlockStore.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java b/test/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/StreamByteBuffer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java b/test/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java rename to test/random_access/src/main/java/seaweedfs/client/btree/UncheckedException.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java b/test/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java rename to test/random_access/src/main/java/seaweedfs/client/btree/UncheckedIOException.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractDecoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractEncoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/AbstractSerializer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/Cast.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/ClassLoaderObjectInputStream.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/Decoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/DefaultSerializer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/Encoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/FlushableEncoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectReader.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/ObjectWriter.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/Serializer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/StatefulSerializer.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedDecoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/KryoBackedEncoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedDecoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java diff --git a/other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java b/test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java similarity index 100% rename from other/java/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java rename to test/random_access/src/main/java/seaweedfs/client/btree/serialize/kryo/TypeSafeSerializer.java diff --git a/other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java b/test/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java similarity index 100% rename from other/java/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java rename to test/random_access/src/test/java/seaweedfs/client/btree/BTreePersistentIndexedCacheTest.java From 2ba817afac1ffb2772c3efd541628b9ec70cb878 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 15:16:46 -0700 Subject: [PATCH 30/81] read randomly written data --- weed/filer2/filechunks.go | 16 +++-- weed/filer2/filechunks_test.go | 118 +++++++++++++++++++++++---------- weed/filer2/reader_at.go | 59 ++++++++--------- 3 files changed, 122 insertions(+), 71 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index d7c31bf0f..3331c3fa2 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -104,7 +104,7 @@ type ChunkView struct { FileId string Offset int64 Size uint64 - LogicOffset int64 + LogicOffset int64 // actual offset in the file, for the data specified via [offset, offset+size) in current chunk ChunkSize uint64 CipherKey []byte IsGzipped bool @@ -139,7 +139,7 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int if chunkStart < chunkStop { views = append(views, &ChunkView{ FileId: chunk.fileId, - Offset: chunkStart - chunk.start, + Offset: chunkStart - chunk.start + chunk.chunkOffset, Size: uint64(chunkStop - chunkStart), LogicOffset: chunkStart, ChunkSize: chunk.chunkSize, @@ -170,7 +170,7 @@ var bufPool = sync.Pool{ func MergeIntoVisibles(visibles, newVisibles []VisibleInterval, chunk *filer_pb.FileChunk) []VisibleInterval { - newV := newVisibleInterval(chunk.Offset, chunk.Offset+int64(chunk.Size), chunk.GetFileIdString(), chunk.Mtime, chunk.Size, chunk.CipherKey, chunk.IsCompressed) + newV := newVisibleInterval(chunk.Offset, chunk.Offset+int64(chunk.Size), chunk.GetFileIdString(), chunk.Mtime, 0, chunk.Size, chunk.CipherKey, chunk.IsCompressed) length := len(visibles) if length == 0 { @@ -182,13 +182,13 @@ func MergeIntoVisibles(visibles, newVisibles []VisibleInterval, chunk *filer_pb. } logPrintf(" before", visibles) + chunkStop := chunk.Offset + int64(chunk.Size) for _, v := range visibles { if v.start < chunk.Offset && chunk.Offset < v.stop { - newVisibles = append(newVisibles, newVisibleInterval(v.start, chunk.Offset, v.fileId, v.modifiedTime, chunk.Size, v.cipherKey, v.isGzipped)) + newVisibles = append(newVisibles, newVisibleInterval(v.start, chunk.Offset, v.fileId, v.modifiedTime, v.chunkOffset, v.chunkSize, v.cipherKey, v.isGzipped)) } - chunkStop := chunk.Offset + int64(chunk.Size) if v.start < chunkStop && chunkStop < v.stop { - newVisibles = append(newVisibles, newVisibleInterval(chunkStop, v.stop, v.fileId, v.modifiedTime, chunk.Size, v.cipherKey, v.isGzipped)) + newVisibles = append(newVisibles, newVisibleInterval(chunkStop, v.stop, v.fileId, v.modifiedTime, v.chunkOffset+(chunkStop-v.start), v.chunkSize, v.cipherKey, v.isGzipped)) } if chunkStop <= v.start || v.stop <= chunk.Offset { newVisibles = append(newVisibles, v) @@ -244,17 +244,19 @@ type VisibleInterval struct { stop int64 modifiedTime int64 fileId string + chunkOffset int64 chunkSize uint64 cipherKey []byte isGzipped bool } -func newVisibleInterval(start, stop int64, fileId string, modifiedTime int64, chunkSize uint64, cipherKey []byte, isGzipped bool) VisibleInterval { +func newVisibleInterval(start, stop int64, fileId string, modifiedTime int64, chunkOffset int64, chunkSize uint64, cipherKey []byte, isGzipped bool) VisibleInterval { return VisibleInterval{ start: start, stop: stop, fileId: fileId, modifiedTime: modifiedTime, + chunkOffset: chunkOffset, // the starting position in the chunk chunkSize: chunkSize, cipherKey: cipherKey, isGzipped: isGzipped, diff --git a/weed/filer2/filechunks_test.go b/weed/filer2/filechunks_test.go index 2390d4fb2..70da6e16c 100644 --- a/weed/filer2/filechunks_test.go +++ b/weed/filer2/filechunks_test.go @@ -1,12 +1,11 @@ package filer2 import ( + "fmt" "log" "math" "testing" - "fmt" - "github.com/stretchr/testify/assert" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" @@ -95,12 +94,12 @@ func TestIntervalMerging(t *testing.T) { // case 2: updates overwrite part of previous chunks { Chunks: []*filer_pb.FileChunk{ - {Offset: 0, Size: 100, FileId: "abc", Mtime: 123}, - {Offset: 0, Size: 50, FileId: "asdf", Mtime: 134}, + {Offset: 0, Size: 100, FileId: "a", Mtime: 123}, + {Offset: 0, Size: 70, FileId: "b", Mtime: 134}, }, Expected: []*VisibleInterval{ - {start: 0, stop: 50, fileId: "asdf"}, - {start: 50, stop: 100, fileId: "abc"}, + {start: 0, stop: 70, fileId: "b"}, + {start: 70, stop: 100, fileId: "a", chunkOffset: 70}, }, }, // case 3: updates overwrite full chunks @@ -130,14 +129,14 @@ func TestIntervalMerging(t *testing.T) { // case 5: updates overwrite full chunks { Chunks: []*filer_pb.FileChunk{ - {Offset: 0, Size: 100, FileId: "abc", Mtime: 123}, - {Offset: 0, Size: 200, FileId: "asdf", Mtime: 184}, - {Offset: 70, Size: 150, FileId: "abc", Mtime: 143}, - {Offset: 80, Size: 100, FileId: "xxxx", Mtime: 134}, + {Offset: 0, Size: 100, FileId: "a", Mtime: 123}, + {Offset: 0, Size: 200, FileId: "d", Mtime: 184}, + {Offset: 70, Size: 150, FileId: "c", Mtime: 143}, + {Offset: 80, Size: 100, FileId: "b", Mtime: 134}, }, Expected: []*VisibleInterval{ - {start: 0, stop: 200, fileId: "asdf"}, - {start: 200, stop: 220, fileId: "abc"}, + {start: 0, stop: 200, fileId: "d"}, + {start: 200, stop: 220, fileId: "c", chunkOffset: 130}, }, }, // case 6: same updates @@ -208,6 +207,10 @@ func TestIntervalMerging(t *testing.T) { t.Fatalf("failed on test case %d, interval %d, chunkId %s, expect %s", i, x, interval.fileId, testcase.Expected[x].fileId) } + if interval.chunkOffset != testcase.Expected[x].chunkOffset { + t.Fatalf("failed on test case %d, interval %d, chunkOffset %d, expect %d", + i, x, interval.chunkOffset, testcase.Expected[x].chunkOffset) + } } if len(intervals) != len(testcase.Expected) { t.Fatalf("failed to compact test case %d, len %d expected %d", i, len(intervals), len(testcase.Expected)) @@ -255,14 +258,14 @@ func TestChunksReading(t *testing.T) { // case 2: updates overwrite part of previous chunks { Chunks: []*filer_pb.FileChunk{ - {Offset: 0, Size: 100, FileId: "abc", Mtime: 123}, - {Offset: 0, Size: 50, FileId: "asdf", Mtime: 134}, + {Offset: 3, Size: 100, FileId: "a", Mtime: 123}, + {Offset: 10, Size: 50, FileId: "b", Mtime: 134}, }, - Offset: 25, - Size: 50, + Offset: 30, + Size: 40, Expected: []*ChunkView{ - {Offset: 25, Size: 25, FileId: "asdf", LogicOffset: 25}, - {Offset: 0, Size: 25, FileId: "abc", LogicOffset: 50}, + {Offset: 20, Size: 30, FileId: "b", LogicOffset: 30}, + {Offset: 57, Size: 10, FileId: "a", LogicOffset: 60}, }, }, // case 3: updates overwrite full chunks @@ -296,16 +299,16 @@ func TestChunksReading(t *testing.T) { // case 5: updates overwrite full chunks { Chunks: []*filer_pb.FileChunk{ - {Offset: 0, Size: 100, FileId: "abc", Mtime: 123}, - {Offset: 0, Size: 200, FileId: "asdf", Mtime: 184}, - {Offset: 70, Size: 150, FileId: "abc", Mtime: 143}, + {Offset: 0, Size: 100, FileId: "a", Mtime: 123}, + {Offset: 0, Size: 200, FileId: "c", Mtime: 184}, + {Offset: 70, Size: 150, FileId: "b", Mtime: 143}, {Offset: 80, Size: 100, FileId: "xxxx", Mtime: 134}, }, Offset: 0, Size: 220, Expected: []*ChunkView{ - {Offset: 0, Size: 200, FileId: "asdf", LogicOffset: 0}, - {Offset: 0, Size: 20, FileId: "abc", LogicOffset: 200}, + {Offset: 0, Size: 200, FileId: "c", LogicOffset: 0}, + {Offset: 130, Size: 20, FileId: "b", LogicOffset: 200}, }, }, // case 6: same updates @@ -374,18 +377,21 @@ func TestChunksReading(t *testing.T) { } for i, testcase := range testcases { + if i != 2 { + // continue + } log.Printf("++++++++++ read test case %d ++++++++++++++++++++", i) chunks := ViewFromChunks(nil, testcase.Chunks, testcase.Offset, testcase.Size) for x, chunk := range chunks { log.Printf("read case %d, chunk %d, offset=%d, size=%d, fileId=%s", i, x, chunk.Offset, chunk.Size, chunk.FileId) if chunk.Offset != testcase.Expected[x].Offset { - t.Fatalf("failed on read case %d, chunk %d, Offset %d, expect %d", - i, x, chunk.Offset, testcase.Expected[x].Offset) + t.Fatalf("failed on read case %d, chunk %s, Offset %d, expect %d", + i, chunk.FileId, chunk.Offset, testcase.Expected[x].Offset) } if chunk.Size != testcase.Expected[x].Size { - t.Fatalf("failed on read case %d, chunk %d, Size %d, expect %d", - i, x, chunk.Size, testcase.Expected[x].Size) + t.Fatalf("failed on read case %d, chunk %s, Size %d, expect %d", + i, chunk.FileId, chunk.Size, testcase.Expected[x].Size) } if chunk.FileId != testcase.Expected[x].FileId { t.Fatalf("failed on read case %d, chunk %d, FileId %s, expect %s", @@ -426,18 +432,18 @@ func BenchmarkCompactFileChunks(b *testing.B) { func TestViewFromVisibleIntervals(t *testing.T) { visibles := []VisibleInterval{ { - start: 0, - stop: 25, + start: 0, + stop: 25, fileId: "fid1", }, { - start: 4096, - stop: 8192, + start: 4096, + stop: 8192, fileId: "fid2", }, { - start: 16384, - stop: 18551, + start: 16384, + stop: 18551, fileId: "fid3", }, } @@ -448,4 +454,48 @@ func TestViewFromVisibleIntervals(t *testing.T) { assert.Equal(t, len(visibles), len(views), "ViewFromVisibleIntervals error") } -} \ No newline at end of file +} + +func TestViewFromVisibleIntervals2(t *testing.T) { + visibles := []VisibleInterval{ + { + start: 344064, + stop: 348160, + fileId: "fid1", + }, + { + start: 348160, + stop: 356352, + fileId: "fid2", + }, + } + + views := ViewFromVisibleIntervals(visibles, 0, math.MaxInt32) + + if len(views) != len(visibles) { + assert.Equal(t, len(visibles), len(views), "ViewFromVisibleIntervals error") + } + +} + +func TestViewFromVisibleIntervals3(t *testing.T) { + visibles := []VisibleInterval{ + { + start: 1000, + stop: 2000, + fileId: "fid1", + }, + { + start: 3000, + stop: 4000, + fileId: "fid2", + }, + } + + views := ViewFromVisibleIntervals(visibles, 1700, 1500) + + if len(views) != len(visibles) { + assert.Equal(t, len(visibles), len(views), "ViewFromVisibleIntervals error") + } + +} diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index b5bd85cbb..b0702e03e 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -16,7 +16,7 @@ type ChunkReadAt struct { masterClient *wdclient.MasterClient chunkViews []*ChunkView buffer []byte - bufferOffset int64 + bufferFileId string lookupFileId func(fileId string) (targetUrl string, err error) readerLock sync.Mutex fileSize int64 @@ -60,7 +60,6 @@ func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []* return &ChunkReadAt{ chunkViews: chunkViews, lookupFileId: LookupFn(filerClient), - bufferOffset: -1, chunkCache: chunkCache, fileSize: fileSize, } @@ -83,71 +82,71 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { var found bool var chunkStart, chunkStop int64 + var chunkView *ChunkView for _, chunk := range c.chunkViews { - // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d), %v && %v\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size), chunk.LogicOffset <= offset, offset < chunk.LogicOffset+int64(chunk.Size)) + // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d)\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) chunkStart, chunkStop = max(chunk.LogicOffset, offset), min(chunk.LogicOffset+int64(chunk.Size), offset+int64(len(p))) + chunkView = chunk if chunkStart < chunkStop { + // fmt.Printf(">>> found [%d,%d), chunk %s [%d,%d)\n", chunkStart, chunkStop, chunk.FileId, chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) found = true - if c.bufferOffset != chunk.LogicOffset { - c.buffer, err = c.fetchChunkData(chunk) - if err != nil { - glog.Errorf("fetching chunk %+v: %v\n", chunk, err) - } - c.bufferOffset = chunk.LogicOffset + c.buffer, err = c.fetchWholeChunkData(chunk) + if err != nil { + glog.Errorf("fetching chunk %+v: %v\n", chunk, err) } + c.bufferFileId = chunk.FileId break } } - // fmt.Printf("> doReadAt [%d,%d), buffer:[%d,%d), found:%v, err:%v\n", offset, offset+int64(len(p)), c.bufferOffset, c.bufferOffset+int64(len(c.buffer)), found, err) + // fmt.Printf("> doReadAt [%d,%d), buffer %s:%d, found:%v, err:%v\n", offset, offset+int64(len(p)), c.bufferFileId, int64(len(c.buffer)), found, err) if err != nil { return } if found { - n = int(chunkStart-offset) + copy(p[chunkStart-offset:chunkStop-offset], c.buffer[chunkStart-c.bufferOffset:chunkStop-c.bufferOffset]) + bufferOffset := chunkStart - chunkView.LogicOffset + chunkView.Offset + /* + skipped, copied := chunkStart-offset, chunkStop-chunkStart + fmt.Printf("+++ copy %d+%d=%d fill:[%d, %d) p[%d,%d) <- buffer:[%d,%d) buffer %s:%d\nchunkView:%+v\n\n", + skipped, copied, skipped+copied, + chunkStart, chunkStop, + chunkStart-offset, chunkStop-offset, bufferOffset, bufferOffset+chunkStop-chunkStart, + c.bufferFileId, len(c.buffer), + chunkView) + */ + n = int(chunkStart-offset) + + copy(p[chunkStart-offset:chunkStop-offset], c.buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) return } n = len(p) if offset+int64(n) >= c.fileSize { err = io.EOF - n = int(c.fileSize - offset) } + // fmt.Printf("~~~ filled %d, err: %v\n\n", n, err) return } -func (c *ChunkReadAt) fetchChunkData(chunkView *ChunkView) (data []byte, err error) { +func (c *ChunkReadAt) fetchWholeChunkData(chunkView *ChunkView) (chunkData []byte, err error) { - glog.V(5).Infof("fetchChunkData %s [%d,%d)\n", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) + glog.V(4).Infof("fetchWholeChunkData %s offset %d [%d,%d)\n", chunkView.FileId, chunkView.Offset, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) - hasDataInCache := false - chunkData := c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) + chunkData = c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { - glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) - hasDataInCache = true + glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset-chunkView.Offset, chunkView.LogicOffset-chunkView.Offset + int64(len(chunkData))) } else { chunkData, err = c.doFetchFullChunkData(chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped) if err != nil { - return nil, err + return } - } - - if int64(len(chunkData)) < chunkView.Offset+int64(chunkView.Size) { - glog.Errorf("unexpected larger cached:%v chunk %s [%d,%d) than %d", hasDataInCache, chunkView.FileId, chunkView.Offset, chunkView.Offset+int64(chunkView.Size), len(chunkData)) - return nil, fmt.Errorf("unexpected larger cached:%v chunk %s [%d,%d) than %d", hasDataInCache, chunkView.FileId, chunkView.Offset, chunkView.Offset+int64(chunkView.Size), len(chunkData)) - } - - data = chunkData[chunkView.Offset : chunkView.Offset+int64(chunkView.Size)] - - if !hasDataInCache { c.chunkCache.SetChunk(chunkView.FileId, chunkData) } - return data, nil + return } func (c *ChunkReadAt) doFetchFullChunkData(fileId string, cipherKey []byte, isGzipped bool) ([]byte, error) { From ee0f92a6be74b008d521405e1c20eb49e2257754 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 16:24:40 -0700 Subject: [PATCH 31/81] reduce memory allocation --- weed/filesys/filehandle.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 550aec5fb..ce4413c62 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -54,9 +54,13 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(5).Infof("%s read fh %d: [%d,%d)", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size)) + glog.V(0).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) - buff := make([]byte, req.Size) + buff := resp.Data[:cap(resp.Data)] + if req.Size > cap(resp.Data) { + // should not happen + buff = make([]byte, req.Size) + } totalRead, err := fh.readFromChunks(buff, req.Offset) if err == nil { From 22e5132b3a0bfae7e3b531fd5d670b004e7e7185 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 16:25:11 -0700 Subject: [PATCH 32/81] adjust log level --- weed/filesys/filehandle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index ce4413c62..b6f350953 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -54,7 +54,7 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(0).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) + glog.V(5).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) buff := resp.Data[:cap(resp.Data)] if req.Size > cap(resp.Data) { From 627b081b671c20810580b26b321ce5ae5bc0872f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 16:32:22 -0700 Subject: [PATCH 33/81] adjust logs --- weed/storage/backend/volume_create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/backend/volume_create.go b/weed/storage/backend/volume_create.go index abb1f7238..d4bd8e40f 100644 --- a/weed/storage/backend/volume_create.go +++ b/weed/storage/backend/volume_create.go @@ -14,7 +14,7 @@ func CreateVolumeFile(fileName string, preallocate int64, memoryMapSizeMB uint32 return nil, e } if preallocate > 0 { - glog.V(0).Infof("Preallocated disk space for %s is not supported", fileName) + glog.V(2).Infof("Preallocated disk space for %s is not supported", fileName) } return NewDiskFile(file), nil } From e72953dff7c8c02416ba5749ab2d2f5c62810601 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:06:03 -0700 Subject: [PATCH 34/81] logs --- weed/filer2/filechunks.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go index 3331c3fa2..1ab6679f9 100644 --- a/weed/filer2/filechunks.go +++ b/weed/filer2/filechunks.go @@ -154,10 +154,11 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int } func logPrintf(name string, visibles []VisibleInterval) { + /* - log.Printf("%s len %d", name, len(visibles)) + glog.V(0).Infof("%s len %d", name, len(visibles)) for _, v := range visibles { - log.Printf("%s: => %+v", name, v) + glog.V(0).Infof("%s: [%d,%d)", name, v.start, v.stop) } */ } @@ -224,6 +225,7 @@ func NonOverlappingVisibleIntervals(lookupFileIdFn LookupFileIdFunctionType, chu var newVisibles []VisibleInterval for _, chunk := range chunks { + // glog.V(0).Infof("merge [%d,%d)", chunk.Offset, chunk.Offset+int64(chunk.Size)) newVisibles = MergeIntoVisibles(visibles, newVisibles, chunk) t := visibles[:0] visibles = newVisibles From 4ceeba9e707330430c3e7638f6eca8222032dc4f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:07:46 -0700 Subject: [PATCH 35/81] streaming reads --- weed/filer2/reader_at.go | 63 +++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index b0702e03e..fc74ef2af 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -80,48 +80,39 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { - var found bool - var chunkStart, chunkStop int64 - var chunkView *ChunkView + var startOffset = offset for _, chunk := range c.chunkViews { - // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d)\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) - chunkStart, chunkStop = max(chunk.LogicOffset, offset), min(chunk.LogicOffset+int64(chunk.Size), offset+int64(len(p))) - chunkView = chunk - if chunkStart < chunkStop { - // fmt.Printf(">>> found [%d,%d), chunk %s [%d,%d)\n", chunkStart, chunkStop, chunk.FileId, chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) - found = true - c.buffer, err = c.fetchWholeChunkData(chunk) - if err != nil { - glog.Errorf("fetching chunk %+v: %v\n", chunk, err) - } - c.bufferFileId = chunk.FileId - break + if startOffset < min(chunk.LogicOffset, int64(len(p))+offset) { + gap := int(min(chunk.LogicOffset, int64(len(p))+offset) - startOffset) + glog.V(4).Infof("zero [%d,%d)", n, n+gap) + n += gap + startOffset = chunk.LogicOffset } + // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d)\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) + chunkStart, chunkStop := max(chunk.LogicOffset, offset), min(chunk.LogicOffset+int64(chunk.Size), offset+int64(len(p))) + if chunkStart >= chunkStop { + continue + } + glog.V(4).Infof("read [%d,%d), chunk %s [%d,%d)\n", chunkStart, chunkStop, chunk.FileId, chunk.LogicOffset-chunk.Offset, chunk.LogicOffset-chunk.Offset+int64(chunk.Size)) + c.buffer, err = c.fetchWholeChunkData(chunk) + if err != nil { + glog.Errorf("fetching chunk %+v: %v\n", chunk, err) + return + } + c.bufferFileId = chunk.FileId + bufferOffset := chunkStart - chunk.LogicOffset + chunk.Offset + copied := copy(p[chunkStart-offset:chunkStop-offset], c.buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) + n += copied + startOffset += int64(copied) } // fmt.Printf("> doReadAt [%d,%d), buffer %s:%d, found:%v, err:%v\n", offset, offset+int64(len(p)), c.bufferFileId, int64(len(c.buffer)), found, err) - if err != nil { - return + if startOffset < min(c.fileSize, int64(len(p))+offset) { + gap := int(min(c.fileSize, int64(len(p))+offset) - startOffset) + glog.V(4).Infof("zero2 [%d,%d)", n, n+gap) + n += gap } - - if found { - bufferOffset := chunkStart - chunkView.LogicOffset + chunkView.Offset - /* - skipped, copied := chunkStart-offset, chunkStop-chunkStart - fmt.Printf("+++ copy %d+%d=%d fill:[%d, %d) p[%d,%d) <- buffer:[%d,%d) buffer %s:%d\nchunkView:%+v\n\n", - skipped, copied, skipped+copied, - chunkStart, chunkStop, - chunkStart-offset, chunkStop-offset, bufferOffset, bufferOffset+chunkStop-chunkStart, - c.bufferFileId, len(c.buffer), - chunkView) - */ - n = int(chunkStart-offset) + - copy(p[chunkStart-offset:chunkStop-offset], c.buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) - return - } - - n = len(p) if offset+int64(n) >= c.fileSize { err = io.EOF } @@ -137,7 +128,7 @@ func (c *ChunkReadAt) fetchWholeChunkData(chunkView *ChunkView) (chunkData []byt chunkData = c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { - glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset-chunkView.Offset, chunkView.LogicOffset-chunkView.Offset + int64(len(chunkData))) + glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset-chunkView.Offset, chunkView.LogicOffset-chunkView.Offset+int64(len(chunkData))) } else { chunkData, err = c.doFetchFullChunkData(chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped) if err != nil { From 13bfe5deefcb83a5a89f9f15e7a15c29f97b1730 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:14:39 -0700 Subject: [PATCH 36/81] same logic for reading random access files from Go --- .../java/seaweedfs/client/SeaweedRead.java | 55 +++++++++++++++---- .../seaweed/hdfs/SeaweedFileSystemStore.java | 4 +- .../java/seaweed/hdfs/SeaweedInputStream.java | 4 +- .../seaweed/hdfs/SeaweedFileSystemStore.java | 4 +- .../java/seaweed/hdfs/SeaweedInputStream.java | 4 +- 5 files changed, 53 insertions(+), 18 deletions(-) diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java index cd2f55678..045751717 100644 --- a/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java +++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java @@ -23,7 +23,7 @@ public class SeaweedRead { // returns bytesRead public static long read(FilerGrpcClient filerGrpcClient, List visibleIntervals, final long position, final byte[] buffer, final int bufferOffset, - final int bufferLength) throws IOException { + final int bufferLength, final long fileSize) throws IOException { List chunkViews = viewFromVisibles(visibleIntervals, position, bufferLength); @@ -42,6 +42,14 @@ public class SeaweedRead { long readCount = 0; int startOffset = bufferOffset; for (ChunkView chunkView : chunkViews) { + + if (startOffset < chunkView.logicOffset) { + long gap = chunkView.logicOffset - startOffset; + LOG.debug("zero [{},{})", startOffset, startOffset + gap); + readCount += gap; + startOffset += gap; + } + FilerProto.Locations locations = vid2Locations.get(parseVolumeId(chunkView.fileId)); if (locations == null || locations.getLocationsCount() == 0) { LOG.error("failed to locate {}", chunkView.fileId); @@ -51,11 +59,22 @@ public class SeaweedRead { int len = readChunkView(position, buffer, startOffset, chunkView, locations); + LOG.debug("read [{},{}) {} size {}", startOffset, startOffset + len, chunkView.fileId, chunkView.size); + readCount += len; startOffset += len; } + long limit = Math.min(bufferLength, fileSize); + + if (startOffset < limit) { + long gap = limit - startOffset; + LOG.debug("zero2 [{},{})", startOffset, startOffset + gap); + readCount += gap; + startOffset += gap; + } + return readCount; } @@ -71,7 +90,7 @@ public class SeaweedRead { int len = (int) chunkView.size; LOG.debug("readChunkView fid:{} chunkData.length:{} chunkView.offset:{} buffer.length:{} startOffset:{} len:{}", chunkView.fileId, chunkData.length, chunkView.offset, buffer.length, startOffset, len); - System.arraycopy(chunkData, (int) chunkView.offset, buffer, startOffset, len); + System.arraycopy(chunkData, startOffset - (int) (chunkView.logicOffset - chunkView.offset), buffer, startOffset, len); return len; } @@ -93,7 +112,7 @@ public class SeaweedRead { Header contentEncodingHeader = entity.getContentEncoding(); if (contentEncodingHeader != null) { - HeaderElement[] encodings =contentEncodingHeader.getElements(); + HeaderElement[] encodings = contentEncodingHeader.getElements(); for (int i = 0; i < encodings.length; i++) { if (encodings[i].getName().equalsIgnoreCase("gzip")) { entity = new GzipDecompressingEntity(entity); @@ -134,18 +153,19 @@ public class SeaweedRead { long stop = offset + size; for (VisibleInterval chunk : visibleIntervals) { - if (chunk.start <= offset && offset < chunk.stop && offset < stop) { + long chunkStart = Math.max(offset, chunk.start); + long chunkStop = Math.min(stop, chunk.stop); + if (chunkStart < chunkStop) { boolean isFullChunk = chunk.isFullChunk && chunk.start == offset && chunk.stop <= stop; views.add(new ChunkView( chunk.fileId, - offset - chunk.start, - Math.min(chunk.stop, stop) - offset, - offset, + chunkStart - chunk.start + chunk.chunkOffset, + chunkStop - chunkStart, + chunkStart, isFullChunk, chunk.cipherKey, chunk.isCompressed )); - offset = Math.min(chunk.stop, stop); } } return views; @@ -160,7 +180,13 @@ public class SeaweedRead { Arrays.sort(chunks, new Comparator() { @Override public int compare(FilerProto.FileChunk a, FilerProto.FileChunk b) { - return (int) (a.getMtime() - b.getMtime()); + // if just a.getMtime() - b.getMtime(), it will overflow! + if (a.getMtime() < b.getMtime()) { + return -1; + } else if (a.getMtime() > b.getMtime()) { + return 1; + } + return 0; } }); @@ -181,6 +207,7 @@ public class SeaweedRead { chunk.getOffset() + chunk.getSize(), chunk.getFileId(), chunk.getMtime(), + 0, true, chunk.getCipherKey().toByteArray(), chunk.getIsCompressed() @@ -203,6 +230,7 @@ public class SeaweedRead { chunk.getOffset(), v.fileId, v.modifiedTime, + v.chunkOffset, false, v.cipherKey, v.isCompressed @@ -215,6 +243,7 @@ public class SeaweedRead { v.stop, v.fileId, v.modifiedTime, + v.chunkOffset + (chunkStop - v.start), false, v.cipherKey, v.isCompressed @@ -247,6 +276,10 @@ public class SeaweedRead { return fileId; } + public static long fileSize(FilerProto.Entry entry) { + return Math.max(totalSize(entry.getChunksList()), entry.getAttributes().getFileSize()); + } + public static long totalSize(List chunksList) { long size = 0; for (FilerProto.FileChunk chunk : chunksList) { @@ -263,15 +296,17 @@ public class SeaweedRead { public final long stop; public final long modifiedTime; public final String fileId; + public final long chunkOffset; public final boolean isFullChunk; public final byte[] cipherKey; public final boolean isCompressed; - public VisibleInterval(long start, long stop, String fileId, long modifiedTime, boolean isFullChunk, byte[] cipherKey, boolean isCompressed) { + public VisibleInterval(long start, long stop, String fileId, long modifiedTime, long chunkOffset, boolean isFullChunk, byte[] cipherKey, boolean isCompressed) { this.start = start; this.stop = stop; this.modifiedTime = modifiedTime; this.fileId = fileId; + this.chunkOffset = chunkOffset; this.isFullChunk = isFullChunk; this.cipherKey = cipherKey; this.isCompressed = isCompressed; diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index 0db6a1f49..53185367a 100644 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -124,7 +124,7 @@ public class SeaweedFileSystemStore { private FileStatus doGetFileStatus(Path path, FilerProto.Entry entry) { FilerProto.FuseAttributes attributes = entry.getAttributes(); - long length = SeaweedRead.totalSize(entry.getChunksList()); + long length = SeaweedRead.fileSize(entry); boolean isDir = entry.getIsDirectory(); int block_replication = 1; int blocksize = 512; @@ -185,7 +185,7 @@ public class SeaweedFileSystemStore { entry.mergeFrom(existingEntry); entry.getAttributesBuilder().setMtime(now); LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry); - writePosition = SeaweedRead.totalSize(existingEntry.getChunksList()); + writePosition = SeaweedRead.fileSize(existingEntry); replication = existingEntry.getAttributes().getReplication(); } } diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedInputStream.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedInputStream.java index 6b3c72f7d..36c0766a4 100644 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedInputStream.java +++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedInputStream.java @@ -41,7 +41,7 @@ public class SeaweedInputStream extends FSInputStream { this.statistics = statistics; this.path = path; this.entry = entry; - this.contentLength = SeaweedRead.totalSize(entry.getChunksList()); + this.contentLength = SeaweedRead.fileSize(entry); this.bufferSize = bufferSize; this.visibleIntervalList = SeaweedRead.nonOverlappingVisibleIntervals(filerGrpcClient, entry.getChunksList()); @@ -87,7 +87,7 @@ public class SeaweedInputStream extends FSInputStream { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } - long bytesRead = SeaweedRead.read(this.filerGrpcClient, this.visibleIntervalList, this.position, b, off, len); + long bytesRead = SeaweedRead.read(this.filerGrpcClient, this.visibleIntervalList, this.position, b, off, len, SeaweedRead.fileSize(entry)); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index 0db6a1f49..53185367a 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -124,7 +124,7 @@ public class SeaweedFileSystemStore { private FileStatus doGetFileStatus(Path path, FilerProto.Entry entry) { FilerProto.FuseAttributes attributes = entry.getAttributes(); - long length = SeaweedRead.totalSize(entry.getChunksList()); + long length = SeaweedRead.fileSize(entry); boolean isDir = entry.getIsDirectory(); int block_replication = 1; int blocksize = 512; @@ -185,7 +185,7 @@ public class SeaweedFileSystemStore { entry.mergeFrom(existingEntry); entry.getAttributesBuilder().setMtime(now); LOG.debug("createFile merged entry path:{} entry:{} from:{}", path, entry, existingEntry); - writePosition = SeaweedRead.totalSize(existingEntry.getChunksList()); + writePosition = SeaweedRead.fileSize(existingEntry); replication = existingEntry.getAttributes().getReplication(); } } diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedInputStream.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedInputStream.java index 6b3c72f7d..36c0766a4 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedInputStream.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedInputStream.java @@ -41,7 +41,7 @@ public class SeaweedInputStream extends FSInputStream { this.statistics = statistics; this.path = path; this.entry = entry; - this.contentLength = SeaweedRead.totalSize(entry.getChunksList()); + this.contentLength = SeaweedRead.fileSize(entry); this.bufferSize = bufferSize; this.visibleIntervalList = SeaweedRead.nonOverlappingVisibleIntervals(filerGrpcClient, entry.getChunksList()); @@ -87,7 +87,7 @@ public class SeaweedInputStream extends FSInputStream { throw new IllegalArgumentException("requested read length is more than will fit after requested offset in buffer"); } - long bytesRead = SeaweedRead.read(this.filerGrpcClient, this.visibleIntervalList, this.position, b, off, len); + long bytesRead = SeaweedRead.read(this.filerGrpcClient, this.visibleIntervalList, this.position, b, off, len, SeaweedRead.fileSize(entry)); if (bytesRead > Integer.MAX_VALUE) { throw new IOException("Unexpected Content-Length"); } From f5d6b8b777f8f416c4a33ea86a8be8c578c9f7a4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:17:03 -0700 Subject: [PATCH 37/81] Hadoop HCFS 1.4.6 random access file --- other/java/client/pom.xml | 2 +- other/java/client/pom.xml.deploy | 2 +- other/java/client/pom_debug.xml | 2 +- other/java/hdfs2/dependency-reduced-pom.xml | 2 +- other/java/hdfs2/pom.xml | 2 +- other/java/hdfs3/dependency-reduced-pom.xml | 2 +- other/java/hdfs3/pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/other/java/client/pom.xml b/other/java/client/pom.xml index 6727f749f..c8e90c96a 100644 --- a/other/java/client/pom.xml +++ b/other/java/client/pom.xml @@ -5,7 +5,7 @@ com.github.chrislusf seaweedfs-client - 1.4.5 + 1.4.6 org.sonatype.oss diff --git a/other/java/client/pom.xml.deploy b/other/java/client/pom.xml.deploy index 6727f749f..c8e90c96a 100644 --- a/other/java/client/pom.xml.deploy +++ b/other/java/client/pom.xml.deploy @@ -5,7 +5,7 @@ com.github.chrislusf seaweedfs-client - 1.4.5 + 1.4.6 org.sonatype.oss diff --git a/other/java/client/pom_debug.xml b/other/java/client/pom_debug.xml index ed3f07298..395efa984 100644 --- a/other/java/client/pom_debug.xml +++ b/other/java/client/pom_debug.xml @@ -5,7 +5,7 @@ com.github.chrislusf seaweedfs-client - 1.4.5 + 1.4.6 org.sonatype.oss diff --git a/other/java/hdfs2/dependency-reduced-pom.xml b/other/java/hdfs2/dependency-reduced-pom.xml index c54f8d2a7..1f48d8390 100644 --- a/other/java/hdfs2/dependency-reduced-pom.xml +++ b/other/java/hdfs2/dependency-reduced-pom.xml @@ -301,7 +301,7 @@ - 1.4.5 + 1.4.6 2.9.2 diff --git a/other/java/hdfs2/pom.xml b/other/java/hdfs2/pom.xml index 2c8d4ce32..a8de5bca0 100644 --- a/other/java/hdfs2/pom.xml +++ b/other/java/hdfs2/pom.xml @@ -5,7 +5,7 @@ 4.0.0 - 1.4.5 + 1.4.6 2.9.2 diff --git a/other/java/hdfs3/dependency-reduced-pom.xml b/other/java/hdfs3/dependency-reduced-pom.xml index 5f1e278f8..3564ef33d 100644 --- a/other/java/hdfs3/dependency-reduced-pom.xml +++ b/other/java/hdfs3/dependency-reduced-pom.xml @@ -127,7 +127,7 @@ - 1.4.5 + 1.4.6 3.1.1 diff --git a/other/java/hdfs3/pom.xml b/other/java/hdfs3/pom.xml index b1bd27f74..afb6ef309 100644 --- a/other/java/hdfs3/pom.xml +++ b/other/java/hdfs3/pom.xml @@ -5,7 +5,7 @@ 4.0.0 - 1.4.5 + 1.4.6 3.1.1 From ff200398bbd2665146e644aaf46951950db37017 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:18:50 -0700 Subject: [PATCH 38/81] 1.90 --- k8s/seaweedfs/Chart.yaml | 2 +- k8s/seaweedfs/values.yaml | 2 +- weed/util/constants.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/seaweedfs/Chart.yaml b/k8s/seaweedfs/Chart.yaml index 14b927d2c..0744d5051 100644 --- a/k8s/seaweedfs/Chart.yaml +++ b/k8s/seaweedfs/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: SeaweedFS name: seaweedfs -version: 1.89 \ No newline at end of file +version: 1.90 \ No newline at end of file diff --git a/k8s/seaweedfs/values.yaml b/k8s/seaweedfs/values.yaml index 6ddb1953c..e87bc0fcb 100644 --- a/k8s/seaweedfs/values.yaml +++ b/k8s/seaweedfs/values.yaml @@ -4,7 +4,7 @@ global: registry: "" repository: "" imageName: chrislusf/seaweedfs - imageTag: "1.89" + imageTag: "1.90" imagePullPolicy: IfNotPresent imagePullSecrets: imagepullsecret restartPolicy: Always diff --git a/weed/util/constants.go b/weed/util/constants.go index 69cf57216..e614a5d24 100644 --- a/weed/util/constants.go +++ b/weed/util/constants.go @@ -5,7 +5,7 @@ import ( ) var ( - VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 89) + VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 90) COMMIT = "" ) From 48ed7f8a328ecaa40a21cac0a72c3711ca196a19 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 21:25:24 -0700 Subject: [PATCH 39/81] generated files --- other/java/hdfs3/dependency-reduced-pom.xml | 182 ++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/other/java/hdfs3/dependency-reduced-pom.xml b/other/java/hdfs3/dependency-reduced-pom.xml index 3564ef33d..25de9dfc0 100644 --- a/other/java/hdfs3/dependency-reduced-pom.xml +++ b/other/java/hdfs3/dependency-reduced-pom.xml @@ -120,6 +120,188 @@ + + + org.apache.hadoop + hadoop-client + 3.1.1 + provided + + + hadoop-hdfs-client + org.apache.hadoop + + + hadoop-yarn-api + org.apache.hadoop + + + hadoop-yarn-client + org.apache.hadoop + + + hadoop-mapreduce-client-core + org.apache.hadoop + + + hadoop-mapreduce-client-jobclient + org.apache.hadoop + + + hadoop-annotations + org.apache.hadoop + + + + + org.apache.hadoop + hadoop-common + 3.1.1 + provided + + + commons-cli + commons-cli + + + commons-math3 + org.apache.commons + + + commons-io + commons-io + + + commons-net + commons-net + + + commons-collections + commons-collections + + + javax.servlet-api + javax.servlet + + + jetty-server + org.eclipse.jetty + + + jetty-util + org.eclipse.jetty + + + jetty-servlet + org.eclipse.jetty + + + jetty-webapp + org.eclipse.jetty + + + jsp-api + javax.servlet.jsp + + + jersey-core + com.sun.jersey + + + jersey-servlet + com.sun.jersey + + + jersey-json + com.sun.jersey + + + jersey-server + com.sun.jersey + + + log4j + log4j + + + commons-lang + commons-lang + + + commons-beanutils + commons-beanutils + + + commons-configuration2 + org.apache.commons + + + commons-lang3 + org.apache.commons + + + slf4j-log4j12 + org.slf4j + + + avro + org.apache.avro + + + re2j + com.google.re2j + + + hadoop-auth + org.apache.hadoop + + + jsch + com.jcraft + + + curator-client + org.apache.curator + + + curator-recipes + org.apache.curator + + + htrace-core4 + org.apache.htrace + + + zookeeper + org.apache.zookeeper + + + commons-compress + org.apache.commons + + + kerb-simplekdc + org.apache.kerby + + + jackson-databind + com.fasterxml.jackson.core + + + stax2-api + org.codehaus.woodstox + + + woodstox-core + com.fasterxml.woodstox + + + hadoop-annotations + org.apache.hadoop + + + + ossrh From 2ac27616bcc9f37adb22ccd00662584724d47a6d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 23:47:34 -0700 Subject: [PATCH 40/81] fix possible out of range bytes avoid buff out of range resp.Data = buff[:totalRead] --- weed/filesys/dirty_page.go | 2 +- weed/filesys/dirty_page_interval.go | 15 ++------------- weed/filesys/filehandle.go | 11 +++++------ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index ba8f7ec41..9e8ec1702 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -172,7 +172,7 @@ func min(x, y int64) int64 { return y } -func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (offset int64, size int) { +func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (maxStop int64) { pages.lock.Lock() defer pages.lock.Unlock() diff --git a/weed/filesys/dirty_page_interval.go b/weed/filesys/dirty_page_interval.go index ec94c6df1..10b74bb68 100644 --- a/weed/filesys/dirty_page_interval.go +++ b/weed/filesys/dirty_page_interval.go @@ -3,7 +3,6 @@ package filesys import ( "bytes" "io" - "math" ) type IntervalNode struct { @@ -186,25 +185,15 @@ func (c *ContinuousIntervals) removeList(target *IntervalLinkedList) { } -func (c *ContinuousIntervals) ReadData(data []byte, startOffset int64) (offset int64, size int) { - var minOffset int64 = math.MaxInt64 - var maxStop int64 +func (c *ContinuousIntervals) ReadData(data []byte, startOffset int64) (maxStop int64) { for _, list := range c.lists { start := max(startOffset, list.Offset()) stop := min(startOffset+int64(len(data)), list.Offset()+list.Size()) - if start <= stop { + if start < stop { list.ReadData(data[start-startOffset:], start, stop) - minOffset = min(minOffset, start) maxStop = max(maxStop, stop) } } - - if minOffset == math.MaxInt64 { - return 0, 0 - } - - offset = minOffset - size = int(maxStop - offset) return } diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index b6f350953..b0242fb19 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -54,7 +54,7 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(5).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) + glog.V(4).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) buff := resp.Data[:cap(resp.Data)] if req.Size > cap(resp.Data) { @@ -64,12 +64,11 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus totalRead, err := fh.readFromChunks(buff, req.Offset) if err == nil { - dirtyOffset, dirtySize := fh.readFromDirtyPages(buff, req.Offset) - if totalRead+req.Offset < dirtyOffset+int64(dirtySize) { - totalRead = dirtyOffset + int64(dirtySize) - req.Offset - } + maxStop := fh.readFromDirtyPages(buff, req.Offset) + totalRead = max(maxStop - req.Offset, totalRead) } + totalRead = min(int64(len(buff)), totalRead) resp.Data = buff[:totalRead] if err != nil { @@ -80,7 +79,7 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus return err } -func (fh *FileHandle) readFromDirtyPages(buff []byte, startOffset int64) (offset int64, size int) { +func (fh *FileHandle) readFromDirtyPages(buff []byte, startOffset int64) (maxStop int64) { return fh.dirtyPages.ReadDirtyData(buff, startOffset) } From f5837b700079b8ad5cf52a7a4996ab49a57b4289 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 16 Aug 2020 23:49:10 -0700 Subject: [PATCH 41/81] report error first --- weed/filesys/filehandle.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index b0242fb19..a40135b42 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -68,14 +68,14 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus totalRead = max(maxStop - req.Offset, totalRead) } - totalRead = min(int64(len(buff)), totalRead) - resp.Data = buff[:totalRead] - if err != nil { glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err) return fuse.EIO } + totalRead = min(int64(len(buff)), totalRead) + resp.Data = buff[:totalRead] + return err } From 24c8e6bcb4f06c7cab1dec4bd44c0cd48f976c79 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 10:03:34 -0700 Subject: [PATCH 42/81] minor optimization --- weed/filesys/meta_cache/meta_cache.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/weed/filesys/meta_cache/meta_cache.go b/weed/filesys/meta_cache/meta_cache.go index edf329143..69a016c23 100644 --- a/weed/filesys/meta_cache/meta_cache.go +++ b/weed/filesys/meta_cache/meta_cache.go @@ -61,8 +61,13 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat oldDir, _ := oldPath.DirAndName() if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) { if oldPath != "" { - if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil { - return err + if oldPath == newEntry.FullPath { + // skip the unnecessary deletion + // leave the update to the following InsertEntry operation + } else { + if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil { + return err + } } } } else { From 60158a23b3a2de8e8aa8ce1d16672adab2cc5540 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 10:04:10 -0700 Subject: [PATCH 43/81] Create MmapFileTest.java --- .../java/seaewedfs/mmap/MmapFileTest.java | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 test/random_access/src/test/java/seaewedfs/mmap/MmapFileTest.java diff --git a/test/random_access/src/test/java/seaewedfs/mmap/MmapFileTest.java b/test/random_access/src/test/java/seaewedfs/mmap/MmapFileTest.java new file mode 100644 index 000000000..e64fb85f0 --- /dev/null +++ b/test/random_access/src/test/java/seaewedfs/mmap/MmapFileTest.java @@ -0,0 +1,143 @@ +package seaewedfs.mmap; + +import org.junit.Test; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.MappedByteBuffer; +import java.nio.channels.FileChannel; + +public class MmapFileTest { + + File dir = new File("/Users/chris/tmp/mm/dev"); + + @Test + public void testMmap() { + try { + System.out.println("starting ..."); + + File f = new File(dir, "mmap_file.txt"); + RandomAccessFile raf = new RandomAccessFile(f, "rw"); + FileChannel fc = raf.getChannel(); + MappedByteBuffer mbf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); + fc.close(); + raf.close(); + + FileOutputStream fos = new FileOutputStream(f); + fos.write("abcdefg".getBytes()); + fos.close(); + System.out.println("completed!"); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Test + public void testBigMmap() throws IOException { + /* + +// new file +I0817 09:48:02 25175 dir.go:147] create /dev/mmap_big.txt: OpenReadWrite+OpenCreate +I0817 09:48:02 25175 wfs.go:116] AcquireHandle /dev/mmap_big.txt uid=502 gid=20 +I0817 09:48:02 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 0 +I0817 09:48:02 25175 meta_cache_subscribe.go:32] creating /dev/mmap_big.txt + +//get channel +I0817 09:48:26 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 0 + +I0817 09:48:32 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 0 +I0817 09:48:32 25175 wfs.go:116] AcquireHandle /dev/mmap_big.txt uid=0 gid=0 +I0817 09:48:32 25175 filehandle.go:160] Release /dev/mmap_big.txt fh 14968871991130164560 + +//fileChannel.map +I0817 09:49:18 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 0 +I0817 09:49:18 25175 file.go:112] /dev/mmap_big.txt file setattr set size=262144 chunks=0 +I0817 09:49:18 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 +I0817 09:49:18 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 +I0817 09:49:18 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 + +// buffer.put +I0817 09:49:49 25175 filehandle.go:57] /dev/mmap_big.txt read fh 14968871991130164560: [0,32768) size 32768 resp.Data len=0 cap=32768 +I0817 09:49:49 25175 reader_at.go:113] zero2 [0,32768) +I0817 09:49:50 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 + +I0817 09:49:53 25175 file.go:233] /dev/mmap_big.txt fsync file Fsync [ID=0x4 Node=0xe Uid=0 Gid=0 Pid=0] Handle 0x2 Flags 1 + +//close +I0817 09:50:14 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 +I0817 09:50:14 25175 dirty_page.go:130] saveToStorage /dev/mmap_big.txt 1,315b69812039e5 [0,4096) of 262144 bytes +I0817 09:50:14 25175 file.go:274] /dev/mmap_big.txt existing 0 chunks adds 1 more +I0817 09:50:14 25175 filehandle.go:218] /dev/mmap_big.txt set chunks: 1 +I0817 09:50:14 25175 filehandle.go:220] /dev/mmap_big.txt chunks 0: 1,315b69812039e5 [0,4096) +I0817 09:50:14 25175 meta_cache_subscribe.go:23] deleting /dev/mmap_big.txt +I0817 09:50:14 25175 meta_cache_subscribe.go:32] creating /dev/mmap_big.txt + +// end of test +I0817 09:50:41 25175 file.go:62] file Attr /dev/mmap_big.txt, open:1, size: 262144 +I0817 09:50:41 25175 filehandle.go:160] Release /dev/mmap_big.txt fh 14968871991130164560 + + */ + // Create file object + File file = new File(dir, "mmap_big.txt"); + + try (RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw")) { + // Get file channel in read-write mode + FileChannel fileChannel = randomAccessFile.getChannel(); + + // Get direct byte buffer access using channel.map() operation + MappedByteBuffer buffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, 4096 * 8 * 8); + + //Write the content using put methods + buffer.put("howtodoinjava.com".getBytes()); + } + +/* +> meta.cat /dev/mmap_big.txt +{ + "name": "mmap_big.txt", + "isDirectory": false, + "chunks": [ + { + "fileId": "1,315b69812039e5", + "offset": "0", + "size": "4096", + "mtime": "1597683014026365000", + "eTag": "985ab0ac", + "sourceFileId": "", + "fid": { + "volumeId": 1, + "fileKey": "3234665", + "cookie": 2166372837 + }, + "sourceFid": null, + "cipherKey": null, + "isCompressed": true, + "isChunkManifest": false + } + ], + "attributes": { + "fileSize": "262144", + "mtime": "1597683014", + "fileMode": 420, + "uid": 502, + "gid": 20, + "crtime": "1597682882", + "mime": "application/octet-stream", + "replication": "", + "collection": "", + "ttlSec": 0, + "userName": "", + "groupName": [ + ], + "symlinkTarget": "", + "md5": null + }, + "extended": { + } +} + */ + + } +} From 4ccfdaeb4dd7a20c50414b1a3f5a4c37cacf6774 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 10:07:34 -0700 Subject: [PATCH 44/81] prevent nil --- weed/filesys/meta_cache/meta_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/meta_cache/meta_cache.go b/weed/filesys/meta_cache/meta_cache.go index 69a016c23..15ec0903d 100644 --- a/weed/filesys/meta_cache/meta_cache.go +++ b/weed/filesys/meta_cache/meta_cache.go @@ -61,7 +61,7 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat oldDir, _ := oldPath.DirAndName() if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) { if oldPath != "" { - if oldPath == newEntry.FullPath { + if newEntry != nil && oldPath == newEntry.FullPath { // skip the unnecessary deletion // leave the update to the following InsertEntry operation } else { From 9d46c7bc78987b1b02236030e9ca0af3f8c9e4f4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 11:12:10 -0700 Subject: [PATCH 45/81] rename --- weed/filesys/dirty_page.go | 4 ++-- weed/filesys/dirty_page_interval.go | 2 +- weed/filesys/filehandle.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index 9e8ec1702..bfb417ea9 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -172,11 +172,11 @@ func min(x, y int64) int64 { return y } -func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (maxStop int64) { +func (pages *ContinuousDirtyPages) ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64) { pages.lock.Lock() defer pages.lock.Unlock() - return pages.intervals.ReadData(data, startOffset) + return pages.intervals.ReadDataAt(data, startOffset) } diff --git a/weed/filesys/dirty_page_interval.go b/weed/filesys/dirty_page_interval.go index 10b74bb68..afa2755ed 100644 --- a/weed/filesys/dirty_page_interval.go +++ b/weed/filesys/dirty_page_interval.go @@ -185,7 +185,7 @@ func (c *ContinuousIntervals) removeList(target *IntervalLinkedList) { } -func (c *ContinuousIntervals) ReadData(data []byte, startOffset int64) (maxStop int64) { +func (c *ContinuousIntervals) ReadDataAt(data []byte, startOffset int64) (maxStop int64) { for _, list := range c.lists { start := max(startOffset, list.Offset()) stop := min(startOffset+int64(len(data)), list.Offset()+list.Size()) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index a40135b42..c3d49b16b 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -80,7 +80,7 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus } func (fh *FileHandle) readFromDirtyPages(buff []byte, startOffset int64) (maxStop int64) { - return fh.dirtyPages.ReadDirtyData(buff, startOffset) + return fh.dirtyPages.ReadDirtyDataAt(buff, startOffset) } func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { From abdaf9958d6d10a09246a9dc107db9f8dea9080b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 16:04:56 -0700 Subject: [PATCH 46/81] possibly read more --- weed/filesys/filehandle.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index c3d49b16b..358475bd3 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -73,7 +73,10 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus return fuse.EIO } - totalRead = min(int64(len(buff)), totalRead) + if totalRead > int64(len(buff)) { + glog.Warningf("%s FileHandle Read %d: [%d,%d) size %d totalRead %d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, totalRead) + totalRead = min(int64(len(buff)), totalRead) + } resp.Data = buff[:totalRead] return err @@ -102,7 +105,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { } if fh.f.reader == nil { - chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt32) + chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt64) fh.f.reader = filer2.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache, fileSize) } From 97e54a80d4e20ea10a258c281df01efca2fb03dc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 16:05:13 -0700 Subject: [PATCH 47/81] rename variables --- weed/util/chunk_cache/chunk_cache.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index b54b40dbb..6c6a45920 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -33,7 +33,7 @@ func NewChunkCache(maxEntries int64, dir string, diskSizeMB int64) *ChunkCache { return c } -func (c *ChunkCache) GetChunk(fileId string, chunkSize uint64) (data []byte) { +func (c *ChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { if c == nil { return } @@ -41,14 +41,14 @@ func (c *ChunkCache) GetChunk(fileId string, chunkSize uint64) (data []byte) { c.RLock() defer c.RUnlock() - return c.doGetChunk(fileId, chunkSize) + return c.doGetChunk(fileId, minSize) } -func (c *ChunkCache) doGetChunk(fileId string, chunkSize uint64) (data []byte) { +func (c *ChunkCache) doGetChunk(fileId string, minSize uint64) (data []byte) { - if chunkSize < memCacheSizeLimit { + if minSize < memCacheSizeLimit { data = c.memCache.GetChunk(fileId) - if len(data) >= int(chunkSize) { + if len(data) >= int(minSize) { return data } } @@ -59,21 +59,21 @@ func (c *ChunkCache) doGetChunk(fileId string, chunkSize uint64) (data []byte) { return nil } - if chunkSize < onDiskCacheSizeLimit0 { + if minSize < onDiskCacheSizeLimit0 { data = c.diskCaches[0].getChunk(fid.Key) - if len(data) >= int(chunkSize) { + if len(data) >= int(minSize) { return data } } - if chunkSize < onDiskCacheSizeLimit1 { + if minSize < onDiskCacheSizeLimit1 { data = c.diskCaches[1].getChunk(fid.Key) - if len(data) >= int(chunkSize) { + if len(data) >= int(minSize) { return data } } { data = c.diskCaches[2].getChunk(fid.Key) - if len(data) >= int(chunkSize) { + if len(data) >= int(minSize) { return data } } From 0be4b6e7f0a5e595a692835e8e755b123a6e72f1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 16:05:40 -0700 Subject: [PATCH 48/81] logs --- weed/filer2/reader_at.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index fc74ef2af..600788f9c 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -70,6 +70,7 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { c.readerLock.Lock() defer c.readerLock.Unlock() + glog.V(4).Infof("ReadAt [%d,%d) of total file size %d bytes %d chunk views", offset, offset+int64(len(p)), c.fileSize, len(c.chunkViews)) for n < len(p) && err == nil { readCount, readErr := c.doReadAt(p[n:], offset+int64(n)) n += readCount @@ -81,7 +82,7 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { var startOffset = offset - for _, chunk := range c.chunkViews { + for i, chunk := range c.chunkViews { if startOffset < min(chunk.LogicOffset, int64(len(p))+offset) { gap := int(min(chunk.LogicOffset, int64(len(p))+offset) - startOffset) glog.V(4).Infof("zero [%d,%d)", n, n+gap) @@ -93,7 +94,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { if chunkStart >= chunkStop { continue } - glog.V(4).Infof("read [%d,%d), chunk %s [%d,%d)\n", chunkStart, chunkStop, chunk.FileId, chunk.LogicOffset-chunk.Offset, chunk.LogicOffset-chunk.Offset+int64(chunk.Size)) + glog.V(4).Infof("read [%d,%d), %d chunk %s [%d,%d)", chunkStart, chunkStop, i, chunk.FileId, chunk.LogicOffset-chunk.Offset, chunk.LogicOffset-chunk.Offset+int64(chunk.Size)) c.buffer, err = c.fetchWholeChunkData(chunk) if err != nil { glog.Errorf("fetching chunk %+v: %v\n", chunk, err) @@ -124,12 +125,13 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { func (c *ChunkReadAt) fetchWholeChunkData(chunkView *ChunkView) (chunkData []byte, err error) { - glog.V(4).Infof("fetchWholeChunkData %s offset %d [%d,%d)\n", chunkView.FileId, chunkView.Offset, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size)) + glog.V(4).Infof("fetchWholeChunkData %s offset %d [%d,%d) size at least %d", chunkView.FileId, chunkView.Offset, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size), chunkView.ChunkSize) chunkData = c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { glog.V(5).Infof("cache hit %s [%d,%d)", chunkView.FileId, chunkView.LogicOffset-chunkView.Offset, chunkView.LogicOffset-chunkView.Offset+int64(len(chunkData))) } else { + glog.V(4).Infof("doFetchFullChunkData %s", chunkView.FileId) chunkData, err = c.doFetchFullChunkData(chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped) if err != nil { return From 0625e63648e8c4a2c4bc9dfe5b8d6011014518ce Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 20:14:40 -0700 Subject: [PATCH 49/81] count 0 as part of the reads --- weed/filer2/reader_at.go | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 600788f9c..75a0a0655 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -15,8 +15,6 @@ import ( type ChunkReadAt struct { masterClient *wdclient.MasterClient chunkViews []*ChunkView - buffer []byte - bufferFileId string lookupFileId func(fileId string) (targetUrl string, err error) readerLock sync.Mutex fileSize int64 @@ -71,49 +69,50 @@ func (c *ChunkReadAt) ReadAt(p []byte, offset int64) (n int, err error) { defer c.readerLock.Unlock() glog.V(4).Infof("ReadAt [%d,%d) of total file size %d bytes %d chunk views", offset, offset+int64(len(p)), c.fileSize, len(c.chunkViews)) - for n < len(p) && err == nil { - readCount, readErr := c.doReadAt(p[n:], offset+int64(n)) - n += readCount - err = readErr - } - return + return c.doReadAt(p[n:], offset+int64(n)) } func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { - var startOffset = offset + var buffer []byte + startOffset, remaining := offset, int64(len(p)) for i, chunk := range c.chunkViews { - if startOffset < min(chunk.LogicOffset, int64(len(p))+offset) { - gap := int(min(chunk.LogicOffset, int64(len(p))+offset) - startOffset) + if remaining <= 0 { + break + } + if startOffset < chunk.LogicOffset { + gap := int(chunk.LogicOffset - startOffset) glog.V(4).Infof("zero [%d,%d)", n, n+gap) n += gap - startOffset = chunk.LogicOffset + startOffset, remaining = chunk.LogicOffset, remaining-int64(gap) + if remaining <= 0 { + break + } } // fmt.Printf(">>> doReadAt [%d,%d), chunk[%d,%d)\n", offset, offset+int64(len(p)), chunk.LogicOffset, chunk.LogicOffset+int64(chunk.Size)) - chunkStart, chunkStop := max(chunk.LogicOffset, offset), min(chunk.LogicOffset+int64(chunk.Size), offset+int64(len(p))) + chunkStart, chunkStop := max(chunk.LogicOffset, startOffset), min(chunk.LogicOffset+int64(chunk.Size), startOffset+remaining) if chunkStart >= chunkStop { continue } - glog.V(4).Infof("read [%d,%d), %d chunk %s [%d,%d)", chunkStart, chunkStop, i, chunk.FileId, chunk.LogicOffset-chunk.Offset, chunk.LogicOffset-chunk.Offset+int64(chunk.Size)) - c.buffer, err = c.fetchWholeChunkData(chunk) + glog.V(4).Infof("read [%d,%d), %d/%d chunk %s [%d,%d)", chunkStart, chunkStop, i, len(c.chunkViews), chunk.FileId, chunk.LogicOffset-chunk.Offset, chunk.LogicOffset-chunk.Offset+int64(chunk.Size)) + buffer, err = c.readFromWholeChunkData(chunk) if err != nil { glog.Errorf("fetching chunk %+v: %v\n", chunk, err) return } - c.bufferFileId = chunk.FileId bufferOffset := chunkStart - chunk.LogicOffset + chunk.Offset - copied := copy(p[chunkStart-offset:chunkStop-offset], c.buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) + copied := copy(p[chunkStart-startOffset:chunkStop-startOffset], buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) n += copied - startOffset += int64(copied) + startOffset, remaining = startOffset + int64(copied), remaining-int64(copied) } - // fmt.Printf("> doReadAt [%d,%d), buffer %s:%d, found:%v, err:%v\n", offset, offset+int64(len(p)), c.bufferFileId, int64(len(c.buffer)), found, err) + glog.V(4).Infof("doReadAt [%d,%d), n:%v, err:%v", offset, offset+int64(len(p)), n, err) - if startOffset < min(c.fileSize, int64(len(p))+offset) { - gap := int(min(c.fileSize, int64(len(p))+offset) - startOffset) - glog.V(4).Infof("zero2 [%d,%d)", n, n+gap) - n += gap + if remaining > 0 { + glog.V(4).Infof("zero2 [%d,%d)", n, n+int(remaining)) + n += int(remaining) } + if offset+int64(n) >= c.fileSize { err = io.EOF } @@ -123,9 +122,9 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { } -func (c *ChunkReadAt) fetchWholeChunkData(chunkView *ChunkView) (chunkData []byte, err error) { +func (c *ChunkReadAt) readFromWholeChunkData(chunkView *ChunkView) (chunkData []byte, err error) { - glog.V(4).Infof("fetchWholeChunkData %s offset %d [%d,%d) size at least %d", chunkView.FileId, chunkView.Offset, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size), chunkView.ChunkSize) + glog.V(4).Infof("readFromWholeChunkData %s offset %d [%d,%d) size at least %d", chunkView.FileId, chunkView.Offset, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size), chunkView.ChunkSize) chunkData = c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize) if chunkData != nil { From be4d42b8e2bffd4a5ff650611f2cfb8c058ca26b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 20:15:53 -0700 Subject: [PATCH 50/81] rename --- weed/filer2/reader_at.go | 4 ++-- weed/filesys/wfs.go | 4 ++-- weed/server/webdav_server.go | 4 ++-- weed/util/chunk_cache/chunk_cache.go | 16 ++++++++-------- .../util/chunk_cache/chunk_cache_on_disk_test.go | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 75a0a0655..4d8e48cb5 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -19,7 +19,7 @@ type ChunkReadAt struct { readerLock sync.Mutex fileSize int64 - chunkCache *chunk_cache.ChunkCache + chunkCache *chunk_cache.TieredChunkCache } // var _ = io.ReaderAt(&ChunkReadAt{}) @@ -53,7 +53,7 @@ func LookupFn(filerClient filer_pb.FilerClient) LookupFileIdFunctionType { } } -func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.ChunkCache, fileSize int64) *ChunkReadAt { +func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.TieredChunkCache, fileSize int64) *ChunkReadAt { return &ChunkReadAt{ chunkViews: chunkViews, diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index eb7042663..8803c31e0 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -65,7 +65,7 @@ type WFS struct { root fs.Node fsNodeCache *FsCache - chunkCache *chunk_cache.ChunkCache + chunkCache *chunk_cache.TieredChunkCache metaCache *meta_cache.MetaCache } type statsCache struct { @@ -87,7 +87,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { cacheDir := path.Join(option.CacheDir, cacheUniqueId) if option.CacheSizeMB > 0 { os.MkdirAll(cacheDir, 0755) - wfs.chunkCache = chunk_cache.NewChunkCache(256, cacheDir, option.CacheSizeMB) + wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB) grace.OnInterrupt(func() { wfs.chunkCache.Shutdown() }) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index 277e261f0..fb13f55d0 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -70,7 +70,7 @@ type WebDavFileSystem struct { secret security.SigningKey filer *filer2.Filer grpcDialOption grpc.DialOption - chunkCache *chunk_cache.ChunkCache + chunkCache *chunk_cache.TieredChunkCache } type FileInfo struct { @@ -100,7 +100,7 @@ type WebDavFile struct { func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) { - chunkCache := chunk_cache.NewChunkCache(256, option.CacheDir, option.CacheSizeMB) + chunkCache := chunk_cache.NewTieredChunkCache(256, option.CacheDir, option.CacheSizeMB) grace.OnInterrupt(func() { chunkCache.Shutdown() }) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index 6c6a45920..d01e2163b 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -14,15 +14,15 @@ const ( ) // a global cache for recently accessed file chunks -type ChunkCache struct { +type TieredChunkCache struct { memCache *ChunkCacheInMemory diskCaches []*OnDiskCacheLayer sync.RWMutex } -func NewChunkCache(maxEntries int64, dir string, diskSizeMB int64) *ChunkCache { +func NewTieredChunkCache(maxEntries int64, dir string, diskSizeMB int64) *TieredChunkCache { - c := &ChunkCache{ + c := &TieredChunkCache{ memCache: NewChunkCacheInMemory(maxEntries), } c.diskCaches = make([]*OnDiskCacheLayer, 3) @@ -33,7 +33,7 @@ func NewChunkCache(maxEntries int64, dir string, diskSizeMB int64) *ChunkCache { return c } -func (c *ChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { +func (c *TieredChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { if c == nil { return } @@ -44,7 +44,7 @@ func (c *ChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { return c.doGetChunk(fileId, minSize) } -func (c *ChunkCache) doGetChunk(fileId string, minSize uint64) (data []byte) { +func (c *TieredChunkCache) doGetChunk(fileId string, minSize uint64) (data []byte) { if minSize < memCacheSizeLimit { data = c.memCache.GetChunk(fileId) @@ -82,7 +82,7 @@ func (c *ChunkCache) doGetChunk(fileId string, minSize uint64) (data []byte) { } -func (c *ChunkCache) SetChunk(fileId string, data []byte) { +func (c *TieredChunkCache) SetChunk(fileId string, data []byte) { if c == nil { return } @@ -94,7 +94,7 @@ func (c *ChunkCache) SetChunk(fileId string, data []byte) { c.doSetChunk(fileId, data) } -func (c *ChunkCache) doSetChunk(fileId string, data []byte) { +func (c *TieredChunkCache) doSetChunk(fileId string, data []byte) { if len(data) < memCacheSizeLimit { c.memCache.SetChunk(fileId, data) @@ -116,7 +116,7 @@ func (c *ChunkCache) doSetChunk(fileId string, data []byte) { } -func (c *ChunkCache) Shutdown() { +func (c *TieredChunkCache) Shutdown() { if c == nil { return } diff --git a/weed/util/chunk_cache/chunk_cache_on_disk_test.go b/weed/util/chunk_cache/chunk_cache_on_disk_test.go index f061f2ba2..558488f18 100644 --- a/weed/util/chunk_cache/chunk_cache_on_disk_test.go +++ b/weed/util/chunk_cache/chunk_cache_on_disk_test.go @@ -16,7 +16,7 @@ func TestOnDisk(t *testing.T) { totalDiskSizeMb := int64(32) - cache := NewChunkCache(0, tmpDir, totalDiskSizeMb) + cache := NewTieredChunkCache(0, tmpDir, totalDiskSizeMb) writeCount := 5 type test_data struct { @@ -45,7 +45,7 @@ func TestOnDisk(t *testing.T) { cache.Shutdown() - cache = NewChunkCache(0, tmpDir, totalDiskSizeMb) + cache = NewTieredChunkCache(0, tmpDir, totalDiskSizeMb) for i := 0; i < writeCount; i++ { data := cache.GetChunk(testData[i].fileId, testData[i].size) From 09e126bae50dac2fe2dee2b074789c6c6e06bf8c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 20:20:08 -0700 Subject: [PATCH 51/81] refactoring: use interface --- weed/filer2/reader_at.go | 6 +++--- weed/util/chunk_cache/chunk_cache.go | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 4d8e48cb5..b036e64fe 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -19,7 +19,7 @@ type ChunkReadAt struct { readerLock sync.Mutex fileSize int64 - chunkCache *chunk_cache.TieredChunkCache + chunkCache chunk_cache.ChunkCache } // var _ = io.ReaderAt(&ChunkReadAt{}) @@ -53,7 +53,7 @@ func LookupFn(filerClient filer_pb.FilerClient) LookupFileIdFunctionType { } } -func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache *chunk_cache.TieredChunkCache, fileSize int64) *ChunkReadAt { +func NewChunkReaderAtFromClient(filerClient filer_pb.FilerClient, chunkViews []*ChunkView, chunkCache chunk_cache.ChunkCache, fileSize int64) *ChunkReadAt { return &ChunkReadAt{ chunkViews: chunkViews, @@ -103,7 +103,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { bufferOffset := chunkStart - chunk.LogicOffset + chunk.Offset copied := copy(p[chunkStart-startOffset:chunkStop-startOffset], buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) n += copied - startOffset, remaining = startOffset + int64(copied), remaining-int64(copied) + startOffset, remaining = startOffset+int64(copied), remaining-int64(copied) } glog.V(4).Infof("doReadAt [%d,%d), n:%v, err:%v", offset, offset+int64(len(p)), n, err) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index d01e2163b..a1a054215 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -13,6 +13,11 @@ const ( onDiskCacheSizeLimit1 = 4 * memCacheSizeLimit ) +type ChunkCache interface { + GetChunk(fileId string, minSize uint64) (data []byte) + SetChunk(fileId string, data []byte) +} + // a global cache for recently accessed file chunks type TieredChunkCache struct { memCache *ChunkCacheInMemory From 56fbd2c2119520702915b07dda419dae97cdd943 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 21:17:32 -0700 Subject: [PATCH 52/81] fix reading --- weed/filer2/reader_at.go | 5 +- weed/filer2/reader_at_test.go | 122 ++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 weed/filer2/reader_at_test.go diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index b036e64fe..09d99dfb8 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -101,7 +101,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { return } bufferOffset := chunkStart - chunk.LogicOffset + chunk.Offset - copied := copy(p[chunkStart-startOffset:chunkStop-startOffset], buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) + copied := copy(p[startOffset-offset:chunkStop-chunkStart+startOffset-offset], buffer[bufferOffset:bufferOffset+chunkStop-chunkStart]) n += copied startOffset, remaining = startOffset+int64(copied), remaining-int64(copied) } @@ -111,6 +111,9 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { if remaining > 0 { glog.V(4).Infof("zero2 [%d,%d)", n, n+int(remaining)) n += int(remaining) + if n > int(c.fileSize - offset){ + n = int(c.fileSize - offset) + } } if offset+int64(n) >= c.fileSize { diff --git a/weed/filer2/reader_at_test.go b/weed/filer2/reader_at_test.go new file mode 100644 index 000000000..2a42cfd49 --- /dev/null +++ b/weed/filer2/reader_at_test.go @@ -0,0 +1,122 @@ +package filer2 + +import ( + "fmt" + "io" + "math" + "strconv" + "sync" + "testing" +) + +type mockChunkCache struct { +} + +func (m *mockChunkCache) GetChunk(fileId string, minSize uint64) (data []byte) { + x, _ := strconv.Atoi(fileId) + data = make([]byte, minSize) + for i := 0; i < int(minSize); i++ { + data[i] = byte(x) + } + return data +} +func (m *mockChunkCache) SetChunk(fileId string, data []byte) { +} + +func TestReaderAt(t *testing.T) { + + visibles := []VisibleInterval{ + { + start: 1, + stop: 2, + fileId: "1", + chunkSize: 9, + }, + { + start: 3, + stop: 4, + fileId: "3", + chunkSize: 1, + }, + { + start: 5, + stop: 6, + fileId: "5", + chunkSize: 2, + }, + { + start: 7, + stop: 9, + fileId: "7", + chunkSize: 2, + }, + { + start: 9, + stop: 10, + fileId: "9", + chunkSize: 2, + }, + } + + readerAt := &ChunkReadAt{ + chunkViews: ViewFromVisibleIntervals(visibles, 0, math.MaxInt64), + lookupFileId: nil, + readerLock: sync.Mutex{}, + fileSize: 10, + chunkCache: &mockChunkCache{}, + } + + testReadAt(t, readerAt, 0, 10, 10, io.EOF) + testReadAt(t, readerAt, 0, 12, 10, io.EOF) + testReadAt(t, readerAt, 2, 8, 8, io.EOF) + testReadAt(t, readerAt, 3, 6, 6, nil) + +} + +func testReadAt(t *testing.T, readerAt *ChunkReadAt, offset int64, size int, expected int, expectedErr error) { + data := make([]byte, size) + n, err := readerAt.ReadAt(data, offset) + + if expected != n { + t.Errorf("unexpected read size: %d, expect: %d", n, expected) + } + if err != expectedErr { + t.Errorf("unexpected read error: %v, expect: %v", err, expectedErr) + } + + for _, d := range data { + fmt.Printf("%x", d) + } + fmt.Println() +} + +func TestReaderAt0(t *testing.T) { + + visibles := []VisibleInterval{ + { + start: 2, + stop: 5, + fileId: "1", + chunkSize: 9, + }, + { + start: 7, + stop: 9, + fileId: "2", + chunkSize: 9, + }, + } + + readerAt := &ChunkReadAt{ + chunkViews: ViewFromVisibleIntervals(visibles, 0, math.MaxInt64), + lookupFileId: nil, + readerLock: sync.Mutex{}, + fileSize: 10, + chunkCache: &mockChunkCache{}, + } + + testReadAt(t, readerAt, 0, 10, 10, io.EOF) + testReadAt(t, readerAt, 3, 16, 7, io.EOF) + testReadAt(t, readerAt, 3, 5, 5, nil) + +} From 1b68ba953be15365b5c2ebdb2e0946a0c69e335d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 22:46:32 -0700 Subject: [PATCH 53/81] fix for out of range reads --- weed/filer2/reader_at.go | 10 ++++------ weed/filer2/reader_at_test.go | 11 +++++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 09d99dfb8..84915f3f2 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -108,12 +108,10 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { glog.V(4).Infof("doReadAt [%d,%d), n:%v, err:%v", offset, offset+int64(len(p)), n, err) - if remaining > 0 { - glog.V(4).Infof("zero2 [%d,%d)", n, n+int(remaining)) - n += int(remaining) - if n > int(c.fileSize - offset){ - n = int(c.fileSize - offset) - } + if remaining > 0 && c.fileSize > startOffset { + delta := int(min(remaining, c.fileSize - startOffset)) + glog.V(4).Infof("zero2 [%d,%d)", n, n+delta) + n += delta } if offset+int64(n) >= c.fileSize { diff --git a/weed/filer2/reader_at_test.go b/weed/filer2/reader_at_test.go index 2a42cfd49..581436c70 100644 --- a/weed/filer2/reader_at_test.go +++ b/weed/filer2/reader_at_test.go @@ -77,6 +77,11 @@ func testReadAt(t *testing.T, readerAt *ChunkReadAt, offset int64, size int, exp data := make([]byte, size) n, err := readerAt.ReadAt(data, offset) + for _, d := range data { + fmt.Printf("%x", d) + } + fmt.Println() + if expected != n { t.Errorf("unexpected read size: %d, expect: %d", n, expected) } @@ -84,10 +89,6 @@ func testReadAt(t *testing.T, readerAt *ChunkReadAt, offset int64, size int, exp t.Errorf("unexpected read error: %v, expect: %v", err, expectedErr) } - for _, d := range data { - fmt.Printf("%x", d) - } - fmt.Println() } func TestReaderAt0(t *testing.T) { @@ -119,4 +120,6 @@ func TestReaderAt0(t *testing.T) { testReadAt(t, readerAt, 3, 16, 7, io.EOF) testReadAt(t, readerAt, 3, 5, 5, nil) + testReadAt(t, readerAt, 11, 5, 0, io.EOF) + } From 30fe424469aaac373737d04cc5b23ebf382fb3bf Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 17 Aug 2020 22:47:27 -0700 Subject: [PATCH 54/81] add one more test case --- weed/filer2/reader_at_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weed/filer2/reader_at_test.go b/weed/filer2/reader_at_test.go index 581436c70..6ead79b1e 100644 --- a/weed/filer2/reader_at_test.go +++ b/weed/filer2/reader_at_test.go @@ -121,5 +121,6 @@ func TestReaderAt0(t *testing.T) { testReadAt(t, readerAt, 3, 5, 5, nil) testReadAt(t, readerAt, 11, 5, 0, io.EOF) + testReadAt(t, readerAt, 10, 5, 0, io.EOF) } From ecb3ce46be4be0a296099075385d21e71363396f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 00:31:42 -0700 Subject: [PATCH 55/81] adjust error logs --- weed/filer2/filer_delete_entry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer2/filer_delete_entry.go b/weed/filer2/filer_delete_entry.go index d6a72e830..926569b30 100644 --- a/weed/filer2/filer_delete_entry.go +++ b/weed/filer2/filer_delete_entry.go @@ -65,7 +65,7 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry } if lastFileName == "" && !isRecursive && len(entries) > 0 { // only for first iteration in the loop - glog.Errorf("deleting a folder %s has children: %+v", entry.FullPath, entries) + glog.Errorf("deleting a folder %s has children: %+v ...", entry.FullPath, entries[0].Name()) return nil, fmt.Errorf("fail to delete non-empty folder: %s", entry.FullPath) } From cd4373824573400d62a37f3edc890a7c50bc137f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 00:32:01 -0700 Subject: [PATCH 56/81] fix reading when filling zeros --- weed/filer2/reader_at.go | 4 ++-- weed/filer2/reader_at_test.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 84915f3f2..52460380c 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -82,8 +82,8 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { } if startOffset < chunk.LogicOffset { gap := int(chunk.LogicOffset - startOffset) - glog.V(4).Infof("zero [%d,%d)", n, n+gap) - n += gap + glog.V(4).Infof("zero [%d,%d)", startOffset, startOffset+int64(gap)) + n += int(min(int64(gap), remaining)) startOffset, remaining = chunk.LogicOffset, remaining-int64(gap) if remaining <= 0 { break diff --git a/weed/filer2/reader_at_test.go b/weed/filer2/reader_at_test.go index 6ead79b1e..f93d7ea11 100644 --- a/weed/filer2/reader_at_test.go +++ b/weed/filer2/reader_at_test.go @@ -124,3 +124,33 @@ func TestReaderAt0(t *testing.T) { testReadAt(t, readerAt, 10, 5, 0, io.EOF) } + +func TestReaderAt1(t *testing.T) { + + visibles := []VisibleInterval{ + { + start: 2, + stop: 5, + fileId: "1", + chunkSize: 9, + }, + } + + readerAt := &ChunkReadAt{ + chunkViews: ViewFromVisibleIntervals(visibles, 0, math.MaxInt64), + lookupFileId: nil, + readerLock: sync.Mutex{}, + fileSize: 20, + chunkCache: &mockChunkCache{}, + } + + testReadAt(t, readerAt, 0, 20, 20, io.EOF) + testReadAt(t, readerAt, 1, 7, 7, nil) + testReadAt(t, readerAt, 0, 1, 1, nil) + testReadAt(t, readerAt, 18, 4, 2, io.EOF) + testReadAt(t, readerAt, 12, 4, 4, nil) + testReadAt(t, readerAt, 4, 20, 16, io.EOF) + testReadAt(t, readerAt, 4, 10, 10, nil) + testReadAt(t, readerAt, 1, 10, 10, nil) + +} From 0ca45a5cbc6813996a6e427b3d22aaf3aced856e Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 00:34:15 -0700 Subject: [PATCH 57/81] adjust logs --- weed/filer2/reader_at.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 52460380c..2894f4a4b 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -110,7 +110,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { if remaining > 0 && c.fileSize > startOffset { delta := int(min(remaining, c.fileSize - startOffset)) - glog.V(4).Infof("zero2 [%d,%d)", n, n+delta) + glog.V(4).Infof("zero2 [%d,%d) of file size %d bytes", startOffset, startOffset+int64(delta), c.fileSize) n += delta } From 85001cbec7898b9264b0c3b025ae2aa71d617fd8 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 08:18:54 -0700 Subject: [PATCH 58/81] properly report io.EOF --- weed/filer2/reader_at.go | 2 +- weed/filer2/reader_at_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 2894f4a4b..19821771f 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -114,7 +114,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { n += delta } - if offset+int64(n) >= c.fileSize { + if err == nil && offset+int64(len(p)) > c.fileSize { err = io.EOF } // fmt.Printf("~~~ filled %d, err: %v\n\n", n, err) diff --git a/weed/filer2/reader_at_test.go b/weed/filer2/reader_at_test.go index f93d7ea11..7377c5dbc 100644 --- a/weed/filer2/reader_at_test.go +++ b/weed/filer2/reader_at_test.go @@ -66,9 +66,9 @@ func TestReaderAt(t *testing.T) { chunkCache: &mockChunkCache{}, } - testReadAt(t, readerAt, 0, 10, 10, io.EOF) + testReadAt(t, readerAt, 0, 10, 10, nil) testReadAt(t, readerAt, 0, 12, 10, io.EOF) - testReadAt(t, readerAt, 2, 8, 8, io.EOF) + testReadAt(t, readerAt, 2, 8, 8, nil) testReadAt(t, readerAt, 3, 6, 6, nil) } @@ -116,7 +116,7 @@ func TestReaderAt0(t *testing.T) { chunkCache: &mockChunkCache{}, } - testReadAt(t, readerAt, 0, 10, 10, io.EOF) + testReadAt(t, readerAt, 0, 10, 10, nil) testReadAt(t, readerAt, 3, 16, 7, io.EOF) testReadAt(t, readerAt, 3, 5, 5, nil) @@ -144,7 +144,7 @@ func TestReaderAt1(t *testing.T) { chunkCache: &mockChunkCache{}, } - testReadAt(t, readerAt, 0, 20, 20, io.EOF) + testReadAt(t, readerAt, 0, 20, 20, nil) testReadAt(t, readerAt, 1, 7, 7, nil) testReadAt(t, readerAt, 0, 1, 1, nil) testReadAt(t, readerAt, 18, 4, 2, io.EOF) From 3e5339337a453e21608061befceef53c25859a1f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 08:50:14 -0700 Subject: [PATCH 59/81] minor --- weed/filer2/reader_at.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer2/reader_at.go b/weed/filer2/reader_at.go index 19821771f..0bf528a42 100644 --- a/weed/filer2/reader_at.go +++ b/weed/filer2/reader_at.go @@ -108,7 +108,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) { glog.V(4).Infof("doReadAt [%d,%d), n:%v, err:%v", offset, offset+int64(len(p)), n, err) - if remaining > 0 && c.fileSize > startOffset { + if err == nil && remaining > 0 && c.fileSize > startOffset { delta := int(min(remaining, c.fileSize - startOffset)) glog.V(4).Infof("zero2 [%d,%d) of file size %d bytes", startOffset, startOffset+int64(delta), c.fileSize) n += delta From 1fcd083db37b3a7d53f62a9195e761b7814d41e4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 09:09:29 -0700 Subject: [PATCH 60/81] printout data size --- weed/filesys/filehandle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 358475bd3..efbdc6f34 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -132,7 +132,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f copy(data, req.Data) fh.f.entry.Attributes.FileSize = uint64(max(req.Offset+int64(len(data)), int64(fh.f.entry.Attributes.FileSize))) - glog.V(5).Infof("%v write [%d,%d)", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data))) + glog.V(4).Infof("%v write [%d,%d) %d", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data)), len(req.Data)) chunks, err := fh.dirtyPages.AddPage(req.Offset, data) if err != nil { From 208849702d7e6e86e4538468e5d96e8665a4df0c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 12:52:54 -0700 Subject: [PATCH 61/81] logs --- weed/filesys/filehandle.go | 4 ++-- weed/pb/filer_pb/filer_pb_helper.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index efbdc6f34..1cbe120ac 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -54,7 +54,7 @@ var _ = fs.HandleReleaser(&FileHandle{}) func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error { - glog.V(4).Infof("%s read fh %d: [%d,%d) size %d resp.Data len=%d cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, len(resp.Data), cap(resp.Data)) + glog.V(4).Infof("%s read fh %d: [%d,%d) size %d resp.Data cap=%d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, cap(resp.Data)) buff := resp.Data[:cap(resp.Data)] if req.Size > cap(resp.Data) { @@ -119,7 +119,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err) } - // glog.V(0).Infof("file handle read %s [%d,%d] %d : %v", fh.f.fullpath(), offset, offset+int64(totalRead), totalRead, err) + glog.V(4).Infof("file handle read %s [%d,%d] %d : %v", fh.f.fullpath(), offset, offset+int64(totalRead), totalRead, err) return int64(totalRead), err } diff --git a/weed/pb/filer_pb/filer_pb_helper.go b/weed/pb/filer_pb/filer_pb_helper.go index 2dc1ebaf8..0ca00d981 100644 --- a/weed/pb/filer_pb/filer_pb_helper.go +++ b/weed/pb/filer_pb/filer_pb_helper.go @@ -81,7 +81,7 @@ func CreateEntry(client SeaweedFilerClient, request *CreateEntryRequest) error { return fmt.Errorf("CreateEntry: %v", err) } if resp.Error != "" { - glog.V(1).Infof("create entry %s/%s %v: %v", request.Directory, request.Entry.Name, request.OExcl, err) + glog.V(1).Infof("create entry %s/%s %v: %v", request.Directory, request.Entry.Name, request.OExcl, resp.Error) return fmt.Errorf("CreateEntry : %v", resp.Error) } return nil From 618b2f6829af2bbf8cfed3a543ee13f675bd8efd Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 12:53:08 -0700 Subject: [PATCH 62/81] release resources only when needed to --- weed/filesys/filehandle.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 1cbe120ac..fa31cd81b 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -167,9 +167,9 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err if fh.f.isOpen <= 0 { fh.dirtyPages.releaseResource() fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle)) + fh.f.entryViewCache = nil + fh.f.reader = nil } - fh.f.entryViewCache = nil - fh.f.reader = nil return nil } From 6a92f0bc7a2cbf0828c720422220b600263b5217 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:04:28 -0700 Subject: [PATCH 63/81] refactoring to typed Size Go is amazing with refactoring! --- .../diff_volume_servers.go | 2 +- unmaintained/see_idx/see_idx.go | 2 +- weed/command/export.go | 4 +-- weed/server/volume_grpc_admin.go | 2 +- weed/server/volume_grpc_batch_delete.go | 2 +- weed/storage/erasure_coding/ec_decoder.go | 4 +-- weed/storage/erasure_coding/ec_encoder.go | 2 +- weed/storage/erasure_coding/ec_locate.go | 10 ++++-- weed/storage/erasure_coding/ec_test.go | 8 ++--- weed/storage/erasure_coding/ec_volume.go | 8 ++--- weed/storage/erasure_coding/ec_volume_test.go | 2 +- weed/storage/idx/walk.go | 9 +++-- weed/storage/needle/needle.go | 2 +- weed/storage/needle/needle_read_write.go | 34 +++++++++---------- weed/storage/needle_map.go | 4 +-- weed/storage/needle_map/compact_map.go | 16 ++++----- .../needle_map/compact_map_perf_test.go | 3 +- weed/storage/needle_map/compact_map_test.go | 10 +++--- weed/storage/needle_map/memdb.go | 9 +++-- weed/storage/needle_map/needle_value.go | 6 ++-- weed/storage/needle_map/needle_value_map.go | 4 +-- weed/storage/needle_map_leveldb.go | 11 +++--- weed/storage/needle_map_memory.go | 4 +-- weed/storage/needle_map_metric.go | 12 +++---- weed/storage/needle_map_metric_test.go | 2 +- weed/storage/needle_map_sorted_file.go | 2 +- weed/storage/store.go | 2 +- weed/storage/types/needle_types.go | 13 ++++++- weed/storage/volume_checking.go | 2 +- weed/storage/volume_read_write.go | 22 ++++++------ weed/storage/volume_vacuum.go | 2 +- weed/storage/volume_vacuum_test.go | 4 +-- weed/topology/store_replicate.go | 3 +- weed/util/chunk_cache/chunk_cache_on_disk.go | 2 +- 34 files changed, 118 insertions(+), 106 deletions(-) diff --git a/unmaintained/diff_volume_servers/diff_volume_servers.go b/unmaintained/diff_volume_servers/diff_volume_servers.go index 0d5bf9ab4..e0f16e2d0 100644 --- a/unmaintained/diff_volume_servers/diff_volume_servers.go +++ b/unmaintained/diff_volume_servers/diff_volume_servers.go @@ -154,7 +154,7 @@ func getVolumeFiles(v uint32, addr string) (map[types.NeedleId]needleState, int6 var maxOffset int64 files := map[types.NeedleId]needleState{} - err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size uint32) error { + err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size Size) error { if offset.IsZero() || size == types.TombstoneFileSize { files[key] = needleState{ state: stateDeleted, diff --git a/unmaintained/see_idx/see_idx.go b/unmaintained/see_idx/see_idx.go index 47cbd291b..31e4bae05 100644 --- a/unmaintained/see_idx/see_idx.go +++ b/unmaintained/see_idx/see_idx.go @@ -36,7 +36,7 @@ func main() { } defer indexFile.Close() - idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size uint32) error { + idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size Size) error { fmt.Printf("key:%v offset:%v size:%v(%v)\n", key, offset, size, util.BytesToHumanReadable(uint64(size))) return nil }) diff --git a/weed/command/export.go b/weed/command/export.go index 411d231cb..0e2e7ccd9 100644 --- a/weed/command/export.go +++ b/weed/command/export.go @@ -72,9 +72,9 @@ var ( func printNeedle(vid needle.VolumeId, n *needle.Needle, version needle.Version, deleted bool) { key := needle.NewFileIdFromNeedle(vid, n).String() - size := n.DataSize + size := int32(n.DataSize) if version == needle.Version1 { - size = n.Size + size = int32(n.Size) } fmt.Printf("%s\t%s\t%d\t%t\t%s\t%s\t%s\t%t\n", key, diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go index eaf5aaf6e..a26b03411 100644 --- a/weed/server/volume_grpc_admin.go +++ b/weed/server/volume_grpc_admin.go @@ -199,7 +199,7 @@ func (vs *VolumeServer) VolumeNeedleStatus(ctx context.Context, req *volume_serv resp.NeedleId = uint64(n.Id) resp.Cookie = uint32(n.Cookie) - resp.Size = n.Size + resp.Size = uint32(n.Size) resp.LastModified = n.LastModified resp.Crc = n.Checksum.Value() if n.HasTtl() { diff --git a/weed/server/volume_grpc_batch_delete.go b/weed/server/volume_grpc_batch_delete.go index 501964191..db6cf160e 100644 --- a/weed/server/volume_grpc_batch_delete.go +++ b/weed/server/volume_grpc_batch_delete.go @@ -79,7 +79,7 @@ func (vs *VolumeServer) BatchDelete(ctx context.Context, req *volume_server_pb.B resp.Results = append(resp.Results, &volume_server_pb.DeleteResult{ FileId: fid, Status: http.StatusAccepted, - Size: size}, + Size: uint32(size)}, ) } } diff --git a/weed/storage/erasure_coding/ec_decoder.go b/weed/storage/erasure_coding/ec_decoder.go index 99bcb6ca5..6793faca5 100644 --- a/weed/storage/erasure_coding/ec_decoder.go +++ b/weed/storage/erasure_coding/ec_decoder.go @@ -52,7 +52,7 @@ func FindDatFileSize(baseFileName string) (datSize int64, err error) { return 0, fmt.Errorf("read ec volume %s version: %v", baseFileName, err) } - err = iterateEcxFile(baseFileName, func(key types.NeedleId, offset types.Offset, size uint32) error { + err = iterateEcxFile(baseFileName, func(key types.NeedleId, offset types.Offset, size types.Size) error { if size == types.TombstoneFileSize { return nil @@ -88,7 +88,7 @@ func readEcVolumeVersion(baseFileName string) (version needle.Version, err error } -func iterateEcxFile(baseFileName string, processNeedleFn func(key types.NeedleId, offset types.Offset, size uint32) error) error { +func iterateEcxFile(baseFileName string, processNeedleFn func(key types.NeedleId, offset types.Offset, size types.Size) error) error { ecxFile, openErr := os.OpenFile(baseFileName+".ecx", os.O_RDONLY, 0644) if openErr != nil { return fmt.Errorf("cannot open ec index %s.ecx: %v", baseFileName, openErr) diff --git a/weed/storage/erasure_coding/ec_encoder.go b/weed/storage/erasure_coding/ec_encoder.go index 5f0f20284..34b639407 100644 --- a/weed/storage/erasure_coding/ec_encoder.go +++ b/weed/storage/erasure_coding/ec_encoder.go @@ -294,7 +294,7 @@ func readNeedleMap(baseFileName string) (*needle_map.MemDb, error) { defer indexFile.Close() cm := needle_map.NewMemDb() - err = idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size uint32) error { + err = idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size types.Size) error { if !offset.IsZero() && size != types.TombstoneFileSize { cm.Set(key, offset, size) } else { diff --git a/weed/storage/erasure_coding/ec_locate.go b/weed/storage/erasure_coding/ec_locate.go index 562966f8f..19eba6235 100644 --- a/weed/storage/erasure_coding/ec_locate.go +++ b/weed/storage/erasure_coding/ec_locate.go @@ -1,14 +1,18 @@ package erasure_coding +import ( + "github.com/chrislusf/seaweedfs/weed/storage/types" +) + type Interval struct { BlockIndex int InnerBlockOffset int64 - Size uint32 + Size types.Size IsLargeBlock bool LargeBlockRowsCount int } -func LocateData(largeBlockLength, smallBlockLength int64, datSize int64, offset int64, size uint32) (intervals []Interval) { +func LocateData(largeBlockLength, smallBlockLength int64, datSize int64, offset int64, size types.Size) (intervals []Interval) { blockIndex, isLargeBlock, innerBlockOffset := locateOffset(largeBlockLength, smallBlockLength, datSize, offset) // adding DataShardsCount*smallBlockLength to ensure we can derive the number of large block size from a shard size @@ -32,7 +36,7 @@ func LocateData(largeBlockLength, smallBlockLength int64, datSize int64, offset intervals = append(intervals, interval) return } - interval.Size = uint32(blockRemaining) + interval.Size = types.Size(blockRemaining) intervals = append(intervals, interval) size -= interval.Size diff --git a/weed/storage/erasure_coding/ec_test.go b/weed/storage/erasure_coding/ec_test.go index 92b83cdc8..63cc2c352 100644 --- a/weed/storage/erasure_coding/ec_test.go +++ b/weed/storage/erasure_coding/ec_test.go @@ -71,7 +71,7 @@ func validateFiles(baseFileName string) error { return nil } -func assertSame(datFile *os.File, datSize int64, ecFiles []*os.File, offset types.Offset, size uint32) error { +func assertSame(datFile *os.File, datSize int64, ecFiles []*os.File, offset types.Offset, size types.Size) error { data, err := readDatFile(datFile, offset, size) if err != nil { @@ -90,7 +90,7 @@ func assertSame(datFile *os.File, datSize int64, ecFiles []*os.File, offset type return nil } -func readDatFile(datFile *os.File, offset types.Offset, size uint32) ([]byte, error) { +func readDatFile(datFile *os.File, offset types.Offset, size types.Size) ([]byte, error) { data := make([]byte, size) n, err := datFile.ReadAt(data, offset.ToAcutalOffset()) @@ -103,7 +103,7 @@ func readDatFile(datFile *os.File, offset types.Offset, size uint32) ([]byte, er return data, nil } -func readEcFile(datSize int64, ecFiles []*os.File, offset types.Offset, size uint32) (data []byte, err error) { +func readEcFile(datSize int64, ecFiles []*os.File, offset types.Offset, size types.Size) (data []byte, err error) { intervals := LocateData(largeBlockSize, smallBlockSize, datSize, offset.ToAcutalOffset(), size) @@ -140,7 +140,7 @@ func readOneInterval(interval Interval, ecFiles []*os.File) (data []byte, err er return } -func readFromOtherEcFiles(ecFiles []*os.File, ecFileIndex int, ecFileOffset int64, size uint32) (data []byte, err error) { +func readFromOtherEcFiles(ecFiles []*os.File, ecFileIndex int, ecFileOffset int64, size types.Size) (data []byte, err error) { enc, err := reedsolomon.New(DataShardsCount, ParityShardsCount) if err != nil { return nil, fmt.Errorf("failed to create encoder: %v", err) diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go index eef53765f..785f33ec4 100644 --- a/weed/storage/erasure_coding/ec_volume.go +++ b/weed/storage/erasure_coding/ec_volume.go @@ -187,7 +187,7 @@ func (ev *EcVolume) ToVolumeEcShardInformationMessage() (messages []*master_pb.V return } -func (ev *EcVolume) LocateEcShardNeedle(needleId types.NeedleId, version needle.Version) (offset types.Offset, size uint32, intervals []Interval, err error) { +func (ev *EcVolume) LocateEcShardNeedle(needleId types.NeedleId, version needle.Version) (offset types.Offset, size types.Size, intervals []Interval, err error) { // find the needle from ecx file offset, size, err = ev.FindNeedleFromEcx(needleId) @@ -198,16 +198,16 @@ func (ev *EcVolume) LocateEcShardNeedle(needleId types.NeedleId, version needle. shard := ev.Shards[0] // calculate the locations in the ec shards - intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, offset.ToAcutalOffset(), uint32(needle.GetActualSize(size, version))) + intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, offset.ToAcutalOffset(), types.Size(needle.GetActualSize(size, version))) return } -func (ev *EcVolume) FindNeedleFromEcx(needleId types.NeedleId) (offset types.Offset, size uint32, err error) { +func (ev *EcVolume) FindNeedleFromEcx(needleId types.NeedleId) (offset types.Offset, size types.Size, err error) { return SearchNeedleFromSortedIndex(ev.ecxFile, ev.ecxFileSize, needleId, nil) } -func SearchNeedleFromSortedIndex(ecxFile *os.File, ecxFileSize int64, needleId types.NeedleId, processNeedleFn func(file *os.File, offset int64) error) (offset types.Offset, size uint32, err error) { +func SearchNeedleFromSortedIndex(ecxFile *os.File, ecxFileSize int64, needleId types.NeedleId, processNeedleFn func(file *os.File, offset int64) error) (offset types.Offset, size types.Size, err error) { var key types.NeedleId buf := make([]byte, types.NeedleMapEntrySize) l, h := int64(0), ecxFileSize/types.NeedleMapEntrySize diff --git a/weed/storage/erasure_coding/ec_volume_test.go b/weed/storage/erasure_coding/ec_volume_test.go index 9a3b1e644..fe45bf722 100644 --- a/weed/storage/erasure_coding/ec_volume_test.go +++ b/weed/storage/erasure_coding/ec_volume_test.go @@ -44,7 +44,7 @@ func TestPositioning(t *testing.T) { fmt.Printf("offset: %d size: %d\n", offset.ToAcutalOffset(), size) var shardEcdFileSize int64 = 1118830592 // 1024*1024*1024*3 - intervals := LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shardEcdFileSize, offset.ToAcutalOffset(), uint32(needle.GetActualSize(size, needle.CurrentVersion))) + intervals := LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shardEcdFileSize, offset.ToAcutalOffset(), types.Size(needle.GetActualSize(size, needle.CurrentVersion))) for _, interval := range intervals { shardId, shardOffset := interval.ToShardIdAndOffset(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize) diff --git a/weed/storage/idx/walk.go b/weed/storage/idx/walk.go index db3b4cd96..5215d3c4f 100644 --- a/weed/storage/idx/walk.go +++ b/weed/storage/idx/walk.go @@ -5,12 +5,11 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/storage/types" - "github.com/chrislusf/seaweedfs/weed/util" ) // walks through the index file, calls fn function with each key, offset, size // stops with the error returned by the fn function -func WalkIndexFile(r io.ReaderAt, fn func(key types.NeedleId, offset types.Offset, size uint32) error) error { +func WalkIndexFile(r io.ReaderAt, fn func(key types.NeedleId, offset types.Offset, size types.Size) error) error { var readerOffset int64 bytes := make([]byte, types.NeedleMapEntrySize*RowsToRead) count, e := r.ReadAt(bytes, readerOffset) @@ -22,7 +21,7 @@ func WalkIndexFile(r io.ReaderAt, fn func(key types.NeedleId, offset types.Offse var ( key types.NeedleId offset types.Offset - size uint32 + size types.Size i int ) @@ -43,10 +42,10 @@ func WalkIndexFile(r io.ReaderAt, fn func(key types.NeedleId, offset types.Offse return e } -func IdxFileEntry(bytes []byte) (key types.NeedleId, offset types.Offset, size uint32) { +func IdxFileEntry(bytes []byte) (key types.NeedleId, offset types.Offset, size types.Size) { key = types.BytesToNeedleId(bytes[:types.NeedleIdSize]) offset = types.BytesToOffset(bytes[types.NeedleIdSize : types.NeedleIdSize+types.OffsetSize]) - size = util.BytesToUint32(bytes[types.NeedleIdSize+types.OffsetSize : types.NeedleIdSize+types.OffsetSize+types.SizeSize]) + size = types.BytesToSize(bytes[types.NeedleIdSize+types.OffsetSize : types.NeedleIdSize+types.OffsetSize+types.SizeSize]) return } diff --git a/weed/storage/needle/needle.go b/weed/storage/needle/needle.go index 7c7aa3feb..0d962886b 100644 --- a/weed/storage/needle/needle.go +++ b/weed/storage/needle/needle.go @@ -24,7 +24,7 @@ const ( type Needle struct { Cookie Cookie `comment:"random number to mitigate brute force lookups"` Id NeedleId `comment:"needle id"` - Size uint32 `comment:"sum of DataSize,Data,NameSize,Name,MimeSize,Mime"` + Size Size `comment:"sum of DataSize,Data,NameSize,Name,MimeSize,Mime"` DataSize uint32 `comment:"Data size"` //version2 Data []byte `comment:"The actual file data"` diff --git a/weed/storage/needle/needle_read_write.go b/weed/storage/needle/needle_read_write.go index 575a72e40..89fc85b0d 100644 --- a/weed/storage/needle/needle_read_write.go +++ b/weed/storage/needle/needle_read_write.go @@ -28,7 +28,7 @@ func (n *Needle) DiskSize(version Version) int64 { return GetActualSize(n.Size, version) } -func (n *Needle) prepareWriteBuffer(version Version) ([]byte, uint32, int64, error) { +func (n *Needle) prepareWriteBuffer(version Version) ([]byte, Size, int64, error) { writeBytes := make([]byte, 0) @@ -37,8 +37,8 @@ func (n *Needle) prepareWriteBuffer(version Version) ([]byte, uint32, int64, err header := make([]byte, NeedleHeaderSize) CookieToBytes(header[0:CookieSize], n.Cookie) NeedleIdToBytes(header[CookieSize:CookieSize+NeedleIdSize], n.Id) - n.Size = uint32(len(n.Data)) - util.Uint32toBytes(header[CookieSize+NeedleIdSize:CookieSize+NeedleIdSize+SizeSize], n.Size) + n.Size = Size(len(n.Data)) + SizeToBytes(header[CookieSize+NeedleIdSize:CookieSize+NeedleIdSize+SizeSize], n.Size) size := n.Size actualSize := NeedleHeaderSize + int64(n.Size) writeBytes = append(writeBytes, header...) @@ -58,12 +58,12 @@ func (n *Needle) prepareWriteBuffer(version Version) ([]byte, uint32, int64, err } n.DataSize, n.MimeSize = uint32(len(n.Data)), uint8(len(n.Mime)) if n.DataSize > 0 { - n.Size = 4 + n.DataSize + 1 + n.Size = 4 + Size(n.DataSize) + 1 if n.HasName() { - n.Size = n.Size + 1 + uint32(n.NameSize) + n.Size = n.Size + 1 + Size(n.NameSize) } if n.HasMime() { - n.Size = n.Size + 1 + uint32(n.MimeSize) + n.Size = n.Size + 1 + Size(n.MimeSize) } if n.HasLastModifiedDate() { n.Size = n.Size + LastModifiedBytesLength @@ -72,12 +72,12 @@ func (n *Needle) prepareWriteBuffer(version Version) ([]byte, uint32, int64, err n.Size = n.Size + TtlBytesLength } if n.HasPairs() { - n.Size += 2 + uint32(n.PairsSize) + n.Size += 2 + Size(n.PairsSize) } } else { n.Size = 0 } - util.Uint32toBytes(header[CookieSize+NeedleIdSize:CookieSize+NeedleIdSize+SizeSize], n.Size) + SizeToBytes(header[CookieSize+NeedleIdSize:CookieSize+NeedleIdSize+SizeSize], n.Size) writeBytes = append(writeBytes, header[0:NeedleHeaderSize]...) if n.DataSize > 0 { util.Uint32toBytes(header[0:4], n.DataSize) @@ -119,13 +119,13 @@ func (n *Needle) prepareWriteBuffer(version Version) ([]byte, uint32, int64, err writeBytes = append(writeBytes, header[0:NeedleChecksumSize+TimestampSize+padding]...) } - return writeBytes, n.DataSize, GetActualSize(n.Size, version), nil + return writeBytes, Size(n.DataSize), GetActualSize(n.Size, version), nil } return writeBytes, 0, 0, fmt.Errorf("Unsupported Version! (%d)", version) } -func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset uint64, size uint32, actualSize int64, err error) { +func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset uint64, size Size, actualSize int64, err error) { if end, _, e := w.GetStat(); e == nil { defer func(w backend.BackendStorageFile, off int64) { @@ -154,7 +154,7 @@ func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset u return offset, size, actualSize, err } -func ReadNeedleBlob(r backend.BackendStorageFile, offset int64, size uint32, version Version) (dataSlice []byte, err error) { +func ReadNeedleBlob(r backend.BackendStorageFile, offset int64, size Size, version Version) (dataSlice []byte, err error) { dataSize := GetActualSize(size, version) dataSlice = make([]byte, int(dataSize)) @@ -165,7 +165,7 @@ func ReadNeedleBlob(r backend.BackendStorageFile, offset int64, size uint32, ver } // ReadBytes hydrates the needle from the bytes buffer, with only n.Id is set. -func (n *Needle) ReadBytes(bytes []byte, offset int64, size uint32, version Version) (err error) { +func (n *Needle) ReadBytes(bytes []byte, offset int64, size Size, version Version) (err error) { n.ParseNeedleHeader(bytes) if n.Size != size { return fmt.Errorf("entry not found: offset %d found id %x size %d, expected size %d", offset, n.Id, n.Size, size) @@ -195,7 +195,7 @@ func (n *Needle) ReadBytes(bytes []byte, offset int64, size uint32, version Vers } // ReadData hydrates the needle from the file, with only n.Id is set. -func (n *Needle) ReadData(r backend.BackendStorageFile, offset int64, size uint32, version Version) (err error) { +func (n *Needle) ReadData(r backend.BackendStorageFile, offset int64, size Size, version Version) (err error) { bytes, err := ReadNeedleBlob(r, offset, size, version) if err != nil { return err @@ -206,7 +206,7 @@ func (n *Needle) ReadData(r backend.BackendStorageFile, offset int64, size uint3 func (n *Needle) ParseNeedleHeader(bytes []byte) { n.Cookie = BytesToCookie(bytes[0:CookieSize]) n.Id = BytesToNeedleId(bytes[CookieSize : CookieSize+NeedleIdSize]) - n.Size = util.BytesToUint32(bytes[CookieSize+NeedleIdSize : NeedleHeaderSize]) + n.Size = BytesToSize(bytes[CookieSize+NeedleIdSize : NeedleHeaderSize]) } func (n *Needle) readNeedleDataVersion2(bytes []byte) (err error) { @@ -288,7 +288,7 @@ func ReadNeedleHeader(r backend.BackendStorageFile, version Version, offset int6 return } -func PaddingLength(needleSize uint32, version Version) uint32 { +func PaddingLength(needleSize Size, version Version) Size { if version == Version3 { // this is same value as version2, but just listed here for clarity return NeedlePaddingSize - ((NeedleHeaderSize + needleSize + NeedleChecksumSize + TimestampSize) % NeedlePaddingSize) @@ -296,7 +296,7 @@ func PaddingLength(needleSize uint32, version Version) uint32 { return NeedlePaddingSize - ((NeedleHeaderSize + needleSize + NeedleChecksumSize) % NeedlePaddingSize) } -func NeedleBodyLength(needleSize uint32, version Version) int64 { +func NeedleBodyLength(needleSize Size, version Version) int64 { if version == Version3 { return int64(needleSize) + NeedleChecksumSize + TimestampSize + int64(PaddingLength(needleSize, version)) } @@ -390,6 +390,6 @@ func (n *Needle) SetHasPairs() { n.Flags = n.Flags | FlagHasPairs } -func GetActualSize(size uint32, version Version) int64 { +func GetActualSize(size Size, version Version) int64 { return NeedleHeaderSize + NeedleBodyLength(size, version) } diff --git a/weed/storage/needle_map.go b/weed/storage/needle_map.go index 8962e78cb..e91856dfe 100644 --- a/weed/storage/needle_map.go +++ b/weed/storage/needle_map.go @@ -19,7 +19,7 @@ const ( ) type NeedleMapper interface { - Put(key NeedleId, offset Offset, size uint32) error + Put(key NeedleId, offset Offset, size Size) error Get(key NeedleId) (element *needle_map.NeedleValue, ok bool) Delete(key NeedleId, offset Offset) error Close() @@ -48,7 +48,7 @@ func (nm *baseNeedleMapper) IndexFileSize() uint64 { return 0 } -func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size uint32) error { +func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size Size) error { bytes := needle_map.ToBytes(key, offset, size) nm.indexFileAccessLock.Lock() diff --git a/weed/storage/needle_map/compact_map.go b/weed/storage/needle_map/compact_map.go index 76783d0b0..b8d242e2d 100644 --- a/weed/storage/needle_map/compact_map.go +++ b/weed/storage/needle_map/compact_map.go @@ -18,7 +18,7 @@ const SectionalNeedleIdLimit = 1<<32 - 1 type SectionalNeedleValue struct { Key SectionalNeedleId OffsetLower OffsetLower `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G - Size uint32 `comment:"Size of the data portion"` + Size Size `comment:"Size of the data portion"` } type SectionalNeedleValueExtra struct { @@ -50,7 +50,7 @@ func NewCompactSection(start NeedleId) *CompactSection { } //return old entry size -func (cs *CompactSection) Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32) { +func (cs *CompactSection) Set(key NeedleId, offset Offset, size Size) (oldOffset Offset, oldSize Size) { cs.Lock() if key > cs.end { cs.end = key @@ -80,7 +80,7 @@ func (cs *CompactSection) Set(key NeedleId, offset Offset, size uint32) (oldOffs return } -func (cs *CompactSection) setOverflowEntry(skey SectionalNeedleId, offset Offset, size uint32) { +func (cs *CompactSection) setOverflowEntry(skey SectionalNeedleId, offset Offset, size Size) { needleValue := SectionalNeedleValue{Key: skey, OffsetLower: offset.OffsetLower, Size: size} needleValueExtra := SectionalNeedleValueExtra{OffsetHigher: offset.OffsetHigher} insertCandidate := sort.Search(len(cs.overflow), func(i int) bool { @@ -125,10 +125,10 @@ func (cs *CompactSection) deleteOverflowEntry(key SectionalNeedleId) { } //return old entry size -func (cs *CompactSection) Delete(key NeedleId) uint32 { +func (cs *CompactSection) Delete(key NeedleId) Size { skey := SectionalNeedleId(key - cs.start) cs.Lock() - ret := uint32(0) + ret := Size(0) if i := cs.binarySearchValues(skey); i >= 0 { if cs.values[i].Size > 0 && cs.values[i].Size != TombstoneFileSize { ret = cs.values[i].Size @@ -181,7 +181,7 @@ func NewCompactMap() *CompactMap { return &CompactMap{} } -func (cm *CompactMap) Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32) { +func (cm *CompactMap) Set(key NeedleId, offset Offset, size Size) (oldOffset Offset, oldSize Size) { x := cm.binarySearchCompactSection(key) if x < 0 || (key-cm.list[x].start) > SectionalNeedleIdLimit { // println(x, "adding to existing", len(cm.list), "sections, starting", key) @@ -204,10 +204,10 @@ func (cm *CompactMap) Set(key NeedleId, offset Offset, size uint32) (oldOffset O // println(key, "set to section[", x, "].start", cm.list[x].start) return cm.list[x].Set(key, offset, size) } -func (cm *CompactMap) Delete(key NeedleId) uint32 { +func (cm *CompactMap) Delete(key NeedleId) Size { x := cm.binarySearchCompactSection(key) if x < 0 { - return uint32(0) + return Size(0) } return cm.list[x].Delete(key) } diff --git a/weed/storage/needle_map/compact_map_perf_test.go b/weed/storage/needle_map/compact_map_perf_test.go index cce1f9490..081fb34e9 100644 --- a/weed/storage/needle_map/compact_map_perf_test.go +++ b/weed/storage/needle_map/compact_map_perf_test.go @@ -9,7 +9,6 @@ import ( "time" . "github.com/chrislusf/seaweedfs/weed/storage/types" - "github.com/chrislusf/seaweedfs/weed/util" ) /* @@ -60,7 +59,7 @@ func loadNewNeedleMap(file *os.File) (*CompactMap, uint64) { rowCount++ key := BytesToNeedleId(bytes[i : i+NeedleIdSize]) offset := BytesToOffset(bytes[i+NeedleIdSize : i+NeedleIdSize+OffsetSize]) - size := util.BytesToUint32(bytes[i+NeedleIdSize+OffsetSize : i+NeedleIdSize+OffsetSize+SizeSize]) + size := BytesToSize(bytes[i+NeedleIdSize+OffsetSize : i+NeedleIdSize+OffsetSize+SizeSize]) if !offset.IsZero() { m.Set(NeedleId(key), offset, size) diff --git a/weed/storage/needle_map/compact_map_test.go b/weed/storage/needle_map/compact_map_test.go index 7eea3969a..33ed4f1ce 100644 --- a/weed/storage/needle_map/compact_map_test.go +++ b/weed/storage/needle_map/compact_map_test.go @@ -49,7 +49,7 @@ func TestIssue52(t *testing.T) { func TestCompactMap(t *testing.T) { m := NewCompactMap() for i := uint32(0); i < 100*batch; i += 2 { - m.Set(NeedleId(i), ToOffset(int64(i)), i) + m.Set(NeedleId(i), ToOffset(int64(i)), Size(i)) } for i := uint32(0); i < 100*batch; i += 37 { @@ -57,7 +57,7 @@ func TestCompactMap(t *testing.T) { } for i := uint32(0); i < 10*batch; i += 3 { - m.Set(NeedleId(i), ToOffset(int64(i+11)), i+5) + m.Set(NeedleId(i), ToOffset(int64(i+11)), Size(i+5)) } // for i := uint32(0); i < 100; i++ { @@ -72,7 +72,7 @@ func TestCompactMap(t *testing.T) { if !ok { t.Fatal("key", i, "missing!") } - if v.Size != i+5 { + if v.Size != Size(i+5) { t.Fatal("key", i, "size", v.Size) } } else if i%37 == 0 { @@ -80,7 +80,7 @@ func TestCompactMap(t *testing.T) { t.Fatal("key", i, "should have been deleted needle value", v) } } else if i%2 == 0 { - if v.Size != i { + if v.Size != Size(i) { t.Fatal("key", i, "size", v.Size) } } @@ -96,7 +96,7 @@ func TestCompactMap(t *testing.T) { if v == nil { t.Fatal("key", i, "missing") } - if v.Size != i { + if v.Size != Size(i) { t.Fatal("key", i, "size", v.Size) } } diff --git a/weed/storage/needle_map/memdb.go b/weed/storage/needle_map/memdb.go index a52d52a10..a80a7870c 100644 --- a/weed/storage/needle_map/memdb.go +++ b/weed/storage/needle_map/memdb.go @@ -11,7 +11,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/storage/idx" . "github.com/chrislusf/seaweedfs/weed/storage/types" - "github.com/chrislusf/seaweedfs/weed/util" ) //This map uses in memory level db @@ -32,7 +31,7 @@ func NewMemDb() *MemDb { return t } -func (cm *MemDb) Set(key NeedleId, offset Offset, size uint32) error { +func (cm *MemDb) Set(key NeedleId, offset Offset, size Size) error { bytes := ToBytes(key, offset, size) @@ -56,7 +55,7 @@ func (cm *MemDb) Get(key NeedleId) (*NeedleValue, bool) { return nil, false } offset := BytesToOffset(data[0:OffsetSize]) - size := util.BytesToUint32(data[OffsetSize : OffsetSize+SizeSize]) + size := BytesToSize(data[OffsetSize : OffsetSize+SizeSize]) return &NeedleValue{Key: key, Offset: offset, Size: size}, true } @@ -67,7 +66,7 @@ func (cm *MemDb) AscendingVisit(visit func(NeedleValue) error) (ret error) { key := BytesToNeedleId(iter.Key()) data := iter.Value() offset := BytesToOffset(data[0:OffsetSize]) - size := util.BytesToUint32(data[OffsetSize : OffsetSize+SizeSize]) + size := BytesToSize(data[OffsetSize : OffsetSize+SizeSize]) needle := NeedleValue{Key: key, Offset: offset, Size: size} ret = visit(needle) @@ -105,7 +104,7 @@ func (cm *MemDb) LoadFromIdx(idxName string) (ret error) { } defer idxFile.Close() - return idx.WalkIndexFile(idxFile, func(key NeedleId, offset Offset, size uint32) error { + return idx.WalkIndexFile(idxFile, func(key NeedleId, offset Offset, size Size) error { if offset.IsZero() || size == TombstoneFileSize { return cm.Delete(key) } diff --git a/weed/storage/needle_map/needle_value.go b/weed/storage/needle_map/needle_value.go index ef540b55e..f4687cb79 100644 --- a/weed/storage/needle_map/needle_value.go +++ b/weed/storage/needle_map/needle_value.go @@ -9,7 +9,7 @@ import ( type NeedleValue struct { Key NeedleId Offset Offset `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G - Size uint32 `comment:"Size of the data portion"` + Size Size `comment:"Size of the data portion"` } func (this NeedleValue) Less(than btree.Item) bool { @@ -21,10 +21,10 @@ func (nv NeedleValue) ToBytes() []byte { return ToBytes(nv.Key, nv.Offset, nv.Size) } -func ToBytes(key NeedleId, offset Offset, size uint32) []byte { +func ToBytes(key NeedleId, offset Offset, size Size) []byte { bytes := make([]byte, NeedleIdSize+OffsetSize+SizeSize) NeedleIdToBytes(bytes[0:NeedleIdSize], key) OffsetToBytes(bytes[NeedleIdSize:NeedleIdSize+OffsetSize], offset) - util.Uint32toBytes(bytes[NeedleIdSize+OffsetSize:NeedleIdSize+OffsetSize+SizeSize], size) + util.Uint32toBytes(bytes[NeedleIdSize+OffsetSize:NeedleIdSize+OffsetSize+SizeSize], uint32(size)) return bytes } diff --git a/weed/storage/needle_map/needle_value_map.go b/weed/storage/needle_map/needle_value_map.go index 0a5a00ef7..a30cb96c4 100644 --- a/weed/storage/needle_map/needle_value_map.go +++ b/weed/storage/needle_map/needle_value_map.go @@ -5,8 +5,8 @@ import ( ) type NeedleValueMap interface { - Set(key NeedleId, offset Offset, size uint32) (oldOffset Offset, oldSize uint32) - Delete(key NeedleId) uint32 + Set(key NeedleId, offset Offset, size Size) (oldOffset Offset, oldSize Size) + Delete(key NeedleId) Size Get(key NeedleId) (*NeedleValue, bool) AscendingVisit(visit func(NeedleValue) error) error } diff --git a/weed/storage/needle_map_leveldb.go b/weed/storage/needle_map_leveldb.go index 83589c231..b4b04c07f 100644 --- a/weed/storage/needle_map_leveldb.go +++ b/weed/storage/needle_map_leveldb.go @@ -15,7 +15,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/storage/needle_map" . "github.com/chrislusf/seaweedfs/weed/storage/types" - "github.com/chrislusf/seaweedfs/weed/util" ) type LevelDbNeedleMap struct { @@ -74,7 +73,7 @@ func generateLevelDbFile(dbFileName string, indexFile *os.File) error { return err } defer db.Close() - return idx.WalkIndexFile(indexFile, func(key NeedleId, offset Offset, size uint32) error { + return idx.WalkIndexFile(indexFile, func(key NeedleId, offset Offset, size Size) error { if !offset.IsZero() && size != TombstoneFileSize { levelDbWrite(db, key, offset, size) } else { @@ -92,12 +91,12 @@ func (m *LevelDbNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue, o return nil, false } offset := BytesToOffset(data[0:OffsetSize]) - size := util.BytesToUint32(data[OffsetSize : OffsetSize+SizeSize]) + size := BytesToSize(data[OffsetSize : OffsetSize+SizeSize]) return &needle_map.NeedleValue{Key: key, Offset: offset, Size: size}, true } -func (m *LevelDbNeedleMap) Put(key NeedleId, offset Offset, size uint32) error { - var oldSize uint32 +func (m *LevelDbNeedleMap) Put(key NeedleId, offset Offset, size Size) error { + var oldSize Size if oldNeedle, ok := m.Get(key); ok { oldSize = oldNeedle.Size } @@ -109,7 +108,7 @@ func (m *LevelDbNeedleMap) Put(key NeedleId, offset Offset, size uint32) error { return levelDbWrite(m.db, key, offset, size) } -func levelDbWrite(db *leveldb.DB, key NeedleId, offset Offset, size uint32) error { +func levelDbWrite(db *leveldb.DB, key NeedleId, offset Offset, size Size) error { bytes := needle_map.ToBytes(key, offset, size) diff --git a/weed/storage/needle_map_memory.go b/weed/storage/needle_map_memory.go index 84197912f..8e7e51973 100644 --- a/weed/storage/needle_map_memory.go +++ b/weed/storage/needle_map_memory.go @@ -28,7 +28,7 @@ func LoadCompactNeedleMap(file *os.File) (*NeedleMap, error) { } func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { - e := idx.WalkIndexFile(file, func(key NeedleId, offset Offset, size uint32) error { + e := idx.WalkIndexFile(file, func(key NeedleId, offset Offset, size Size) error { nm.MaybeSetMaxFileKey(key) if !offset.IsZero() && size != TombstoneFileSize { nm.FileCounter++ @@ -49,7 +49,7 @@ func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { return nm, e } -func (nm *NeedleMap) Put(key NeedleId, offset Offset, size uint32) error { +func (nm *NeedleMap) Put(key NeedleId, offset Offset, size Size) error { _, oldSize := nm.m.Set(NeedleId(key), offset, size) nm.logPut(key, oldSize, size) return nm.appendToIndexFile(key, offset, size) diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go index 823a04108..85addc27d 100644 --- a/weed/storage/needle_map_metric.go +++ b/weed/storage/needle_map_metric.go @@ -18,14 +18,14 @@ type mapMetric struct { MaximumFileKey uint64 `json:"MaxFileKey"` } -func (mm *mapMetric) logDelete(deletedByteCount uint32) { +func (mm *mapMetric) logDelete(deletedByteCount Size) { if mm == nil { return } mm.LogDeletionCounter(deletedByteCount) } -func (mm *mapMetric) logPut(key NeedleId, oldSize uint32, newSize uint32) { +func (mm *mapMetric) logPut(key NeedleId, oldSize Size, newSize Size) { if mm == nil { return } @@ -35,14 +35,14 @@ func (mm *mapMetric) logPut(key NeedleId, oldSize uint32, newSize uint32) { mm.LogDeletionCounter(oldSize) } } -func (mm *mapMetric) LogFileCounter(newSize uint32) { +func (mm *mapMetric) LogFileCounter(newSize Size) { if mm == nil { return } atomic.AddUint32(&mm.FileCounter, 1) atomic.AddUint64(&mm.FileByteCounter, uint64(newSize)) } -func (mm *mapMetric) LogDeletionCounter(oldSize uint32) { +func (mm *mapMetric) LogDeletionCounter(oldSize Size) { if mm == nil { return } @@ -97,7 +97,7 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { buf := make([]byte, NeedleIdSize) err = reverseWalkIndexFile(r, func(entryCount int64) { bf = bloom.NewWithEstimates(uint(entryCount), 0.001) - }, func(key NeedleId, offset Offset, size uint32) error { + }, func(key NeedleId, offset Offset, size Size) error { mm.MaybeSetMaxFileKey(key) NeedleIdToBytes(buf, key) @@ -121,7 +121,7 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { return } -func reverseWalkIndexFile(r *os.File, initFn func(entryCount int64), fn func(key NeedleId, offset Offset, size uint32) error) error { +func reverseWalkIndexFile(r *os.File, initFn func(entryCount int64), fn func(key NeedleId, offset Offset, size Size) error) error { fi, err := r.Stat() if err != nil { return fmt.Errorf("file %s stat error: %v", r.Name(), err) diff --git a/weed/storage/needle_map_metric_test.go b/weed/storage/needle_map_metric_test.go index ae2177a30..362659a11 100644 --- a/weed/storage/needle_map_metric_test.go +++ b/weed/storage/needle_map_metric_test.go @@ -15,7 +15,7 @@ func TestFastLoadingNeedleMapMetrics(t *testing.T) { nm := NewCompactNeedleMap(idxFile) for i := 0; i < 10000; i++ { - nm.Put(Uint64ToNeedleId(uint64(i+1)), Uint32ToOffset(uint32(0)), uint32(1)) + nm.Put(Uint64ToNeedleId(uint64(i+1)), Uint32ToOffset(uint32(0)), Size(1)) if rand.Float32() < 0.2 { nm.Delete(Uint64ToNeedleId(uint64(rand.Int63n(int64(i))+1)), Uint32ToOffset(uint32(0))) } diff --git a/weed/storage/needle_map_sorted_file.go b/weed/storage/needle_map_sorted_file.go index e6f9258f3..c89916f67 100644 --- a/weed/storage/needle_map_sorted_file.go +++ b/weed/storage/needle_map_sorted_file.go @@ -65,7 +65,7 @@ func (m *SortedFileNeedleMap) Get(key NeedleId) (element *needle_map.NeedleValue } -func (m *SortedFileNeedleMap) Put(key NeedleId, offset Offset, size uint32) error { +func (m *SortedFileNeedleMap) Put(key NeedleId, offset Offset, size Size) error { return os.ErrInvalid } diff --git a/weed/storage/store.go b/weed/storage/store.go index 02372da97..21f2acf5d 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -273,7 +273,7 @@ func (s *Store) WriteVolumeNeedle(i needle.VolumeId, n *needle.Needle, fsync boo return } -func (s *Store) DeleteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (uint32, error) { +func (s *Store) DeleteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (Size, error) { if v := s.findVolume(i); v != nil { if v.noWriteOrDelete { return 0, fmt.Errorf("volume %d is read only", i) diff --git a/weed/storage/types/needle_types.go b/weed/storage/types/needle_types.go index 2ebb392db..c8234aa49 100644 --- a/weed/storage/types/needle_types.go +++ b/weed/storage/types/needle_types.go @@ -2,9 +2,10 @@ package types import ( "fmt" - "github.com/chrislusf/seaweedfs/weed/util" "math" "strconv" + + "github.com/chrislusf/seaweedfs/weed/util" ) type Offset struct { @@ -12,6 +13,8 @@ type Offset struct { OffsetLower } +type Size uint32 + type OffsetLower struct { b3 byte b2 byte @@ -49,3 +52,11 @@ func ParseCookie(cookieString string) (Cookie, error) { } return Cookie(cookie), nil } + +func BytesToSize(bytes []byte) Size { + return Size(util.BytesToUint32(bytes)) +} + +func SizeToBytes(bytes []byte, size Size) { + util.Uint32toBytes(bytes, uint32(size)) +} diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go index c33f0049a..36c6628aa 100644 --- a/weed/storage/volume_checking.go +++ b/weed/storage/volume_checking.go @@ -55,7 +55,7 @@ func readIndexEntryAtOffset(indexFile *os.File, offset int64) (bytes []byte, err return } -func verifyNeedleIntegrity(datFile backend.BackendStorageFile, v needle.Version, offset int64, key NeedleId, size uint32) (lastAppendAtNs uint64, err error) { +func verifyNeedleIntegrity(datFile backend.BackendStorageFile, v needle.Version, offset int64, key NeedleId, size Size) (lastAppendAtNs uint64, err error) { n := new(needle.Needle) if err = n.ReadData(datFile, offset, size, v); err != nil { return n.AppendAtNs, fmt.Errorf("read data [%d,%d) : %v", offset, offset+int64(size), err) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index edb5f48d8..fa1a80cbd 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -68,9 +68,9 @@ func (v *Volume) asyncRequestAppend(request *needle.AsyncRequest) { v.asyncRequestsChan <- request } -func (v *Volume) syncWrite(n *needle.Needle) (offset uint64, size uint32, isUnchanged bool, err error) { +func (v *Volume) syncWrite(n *needle.Needle) (offset uint64, size Size, isUnchanged bool, err error) { // glog.V(4).Infof("writing needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) - actualSize := needle.GetActualSize(uint32(len(n.Data)), v.Version()) + actualSize := needle.GetActualSize(Size(len(n.Data)), v.Version()) v.dataFileAccessLock.Lock() defer v.dataFileAccessLock.Unlock() @@ -80,7 +80,7 @@ func (v *Volume) syncWrite(n *needle.Needle) (offset uint64, size uint32, isUnch return } if v.isFileUnchanged(n) { - size = n.DataSize + size = Size(n.DataSize) isUnchanged = true return } @@ -120,7 +120,7 @@ func (v *Volume) syncWrite(n *needle.Needle) (offset uint64, size uint32, isUnch return } -func (v *Volume) writeNeedle2(n *needle.Needle, fsync bool) (offset uint64, size uint32, isUnchanged bool, err error) { +func (v *Volume) writeNeedle2(n *needle.Needle, fsync bool) (offset uint64, size Size, isUnchanged bool, err error) { // glog.V(4).Infof("writing needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) if n.Ttl == needle.EMPTY_TTL && v.Ttl != needle.EMPTY_TTL { n.SetHasTtl() @@ -132,7 +132,7 @@ func (v *Volume) writeNeedle2(n *needle.Needle, fsync bool) (offset uint64, size } else { asyncRequest := needle.NewAsyncRequest(n, true) // using len(n.Data) here instead of n.Size before n.Size is populated in n.Append() - asyncRequest.ActualSize = needle.GetActualSize(uint32(len(n.Data)), v.Version()) + asyncRequest.ActualSize = needle.GetActualSize(Size(len(n.Data)), v.Version()) v.asyncRequestAppend(asyncRequest) offset, _, isUnchanged, err = asyncRequest.WaitComplete() @@ -141,10 +141,10 @@ func (v *Volume) writeNeedle2(n *needle.Needle, fsync bool) (offset uint64, size } } -func (v *Volume) doWriteRequest(n *needle.Needle) (offset uint64, size uint32, isUnchanged bool, err error) { +func (v *Volume) doWriteRequest(n *needle.Needle) (offset uint64, size Size, isUnchanged bool, err error) { // glog.V(4).Infof("writing needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) if v.isFileUnchanged(n) { - size = n.DataSize + size = Size(n.DataSize) isUnchanged = true return } @@ -183,7 +183,7 @@ func (v *Volume) doWriteRequest(n *needle.Needle) (offset uint64, size uint32, i return } -func (v *Volume) syncDelete(n *needle.Needle) (uint32, error) { +func (v *Volume) syncDelete(n *needle.Needle) (Size, error) { glog.V(4).Infof("delete needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) actualSize := needle.GetActualSize(0, v.Version()) v.dataFileAccessLock.Lock() @@ -213,7 +213,7 @@ func (v *Volume) syncDelete(n *needle.Needle) (uint32, error) { return 0, nil } -func (v *Volume) deleteNeedle2(n *needle.Needle) (uint32, error) { +func (v *Volume) deleteNeedle2(n *needle.Needle) (Size, error) { // todo: delete info is always appended no fsync, it may need fsync in future fsync := false @@ -226,11 +226,11 @@ func (v *Volume) deleteNeedle2(n *needle.Needle) (uint32, error) { v.asyncRequestAppend(asyncRequest) _, size, _, err := asyncRequest.WaitComplete() - return uint32(size), err + return Size(size), err } } -func (v *Volume) doDeleteRequest(n *needle.Needle) (uint32, error) { +func (v *Volume) doDeleteRequest(n *needle.Needle) (Size, error) { glog.V(4).Infof("delete needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) nv, ok := v.nm.Get(n.Id) //fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index ed8172909..505af50bb 100644 --- a/weed/storage/volume_vacuum.go +++ b/weed/storage/volume_vacuum.go @@ -207,7 +207,7 @@ func (v *Volume) makeupDiff(newDatFileName, newIdxFileName, oldDatFileName, oldI type keyField struct { offset Offset - size uint32 + size Size } incrementedHasUpdatedIndexEntry := make(map[NeedleId]keyField) diff --git a/weed/storage/volume_vacuum_test.go b/weed/storage/volume_vacuum_test.go index 1b5161e63..23b43fa40 100644 --- a/weed/storage/volume_vacuum_test.go +++ b/weed/storage/volume_vacuum_test.go @@ -117,7 +117,7 @@ func TestCompaction(t *testing.T) { if err != nil { t.Fatalf("read file %d: %v", i, err) } - if infos[i-1].size != uint32(size) { + if infos[i-1].size != types.Size(size) { t.Fatalf("read file %d size mismatch expected %d found %d", i, infos[i-1].size, size) } if infos[i-1].crc != n.Checksum { @@ -151,7 +151,7 @@ func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) { } type needleInfo struct { - size uint32 + size types.Size crc needle.CRC } diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go index 481e72fe0..faa16e2f6 100644 --- a/weed/topology/store_replicate.go +++ b/weed/topology/store_replicate.go @@ -14,6 +14,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage/needle" + "github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/util" ) @@ -92,7 +93,7 @@ func ReplicatedWrite(masterNode string, s *storage.Store, volumeId needle.Volume func ReplicatedDelete(masterNode string, store *storage.Store, volumeId needle.VolumeId, n *needle.Needle, - r *http.Request) (size uint32, err error) { + r *http.Request) (size types.Size, err error) { //check JWT jwt := security.GetJwt(r) diff --git a/weed/util/chunk_cache/chunk_cache_on_disk.go b/weed/util/chunk_cache/chunk_cache_on_disk.go index d74f87b0c..4009d2309 100644 --- a/weed/util/chunk_cache/chunk_cache_on_disk.go +++ b/weed/util/chunk_cache/chunk_cache_on_disk.go @@ -137,7 +137,7 @@ func (v *ChunkCacheVolume) WriteNeedle(key types.NeedleId, data []byte) error { v.fileSize += int64(types.NeedlePaddingSize - extraSize) } - if err := v.nm.Put(key, types.ToOffset(offset), uint32(len(data))); err != nil { + if err := v.nm.Put(key, types.ToOffset(offset), types.Size(len(data))); err != nil { return err } From 332caf0cd7881ef4881099fee09ac9c8a63d8f0b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:23:01 -0700 Subject: [PATCH 64/81] maintain the unmaintained --- .../diff_volume_servers.go | 6 +- unmaintained/fix_dat/fix_dat.go | 4 +- unmaintained/see_dat/see_dat_gzip.go | 83 ------------------- unmaintained/see_idx/see_idx.go | 2 +- 4 files changed, 6 insertions(+), 89 deletions(-) delete mode 100644 unmaintained/see_dat/see_dat_gzip.go diff --git a/unmaintained/diff_volume_servers/diff_volume_servers.go b/unmaintained/diff_volume_servers/diff_volume_servers.go index e0f16e2d0..339d9c335 100644 --- a/unmaintained/diff_volume_servers/diff_volume_servers.go +++ b/unmaintained/diff_volume_servers/diff_volume_servers.go @@ -118,7 +118,7 @@ const ( type needleState struct { state uint8 - size uint32 + size types.Size } func getVolumeFiles(v uint32, addr string) (map[types.NeedleId]needleState, int64, error) { @@ -154,8 +154,8 @@ func getVolumeFiles(v uint32, addr string) (map[types.NeedleId]needleState, int6 var maxOffset int64 files := map[types.NeedleId]needleState{} - err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size Size) error { - if offset.IsZero() || size == types.TombstoneFileSize { + err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size types.Size) error { + if offset.IsZero() || size < 0 || size == types.TombstoneFileSize { files[key] = needleState{ state: stateDeleted, size: size, diff --git a/unmaintained/fix_dat/fix_dat.go b/unmaintained/fix_dat/fix_dat.go index d6110d870..70bce3bf9 100644 --- a/unmaintained/fix_dat/fix_dat.go +++ b/unmaintained/fix_dat/fix_dat.go @@ -98,7 +98,7 @@ func iterateEntries(datBackend backend.BackendStorageFile, idxFile *os.File, vis // parse index file entry key := util.BytesToUint64(bytes[0:8]) offsetFromIndex := util.BytesToUint32(bytes[8:12]) - sizeFromIndex := util.BytesToUint32(bytes[12:16]) + sizeFromIndex := types.BytesToSize(bytes[12:16]) count, _ = idxFile.ReadAt(bytes, readerOffset) readerOffset += int64(count) @@ -123,7 +123,7 @@ func iterateEntries(datBackend backend.BackendStorageFile, idxFile *os.File, vis } }() - if n.Size <= n.DataSize { + if n.Size <= types.Size(n.DataSize) { continue } visitNeedle(n, offset) diff --git a/unmaintained/see_dat/see_dat_gzip.go b/unmaintained/see_dat/see_dat_gzip.go deleted file mode 100644 index cec073e3f..000000000 --- a/unmaintained/see_dat/see_dat_gzip.go +++ /dev/null @@ -1,83 +0,0 @@ -package main - -import ( - "bytes" - "compress/gzip" - "crypto/md5" - "flag" - "io" - "io/ioutil" - "net/http" - "time" - "github.com/chrislusf/seaweedfs/weed/glog" - "github.com/chrislusf/seaweedfs/weed/storage" - "github.com/chrislusf/seaweedfs/weed/storage/needle" - "github.com/chrislusf/seaweedfs/weed/storage/super_block" - "github.com/chrislusf/seaweedfs/weed/util" -) - -type VolumeFileScanner4SeeDat struct { - version needle.Version -} - -func (scanner *VolumeFileScanner4SeeDat) VisitSuperBlock(superBlock super_block.SuperBlock) error { - scanner.version = superBlock.Version - return nil -} - -func (scanner *VolumeFileScanner4SeeDat) ReadNeedleBody() bool { - return true -} - -var ( - files = int64(0) - filebytes = int64(0) - diffbytes = int64(0) -) - -func Compresssion(data []byte) float64 { - if len(data) <= 128 { - return 100.0 - } - compressed, _ := util.GzipData(data[0:128]) - return float64(len(compressed)*10) / 1280.0 -} - -func (scanner *VolumeFileScanner4SeeDat) VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error { - t := time.Unix(int64(n.AppendAtNs)/int64(time.Second), int64(n.AppendAtNs)%int64(time.Second)) - glog.V(0).Info("----------------------------------------------------------------------------------") - glog.V(0).Infof("%d,%s%x offset %d size %d(%s) cookie %x appendedAt %v hasmime[%t] mime[%s] (len: %d)", - *volumeId, n.Id, n.Cookie, offset, n.Size, util.BytesToHumanReadable(uint64(n.Size)), n.Cookie, t, n.HasMime(), string(n.Mime), len(n.Mime)) - r, err := gzip.NewReader(bytes.NewReader(n.Data)) - if err == nil { - buf := bytes.Buffer{} - h := md5.New() - c, _ := io.Copy(&buf, r) - d := buf.Bytes() - io.Copy(h, bytes.NewReader(d)) - diff := (int64(n.DataSize) - int64(c)) - diffbytes += diff - glog.V(0).Infof("was gzip! stored_size: %d orig_size: %d diff: %d(%d) mime:%s compression-of-128: %.2f md5: %x", n.DataSize, c, diff, diffbytes, http.DetectContentType(d), Compresssion(d), h.Sum(nil)) - } else { - glog.V(0).Infof("no gzip!") - } - return nil -} - -var ( - _ = ioutil.ReadAll - volumePath = flag.String("dir", "/tmp", "data directory to store files") - volumeCollection = flag.String("collection", "", "the volume collection name") - volumeId = flag.Int("volumeId", -1, "a volume id. The volume should already exist in the dir. The volume index file should not exist.") -) - -func main() { - flag.Parse() - vid := needle.VolumeId(*volumeId) - glog.V(0).Info("Starting") - scanner := &VolumeFileScanner4SeeDat{} - err := storage.ScanVolumeFile(*volumePath, *volumeCollection, vid, storage.NeedleMapInMemory, scanner) - if err != nil { - glog.Fatalf("Reading Volume File [ERROR] %s\n", err) - } -} diff --git a/unmaintained/see_idx/see_idx.go b/unmaintained/see_idx/see_idx.go index 31e4bae05..22c659351 100644 --- a/unmaintained/see_idx/see_idx.go +++ b/unmaintained/see_idx/see_idx.go @@ -36,7 +36,7 @@ func main() { } defer indexFile.Close() - idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size Size) error { + idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size types.Size) error { fmt.Printf("key:%v offset:%v size:%v(%v)\n", key, offset, size, util.BytesToHumanReadable(uint64(size))) return nil }) From ee11d98650510d4eb2060d80f0564805bf8f56fa Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:35:19 -0700 Subject: [PATCH 65/81] refactoring --- weed/storage/needle_map/memdb.go | 4 ++-- weed/storage/needle_map_sorted_file.go | 2 +- weed/storage/types/needle_types.go | 4 ++++ weed/storage/volume_checking.go | 2 +- weed/storage/volume_read_write.go | 2 +- weed/storage/volume_vacuum.go | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/weed/storage/needle_map/memdb.go b/weed/storage/needle_map/memdb.go index a80a7870c..b25b5e89a 100644 --- a/weed/storage/needle_map/memdb.go +++ b/weed/storage/needle_map/memdb.go @@ -88,7 +88,7 @@ func (cm *MemDb) SaveToIdx(idxName string) (ret error) { defer idxFile.Close() return cm.AscendingVisit(func(value NeedleValue) error { - if value.Offset.IsZero() || value.Size == TombstoneFileSize { + if value.Offset.IsZero() || value.Size.IsDeleted() { return nil } _, err := idxFile.Write(value.ToBytes()) @@ -105,7 +105,7 @@ func (cm *MemDb) LoadFromIdx(idxName string) (ret error) { defer idxFile.Close() return idx.WalkIndexFile(idxFile, func(key NeedleId, offset Offset, size Size) error { - if offset.IsZero() || size == TombstoneFileSize { + if offset.IsZero() || size.IsDeleted() { return cm.Delete(key) } return cm.Set(key, offset, size) diff --git a/weed/storage/needle_map_sorted_file.go b/weed/storage/needle_map_sorted_file.go index c89916f67..1ca113ca9 100644 --- a/weed/storage/needle_map_sorted_file.go +++ b/weed/storage/needle_map_sorted_file.go @@ -80,7 +80,7 @@ func (m *SortedFileNeedleMap) Delete(key NeedleId, offset Offset) error { return err } - if size == TombstoneFileSize { + if size.IsDeleted() { return nil } diff --git a/weed/storage/types/needle_types.go b/weed/storage/types/needle_types.go index c8234aa49..138643f7f 100644 --- a/weed/storage/types/needle_types.go +++ b/weed/storage/types/needle_types.go @@ -15,6 +15,10 @@ type Offset struct { type Size uint32 +func (s Size) IsDeleted() bool { + return s == TombstoneFileSize +} + type OffsetLower struct { b3 byte b2 byte diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go index 36c6628aa..7a5a423b4 100644 --- a/weed/storage/volume_checking.go +++ b/weed/storage/volume_checking.go @@ -27,7 +27,7 @@ func CheckVolumeDataIntegrity(v *Volume, indexFile *os.File) (lastAppendAtNs uin if offset.IsZero() { return 0, nil } - if size == TombstoneFileSize { + if size.IsDeleted() { size = 0 } if lastAppendAtNs, e = verifyNeedleIntegrity(v.DataBackend, v.Version(), offset.ToAcutalOffset(), key, size); e != nil { diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index fa1a80cbd..d7b477a2d 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -260,7 +260,7 @@ func (v *Volume) readNeedle(n *needle.Needle) (int, error) { if !ok || nv.Offset.IsZero() { return -1, ErrorNotFound } - if nv.Size == TombstoneFileSize { + if nv.Size.IsDeleted() { return -1, errors.New("already deleted") } if nv.Size == 0 { diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index 505af50bb..9d366a27d 100644 --- a/weed/storage/volume_vacuum.go +++ b/weed/storage/volume_vacuum.go @@ -413,7 +413,7 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str offset, size := value.Offset, value.Size - if offset.IsZero() || size == TombstoneFileSize { + if offset.IsZero() || size.IsDeleted() { return nil } From 51ecb49db3c9a19625b0719449126c46abd95152 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:35:39 -0700 Subject: [PATCH 66/81] for debugging --- weed/Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 weed/Makefile diff --git a/weed/Makefile b/weed/Makefile new file mode 100644 index 000000000..896067df0 --- /dev/null +++ b/weed/Makefile @@ -0,0 +1,15 @@ +BINARY = weed + +SOURCE_DIR = . + +all: debug_mount + +.PHONY : clean debug_mount + +clean: + go clean $(SOURCE_DIR) + rm -f $(BINARY) + +debug_mount: + go build -gcflags="all=-N -l" + dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- mount -dir=~/tmp/mm From 7e91ae592c2e34506b040c08d3aecbbdbe3781d1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:37:26 -0700 Subject: [PATCH 67/81] pass in option to read deleted entries not working yet --- weed/server/volume_grpc_admin.go | 2 +- weed/server/volume_grpc_batch_delete.go | 2 +- weed/server/volume_grpc_query.go | 2 +- weed/server/volume_server_handlers_read.go | 8 +++++++- weed/server/volume_server_handlers_write.go | 2 +- weed/storage/store.go | 8 ++++++-- weed/storage/volume_read_write.go | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go index a26b03411..a058573a3 100644 --- a/weed/server/volume_grpc_admin.go +++ b/weed/server/volume_grpc_admin.go @@ -188,7 +188,7 @@ func (vs *VolumeServer) VolumeNeedleStatus(ctx context.Context, req *volume_serv } count, err = vs.store.ReadEcShardNeedle(volumeId, n) } else { - count, err = vs.store.ReadVolumeNeedle(volumeId, n) + count, err = vs.store.ReadVolumeNeedle(volumeId, n, nil) } if err != nil { return nil, err diff --git a/weed/server/volume_grpc_batch_delete.go b/weed/server/volume_grpc_batch_delete.go index db6cf160e..8e84dc2a8 100644 --- a/weed/server/volume_grpc_batch_delete.go +++ b/weed/server/volume_grpc_batch_delete.go @@ -41,7 +41,7 @@ func (vs *VolumeServer) BatchDelete(ctx context.Context, req *volume_server_pb.B } else { n.ParsePath(id_cookie) cookie := n.Cookie - if _, err := vs.store.ReadVolumeNeedle(volumeId, n); err != nil { + if _, err := vs.store.ReadVolumeNeedle(volumeId, n, nil); err != nil { resp.Results = append(resp.Results, &volume_server_pb.DeleteResult{ FileId: fid, Status: http.StatusNotFound, diff --git a/weed/server/volume_grpc_query.go b/weed/server/volume_grpc_query.go index 767e28e7b..2f4fab96a 100644 --- a/weed/server/volume_grpc_query.go +++ b/weed/server/volume_grpc_query.go @@ -24,7 +24,7 @@ func (vs *VolumeServer) Query(req *volume_server_pb.QueryRequest, stream volume_ n.ParsePath(id_cookie) cookie := n.Cookie - if _, err := vs.store.ReadVolumeNeedle(volumeId, n); err != nil { + if _, err := vs.store.ReadVolumeNeedle(volumeId, n, nil); err != nil { glog.V(0).Infof("volume query failed to read fid %s: %v", fid, err) return err } diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go index d730600e4..07289e880 100644 --- a/weed/server/volume_server_handlers_read.go +++ b/weed/server/volume_server_handlers_read.go @@ -18,6 +18,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/images" "github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/stats" + "github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage/needle" "github.com/chrislusf/seaweedfs/weed/util" ) @@ -81,9 +82,14 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) return } cookie := n.Cookie + + readOption := &storage.ReadOption{ + ReadDeleted: r.FormValue("readDeleted") == "true", + } + var count int if hasVolume { - count, err = vs.store.ReadVolumeNeedle(volumeId, n) + count, err = vs.store.ReadVolumeNeedle(volumeId, n, readOption) } else if hasEcVolume { count, err = vs.store.ReadEcShardNeedle(volumeId, n) } diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index b4f8a90b2..78cbf08c5 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -104,7 +104,7 @@ func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request) { return } - _, ok := vs.store.ReadVolumeNeedle(volumeId, n) + _, ok := vs.store.ReadVolumeNeedle(volumeId, n, nil) if ok != nil { m := make(map[string]uint32) m["size"] = 0 diff --git a/weed/storage/store.go b/weed/storage/store.go index 21f2acf5d..68e1653c0 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -23,6 +23,10 @@ const ( MAX_TTL_VOLUME_REMOVAL_DELAY = 10 // 10 minutes ) +type ReadOption struct { + ReadDeleted bool +} + /* * A VolumeServer contains one Store */ @@ -283,9 +287,9 @@ func (s *Store) DeleteVolumeNeedle(i needle.VolumeId, n *needle.Needle) (Size, e return 0, fmt.Errorf("volume %d not found on %s:%d", i, s.Ip, s.Port) } -func (s *Store) ReadVolumeNeedle(i needle.VolumeId, n *needle.Needle) (int, error) { +func (s *Store) ReadVolumeNeedle(i needle.VolumeId, n *needle.Needle, readOption *ReadOption) (int, error) { if v := s.findVolume(i); v != nil { - return v.readNeedle(n) + return v.readNeedle(n, readOption) } return 0, fmt.Errorf("volume %d not found", i) } diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index d7b477a2d..31be0640a 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -252,7 +252,7 @@ func (v *Volume) doDeleteRequest(n *needle.Needle) (Size, error) { } // read fills in Needle content by looking up n.Id from NeedleMapper -func (v *Volume) readNeedle(n *needle.Needle) (int, error) { +func (v *Volume) readNeedle(n *needle.Needle, readOption *ReadOption) (int, error) { v.dataFileAccessLock.RLock() defer v.dataFileAccessLock.RUnlock() From c026eb05921b180cad0b529634ff4c891cb5b61f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 17:39:29 -0700 Subject: [PATCH 68/81] refactoring --- unmaintained/diff_volume_servers/diff_volume_servers.go | 2 +- weed/server/volume_grpc_erasure_coding.go | 4 ++-- weed/storage/erasure_coding/ec_decoder.go | 2 +- weed/storage/store_ec.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unmaintained/diff_volume_servers/diff_volume_servers.go b/unmaintained/diff_volume_servers/diff_volume_servers.go index 339d9c335..4de864980 100644 --- a/unmaintained/diff_volume_servers/diff_volume_servers.go +++ b/unmaintained/diff_volume_servers/diff_volume_servers.go @@ -155,7 +155,7 @@ func getVolumeFiles(v uint32, addr string) (map[types.NeedleId]needleState, int6 var maxOffset int64 files := map[types.NeedleId]needleState{} err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size types.Size) error { - if offset.IsZero() || size < 0 || size == types.TombstoneFileSize { + if offset.IsZero() || size.IsDeleted() { files[key] = needleState{ state: stateDeleted, size: size, diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index 79348c9d7..55e0261c8 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -272,7 +272,7 @@ func (vs *VolumeServer) VolumeEcShardRead(req *volume_server_pb.VolumeEcShardRea if req.FileKey != 0 { _, size, _ := ecVolume.FindNeedleFromEcx(types.Uint64ToNeedleId(req.FileKey)) - if size == types.TombstoneFileSize { + if size.IsDeleted() { return stream.Send(&volume_server_pb.VolumeEcShardReadResponse{ IsDeleted: true, }) @@ -340,7 +340,7 @@ func (vs *VolumeServer) VolumeEcBlobDelete(ctx context.Context, req *volume_serv if err != nil { return nil, fmt.Errorf("locate in local ec volume: %v", err) } - if size == types.TombstoneFileSize { + if size.IsDeleted() { return resp, nil } diff --git a/weed/storage/erasure_coding/ec_decoder.go b/weed/storage/erasure_coding/ec_decoder.go index 6793faca5..795a7d523 100644 --- a/weed/storage/erasure_coding/ec_decoder.go +++ b/weed/storage/erasure_coding/ec_decoder.go @@ -54,7 +54,7 @@ func FindDatFileSize(baseFileName string) (datSize int64, err error) { err = iterateEcxFile(baseFileName, func(key types.NeedleId, offset types.Offset, size types.Size) error { - if size == types.TombstoneFileSize { + if size.IsDeleted() { return nil } diff --git a/weed/storage/store_ec.go b/weed/storage/store_ec.go index 2b0df439c..8b4388519 100644 --- a/weed/storage/store_ec.go +++ b/weed/storage/store_ec.go @@ -124,7 +124,7 @@ func (s *Store) ReadEcShardNeedle(vid needle.VolumeId, n *needle.Needle) (int, e if err != nil { return 0, fmt.Errorf("locate in local ec volume: %v", err) } - if size == types.TombstoneFileSize { + if size.IsDeleted() { return 0, fmt.Errorf("entry %s is deleted", n.Id) } From 6ccd7f0a4d8ff5167054147cc66774fec84d80b6 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 18:01:37 -0700 Subject: [PATCH 69/81] refactoring --- weed/storage/needle_map/compact_map.go | 2 +- weed/storage/needle_map/compact_map_test.go | 4 ++-- weed/storage/needle_map_leveldb.go | 2 +- weed/storage/needle_map_memory.go | 4 ++-- weed/storage/needle_map_metric.go | 6 +++--- weed/storage/types/needle_types.go | 3 +++ weed/storage/volume_backup.go | 2 +- weed/storage/volume_read_write.go | 6 +++--- weed/storage/volume_vacuum.go | 4 ++-- 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/weed/storage/needle_map/compact_map.go b/weed/storage/needle_map/compact_map.go index b8d242e2d..c1fb00268 100644 --- a/weed/storage/needle_map/compact_map.go +++ b/weed/storage/needle_map/compact_map.go @@ -130,7 +130,7 @@ func (cs *CompactSection) Delete(key NeedleId) Size { cs.Lock() ret := Size(0) if i := cs.binarySearchValues(skey); i >= 0 { - if cs.values[i].Size > 0 && cs.values[i].Size != TombstoneFileSize { + if cs.values[i].Size > 0 && cs.values[i].Size.IsValid() { ret = cs.values[i].Size cs.values[i].Size = TombstoneFileSize } diff --git a/weed/storage/needle_map/compact_map_test.go b/weed/storage/needle_map/compact_map_test.go index 33ed4f1ce..c6bfb97b4 100644 --- a/weed/storage/needle_map/compact_map_test.go +++ b/weed/storage/needle_map/compact_map_test.go @@ -76,7 +76,7 @@ func TestCompactMap(t *testing.T) { t.Fatal("key", i, "size", v.Size) } } else if i%37 == 0 { - if ok && v.Size != TombstoneFileSize { + if ok && v.Size.IsValid() { t.Fatal("key", i, "should have been deleted needle value", v) } } else if i%2 == 0 { @@ -89,7 +89,7 @@ func TestCompactMap(t *testing.T) { for i := uint32(10 * batch); i < 100*batch; i++ { v, ok := m.Get(NeedleId(i)) if i%37 == 0 { - if ok && v.Size != TombstoneFileSize { + if ok && v.Size.IsValid() { t.Fatal("key", i, "should have been deleted needle value", v) } } else if i%2 == 0 { diff --git a/weed/storage/needle_map_leveldb.go b/weed/storage/needle_map_leveldb.go index b4b04c07f..4a17e6d0e 100644 --- a/weed/storage/needle_map_leveldb.go +++ b/weed/storage/needle_map_leveldb.go @@ -74,7 +74,7 @@ func generateLevelDbFile(dbFileName string, indexFile *os.File) error { } defer db.Close() return idx.WalkIndexFile(indexFile, func(key NeedleId, offset Offset, size Size) error { - if !offset.IsZero() && size != TombstoneFileSize { + if !offset.IsZero() && size.IsValid() { levelDbWrite(db, key, offset, size) } else { levelDbDelete(db, key) diff --git a/weed/storage/needle_map_memory.go b/weed/storage/needle_map_memory.go index 8e7e51973..d0891dc98 100644 --- a/weed/storage/needle_map_memory.go +++ b/weed/storage/needle_map_memory.go @@ -30,11 +30,11 @@ func LoadCompactNeedleMap(file *os.File) (*NeedleMap, error) { func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) { e := idx.WalkIndexFile(file, func(key NeedleId, offset Offset, size Size) error { nm.MaybeSetMaxFileKey(key) - if !offset.IsZero() && size != TombstoneFileSize { + if !offset.IsZero() && size.IsValid() { nm.FileCounter++ nm.FileByteCounter = nm.FileByteCounter + uint64(size) oldOffset, oldSize := nm.m.Set(NeedleId(key), offset, size) - if !oldOffset.IsZero() && oldSize != TombstoneFileSize { + if !oldOffset.IsZero() && oldSize.IsValid() { nm.DeletionCounter++ nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize) } diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go index 85addc27d..3618dada9 100644 --- a/weed/storage/needle_map_metric.go +++ b/weed/storage/needle_map_metric.go @@ -31,7 +31,7 @@ func (mm *mapMetric) logPut(key NeedleId, oldSize Size, newSize Size) { } mm.MaybeSetMaxFileKey(key) mm.LogFileCounter(newSize) - if oldSize > 0 && oldSize != TombstoneFileSize { + if oldSize > 0 && oldSize.IsValid() { mm.LogDeletionCounter(oldSize) } } @@ -101,7 +101,7 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { mm.MaybeSetMaxFileKey(key) NeedleIdToBytes(buf, key) - if size != TombstoneFileSize { + if size.IsValid() { mm.FileByteCounter += uint64(size) } @@ -111,7 +111,7 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { } else { // deleted file mm.DeletionCounter++ - if size != TombstoneFileSize { + if size.IsValid() { // previously already deleted file mm.DeletionByteCounter += uint64(size) } diff --git a/weed/storage/types/needle_types.go b/weed/storage/types/needle_types.go index 138643f7f..0e9115c0d 100644 --- a/weed/storage/types/needle_types.go +++ b/weed/storage/types/needle_types.go @@ -18,6 +18,9 @@ type Size uint32 func (s Size) IsDeleted() bool { return s == TombstoneFileSize } +func (s Size) IsValid() bool { + return s != TombstoneFileSize +} type OffsetLower struct { b3 byte diff --git a/weed/storage/volume_backup.go b/weed/storage/volume_backup.go index f7075fe2b..595bd8a35 100644 --- a/weed/storage/volume_backup.go +++ b/weed/storage/volume_backup.go @@ -253,7 +253,7 @@ func (scanner *VolumeFileScanner4GenIdx) ReadNeedleBody() bool { } func (scanner *VolumeFileScanner4GenIdx) VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error { - if n.Size > 0 && n.Size != TombstoneFileSize { + if n.Size > 0 && n.Size.IsValid() { return scanner.v.nm.Put(n.Id, ToOffset(offset), n.Size) } return scanner.v.nm.Delete(n.Id, ToOffset(offset)) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index 31be0640a..b2487dde0 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -25,7 +25,7 @@ func (v *Volume) isFileUnchanged(n *needle.Needle) bool { } nv, ok := v.nm.Get(n.Id) - if ok && !nv.Offset.IsZero() && nv.Size != TombstoneFileSize { + if ok && !nv.Offset.IsZero() && nv.Size.IsValid() { oldNeedle := new(needle.Needle) err := oldNeedle.ReadData(v.DataBackend, nv.Offset.ToAcutalOffset(), nv.Size, v.Version()) if err != nil { @@ -196,7 +196,7 @@ func (v *Volume) syncDelete(n *needle.Needle) (Size, error) { nv, ok := v.nm.Get(n.Id) //fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) - if ok && nv.Size != TombstoneFileSize { + if ok && nv.Size.IsValid() { size := nv.Size n.Data = nil n.AppendAtNs = uint64(time.Now().UnixNano()) @@ -234,7 +234,7 @@ func (v *Volume) doDeleteRequest(n *needle.Needle) (Size, error) { glog.V(4).Infof("delete needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) nv, ok := v.nm.Get(n.Id) //fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) - if ok && nv.Size != TombstoneFileSize { + if ok && nv.Size.IsValid() { size := nv.Size n.Data = nil n.AppendAtNs = uint64(time.Now().UnixNano()) diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index 9d366a27d..a3e5800df 100644 --- a/weed/storage/volume_vacuum.go +++ b/weed/storage/volume_vacuum.go @@ -274,7 +274,7 @@ func (v *Volume) makeupDiff(newDatFileName, newIdxFileName, oldDatFileName, oldI } //updated needle - if !increIdxEntry.offset.IsZero() && increIdxEntry.size != 0 && increIdxEntry.size != TombstoneFileSize { + if !increIdxEntry.offset.IsZero() && increIdxEntry.size != 0 && increIdxEntry.size.IsValid() { //even the needle cache in memory is hit, the need_bytes is correct glog.V(4).Infof("file %d offset %d size %d", key, increIdxEntry.offset.ToAcutalOffset(), increIdxEntry.size) var needleBytes []byte @@ -335,7 +335,7 @@ func (scanner *VolumeFileScanner4Vacuum) VisitNeedle(n *needle.Needle, offset in } nv, ok := scanner.v.nm.Get(n.Id) glog.V(4).Infoln("needle expected offset ", offset, "ok", ok, "nv", nv) - if ok && nv.Offset.ToAcutalOffset() == offset && nv.Size > 0 && nv.Size != TombstoneFileSize { + if ok && nv.Offset.ToAcutalOffset() == offset && nv.Size > 0 && nv.Size.IsValid() { if err := scanner.nm.Set(n.Id, ToOffset(scanner.newOffset), n.Size); err != nil { return fmt.Errorf("cannot put needle: %s", err) } From fe01191b5b93c7f3851e7add9b046c89c8189cdc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 19:22:16 -0700 Subject: [PATCH 70/81] support read option readDeleted=true --- weed/command/export.go | 2 +- weed/command/fix.go | 2 +- .../erasure_coding/ec_volume_delete.go | 2 +- weed/storage/needle_map/compact_map.go | 9 +++----- weed/storage/needle_map_leveldb.go | 10 +++++--- weed/storage/types/needle_types.go | 9 ++++---- weed/storage/volume_read_write.go | 23 +++++++++++-------- 7 files changed, 31 insertions(+), 26 deletions(-) diff --git a/weed/command/export.go b/weed/command/export.go index 0e2e7ccd9..3ea4b00d3 100644 --- a/weed/command/export.go +++ b/weed/command/export.go @@ -111,7 +111,7 @@ func (scanner *VolumeFileScanner4Export) VisitNeedle(n *needle.Needle, offset in nv, ok := needleMap.Get(n.Id) glog.V(3).Infof("key %d offset %d size %d disk_size %d compressed %v ok %v nv %+v", n.Id, offset, n.Size, n.DiskSize(scanner.version), n.IsCompressed(), ok, nv) - if ok && nv.Size > 0 && nv.Size != types.TombstoneFileSize && nv.Offset.ToAcutalOffset() == offset { + if ok && nv.Size.IsValid() && nv.Offset.ToAcutalOffset() == offset { if newerThanUnix >= 0 && n.HasLastModifiedDate() && n.LastModified < uint64(newerThanUnix) { glog.V(3).Infof("Skipping this file, as it's old enough: LastModified %d vs %d", n.LastModified, newerThanUnix) diff --git a/weed/command/fix.go b/weed/command/fix.go index e1455790f..ae9a051b8 100644 --- a/weed/command/fix.go +++ b/weed/command/fix.go @@ -48,7 +48,7 @@ func (scanner *VolumeFileScanner4Fix) ReadNeedleBody() bool { func (scanner *VolumeFileScanner4Fix) VisitNeedle(n *needle.Needle, offset int64, needleHeader, needleBody []byte) error { glog.V(2).Infof("key %d offset %d size %d disk_size %d compressed %v", n.Id, offset, n.Size, n.DiskSize(scanner.version), n.IsCompressed()) - if n.Size > 0 && n.Size != types.TombstoneFileSize { + if n.Size.IsValid() { pe := scanner.nm.Set(n.Id, types.ToOffset(offset), n.Size) glog.V(2).Infof("saved %d with error %v", n.Size, pe) } else { diff --git a/weed/storage/erasure_coding/ec_volume_delete.go b/weed/storage/erasure_coding/ec_volume_delete.go index 822a9e923..a7f8c24a3 100644 --- a/weed/storage/erasure_coding/ec_volume_delete.go +++ b/weed/storage/erasure_coding/ec_volume_delete.go @@ -12,7 +12,7 @@ import ( var ( MarkNeedleDeleted = func(file *os.File, offset int64) error { b := make([]byte, types.SizeSize) - util.Uint32toBytes(b, types.TombstoneFileSize) + types.SizeToBytes(b, types.TombstoneFileSize) n, err := file.WriteAt(b, offset+types.NeedleIdSize+types.OffsetSize) if err != nil { return fmt.Errorf("sorted needle write error: %v", err) diff --git a/weed/storage/needle_map/compact_map.go b/weed/storage/needle_map/compact_map.go index c1fb00268..81ff27c45 100644 --- a/weed/storage/needle_map/compact_map.go +++ b/weed/storage/needle_map/compact_map.go @@ -115,12 +115,9 @@ func (cs *CompactSection) deleteOverflowEntry(key SectionalNeedleId) { return cs.overflow[i].Key >= key }) if deleteCandidate != length && cs.overflow[deleteCandidate].Key == key { - for i := deleteCandidate; i < length-1; i++ { - cs.overflow[i] = cs.overflow[i+1] - cs.overflowExtra[i] = cs.overflowExtra[i+1] + if cs.overflow[deleteCandidate].Size.IsValid() { + cs.overflow[deleteCandidate].Size = - cs.overflow[deleteCandidate].Size } - cs.overflow = cs.overflow[0 : length-1] - cs.overflowExtra = cs.overflowExtra[0 : length-1] } } @@ -132,7 +129,7 @@ func (cs *CompactSection) Delete(key NeedleId) Size { if i := cs.binarySearchValues(skey); i >= 0 { if cs.values[i].Size > 0 && cs.values[i].Size.IsValid() { ret = cs.values[i].Size - cs.values[i].Size = TombstoneFileSize + cs.values[i].Size = -cs.values[i].Size } } if _, v, found := cs.findOverflowEntry(skey); found { diff --git a/weed/storage/needle_map_leveldb.go b/weed/storage/needle_map_leveldb.go index 4a17e6d0e..415cd14dd 100644 --- a/weed/storage/needle_map_leveldb.go +++ b/weed/storage/needle_map_leveldb.go @@ -124,14 +124,18 @@ func levelDbDelete(db *leveldb.DB, key NeedleId) error { } func (m *LevelDbNeedleMap) Delete(key NeedleId, offset Offset) error { - if oldNeedle, ok := m.Get(key); ok { - m.logDelete(oldNeedle.Size) + oldNeedle, found := m.Get(key) + if !found || oldNeedle.Size.IsDeleted() { + return nil } + m.logDelete(oldNeedle.Size) + // write to index file first if err := m.appendToIndexFile(key, offset, TombstoneFileSize); err != nil { return err } - return levelDbDelete(m.db, key) + + return levelDbWrite(m.db, key, oldNeedle.Offset, -oldNeedle.Size) } func (m *LevelDbNeedleMap) Close() { diff --git a/weed/storage/types/needle_types.go b/weed/storage/types/needle_types.go index 0e9115c0d..7e30d2bd8 100644 --- a/weed/storage/types/needle_types.go +++ b/weed/storage/types/needle_types.go @@ -2,7 +2,6 @@ package types import ( "fmt" - "math" "strconv" "github.com/chrislusf/seaweedfs/weed/util" @@ -13,13 +12,13 @@ type Offset struct { OffsetLower } -type Size uint32 +type Size int32 func (s Size) IsDeleted() bool { - return s == TombstoneFileSize + return s < 0 || s == TombstoneFileSize } func (s Size) IsValid() bool { - return s != TombstoneFileSize + return s >0 && s != TombstoneFileSize } type OffsetLower struct { @@ -37,7 +36,7 @@ const ( NeedleMapEntrySize = NeedleIdSize + OffsetSize + SizeSize TimestampSize = 8 // int64 size NeedlePaddingSize = 8 - TombstoneFileSize = math.MaxUint32 + TombstoneFileSize = Size(-1) CookieSize = 4 ) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index b2487dde0..4a997832c 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -195,7 +195,7 @@ func (v *Volume) syncDelete(n *needle.Needle) (Size, error) { } nv, ok := v.nm.Get(n.Id) - //fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) + // fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) if ok && nv.Size.IsValid() { size := nv.Size n.Data = nil @@ -233,7 +233,7 @@ func (v *Volume) deleteNeedle2(n *needle.Needle) (Size, error) { func (v *Volume) doDeleteRequest(n *needle.Needle) (Size, error) { glog.V(4).Infof("delete needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) nv, ok := v.nm.Get(n.Id) - //fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) + // fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size) if ok && nv.Size.IsValid() { size := nv.Size n.Data = nil @@ -260,13 +260,18 @@ func (v *Volume) readNeedle(n *needle.Needle, readOption *ReadOption) (int, erro if !ok || nv.Offset.IsZero() { return -1, ErrorNotFound } - if nv.Size.IsDeleted() { - return -1, errors.New("already deleted") + readSize := nv.Size + if readSize.IsDeleted() { + if readOption != nil && readOption.ReadDeleted && readSize != TombstoneFileSize { + readSize = -readSize + } else { + return -1, errors.New("already deleted") + } } - if nv.Size == 0 { + if readSize == 0 { return 0, nil } - err := n.ReadData(v.DataBackend, nv.Offset.ToAcutalOffset(), nv.Size, v.Version()) + err := n.ReadData(v.DataBackend, nv.Offset.ToAcutalOffset(), readSize, v.Version()) if err != nil { return 0, err } @@ -299,7 +304,7 @@ func (v *Volume) startWorker() { currentBytesToWrite := int64(0) for { request, ok := <-v.asyncRequestsChan - //volume may be closed + // volume may be closed if !ok { chanClosed = true break @@ -402,8 +407,8 @@ func ScanVolumeFileFrom(version needle.Version, datBackend backend.BackendStorag if volumeFileScanner.ReadNeedleBody() { if needleBody, err = n.ReadNeedleBody(datBackend, version, offset+NeedleHeaderSize, rest); err != nil { glog.V(0).Infof("cannot read needle body: %v", err) - //err = fmt.Errorf("cannot read needle body: %v", err) - //return + // err = fmt.Errorf("cannot read needle body: %v", err) + // return } } err := volumeFileScanner.VisitNeedle(n, offset, nh, needleBody) From 99d05f758c20e9884cb2879567fba7e9b56c2782 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 23:39:18 -0700 Subject: [PATCH 71/81] adjust logs --- weed/util/chunk_cache/chunk_cache_on_disk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/util/chunk_cache/chunk_cache_on_disk.go b/weed/util/chunk_cache/chunk_cache_on_disk.go index 4009d2309..356dfe188 100644 --- a/weed/util/chunk_cache/chunk_cache_on_disk.go +++ b/weed/util/chunk_cache/chunk_cache_on_disk.go @@ -63,7 +63,7 @@ func LoadOrCreateChunkCacheVolume(fileName string, preallocate int64) (*ChunkCac return nil, fmt.Errorf("cannot write cache index %s.idx: %v", v.fileName, err) } - glog.V(0).Infoln("loading leveldb", v.fileName+".ldb") + glog.V(1).Infoln("loading leveldb", v.fileName+".ldb") opts := &opt.Options{ BlockCacheCapacity: 2 * 1024 * 1024, // default value is 8MiB WriteBuffer: 1 * 1024 * 1024, // default value is 4MiB From 9f1e0aeef5898db5b121eb0b9f8a70a06844b0e9 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 23:40:53 -0700 Subject: [PATCH 72/81] delete chunks in the last step --- weed/filesys/dir.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 578c40014..645051821 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -317,8 +317,8 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error { return nil } - dir.wfs.deleteFileChunks(entry.Chunks) + // first, ensure the filer store can correctly delete glog.V(3).Infof("remove file: %v", req) err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, false, false, false, false) if err != nil { @@ -326,9 +326,13 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error { return fuse.ENOENT } + // then, delete meta cache and fsNode cache dir.wfs.metaCache.DeleteEntry(context.Background(), filePath) dir.wfs.fsNodeCache.DeleteFsNode(filePath) + // delete the chunks last + dir.wfs.deleteFileChunks(entry.Chunks) + return nil } From ed4b43b419dc1a77fb9db946cf5c01517f525356 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 23:42:09 -0700 Subject: [PATCH 73/81] adjust logs --- weed/filesys/dir.go | 2 +- weed/filesys/file.go | 4 ++-- weed/filesys/wfs.go | 2 +- weed/storage/volume_read_write.go | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 645051821..46f5f22ed 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -465,7 +465,7 @@ func (dir *Dir) saveEntry() error { glog.V(1).Infof("save dir entry: %v", request) _, err := client.UpdateEntry(context.Background(), request) if err != nil { - glog.V(0).Infof("UpdateEntry dir %s/%s: %v", parentDir, name, err) + glog.Errorf("UpdateEntry dir %s/%s: %v", parentDir, name, err) return fuse.EIO } diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 8db892447..a501493d8 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -85,7 +85,7 @@ func (file *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) { - glog.V(5).Infof("file %v open %+v", file.fullpath(), req) + glog.V(4).Infof("file %v open %+v", file.fullpath(), req) file.isOpen++ @@ -293,7 +293,7 @@ func (file *File) saveEntry() error { glog.V(4).Infof("save file entry: %v", request) _, err := client.UpdateEntry(context.Background(), request) if err != nil { - glog.V(0).Infof("UpdateEntry file %s/%s: %v", file.dir.FullPath(), file.Name, err) + glog.Errorf("UpdateEntry file %s/%s: %v", file.dir.FullPath(), file.Name, err) return fuse.EIO } diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 8803c31e0..e8e619c4a 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -135,7 +135,7 @@ func (wfs *WFS) ReleaseHandle(fullpath util.FullPath, handleId fuse.HandleID) { wfs.handlesLock.Lock() defer wfs.handlesLock.Unlock() - glog.V(5).Infof("%s ReleaseHandle id %d current handles length %d", fullpath, handleId, len(wfs.handles)) + glog.V(4).Infof("%s ReleaseHandle id %d current handles length %d", fullpath, handleId, len(wfs.handles)) delete(wfs.handles, fullpath.AsInode()) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index 4a997832c..e77010dbd 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -263,6 +263,7 @@ func (v *Volume) readNeedle(n *needle.Needle, readOption *ReadOption) (int, erro readSize := nv.Size if readSize.IsDeleted() { if readOption != nil && readOption.ReadDeleted && readSize != TombstoneFileSize { + glog.V(3).Infof("reading deleted %s", n.String()) readSize = -readSize } else { return -1, errors.New("already deleted") From ae9bc4a50800504115d55f68bfaeb489b9a0e2d8 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 23:42:26 -0700 Subject: [PATCH 74/81] logs --- weed/filesys/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index a501493d8..d57f6cc57 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -93,7 +93,7 @@ func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.Op resp.Handle = fuse.HandleID(handle.handle) - glog.V(5).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) + glog.V(4).Infof("%v file open handle id = %d", file.fullpath(), handle.handle) return handle, nil From a78772d5ea235e55ef515d1de28c2201ee9a5d66 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 00:42:02 -0700 Subject: [PATCH 75/81] avoid shutdown in the middle of running --- weed/filesys/wfs.go | 3 --- weed/server/webdav_server.go | 4 ---- 2 files changed, 7 deletions(-) diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index e8e619c4a..f147d7548 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -88,9 +88,6 @@ func NewSeaweedFileSystem(option *Option) *WFS { if option.CacheSizeMB > 0 { os.MkdirAll(cacheDir, 0755) wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB) - grace.OnInterrupt(func() { - wfs.chunkCache.Shutdown() - }) } wfs.metaCache = meta_cache.NewMetaCache(path.Join(cacheDir, "meta")) diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.go index fb13f55d0..3d2629c19 100644 --- a/weed/server/webdav_server.go +++ b/weed/server/webdav_server.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/chrislusf/seaweedfs/weed/util/grace" "golang.org/x/net/webdav" "google.golang.org/grpc" @@ -101,9 +100,6 @@ type WebDavFile struct { func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) { chunkCache := chunk_cache.NewTieredChunkCache(256, option.CacheDir, option.CacheSizeMB) - grace.OnInterrupt(func() { - chunkCache.Shutdown() - }) return &WebDavFileSystem{ option: option, chunkCache: chunkCache, From c27e18aa6a1c17190816d95876e45093646d477a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 00:43:07 -0700 Subject: [PATCH 76/81] read possible old deleted chunks --- weed/filer2/filechunk_manifest.go | 2 +- weed/filer2/stream.go | 6 +++--- weed/replication/sink/azuresink/azure_sink.go | 2 +- weed/replication/sink/b2sink/b2_sink.go | 2 +- weed/replication/sink/gcssink/gcs_sink.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/weed/filer2/filechunk_manifest.go b/weed/filer2/filechunk_manifest.go index 62d2c6e7f..037b0c1e8 100644 --- a/weed/filer2/filechunk_manifest.go +++ b/weed/filer2/filechunk_manifest.go @@ -64,7 +64,7 @@ func fetchChunk(lookupFileIdFn LookupFileIdFunctionType, fileId string, cipherKe return nil, err } var buffer bytes.Buffer - err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, true, 0, 0, func(data []byte) { + err = util.ReadUrlAsStream(urlString+"?readDeleted=true", cipherKey, isGzipped, true, 0, 0, func(data []byte) { buffer.Write(data) }) if err != nil { diff --git a/weed/filer2/stream.go b/weed/filer2/stream.go index e9707d3ae..fee9d45da 100644 --- a/weed/filer2/stream.go +++ b/weed/filer2/stream.go @@ -32,7 +32,7 @@ func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*f for _, chunkView := range chunkViews { urlString := fileId2Url[chunkView.FileId] - err := util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err := util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { w.Write(data) }) if err != nil { @@ -63,7 +63,7 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err) return nil, err } - err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err = util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { buffer.Write(data) }) if err != nil { @@ -175,7 +175,7 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error { return err } var buffer bytes.Buffer - err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err = util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { buffer.Write(data) }) if err != nil { diff --git a/weed/replication/sink/azuresink/azure_sink.go b/weed/replication/sink/azuresink/azure_sink.go index 3240b705a..6419509be 100644 --- a/weed/replication/sink/azuresink/azure_sink.go +++ b/weed/replication/sink/azuresink/azure_sink.go @@ -115,7 +115,7 @@ func (g *AzureSink) CreateEntry(key string, entry *filer_pb.Entry) error { } var writeErr error - readErr := util.ReadUrlAsStream(fileUrl, nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { + readErr := util.ReadUrlAsStream(fileUrl+"?readDeleted=true", nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { _, writeErr = appendBlobURL.AppendBlock(context.Background(), bytes.NewReader(data), azblob.AppendBlobAccessConditions{}, nil) }) diff --git a/weed/replication/sink/b2sink/b2_sink.go b/weed/replication/sink/b2sink/b2_sink.go index 8532c0231..041cee952 100644 --- a/weed/replication/sink/b2sink/b2_sink.go +++ b/weed/replication/sink/b2sink/b2_sink.go @@ -103,7 +103,7 @@ func (g *B2Sink) CreateEntry(key string, entry *filer_pb.Entry) error { } var writeErr error - readErr := util.ReadUrlAsStream(fileUrl, nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { + readErr := util.ReadUrlAsStream(fileUrl+"?readDeleted=true", nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { _, err := writer.Write(data) if err != nil { writeErr = err diff --git a/weed/replication/sink/gcssink/gcs_sink.go b/weed/replication/sink/gcssink/gcs_sink.go index 35a7dd9f7..82f4d72cf 100644 --- a/weed/replication/sink/gcssink/gcs_sink.go +++ b/weed/replication/sink/gcssink/gcs_sink.go @@ -101,7 +101,7 @@ func (g *GcsSink) CreateEntry(key string, entry *filer_pb.Entry) error { return err } - err = util.ReadUrlAsStream(fileUrl, nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { + err = util.ReadUrlAsStream(fileUrl+"?readDeleted=true", nil, false, chunk.IsFullChunk(), chunk.Offset, int(chunk.Size), func(data []byte) { wc.Write(data) }) From 839634097f680ccbd1bfc3cfa7889fa2c71aec7e Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 01:27:10 -0700 Subject: [PATCH 77/81] also do flush on release --- weed/filesys/filehandle.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index fa31cd81b..9186eddbb 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -165,6 +165,7 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err fh.f.isOpen-- if fh.f.isOpen <= 0 { + fh.doFlush(ctx, req.Header) fh.dirtyPages.releaseResource() fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle)) fh.f.entryViewCache = nil @@ -175,9 +176,13 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err } func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { + return fh.doFlush(ctx, req.Header) +} + +func (fh *FileHandle) doFlush(ctx context.Context, header fuse.Header) error { // fflush works at fh level // send the data to the OS - glog.V(5).Infof("Flush %s fh %d %v", fh.f.fullpath(), fh.handle, req) + glog.V(4).Infof("doFlush %s fh %d %v", fh.f.fullpath(), fh.handle, header) chunks, err := fh.dirtyPages.FlushToStorage() if err != nil { @@ -199,10 +204,10 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { if fh.f.entry.Attributes != nil { fh.f.entry.Attributes.Mime = fh.contentType if fh.f.entry.Attributes.Uid == 0 { - fh.f.entry.Attributes.Uid = req.Uid + fh.f.entry.Attributes.Uid = header.Uid } if fh.f.entry.Attributes.Gid == 0 { - fh.f.entry.Attributes.Gid = req.Gid + fh.f.entry.Attributes.Gid = header.Gid } if fh.f.entry.Attributes.Crtime == 0 { fh.f.entry.Attributes.Crtime = time.Now().Unix() From 3b4b1d4a77f6ac57e35a47316cce1621010f0d7f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 01:37:56 -0700 Subject: [PATCH 78/81] fix tests --- weed/storage/needle_map/compact_map_test.go | 6 +++--- weed/storage/volume_vacuum_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/storage/needle_map/compact_map_test.go b/weed/storage/needle_map/compact_map_test.go index c6bfb97b4..199cb26b3 100644 --- a/weed/storage/needle_map/compact_map_test.go +++ b/weed/storage/needle_map/compact_map_test.go @@ -129,8 +129,8 @@ func TestOverflow(t *testing.T) { cs.deleteOverflowEntry(4) - if len(cs.overflow) != 4 { - t.Fatalf("expecting 4 entries now: %+v", cs.overflow) + if len(cs.overflow) != 5 { + t.Fatalf("expecting 5 entries now: %+v", cs.overflow) } _, x, _ := cs.findOverflowEntry(5) @@ -146,7 +146,7 @@ func TestOverflow(t *testing.T) { cs.deleteOverflowEntry(1) for i, x := range cs.overflow { - println("overflow[", i, "]:", x.Key) + println("overflow[", i, "]:", x.Key, "size", x.Size) } println() diff --git a/weed/storage/volume_vacuum_test.go b/weed/storage/volume_vacuum_test.go index 23b43fa40..f96e9b0cf 100644 --- a/weed/storage/volume_vacuum_test.go +++ b/weed/storage/volume_vacuum_test.go @@ -113,7 +113,7 @@ func TestCompaction(t *testing.T) { } n := newEmptyNeedle(uint64(i)) - size, err := v.readNeedle(n) + size, err := v.readNeedle(n, nil) if err != nil { t.Fatalf("read file %d: %v", i, err) } From 3ccfa4c6adf967b550defea72c3691956e541e26 Mon Sep 17 00:00:00 2001 From: James Hartig Date: Wed, 19 Aug 2020 11:42:56 -0400 Subject: [PATCH 79/81] Added VolumeMarkWritable and VolumeStatus grpc methods This is necessary for copy to mark as read-only and then restore the original state afterwards. --- weed/pb/volume_server.proto | 17 + weed/pb/volume_server_pb/volume_server.pb.go | 2237 ++++++++++-------- weed/server/volume_grpc_admin.go | 28 + weed/shell/command_volume_move.go | 37 + weed/storage/store.go | 13 + weed/storage/volume.go | 5 + weed/storage/volume_super_block.go | 2 + 7 files changed, 1387 insertions(+), 952 deletions(-) diff --git a/weed/pb/volume_server.proto b/weed/pb/volume_server.proto index 480a04671..2121cc3cc 100644 --- a/weed/pb/volume_server.proto +++ b/weed/pb/volume_server.proto @@ -37,8 +37,12 @@ service VolumeServer { } rpc VolumeMarkReadonly (VolumeMarkReadonlyRequest) returns (VolumeMarkReadonlyResponse) { } + rpc VolumeMarkWritable (VolumeMarkWritableRequest) returns (VolumeMarkWritableResponse) { + } rpc VolumeConfigure (VolumeConfigureRequest) returns (VolumeConfigureResponse) { } + rpc VolumeStatus (VolumeStatusRequest) returns (VolumeStatusResponse) { + } // copy the .idx .dat files, and mount this volume rpc VolumeCopy (VolumeCopyRequest) returns (VolumeCopyResponse) { @@ -200,6 +204,12 @@ message VolumeMarkReadonlyRequest { message VolumeMarkReadonlyResponse { } +message VolumeMarkWritableRequest { + uint32 volume_id = 1; +} +message VolumeMarkWritableResponse { +} + message VolumeConfigureRequest { uint32 volume_id = 1; string replication = 2; @@ -208,6 +218,13 @@ message VolumeConfigureResponse { string error = 1; } +message VolumeStatusRequest { + uint32 volume_id = 1; +} +message VolumeStatusResponse { + bool is_read_only = 1; +} + message VolumeCopyRequest { uint32 volume_id = 1; string collection = 2; diff --git a/weed/pb/volume_server_pb/volume_server.pb.go b/weed/pb/volume_server_pb/volume_server.pb.go index 870758108..bf12d5edb 100644 --- a/weed/pb/volume_server_pb/volume_server.pb.go +++ b/weed/pb/volume_server_pb/volume_server.pb.go @@ -1408,6 +1408,91 @@ func (*VolumeMarkReadonlyResponse) Descriptor() ([]byte, []int) { return file_volume_server_proto_rawDescGZIP(), []int{27} } +type VolumeMarkWritableRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` +} + +func (x *VolumeMarkWritableRequest) Reset() { + *x = VolumeMarkWritableRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_volume_server_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VolumeMarkWritableRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VolumeMarkWritableRequest) ProtoMessage() {} + +func (x *VolumeMarkWritableRequest) ProtoReflect() protoreflect.Message { + mi := &file_volume_server_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VolumeMarkWritableRequest.ProtoReflect.Descriptor instead. +func (*VolumeMarkWritableRequest) Descriptor() ([]byte, []int) { + return file_volume_server_proto_rawDescGZIP(), []int{28} +} + +func (x *VolumeMarkWritableRequest) GetVolumeId() uint32 { + if x != nil { + return x.VolumeId + } + return 0 +} + +type VolumeMarkWritableResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *VolumeMarkWritableResponse) Reset() { + *x = VolumeMarkWritableResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_volume_server_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VolumeMarkWritableResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VolumeMarkWritableResponse) ProtoMessage() {} + +func (x *VolumeMarkWritableResponse) ProtoReflect() protoreflect.Message { + mi := &file_volume_server_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VolumeMarkWritableResponse.ProtoReflect.Descriptor instead. +func (*VolumeMarkWritableResponse) Descriptor() ([]byte, []int) { + return file_volume_server_proto_rawDescGZIP(), []int{29} +} + type VolumeConfigureRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1420,7 +1505,7 @@ type VolumeConfigureRequest struct { func (x *VolumeConfigureRequest) Reset() { *x = VolumeConfigureRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[28] + mi := &file_volume_server_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1433,7 +1518,7 @@ func (x *VolumeConfigureRequest) String() string { func (*VolumeConfigureRequest) ProtoMessage() {} func (x *VolumeConfigureRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[28] + mi := &file_volume_server_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1446,7 +1531,7 @@ func (x *VolumeConfigureRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeConfigureRequest.ProtoReflect.Descriptor instead. func (*VolumeConfigureRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{28} + return file_volume_server_proto_rawDescGZIP(), []int{30} } func (x *VolumeConfigureRequest) GetVolumeId() uint32 { @@ -1474,7 +1559,7 @@ type VolumeConfigureResponse struct { func (x *VolumeConfigureResponse) Reset() { *x = VolumeConfigureResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[29] + mi := &file_volume_server_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1487,7 +1572,7 @@ func (x *VolumeConfigureResponse) String() string { func (*VolumeConfigureResponse) ProtoMessage() {} func (x *VolumeConfigureResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[29] + mi := &file_volume_server_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1500,7 +1585,7 @@ func (x *VolumeConfigureResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeConfigureResponse.ProtoReflect.Descriptor instead. func (*VolumeConfigureResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{29} + return file_volume_server_proto_rawDescGZIP(), []int{31} } func (x *VolumeConfigureResponse) GetError() string { @@ -1510,6 +1595,100 @@ func (x *VolumeConfigureResponse) GetError() string { return "" } +type VolumeStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` +} + +func (x *VolumeStatusRequest) Reset() { + *x = VolumeStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_volume_server_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VolumeStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VolumeStatusRequest) ProtoMessage() {} + +func (x *VolumeStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_volume_server_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VolumeStatusRequest.ProtoReflect.Descriptor instead. +func (*VolumeStatusRequest) Descriptor() ([]byte, []int) { + return file_volume_server_proto_rawDescGZIP(), []int{32} +} + +func (x *VolumeStatusRequest) GetVolumeId() uint32 { + if x != nil { + return x.VolumeId + } + return 0 +} + +type VolumeStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsReadOnly bool `protobuf:"varint,1,opt,name=is_read_only,json=isReadOnly,proto3" json:"is_read_only,omitempty"` +} + +func (x *VolumeStatusResponse) Reset() { + *x = VolumeStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_volume_server_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VolumeStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VolumeStatusResponse) ProtoMessage() {} + +func (x *VolumeStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_volume_server_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VolumeStatusResponse.ProtoReflect.Descriptor instead. +func (*VolumeStatusResponse) Descriptor() ([]byte, []int) { + return file_volume_server_proto_rawDescGZIP(), []int{33} +} + +func (x *VolumeStatusResponse) GetIsReadOnly() bool { + if x != nil { + return x.IsReadOnly + } + return false +} + type VolumeCopyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1525,7 +1704,7 @@ type VolumeCopyRequest struct { func (x *VolumeCopyRequest) Reset() { *x = VolumeCopyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[30] + mi := &file_volume_server_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1538,7 +1717,7 @@ func (x *VolumeCopyRequest) String() string { func (*VolumeCopyRequest) ProtoMessage() {} func (x *VolumeCopyRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[30] + mi := &file_volume_server_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1551,7 +1730,7 @@ func (x *VolumeCopyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeCopyRequest.ProtoReflect.Descriptor instead. func (*VolumeCopyRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{30} + return file_volume_server_proto_rawDescGZIP(), []int{34} } func (x *VolumeCopyRequest) GetVolumeId() uint32 { @@ -1600,7 +1779,7 @@ type VolumeCopyResponse struct { func (x *VolumeCopyResponse) Reset() { *x = VolumeCopyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[31] + mi := &file_volume_server_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1613,7 +1792,7 @@ func (x *VolumeCopyResponse) String() string { func (*VolumeCopyResponse) ProtoMessage() {} func (x *VolumeCopyResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[31] + mi := &file_volume_server_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1626,7 +1805,7 @@ func (x *VolumeCopyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeCopyResponse.ProtoReflect.Descriptor instead. func (*VolumeCopyResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{31} + return file_volume_server_proto_rawDescGZIP(), []int{35} } func (x *VolumeCopyResponse) GetLastAppendAtNs() uint64 { @@ -1653,7 +1832,7 @@ type CopyFileRequest struct { func (x *CopyFileRequest) Reset() { *x = CopyFileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[32] + mi := &file_volume_server_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1666,7 +1845,7 @@ func (x *CopyFileRequest) String() string { func (*CopyFileRequest) ProtoMessage() {} func (x *CopyFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[32] + mi := &file_volume_server_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1679,7 +1858,7 @@ func (x *CopyFileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CopyFileRequest.ProtoReflect.Descriptor instead. func (*CopyFileRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{32} + return file_volume_server_proto_rawDescGZIP(), []int{36} } func (x *CopyFileRequest) GetVolumeId() uint32 { @@ -1742,7 +1921,7 @@ type CopyFileResponse struct { func (x *CopyFileResponse) Reset() { *x = CopyFileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[33] + mi := &file_volume_server_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1755,7 +1934,7 @@ func (x *CopyFileResponse) String() string { func (*CopyFileResponse) ProtoMessage() {} func (x *CopyFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[33] + mi := &file_volume_server_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1768,7 +1947,7 @@ func (x *CopyFileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CopyFileResponse.ProtoReflect.Descriptor instead. func (*CopyFileResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{33} + return file_volume_server_proto_rawDescGZIP(), []int{37} } func (x *CopyFileResponse) GetFileContent() []byte { @@ -1791,7 +1970,7 @@ type VolumeTailSenderRequest struct { func (x *VolumeTailSenderRequest) Reset() { *x = VolumeTailSenderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[34] + mi := &file_volume_server_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1804,7 +1983,7 @@ func (x *VolumeTailSenderRequest) String() string { func (*VolumeTailSenderRequest) ProtoMessage() {} func (x *VolumeTailSenderRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[34] + mi := &file_volume_server_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1817,7 +1996,7 @@ func (x *VolumeTailSenderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeTailSenderRequest.ProtoReflect.Descriptor instead. func (*VolumeTailSenderRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{34} + return file_volume_server_proto_rawDescGZIP(), []int{38} } func (x *VolumeTailSenderRequest) GetVolumeId() uint32 { @@ -1854,7 +2033,7 @@ type VolumeTailSenderResponse struct { func (x *VolumeTailSenderResponse) Reset() { *x = VolumeTailSenderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[35] + mi := &file_volume_server_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1867,7 +2046,7 @@ func (x *VolumeTailSenderResponse) String() string { func (*VolumeTailSenderResponse) ProtoMessage() {} func (x *VolumeTailSenderResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[35] + mi := &file_volume_server_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1880,7 +2059,7 @@ func (x *VolumeTailSenderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeTailSenderResponse.ProtoReflect.Descriptor instead. func (*VolumeTailSenderResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{35} + return file_volume_server_proto_rawDescGZIP(), []int{39} } func (x *VolumeTailSenderResponse) GetNeedleHeader() []byte { @@ -1918,7 +2097,7 @@ type VolumeTailReceiverRequest struct { func (x *VolumeTailReceiverRequest) Reset() { *x = VolumeTailReceiverRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[36] + mi := &file_volume_server_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1931,7 +2110,7 @@ func (x *VolumeTailReceiverRequest) String() string { func (*VolumeTailReceiverRequest) ProtoMessage() {} func (x *VolumeTailReceiverRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[36] + mi := &file_volume_server_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1944,7 +2123,7 @@ func (x *VolumeTailReceiverRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeTailReceiverRequest.ProtoReflect.Descriptor instead. func (*VolumeTailReceiverRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{36} + return file_volume_server_proto_rawDescGZIP(), []int{40} } func (x *VolumeTailReceiverRequest) GetVolumeId() uint32 { @@ -1984,7 +2163,7 @@ type VolumeTailReceiverResponse struct { func (x *VolumeTailReceiverResponse) Reset() { *x = VolumeTailReceiverResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[37] + mi := &file_volume_server_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1997,7 +2176,7 @@ func (x *VolumeTailReceiverResponse) String() string { func (*VolumeTailReceiverResponse) ProtoMessage() {} func (x *VolumeTailReceiverResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[37] + mi := &file_volume_server_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2010,7 +2189,7 @@ func (x *VolumeTailReceiverResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeTailReceiverResponse.ProtoReflect.Descriptor instead. func (*VolumeTailReceiverResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{37} + return file_volume_server_proto_rawDescGZIP(), []int{41} } type VolumeEcShardsGenerateRequest struct { @@ -2025,7 +2204,7 @@ type VolumeEcShardsGenerateRequest struct { func (x *VolumeEcShardsGenerateRequest) Reset() { *x = VolumeEcShardsGenerateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[38] + mi := &file_volume_server_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2038,7 +2217,7 @@ func (x *VolumeEcShardsGenerateRequest) String() string { func (*VolumeEcShardsGenerateRequest) ProtoMessage() {} func (x *VolumeEcShardsGenerateRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[38] + mi := &file_volume_server_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2051,7 +2230,7 @@ func (x *VolumeEcShardsGenerateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsGenerateRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsGenerateRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{38} + return file_volume_server_proto_rawDescGZIP(), []int{42} } func (x *VolumeEcShardsGenerateRequest) GetVolumeId() uint32 { @@ -2077,7 +2256,7 @@ type VolumeEcShardsGenerateResponse struct { func (x *VolumeEcShardsGenerateResponse) Reset() { *x = VolumeEcShardsGenerateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[39] + mi := &file_volume_server_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2090,7 +2269,7 @@ func (x *VolumeEcShardsGenerateResponse) String() string { func (*VolumeEcShardsGenerateResponse) ProtoMessage() {} func (x *VolumeEcShardsGenerateResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[39] + mi := &file_volume_server_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2103,7 +2282,7 @@ func (x *VolumeEcShardsGenerateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsGenerateResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsGenerateResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{39} + return file_volume_server_proto_rawDescGZIP(), []int{43} } type VolumeEcShardsRebuildRequest struct { @@ -2118,7 +2297,7 @@ type VolumeEcShardsRebuildRequest struct { func (x *VolumeEcShardsRebuildRequest) Reset() { *x = VolumeEcShardsRebuildRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[40] + mi := &file_volume_server_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2131,7 +2310,7 @@ func (x *VolumeEcShardsRebuildRequest) String() string { func (*VolumeEcShardsRebuildRequest) ProtoMessage() {} func (x *VolumeEcShardsRebuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[40] + mi := &file_volume_server_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2144,7 +2323,7 @@ func (x *VolumeEcShardsRebuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsRebuildRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsRebuildRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{40} + return file_volume_server_proto_rawDescGZIP(), []int{44} } func (x *VolumeEcShardsRebuildRequest) GetVolumeId() uint32 { @@ -2172,7 +2351,7 @@ type VolumeEcShardsRebuildResponse struct { func (x *VolumeEcShardsRebuildResponse) Reset() { *x = VolumeEcShardsRebuildResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[41] + mi := &file_volume_server_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2185,7 +2364,7 @@ func (x *VolumeEcShardsRebuildResponse) String() string { func (*VolumeEcShardsRebuildResponse) ProtoMessage() {} func (x *VolumeEcShardsRebuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[41] + mi := &file_volume_server_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2198,7 +2377,7 @@ func (x *VolumeEcShardsRebuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsRebuildResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsRebuildResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{41} + return file_volume_server_proto_rawDescGZIP(), []int{45} } func (x *VolumeEcShardsRebuildResponse) GetRebuiltShardIds() []uint32 { @@ -2225,7 +2404,7 @@ type VolumeEcShardsCopyRequest struct { func (x *VolumeEcShardsCopyRequest) Reset() { *x = VolumeEcShardsCopyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[42] + mi := &file_volume_server_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2238,7 +2417,7 @@ func (x *VolumeEcShardsCopyRequest) String() string { func (*VolumeEcShardsCopyRequest) ProtoMessage() {} func (x *VolumeEcShardsCopyRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[42] + mi := &file_volume_server_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2251,7 +2430,7 @@ func (x *VolumeEcShardsCopyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsCopyRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsCopyRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{42} + return file_volume_server_proto_rawDescGZIP(), []int{46} } func (x *VolumeEcShardsCopyRequest) GetVolumeId() uint32 { @@ -2312,7 +2491,7 @@ type VolumeEcShardsCopyResponse struct { func (x *VolumeEcShardsCopyResponse) Reset() { *x = VolumeEcShardsCopyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[43] + mi := &file_volume_server_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2325,7 +2504,7 @@ func (x *VolumeEcShardsCopyResponse) String() string { func (*VolumeEcShardsCopyResponse) ProtoMessage() {} func (x *VolumeEcShardsCopyResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[43] + mi := &file_volume_server_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2338,7 +2517,7 @@ func (x *VolumeEcShardsCopyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsCopyResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsCopyResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{43} + return file_volume_server_proto_rawDescGZIP(), []int{47} } type VolumeEcShardsDeleteRequest struct { @@ -2354,7 +2533,7 @@ type VolumeEcShardsDeleteRequest struct { func (x *VolumeEcShardsDeleteRequest) Reset() { *x = VolumeEcShardsDeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[44] + mi := &file_volume_server_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2367,7 +2546,7 @@ func (x *VolumeEcShardsDeleteRequest) String() string { func (*VolumeEcShardsDeleteRequest) ProtoMessage() {} func (x *VolumeEcShardsDeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[44] + mi := &file_volume_server_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2380,7 +2559,7 @@ func (x *VolumeEcShardsDeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsDeleteRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsDeleteRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{44} + return file_volume_server_proto_rawDescGZIP(), []int{48} } func (x *VolumeEcShardsDeleteRequest) GetVolumeId() uint32 { @@ -2413,7 +2592,7 @@ type VolumeEcShardsDeleteResponse struct { func (x *VolumeEcShardsDeleteResponse) Reset() { *x = VolumeEcShardsDeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[45] + mi := &file_volume_server_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2426,7 +2605,7 @@ func (x *VolumeEcShardsDeleteResponse) String() string { func (*VolumeEcShardsDeleteResponse) ProtoMessage() {} func (x *VolumeEcShardsDeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[45] + mi := &file_volume_server_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2439,7 +2618,7 @@ func (x *VolumeEcShardsDeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsDeleteResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsDeleteResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{45} + return file_volume_server_proto_rawDescGZIP(), []int{49} } type VolumeEcShardsMountRequest struct { @@ -2455,7 +2634,7 @@ type VolumeEcShardsMountRequest struct { func (x *VolumeEcShardsMountRequest) Reset() { *x = VolumeEcShardsMountRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[46] + mi := &file_volume_server_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2468,7 +2647,7 @@ func (x *VolumeEcShardsMountRequest) String() string { func (*VolumeEcShardsMountRequest) ProtoMessage() {} func (x *VolumeEcShardsMountRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[46] + mi := &file_volume_server_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2481,7 +2660,7 @@ func (x *VolumeEcShardsMountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsMountRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsMountRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{46} + return file_volume_server_proto_rawDescGZIP(), []int{50} } func (x *VolumeEcShardsMountRequest) GetVolumeId() uint32 { @@ -2514,7 +2693,7 @@ type VolumeEcShardsMountResponse struct { func (x *VolumeEcShardsMountResponse) Reset() { *x = VolumeEcShardsMountResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[47] + mi := &file_volume_server_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2527,7 +2706,7 @@ func (x *VolumeEcShardsMountResponse) String() string { func (*VolumeEcShardsMountResponse) ProtoMessage() {} func (x *VolumeEcShardsMountResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[47] + mi := &file_volume_server_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2540,7 +2719,7 @@ func (x *VolumeEcShardsMountResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsMountResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsMountResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{47} + return file_volume_server_proto_rawDescGZIP(), []int{51} } type VolumeEcShardsUnmountRequest struct { @@ -2555,7 +2734,7 @@ type VolumeEcShardsUnmountRequest struct { func (x *VolumeEcShardsUnmountRequest) Reset() { *x = VolumeEcShardsUnmountRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[48] + mi := &file_volume_server_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2568,7 +2747,7 @@ func (x *VolumeEcShardsUnmountRequest) String() string { func (*VolumeEcShardsUnmountRequest) ProtoMessage() {} func (x *VolumeEcShardsUnmountRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[48] + mi := &file_volume_server_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2581,7 +2760,7 @@ func (x *VolumeEcShardsUnmountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsUnmountRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsUnmountRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{48} + return file_volume_server_proto_rawDescGZIP(), []int{52} } func (x *VolumeEcShardsUnmountRequest) GetVolumeId() uint32 { @@ -2607,7 +2786,7 @@ type VolumeEcShardsUnmountResponse struct { func (x *VolumeEcShardsUnmountResponse) Reset() { *x = VolumeEcShardsUnmountResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[49] + mi := &file_volume_server_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2620,7 +2799,7 @@ func (x *VolumeEcShardsUnmountResponse) String() string { func (*VolumeEcShardsUnmountResponse) ProtoMessage() {} func (x *VolumeEcShardsUnmountResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[49] + mi := &file_volume_server_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2633,7 +2812,7 @@ func (x *VolumeEcShardsUnmountResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsUnmountResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsUnmountResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{49} + return file_volume_server_proto_rawDescGZIP(), []int{53} } type VolumeEcShardReadRequest struct { @@ -2651,7 +2830,7 @@ type VolumeEcShardReadRequest struct { func (x *VolumeEcShardReadRequest) Reset() { *x = VolumeEcShardReadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[50] + mi := &file_volume_server_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2664,7 +2843,7 @@ func (x *VolumeEcShardReadRequest) String() string { func (*VolumeEcShardReadRequest) ProtoMessage() {} func (x *VolumeEcShardReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[50] + mi := &file_volume_server_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2677,7 +2856,7 @@ func (x *VolumeEcShardReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardReadRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardReadRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{50} + return file_volume_server_proto_rawDescGZIP(), []int{54} } func (x *VolumeEcShardReadRequest) GetVolumeId() uint32 { @@ -2727,7 +2906,7 @@ type VolumeEcShardReadResponse struct { func (x *VolumeEcShardReadResponse) Reset() { *x = VolumeEcShardReadResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[51] + mi := &file_volume_server_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2740,7 +2919,7 @@ func (x *VolumeEcShardReadResponse) String() string { func (*VolumeEcShardReadResponse) ProtoMessage() {} func (x *VolumeEcShardReadResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[51] + mi := &file_volume_server_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2753,7 +2932,7 @@ func (x *VolumeEcShardReadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardReadResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardReadResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{51} + return file_volume_server_proto_rawDescGZIP(), []int{55} } func (x *VolumeEcShardReadResponse) GetData() []byte { @@ -2784,7 +2963,7 @@ type VolumeEcBlobDeleteRequest struct { func (x *VolumeEcBlobDeleteRequest) Reset() { *x = VolumeEcBlobDeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[52] + mi := &file_volume_server_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2797,7 +2976,7 @@ func (x *VolumeEcBlobDeleteRequest) String() string { func (*VolumeEcBlobDeleteRequest) ProtoMessage() {} func (x *VolumeEcBlobDeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[52] + mi := &file_volume_server_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2810,7 +2989,7 @@ func (x *VolumeEcBlobDeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcBlobDeleteRequest.ProtoReflect.Descriptor instead. func (*VolumeEcBlobDeleteRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{52} + return file_volume_server_proto_rawDescGZIP(), []int{56} } func (x *VolumeEcBlobDeleteRequest) GetVolumeId() uint32 { @@ -2850,7 +3029,7 @@ type VolumeEcBlobDeleteResponse struct { func (x *VolumeEcBlobDeleteResponse) Reset() { *x = VolumeEcBlobDeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[53] + mi := &file_volume_server_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2863,7 +3042,7 @@ func (x *VolumeEcBlobDeleteResponse) String() string { func (*VolumeEcBlobDeleteResponse) ProtoMessage() {} func (x *VolumeEcBlobDeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[53] + mi := &file_volume_server_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2876,7 +3055,7 @@ func (x *VolumeEcBlobDeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcBlobDeleteResponse.ProtoReflect.Descriptor instead. func (*VolumeEcBlobDeleteResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{53} + return file_volume_server_proto_rawDescGZIP(), []int{57} } type VolumeEcShardsToVolumeRequest struct { @@ -2891,7 +3070,7 @@ type VolumeEcShardsToVolumeRequest struct { func (x *VolumeEcShardsToVolumeRequest) Reset() { *x = VolumeEcShardsToVolumeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[54] + mi := &file_volume_server_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2904,7 +3083,7 @@ func (x *VolumeEcShardsToVolumeRequest) String() string { func (*VolumeEcShardsToVolumeRequest) ProtoMessage() {} func (x *VolumeEcShardsToVolumeRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[54] + mi := &file_volume_server_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2917,7 +3096,7 @@ func (x *VolumeEcShardsToVolumeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsToVolumeRequest.ProtoReflect.Descriptor instead. func (*VolumeEcShardsToVolumeRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{54} + return file_volume_server_proto_rawDescGZIP(), []int{58} } func (x *VolumeEcShardsToVolumeRequest) GetVolumeId() uint32 { @@ -2943,7 +3122,7 @@ type VolumeEcShardsToVolumeResponse struct { func (x *VolumeEcShardsToVolumeResponse) Reset() { *x = VolumeEcShardsToVolumeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[55] + mi := &file_volume_server_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2956,7 +3135,7 @@ func (x *VolumeEcShardsToVolumeResponse) String() string { func (*VolumeEcShardsToVolumeResponse) ProtoMessage() {} func (x *VolumeEcShardsToVolumeResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[55] + mi := &file_volume_server_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2969,7 +3148,7 @@ func (x *VolumeEcShardsToVolumeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeEcShardsToVolumeResponse.ProtoReflect.Descriptor instead. func (*VolumeEcShardsToVolumeResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{55} + return file_volume_server_proto_rawDescGZIP(), []int{59} } type ReadVolumeFileStatusRequest struct { @@ -2983,7 +3162,7 @@ type ReadVolumeFileStatusRequest struct { func (x *ReadVolumeFileStatusRequest) Reset() { *x = ReadVolumeFileStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[56] + mi := &file_volume_server_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2996,7 +3175,7 @@ func (x *ReadVolumeFileStatusRequest) String() string { func (*ReadVolumeFileStatusRequest) ProtoMessage() {} func (x *ReadVolumeFileStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[56] + mi := &file_volume_server_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3009,7 +3188,7 @@ func (x *ReadVolumeFileStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVolumeFileStatusRequest.ProtoReflect.Descriptor instead. func (*ReadVolumeFileStatusRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{56} + return file_volume_server_proto_rawDescGZIP(), []int{60} } func (x *ReadVolumeFileStatusRequest) GetVolumeId() uint32 { @@ -3037,7 +3216,7 @@ type ReadVolumeFileStatusResponse struct { func (x *ReadVolumeFileStatusResponse) Reset() { *x = ReadVolumeFileStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[57] + mi := &file_volume_server_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3050,7 +3229,7 @@ func (x *ReadVolumeFileStatusResponse) String() string { func (*ReadVolumeFileStatusResponse) ProtoMessage() {} func (x *ReadVolumeFileStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[57] + mi := &file_volume_server_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3063,7 +3242,7 @@ func (x *ReadVolumeFileStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVolumeFileStatusResponse.ProtoReflect.Descriptor instead. func (*ReadVolumeFileStatusResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{57} + return file_volume_server_proto_rawDescGZIP(), []int{61} } func (x *ReadVolumeFileStatusResponse) GetVolumeId() uint32 { @@ -3138,7 +3317,7 @@ type DiskStatus struct { func (x *DiskStatus) Reset() { *x = DiskStatus{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[58] + mi := &file_volume_server_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3151,7 +3330,7 @@ func (x *DiskStatus) String() string { func (*DiskStatus) ProtoMessage() {} func (x *DiskStatus) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[58] + mi := &file_volume_server_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3164,7 +3343,7 @@ func (x *DiskStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use DiskStatus.ProtoReflect.Descriptor instead. func (*DiskStatus) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{58} + return file_volume_server_proto_rawDescGZIP(), []int{62} } func (x *DiskStatus) GetDir() string { @@ -3226,7 +3405,7 @@ type MemStatus struct { func (x *MemStatus) Reset() { *x = MemStatus{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[59] + mi := &file_volume_server_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3239,7 +3418,7 @@ func (x *MemStatus) String() string { func (*MemStatus) ProtoMessage() {} func (x *MemStatus) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[59] + mi := &file_volume_server_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3252,7 +3431,7 @@ func (x *MemStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use MemStatus.ProtoReflect.Descriptor instead. func (*MemStatus) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{59} + return file_volume_server_proto_rawDescGZIP(), []int{63} } func (x *MemStatus) GetGoroutines() int32 { @@ -3322,7 +3501,7 @@ type RemoteFile struct { func (x *RemoteFile) Reset() { *x = RemoteFile{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[60] + mi := &file_volume_server_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3335,7 +3514,7 @@ func (x *RemoteFile) String() string { func (*RemoteFile) ProtoMessage() {} func (x *RemoteFile) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[60] + mi := &file_volume_server_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3348,7 +3527,7 @@ func (x *RemoteFile) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoteFile.ProtoReflect.Descriptor instead. func (*RemoteFile) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{60} + return file_volume_server_proto_rawDescGZIP(), []int{64} } func (x *RemoteFile) GetBackendType() string { @@ -3413,7 +3592,7 @@ type VolumeInfo struct { func (x *VolumeInfo) Reset() { *x = VolumeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[61] + mi := &file_volume_server_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3426,7 +3605,7 @@ func (x *VolumeInfo) String() string { func (*VolumeInfo) ProtoMessage() {} func (x *VolumeInfo) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[61] + mi := &file_volume_server_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3439,7 +3618,7 @@ func (x *VolumeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeInfo.ProtoReflect.Descriptor instead. func (*VolumeInfo) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{61} + return file_volume_server_proto_rawDescGZIP(), []int{65} } func (x *VolumeInfo) GetFiles() []*RemoteFile { @@ -3477,7 +3656,7 @@ type VolumeTierMoveDatToRemoteRequest struct { func (x *VolumeTierMoveDatToRemoteRequest) Reset() { *x = VolumeTierMoveDatToRemoteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[62] + mi := &file_volume_server_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3490,7 +3669,7 @@ func (x *VolumeTierMoveDatToRemoteRequest) String() string { func (*VolumeTierMoveDatToRemoteRequest) ProtoMessage() {} func (x *VolumeTierMoveDatToRemoteRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[62] + mi := &file_volume_server_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3503,7 +3682,7 @@ func (x *VolumeTierMoveDatToRemoteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeTierMoveDatToRemoteRequest.ProtoReflect.Descriptor instead. func (*VolumeTierMoveDatToRemoteRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{62} + return file_volume_server_proto_rawDescGZIP(), []int{66} } func (x *VolumeTierMoveDatToRemoteRequest) GetVolumeId() uint32 { @@ -3546,7 +3725,7 @@ type VolumeTierMoveDatToRemoteResponse struct { func (x *VolumeTierMoveDatToRemoteResponse) Reset() { *x = VolumeTierMoveDatToRemoteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[63] + mi := &file_volume_server_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3559,7 +3738,7 @@ func (x *VolumeTierMoveDatToRemoteResponse) String() string { func (*VolumeTierMoveDatToRemoteResponse) ProtoMessage() {} func (x *VolumeTierMoveDatToRemoteResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[63] + mi := &file_volume_server_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3572,7 +3751,7 @@ func (x *VolumeTierMoveDatToRemoteResponse) ProtoReflect() protoreflect.Message // Deprecated: Use VolumeTierMoveDatToRemoteResponse.ProtoReflect.Descriptor instead. func (*VolumeTierMoveDatToRemoteResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{63} + return file_volume_server_proto_rawDescGZIP(), []int{67} } func (x *VolumeTierMoveDatToRemoteResponse) GetProcessed() int64 { @@ -3602,7 +3781,7 @@ type VolumeTierMoveDatFromRemoteRequest struct { func (x *VolumeTierMoveDatFromRemoteRequest) Reset() { *x = VolumeTierMoveDatFromRemoteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[64] + mi := &file_volume_server_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3615,7 +3794,7 @@ func (x *VolumeTierMoveDatFromRemoteRequest) String() string { func (*VolumeTierMoveDatFromRemoteRequest) ProtoMessage() {} func (x *VolumeTierMoveDatFromRemoteRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[64] + mi := &file_volume_server_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3628,7 +3807,7 @@ func (x *VolumeTierMoveDatFromRemoteRequest) ProtoReflect() protoreflect.Message // Deprecated: Use VolumeTierMoveDatFromRemoteRequest.ProtoReflect.Descriptor instead. func (*VolumeTierMoveDatFromRemoteRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{64} + return file_volume_server_proto_rawDescGZIP(), []int{68} } func (x *VolumeTierMoveDatFromRemoteRequest) GetVolumeId() uint32 { @@ -3664,7 +3843,7 @@ type VolumeTierMoveDatFromRemoteResponse struct { func (x *VolumeTierMoveDatFromRemoteResponse) Reset() { *x = VolumeTierMoveDatFromRemoteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[65] + mi := &file_volume_server_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3677,7 +3856,7 @@ func (x *VolumeTierMoveDatFromRemoteResponse) String() string { func (*VolumeTierMoveDatFromRemoteResponse) ProtoMessage() {} func (x *VolumeTierMoveDatFromRemoteResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[65] + mi := &file_volume_server_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3690,7 +3869,7 @@ func (x *VolumeTierMoveDatFromRemoteResponse) ProtoReflect() protoreflect.Messag // Deprecated: Use VolumeTierMoveDatFromRemoteResponse.ProtoReflect.Descriptor instead. func (*VolumeTierMoveDatFromRemoteResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{65} + return file_volume_server_proto_rawDescGZIP(), []int{69} } func (x *VolumeTierMoveDatFromRemoteResponse) GetProcessed() int64 { @@ -3716,7 +3895,7 @@ type VolumeServerStatusRequest struct { func (x *VolumeServerStatusRequest) Reset() { *x = VolumeServerStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[66] + mi := &file_volume_server_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3729,7 +3908,7 @@ func (x *VolumeServerStatusRequest) String() string { func (*VolumeServerStatusRequest) ProtoMessage() {} func (x *VolumeServerStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[66] + mi := &file_volume_server_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3742,7 +3921,7 @@ func (x *VolumeServerStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeServerStatusRequest.ProtoReflect.Descriptor instead. func (*VolumeServerStatusRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{66} + return file_volume_server_proto_rawDescGZIP(), []int{70} } type VolumeServerStatusResponse struct { @@ -3757,7 +3936,7 @@ type VolumeServerStatusResponse struct { func (x *VolumeServerStatusResponse) Reset() { *x = VolumeServerStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[67] + mi := &file_volume_server_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3770,7 +3949,7 @@ func (x *VolumeServerStatusResponse) String() string { func (*VolumeServerStatusResponse) ProtoMessage() {} func (x *VolumeServerStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[67] + mi := &file_volume_server_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3783,7 +3962,7 @@ func (x *VolumeServerStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeServerStatusResponse.ProtoReflect.Descriptor instead. func (*VolumeServerStatusResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{67} + return file_volume_server_proto_rawDescGZIP(), []int{71} } func (x *VolumeServerStatusResponse) GetDiskStatuses() []*DiskStatus { @@ -3816,7 +3995,7 @@ type QueryRequest struct { func (x *QueryRequest) Reset() { *x = QueryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[68] + mi := &file_volume_server_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3829,7 +4008,7 @@ func (x *QueryRequest) String() string { func (*QueryRequest) ProtoMessage() {} func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[68] + mi := &file_volume_server_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3842,7 +4021,7 @@ func (x *QueryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68} + return file_volume_server_proto_rawDescGZIP(), []int{72} } func (x *QueryRequest) GetSelections() []string { @@ -3891,7 +4070,7 @@ type QueriedStripe struct { func (x *QueriedStripe) Reset() { *x = QueriedStripe{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[69] + mi := &file_volume_server_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3904,7 +4083,7 @@ func (x *QueriedStripe) String() string { func (*QueriedStripe) ProtoMessage() {} func (x *QueriedStripe) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[69] + mi := &file_volume_server_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3917,7 +4096,7 @@ func (x *QueriedStripe) ProtoReflect() protoreflect.Message { // Deprecated: Use QueriedStripe.ProtoReflect.Descriptor instead. func (*QueriedStripe) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{69} + return file_volume_server_proto_rawDescGZIP(), []int{73} } func (x *QueriedStripe) GetRecords() []byte { @@ -3939,7 +4118,7 @@ type VolumeNeedleStatusRequest struct { func (x *VolumeNeedleStatusRequest) Reset() { *x = VolumeNeedleStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[70] + mi := &file_volume_server_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3952,7 +4131,7 @@ func (x *VolumeNeedleStatusRequest) String() string { func (*VolumeNeedleStatusRequest) ProtoMessage() {} func (x *VolumeNeedleStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[70] + mi := &file_volume_server_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3965,7 +4144,7 @@ func (x *VolumeNeedleStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeNeedleStatusRequest.ProtoReflect.Descriptor instead. func (*VolumeNeedleStatusRequest) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{70} + return file_volume_server_proto_rawDescGZIP(), []int{74} } func (x *VolumeNeedleStatusRequest) GetVolumeId() uint32 { @@ -3998,7 +4177,7 @@ type VolumeNeedleStatusResponse struct { func (x *VolumeNeedleStatusResponse) Reset() { *x = VolumeNeedleStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[71] + mi := &file_volume_server_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4011,7 +4190,7 @@ func (x *VolumeNeedleStatusResponse) String() string { func (*VolumeNeedleStatusResponse) ProtoMessage() {} func (x *VolumeNeedleStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[71] + mi := &file_volume_server_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4024,7 +4203,7 @@ func (x *VolumeNeedleStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumeNeedleStatusResponse.ProtoReflect.Descriptor instead. func (*VolumeNeedleStatusResponse) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{71} + return file_volume_server_proto_rawDescGZIP(), []int{75} } func (x *VolumeNeedleStatusResponse) GetNeedleId() uint64 { @@ -4082,7 +4261,7 @@ type QueryRequest_Filter struct { func (x *QueryRequest_Filter) Reset() { *x = QueryRequest_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[72] + mi := &file_volume_server_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4095,7 +4274,7 @@ func (x *QueryRequest_Filter) String() string { func (*QueryRequest_Filter) ProtoMessage() {} func (x *QueryRequest_Filter) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[72] + mi := &file_volume_server_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4108,7 +4287,7 @@ func (x *QueryRequest_Filter) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryRequest_Filter.ProtoReflect.Descriptor instead. func (*QueryRequest_Filter) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 0} + return file_volume_server_proto_rawDescGZIP(), []int{72, 0} } func (x *QueryRequest_Filter) GetField() string { @@ -4147,7 +4326,7 @@ type QueryRequest_InputSerialization struct { func (x *QueryRequest_InputSerialization) Reset() { *x = QueryRequest_InputSerialization{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[73] + mi := &file_volume_server_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4160,7 +4339,7 @@ func (x *QueryRequest_InputSerialization) String() string { func (*QueryRequest_InputSerialization) ProtoMessage() {} func (x *QueryRequest_InputSerialization) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[73] + mi := &file_volume_server_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4173,7 +4352,7 @@ func (x *QueryRequest_InputSerialization) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryRequest_InputSerialization.ProtoReflect.Descriptor instead. func (*QueryRequest_InputSerialization) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 1} + return file_volume_server_proto_rawDescGZIP(), []int{72, 1} } func (x *QueryRequest_InputSerialization) GetCompressionType() string { @@ -4216,7 +4395,7 @@ type QueryRequest_OutputSerialization struct { func (x *QueryRequest_OutputSerialization) Reset() { *x = QueryRequest_OutputSerialization{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[74] + mi := &file_volume_server_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4229,7 +4408,7 @@ func (x *QueryRequest_OutputSerialization) String() string { func (*QueryRequest_OutputSerialization) ProtoMessage() {} func (x *QueryRequest_OutputSerialization) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[74] + mi := &file_volume_server_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4242,7 +4421,7 @@ func (x *QueryRequest_OutputSerialization) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryRequest_OutputSerialization.ProtoReflect.Descriptor instead. func (*QueryRequest_OutputSerialization) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 2} + return file_volume_server_proto_rawDescGZIP(), []int{72, 2} } func (x *QueryRequest_OutputSerialization) GetCsvOutput() *QueryRequest_OutputSerialization_CSVOutput { @@ -4277,7 +4456,7 @@ type QueryRequest_InputSerialization_CSVInput struct { func (x *QueryRequest_InputSerialization_CSVInput) Reset() { *x = QueryRequest_InputSerialization_CSVInput{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[75] + mi := &file_volume_server_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4290,7 +4469,7 @@ func (x *QueryRequest_InputSerialization_CSVInput) String() string { func (*QueryRequest_InputSerialization_CSVInput) ProtoMessage() {} func (x *QueryRequest_InputSerialization_CSVInput) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[75] + mi := &file_volume_server_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4303,7 +4482,7 @@ func (x *QueryRequest_InputSerialization_CSVInput) ProtoReflect() protoreflect.M // Deprecated: Use QueryRequest_InputSerialization_CSVInput.ProtoReflect.Descriptor instead. func (*QueryRequest_InputSerialization_CSVInput) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 1, 0} + return file_volume_server_proto_rawDescGZIP(), []int{72, 1, 0} } func (x *QueryRequest_InputSerialization_CSVInput) GetFileHeaderInfo() string { @@ -4366,7 +4545,7 @@ type QueryRequest_InputSerialization_JSONInput struct { func (x *QueryRequest_InputSerialization_JSONInput) Reset() { *x = QueryRequest_InputSerialization_JSONInput{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[76] + mi := &file_volume_server_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4379,7 +4558,7 @@ func (x *QueryRequest_InputSerialization_JSONInput) String() string { func (*QueryRequest_InputSerialization_JSONInput) ProtoMessage() {} func (x *QueryRequest_InputSerialization_JSONInput) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[76] + mi := &file_volume_server_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4392,7 +4571,7 @@ func (x *QueryRequest_InputSerialization_JSONInput) ProtoReflect() protoreflect. // Deprecated: Use QueryRequest_InputSerialization_JSONInput.ProtoReflect.Descriptor instead. func (*QueryRequest_InputSerialization_JSONInput) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 1, 1} + return file_volume_server_proto_rawDescGZIP(), []int{72, 1, 1} } func (x *QueryRequest_InputSerialization_JSONInput) GetType() string { @@ -4411,7 +4590,7 @@ type QueryRequest_InputSerialization_ParquetInput struct { func (x *QueryRequest_InputSerialization_ParquetInput) Reset() { *x = QueryRequest_InputSerialization_ParquetInput{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[77] + mi := &file_volume_server_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4424,7 +4603,7 @@ func (x *QueryRequest_InputSerialization_ParquetInput) String() string { func (*QueryRequest_InputSerialization_ParquetInput) ProtoMessage() {} func (x *QueryRequest_InputSerialization_ParquetInput) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[77] + mi := &file_volume_server_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4437,7 +4616,7 @@ func (x *QueryRequest_InputSerialization_ParquetInput) ProtoReflect() protorefle // Deprecated: Use QueryRequest_InputSerialization_ParquetInput.ProtoReflect.Descriptor instead. func (*QueryRequest_InputSerialization_ParquetInput) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 1, 2} + return file_volume_server_proto_rawDescGZIP(), []int{72, 1, 2} } type QueryRequest_OutputSerialization_CSVOutput struct { @@ -4455,7 +4634,7 @@ type QueryRequest_OutputSerialization_CSVOutput struct { func (x *QueryRequest_OutputSerialization_CSVOutput) Reset() { *x = QueryRequest_OutputSerialization_CSVOutput{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[78] + mi := &file_volume_server_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4468,7 +4647,7 @@ func (x *QueryRequest_OutputSerialization_CSVOutput) String() string { func (*QueryRequest_OutputSerialization_CSVOutput) ProtoMessage() {} func (x *QueryRequest_OutputSerialization_CSVOutput) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[78] + mi := &file_volume_server_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4481,7 +4660,7 @@ func (x *QueryRequest_OutputSerialization_CSVOutput) ProtoReflect() protoreflect // Deprecated: Use QueryRequest_OutputSerialization_CSVOutput.ProtoReflect.Descriptor instead. func (*QueryRequest_OutputSerialization_CSVOutput) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 2, 0} + return file_volume_server_proto_rawDescGZIP(), []int{72, 2, 0} } func (x *QueryRequest_OutputSerialization_CSVOutput) GetQuoteFields() string { @@ -4530,7 +4709,7 @@ type QueryRequest_OutputSerialization_JSONOutput struct { func (x *QueryRequest_OutputSerialization_JSONOutput) Reset() { *x = QueryRequest_OutputSerialization_JSONOutput{} if protoimpl.UnsafeEnabled { - mi := &file_volume_server_proto_msgTypes[79] + mi := &file_volume_server_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4543,7 +4722,7 @@ func (x *QueryRequest_OutputSerialization_JSONOutput) String() string { func (*QueryRequest_OutputSerialization_JSONOutput) ProtoMessage() {} func (x *QueryRequest_OutputSerialization_JSONOutput) ProtoReflect() protoreflect.Message { - mi := &file_volume_server_proto_msgTypes[79] + mi := &file_volume_server_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4556,7 +4735,7 @@ func (x *QueryRequest_OutputSerialization_JSONOutput) ProtoReflect() protoreflec // Deprecated: Use QueryRequest_OutputSerialization_JSONOutput.ProtoReflect.Descriptor instead. func (*QueryRequest_OutputSerialization_JSONOutput) Descriptor() ([]byte, []int) { - return file_volume_server_proto_rawDescGZIP(), []int{68, 2, 1} + return file_volume_server_proto_rawDescGZIP(), []int{72, 2, 1} } func (x *QueryRequest_OutputSerialization_JSONOutput) GetRecordDelimiter() string { @@ -4690,657 +4869,683 @@ var file_volume_server_proto_rawDesc = []byte{ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x57, 0x0a, 0x16, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x17, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xae, 0x01, 0x0a, 0x11, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, - 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x74, 0x6c, - 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, - 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x3f, 0x0a, 0x12, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, - 0x61, 0x74, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6c, 0x61, 0x73, - 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x4e, 0x73, 0x22, 0x94, 0x02, 0x0a, 0x0f, - 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x78, 0x74, 0x12, 0x2f, - 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x45, 0x63, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x1c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x66, 0x6f, 0x75, - 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, - 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x10, 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, - 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x38, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x57, 0x72, 0x69, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x16, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x2f, 0x0a, 0x17, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x22, 0x32, 0x0a, 0x13, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, + 0x0c, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, + 0xae, 0x01, 0x0a, 0x11, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x73, 0x12, 0x30, 0x0a, - 0x14, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x69, 0x64, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, - 0x84, 0x01, 0x0a, 0x18, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4c, 0x61, 0x73, - 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xb7, 0x01, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x73, 0x12, 0x30, 0x0a, 0x14, - 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, - 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x69, 0x64, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x30, - 0x0a, 0x14, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, - 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x1e, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, - 0x0a, 0x1c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, - 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4b, 0x0a, 0x1d, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, - 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x74, - 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x8b, 0x02, 0x0a, 0x19, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, - 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x65, 0x63, 0x78, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x45, 0x63, 0x78, - 0x46, 0x69, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x65, 0x63, 0x6a, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x45, 0x63, 0x6a, 0x46, 0x69, - 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x76, 0x69, 0x66, 0x5f, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x56, - 0x69, 0x66, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x77, 0x0a, 0x1b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, - 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, - 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x1e, 0x0a, - 0x1c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x0a, - 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, + 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4e, 0x6f, 0x64, 0x65, + 0x22, 0x3f, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, + 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x4e, + 0x73, 0x22, 0x94, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x65, 0x78, 0x74, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x70, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x5f, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, + 0x45, 0x63, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x1c, 0x69, 0x67, 0x6e, 0x6f, + 0x72, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, + 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, + 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x10, 0x43, 0x6f, 0x70, 0x79, + 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, + 0x83, 0x01, 0x0a, 0x17, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, - 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, - 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, - 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, 0x1c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, - 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x63, + 0x65, 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x6e, 0x63, + 0x65, 0x4e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x12, 0x69, 0x64, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x18, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6e, 0x65, 0x65, 0x64, 0x6c, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x65, 0x64, 0x6c, + 0x65, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6e, 0x65, + 0x65, 0x64, 0x6c, 0x65, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x69, 0x73, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xb7, 0x01, 0x0a, + 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x6e, 0x63, 0x65, + 0x5f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x6e, 0x63, 0x65, + 0x4e, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x12, 0x69, 0x64, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, + 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x1e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x0a, 0x1c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, + 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, - 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x1f, - 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, - 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x99, 0x01, 0x0a, 0x18, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, - 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x4b, 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x5f, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0f, 0x72, + 0x65, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x8b, + 0x02, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, + 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x61, - 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x73, 0x68, 0x61, - 0x72, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x4e, 0x0a, 0x19, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x19, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, + 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x65, + 0x63, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, + 0x6f, 0x70, 0x79, 0x45, 0x63, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x65, 0x63, 0x6a, + 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, 0x70, + 0x79, 0x45, 0x63, 0x6a, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, + 0x5f, 0x76, 0x69, 0x66, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x56, 0x69, 0x66, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, + 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x77, 0x0a, 0x1b, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x1c, 0x0a, 0x1a, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x1d, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, + 0x49, 0x64, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, + 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x76, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, + 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, + 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x1d, 0x0a, 0x1b, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, 0x1c, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x1e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x0a, 0x1b, 0x52, 0x65, 0x61, - 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0xed, 0x02, 0x0a, 0x1c, 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x64, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x69, 0x64, 0x78, 0x46, 0x69, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x64, 0x78, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, 0x64, 0x78, 0x46, 0x69, 0x6c, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x64, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x64, 0x61, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x64, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x66, 0x72, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x72, 0x65, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x46, - 0x72, 0x65, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x75, - 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, - 0x6e, 0x74, 0x55, 0x73, 0x65, 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x09, 0x4d, 0x65, 0x6d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, - 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, - 0x6c, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x04, 0x68, 0x65, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0xd8, 0x01, 0x0a, - 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x6f, 0x64, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7c, 0x0a, 0x0a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, - 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x20, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, - 0x64, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x6b, 0x65, 0x65, 0x70, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, - 0x22, 0x73, 0x0a, 0x21, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, - 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, - 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, - 0x52, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, - 0x6e, 0x74, 0x61, 0x67, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x22, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, + 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x18, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x73, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x22, 0x4e, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, + 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x1c, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, + 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x5c, 0x0a, 0x1d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, + 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, + 0x1e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, + 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3a, 0x0a, 0x1b, 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0xed, 0x02, 0x0a, 0x1c, + 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x14, 0x6b, 0x65, 0x65, - 0x70, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x75, 0x0a, 0x23, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, - 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, - 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, - 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa1, - 0x01, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, - 0x0d, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, - 0x12, 0x40, 0x0a, 0x0d, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x6d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0xf8, 0x0c, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x72, 0x6f, 0x6d, - 0x46, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x13, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, - 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, - 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x65, 0x0a, 0x14, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, - 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x4e, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x1a, 0xd5, 0x05, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x63, 0x73, 0x76, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x69, 0x64, 0x78, + 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x69, + 0x64, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x64, 0x78, 0x5f, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, + 0x64, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x64, 0x61, + 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, + 0x64, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x64, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x0a, + 0x44, 0x69, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, + 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x65, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x0b, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x64, 0x22, 0xa3, 0x01, 0x0a, + 0x09, 0x4d, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x6f, + 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x67, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, 0x65, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x66, 0x72, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x70, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x68, 0x65, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x63, 0x6b, 0x22, 0xd8, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7c, 0x0a, + 0x0a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x05, 0x66, + 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x20, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, + 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, + 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x63, + 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x16, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x6b, 0x65, 0x65, 0x70, 0x5f, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6b, 0x65, 0x65, 0x70, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, + 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x73, 0x0a, 0x21, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x22, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, + 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2f, 0x0a, 0x14, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x64, + 0x61, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6b, + 0x65, 0x65, 0x70, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x22, 0x75, 0x0a, 0x23, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, + 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x44, 0x69, + 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0d, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, + 0x2e, 0x4d, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xf8, 0x0c, 0x0a, 0x0c, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x72, 0x6f, + 0x6d, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x12, 0x3d, 0x0a, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x13, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x65, 0x0a, 0x14, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x13, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x4e, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x6e, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0xd5, 0x05, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x63, 0x73, 0x76, + 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x43, 0x53, 0x56, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x08, 0x63, 0x73, 0x76, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x12, 0x5a, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, - 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x53, 0x56, 0x49, 0x6e, 0x70, - 0x75, 0x74, 0x52, 0x08, 0x63, 0x73, 0x76, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x5a, 0x0a, 0x0a, - 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x09, 0x6a, - 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x63, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x71, - 0x75, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x3e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, - 0x0c, 0x70, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0xc8, 0x02, - 0x0a, 0x08, 0x43, 0x53, 0x56, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, - 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, - 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, - 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, - 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x74, - 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, - 0x6f, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x73, 0x63, - 0x61, 0x70, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x14, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x73, 0x63, 0x61, 0x70, 0x65, - 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x71, - 0x75, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, - 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x0a, 0x09, 0x4a, 0x53, 0x4f, 0x4e, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x0e, 0x0a, 0x0c, 0x50, 0x61, 0x72, - 0x71, 0x75, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, 0xf1, 0x03, 0x0a, 0x13, 0x4f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x5b, 0x0a, 0x0a, 0x63, 0x73, 0x76, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x63, + 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, - 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x53, 0x56, 0x4f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x52, 0x09, 0x63, 0x73, 0x76, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x5e, - 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, 0xe3, - 0x01, 0x0a, 0x09, 0x43, 0x53, 0x56, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, - 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, - 0x72, 0x61, 0x63, 0x74, 0x6f, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x71, - 0x75, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x65, 0x72, 0x12, 0x34, - 0x0a, 0x16, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x5f, 0x63, - 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, - 0x71, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x73, 0x63, 0x61, 0x70, 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, - 0x63, 0x74, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x22, 0x29, 0x0a, - 0x0d, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x70, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x55, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x22, - 0xae, 0x01, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, - 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x6f, 0x6f, - 0x6b, 0x69, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, - 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, - 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, - 0x63, 0x72, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x63, 0x72, 0x63, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x74, 0x6c, - 0x32, 0x94, 0x1d, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x5c, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x24, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x1a, 0xc8, 0x02, 0x0a, 0x08, 0x43, 0x53, 0x56, 0x49, 0x6e, 0x70, 0x75, 0x74, + 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, + 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x29, + 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x6f, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x71, 0x75, 0x6f, + 0x74, 0x65, 0x5f, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, + 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x71, 0x75, 0x6f, 0x74, 0x65, + 0x45, 0x73, 0x63, 0x61, 0x70, 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x1a, 0x1f, + 0x0a, 0x09, 0x4a, 0x53, 0x4f, 0x4e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, + 0x0e, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x71, 0x75, 0x65, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x1a, + 0xf1, 0x03, 0x0a, 0x13, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x0a, 0x63, 0x73, 0x76, 0x5f, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x76, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x43, 0x53, 0x56, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x09, 0x63, 0x73, 0x76, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x12, 0x5e, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4a, 0x53, + 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x4f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x1a, 0xe3, 0x01, 0x0a, 0x09, 0x43, 0x53, 0x56, 0x4f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, + 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, + 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, + 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x6f, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, + 0x74, 0x6f, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x73, + 0x63, 0x61, 0x70, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x73, 0x63, 0x61, 0x70, + 0x65, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x0a, 0x4a, 0x53, + 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x72, 0x22, 0x29, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x53, 0x74, + 0x72, 0x69, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x55, + 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x65, 0x64, + 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6e, 0x65, 0x65, + 0x64, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x1a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x03, 0x63, 0x72, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x32, 0xe8, 0x1e, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x5c, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x24, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x6e, 0x0a, 0x11, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x12, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x74, 0x0a, 0x13, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, - 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x11, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, + 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x2b, 0x2e, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x13, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x12, 0x2c, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, + 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, - 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x13, 0x56, 0x61, 0x63, 0x75, - 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x12, - 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, - 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, - 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6c, 0x65, - 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, - 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x0e, 0x41, - 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x27, 0x2e, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, - 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x10, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x79, 0x6e, 0x63, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x7c, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5c, 0x0a, - 0x0b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x76, + 0x74, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, + 0x0a, 0x13, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6c, + 0x65, 0x61, 0x6e, 0x75, 0x70, 0x12, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x61, 0x63, 0x75, 0x75, 0x6d, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x65, 0x0a, 0x0e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x12, 0x27, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0d, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x76, + 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x10, 0x56, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x5f, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, - 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, - 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, - 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x0f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x28, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, - 0x0a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x23, 0x2e, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x77, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x55, 0x0a, 0x08, 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x21, 0x2e, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x6d, 0x0a, 0x10, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x2b, 0x2e, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, - 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, + 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7c, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, + 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x2e, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x30, 0x01, 0x12, 0x5c, 0x0a, 0x0b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x62, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x16, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, - 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, - 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x15, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x12, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, - 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, - 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, - 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x2b, 0x2e, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x77, 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, - 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, - 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x74, 0x0a, 0x13, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, - 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, - 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, - 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x70, 0x0a, 0x11, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, - 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x12, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, - 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, - 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2b, 0x2e, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x16, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x12, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, - 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, - 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, - 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6c, 0x75, 0x6d, 0x65, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x2b, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, + 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x30, 0x01, 0x12, 0x8e, 0x01, 0x0a, 0x1b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, - 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x12, 0x34, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x57, 0x72, 0x69, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x0f, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, + 0x28, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, + 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x0a, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x23, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, + 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x77, 0x0a, 0x14, 0x52, 0x65, 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x61, + 0x64, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x08, 0x43, + 0x6f, 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x21, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x46, + 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x70, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x6d, 0x0a, 0x10, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, + 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x54, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x53, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, + 0x01, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x54, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x16, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, + 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x2f, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x30, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, + 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, + 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x2e, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, + 0x73, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, + 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x43, 0x6f, 0x70, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x77, 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x13, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, + 0x64, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x7a, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x55, 0x6e, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x70, 0x0a, + 0x11, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x61, 0x64, 0x12, 0x2a, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, + 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, + 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, + 0x63, 0x42, 0x6c, 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x42, 0x6c, + 0x6f, 0x62, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x7d, 0x0a, 0x16, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, + 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x2f, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, 0x6f, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, + 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x63, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x54, + 0x6f, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x88, 0x01, 0x0a, 0x19, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, + 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, + 0x32, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, + 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, + 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x54, 0x6f, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x8e, 0x01, 0x0a, + 0x1b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, + 0x61, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x34, 0x2e, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, + 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x54, 0x69, 0x65, 0x72, 0x4d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x46, 0x72, 0x6f, - 0x6d, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x1e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x70, 0x65, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, - 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x72, 0x69, 0x73, 0x6c, 0x75, 0x73, 0x66, 0x2f, - 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2f, 0x77, 0x65, 0x65, 0x64, 0x2f, 0x70, - 0x62, 0x2f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, 0x0a, + 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x4c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x69, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x70, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, + 0x0a, 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x2b, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, + 0x65, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2c, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4e, 0x65, 0x65, 0x64, 0x6c, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x68, 0x72, 0x69, 0x73, 0x6c, 0x75, 0x73, 0x66, 0x2f, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, + 0x64, 0x66, 0x73, 0x2f, 0x77, 0x65, 0x65, 0x64, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5355,7 +5560,7 @@ func file_volume_server_proto_rawDescGZIP() []byte { return file_volume_server_proto_rawDescData } -var file_volume_server_proto_msgTypes = make([]protoimpl.MessageInfo, 80) +var file_volume_server_proto_msgTypes = make([]protoimpl.MessageInfo, 84) var file_volume_server_proto_goTypes = []interface{}{ (*BatchDeleteRequest)(nil), // 0: volume_server_pb.BatchDeleteRequest (*BatchDeleteResponse)(nil), // 1: volume_server_pb.BatchDeleteResponse @@ -5385,72 +5590,76 @@ var file_volume_server_proto_goTypes = []interface{}{ (*VolumeDeleteResponse)(nil), // 25: volume_server_pb.VolumeDeleteResponse (*VolumeMarkReadonlyRequest)(nil), // 26: volume_server_pb.VolumeMarkReadonlyRequest (*VolumeMarkReadonlyResponse)(nil), // 27: volume_server_pb.VolumeMarkReadonlyResponse - (*VolumeConfigureRequest)(nil), // 28: volume_server_pb.VolumeConfigureRequest - (*VolumeConfigureResponse)(nil), // 29: volume_server_pb.VolumeConfigureResponse - (*VolumeCopyRequest)(nil), // 30: volume_server_pb.VolumeCopyRequest - (*VolumeCopyResponse)(nil), // 31: volume_server_pb.VolumeCopyResponse - (*CopyFileRequest)(nil), // 32: volume_server_pb.CopyFileRequest - (*CopyFileResponse)(nil), // 33: volume_server_pb.CopyFileResponse - (*VolumeTailSenderRequest)(nil), // 34: volume_server_pb.VolumeTailSenderRequest - (*VolumeTailSenderResponse)(nil), // 35: volume_server_pb.VolumeTailSenderResponse - (*VolumeTailReceiverRequest)(nil), // 36: volume_server_pb.VolumeTailReceiverRequest - (*VolumeTailReceiverResponse)(nil), // 37: volume_server_pb.VolumeTailReceiverResponse - (*VolumeEcShardsGenerateRequest)(nil), // 38: volume_server_pb.VolumeEcShardsGenerateRequest - (*VolumeEcShardsGenerateResponse)(nil), // 39: volume_server_pb.VolumeEcShardsGenerateResponse - (*VolumeEcShardsRebuildRequest)(nil), // 40: volume_server_pb.VolumeEcShardsRebuildRequest - (*VolumeEcShardsRebuildResponse)(nil), // 41: volume_server_pb.VolumeEcShardsRebuildResponse - (*VolumeEcShardsCopyRequest)(nil), // 42: volume_server_pb.VolumeEcShardsCopyRequest - (*VolumeEcShardsCopyResponse)(nil), // 43: volume_server_pb.VolumeEcShardsCopyResponse - (*VolumeEcShardsDeleteRequest)(nil), // 44: volume_server_pb.VolumeEcShardsDeleteRequest - (*VolumeEcShardsDeleteResponse)(nil), // 45: volume_server_pb.VolumeEcShardsDeleteResponse - (*VolumeEcShardsMountRequest)(nil), // 46: volume_server_pb.VolumeEcShardsMountRequest - (*VolumeEcShardsMountResponse)(nil), // 47: volume_server_pb.VolumeEcShardsMountResponse - (*VolumeEcShardsUnmountRequest)(nil), // 48: volume_server_pb.VolumeEcShardsUnmountRequest - (*VolumeEcShardsUnmountResponse)(nil), // 49: volume_server_pb.VolumeEcShardsUnmountResponse - (*VolumeEcShardReadRequest)(nil), // 50: volume_server_pb.VolumeEcShardReadRequest - (*VolumeEcShardReadResponse)(nil), // 51: volume_server_pb.VolumeEcShardReadResponse - (*VolumeEcBlobDeleteRequest)(nil), // 52: volume_server_pb.VolumeEcBlobDeleteRequest - (*VolumeEcBlobDeleteResponse)(nil), // 53: volume_server_pb.VolumeEcBlobDeleteResponse - (*VolumeEcShardsToVolumeRequest)(nil), // 54: volume_server_pb.VolumeEcShardsToVolumeRequest - (*VolumeEcShardsToVolumeResponse)(nil), // 55: volume_server_pb.VolumeEcShardsToVolumeResponse - (*ReadVolumeFileStatusRequest)(nil), // 56: volume_server_pb.ReadVolumeFileStatusRequest - (*ReadVolumeFileStatusResponse)(nil), // 57: volume_server_pb.ReadVolumeFileStatusResponse - (*DiskStatus)(nil), // 58: volume_server_pb.DiskStatus - (*MemStatus)(nil), // 59: volume_server_pb.MemStatus - (*RemoteFile)(nil), // 60: volume_server_pb.RemoteFile - (*VolumeInfo)(nil), // 61: volume_server_pb.VolumeInfo - (*VolumeTierMoveDatToRemoteRequest)(nil), // 62: volume_server_pb.VolumeTierMoveDatToRemoteRequest - (*VolumeTierMoveDatToRemoteResponse)(nil), // 63: volume_server_pb.VolumeTierMoveDatToRemoteResponse - (*VolumeTierMoveDatFromRemoteRequest)(nil), // 64: volume_server_pb.VolumeTierMoveDatFromRemoteRequest - (*VolumeTierMoveDatFromRemoteResponse)(nil), // 65: volume_server_pb.VolumeTierMoveDatFromRemoteResponse - (*VolumeServerStatusRequest)(nil), // 66: volume_server_pb.VolumeServerStatusRequest - (*VolumeServerStatusResponse)(nil), // 67: volume_server_pb.VolumeServerStatusResponse - (*QueryRequest)(nil), // 68: volume_server_pb.QueryRequest - (*QueriedStripe)(nil), // 69: volume_server_pb.QueriedStripe - (*VolumeNeedleStatusRequest)(nil), // 70: volume_server_pb.VolumeNeedleStatusRequest - (*VolumeNeedleStatusResponse)(nil), // 71: volume_server_pb.VolumeNeedleStatusResponse - (*QueryRequest_Filter)(nil), // 72: volume_server_pb.QueryRequest.Filter - (*QueryRequest_InputSerialization)(nil), // 73: volume_server_pb.QueryRequest.InputSerialization - (*QueryRequest_OutputSerialization)(nil), // 74: volume_server_pb.QueryRequest.OutputSerialization - (*QueryRequest_InputSerialization_CSVInput)(nil), // 75: volume_server_pb.QueryRequest.InputSerialization.CSVInput - (*QueryRequest_InputSerialization_JSONInput)(nil), // 76: volume_server_pb.QueryRequest.InputSerialization.JSONInput - (*QueryRequest_InputSerialization_ParquetInput)(nil), // 77: volume_server_pb.QueryRequest.InputSerialization.ParquetInput - (*QueryRequest_OutputSerialization_CSVOutput)(nil), // 78: volume_server_pb.QueryRequest.OutputSerialization.CSVOutput - (*QueryRequest_OutputSerialization_JSONOutput)(nil), // 79: volume_server_pb.QueryRequest.OutputSerialization.JSONOutput + (*VolumeMarkWritableRequest)(nil), // 28: volume_server_pb.VolumeMarkWritableRequest + (*VolumeMarkWritableResponse)(nil), // 29: volume_server_pb.VolumeMarkWritableResponse + (*VolumeConfigureRequest)(nil), // 30: volume_server_pb.VolumeConfigureRequest + (*VolumeConfigureResponse)(nil), // 31: volume_server_pb.VolumeConfigureResponse + (*VolumeStatusRequest)(nil), // 32: volume_server_pb.VolumeStatusRequest + (*VolumeStatusResponse)(nil), // 33: volume_server_pb.VolumeStatusResponse + (*VolumeCopyRequest)(nil), // 34: volume_server_pb.VolumeCopyRequest + (*VolumeCopyResponse)(nil), // 35: volume_server_pb.VolumeCopyResponse + (*CopyFileRequest)(nil), // 36: volume_server_pb.CopyFileRequest + (*CopyFileResponse)(nil), // 37: volume_server_pb.CopyFileResponse + (*VolumeTailSenderRequest)(nil), // 38: volume_server_pb.VolumeTailSenderRequest + (*VolumeTailSenderResponse)(nil), // 39: volume_server_pb.VolumeTailSenderResponse + (*VolumeTailReceiverRequest)(nil), // 40: volume_server_pb.VolumeTailReceiverRequest + (*VolumeTailReceiverResponse)(nil), // 41: volume_server_pb.VolumeTailReceiverResponse + (*VolumeEcShardsGenerateRequest)(nil), // 42: volume_server_pb.VolumeEcShardsGenerateRequest + (*VolumeEcShardsGenerateResponse)(nil), // 43: volume_server_pb.VolumeEcShardsGenerateResponse + (*VolumeEcShardsRebuildRequest)(nil), // 44: volume_server_pb.VolumeEcShardsRebuildRequest + (*VolumeEcShardsRebuildResponse)(nil), // 45: volume_server_pb.VolumeEcShardsRebuildResponse + (*VolumeEcShardsCopyRequest)(nil), // 46: volume_server_pb.VolumeEcShardsCopyRequest + (*VolumeEcShardsCopyResponse)(nil), // 47: volume_server_pb.VolumeEcShardsCopyResponse + (*VolumeEcShardsDeleteRequest)(nil), // 48: volume_server_pb.VolumeEcShardsDeleteRequest + (*VolumeEcShardsDeleteResponse)(nil), // 49: volume_server_pb.VolumeEcShardsDeleteResponse + (*VolumeEcShardsMountRequest)(nil), // 50: volume_server_pb.VolumeEcShardsMountRequest + (*VolumeEcShardsMountResponse)(nil), // 51: volume_server_pb.VolumeEcShardsMountResponse + (*VolumeEcShardsUnmountRequest)(nil), // 52: volume_server_pb.VolumeEcShardsUnmountRequest + (*VolumeEcShardsUnmountResponse)(nil), // 53: volume_server_pb.VolumeEcShardsUnmountResponse + (*VolumeEcShardReadRequest)(nil), // 54: volume_server_pb.VolumeEcShardReadRequest + (*VolumeEcShardReadResponse)(nil), // 55: volume_server_pb.VolumeEcShardReadResponse + (*VolumeEcBlobDeleteRequest)(nil), // 56: volume_server_pb.VolumeEcBlobDeleteRequest + (*VolumeEcBlobDeleteResponse)(nil), // 57: volume_server_pb.VolumeEcBlobDeleteResponse + (*VolumeEcShardsToVolumeRequest)(nil), // 58: volume_server_pb.VolumeEcShardsToVolumeRequest + (*VolumeEcShardsToVolumeResponse)(nil), // 59: volume_server_pb.VolumeEcShardsToVolumeResponse + (*ReadVolumeFileStatusRequest)(nil), // 60: volume_server_pb.ReadVolumeFileStatusRequest + (*ReadVolumeFileStatusResponse)(nil), // 61: volume_server_pb.ReadVolumeFileStatusResponse + (*DiskStatus)(nil), // 62: volume_server_pb.DiskStatus + (*MemStatus)(nil), // 63: volume_server_pb.MemStatus + (*RemoteFile)(nil), // 64: volume_server_pb.RemoteFile + (*VolumeInfo)(nil), // 65: volume_server_pb.VolumeInfo + (*VolumeTierMoveDatToRemoteRequest)(nil), // 66: volume_server_pb.VolumeTierMoveDatToRemoteRequest + (*VolumeTierMoveDatToRemoteResponse)(nil), // 67: volume_server_pb.VolumeTierMoveDatToRemoteResponse + (*VolumeTierMoveDatFromRemoteRequest)(nil), // 68: volume_server_pb.VolumeTierMoveDatFromRemoteRequest + (*VolumeTierMoveDatFromRemoteResponse)(nil), // 69: volume_server_pb.VolumeTierMoveDatFromRemoteResponse + (*VolumeServerStatusRequest)(nil), // 70: volume_server_pb.VolumeServerStatusRequest + (*VolumeServerStatusResponse)(nil), // 71: volume_server_pb.VolumeServerStatusResponse + (*QueryRequest)(nil), // 72: volume_server_pb.QueryRequest + (*QueriedStripe)(nil), // 73: volume_server_pb.QueriedStripe + (*VolumeNeedleStatusRequest)(nil), // 74: volume_server_pb.VolumeNeedleStatusRequest + (*VolumeNeedleStatusResponse)(nil), // 75: volume_server_pb.VolumeNeedleStatusResponse + (*QueryRequest_Filter)(nil), // 76: volume_server_pb.QueryRequest.Filter + (*QueryRequest_InputSerialization)(nil), // 77: volume_server_pb.QueryRequest.InputSerialization + (*QueryRequest_OutputSerialization)(nil), // 78: volume_server_pb.QueryRequest.OutputSerialization + (*QueryRequest_InputSerialization_CSVInput)(nil), // 79: volume_server_pb.QueryRequest.InputSerialization.CSVInput + (*QueryRequest_InputSerialization_JSONInput)(nil), // 80: volume_server_pb.QueryRequest.InputSerialization.JSONInput + (*QueryRequest_InputSerialization_ParquetInput)(nil), // 81: volume_server_pb.QueryRequest.InputSerialization.ParquetInput + (*QueryRequest_OutputSerialization_CSVOutput)(nil), // 82: volume_server_pb.QueryRequest.OutputSerialization.CSVOutput + (*QueryRequest_OutputSerialization_JSONOutput)(nil), // 83: volume_server_pb.QueryRequest.OutputSerialization.JSONOutput } var file_volume_server_proto_depIdxs = []int32{ 2, // 0: volume_server_pb.BatchDeleteResponse.results:type_name -> volume_server_pb.DeleteResult - 60, // 1: volume_server_pb.VolumeInfo.files:type_name -> volume_server_pb.RemoteFile - 58, // 2: volume_server_pb.VolumeServerStatusResponse.disk_statuses:type_name -> volume_server_pb.DiskStatus - 59, // 3: volume_server_pb.VolumeServerStatusResponse.memory_status:type_name -> volume_server_pb.MemStatus - 72, // 4: volume_server_pb.QueryRequest.filter:type_name -> volume_server_pb.QueryRequest.Filter - 73, // 5: volume_server_pb.QueryRequest.input_serialization:type_name -> volume_server_pb.QueryRequest.InputSerialization - 74, // 6: volume_server_pb.QueryRequest.output_serialization:type_name -> volume_server_pb.QueryRequest.OutputSerialization - 75, // 7: volume_server_pb.QueryRequest.InputSerialization.csv_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.CSVInput - 76, // 8: volume_server_pb.QueryRequest.InputSerialization.json_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.JSONInput - 77, // 9: volume_server_pb.QueryRequest.InputSerialization.parquet_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.ParquetInput - 78, // 10: volume_server_pb.QueryRequest.OutputSerialization.csv_output:type_name -> volume_server_pb.QueryRequest.OutputSerialization.CSVOutput - 79, // 11: volume_server_pb.QueryRequest.OutputSerialization.json_output:type_name -> volume_server_pb.QueryRequest.OutputSerialization.JSONOutput + 64, // 1: volume_server_pb.VolumeInfo.files:type_name -> volume_server_pb.RemoteFile + 62, // 2: volume_server_pb.VolumeServerStatusResponse.disk_statuses:type_name -> volume_server_pb.DiskStatus + 63, // 3: volume_server_pb.VolumeServerStatusResponse.memory_status:type_name -> volume_server_pb.MemStatus + 76, // 4: volume_server_pb.QueryRequest.filter:type_name -> volume_server_pb.QueryRequest.Filter + 77, // 5: volume_server_pb.QueryRequest.input_serialization:type_name -> volume_server_pb.QueryRequest.InputSerialization + 78, // 6: volume_server_pb.QueryRequest.output_serialization:type_name -> volume_server_pb.QueryRequest.OutputSerialization + 79, // 7: volume_server_pb.QueryRequest.InputSerialization.csv_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.CSVInput + 80, // 8: volume_server_pb.QueryRequest.InputSerialization.json_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.JSONInput + 81, // 9: volume_server_pb.QueryRequest.InputSerialization.parquet_input:type_name -> volume_server_pb.QueryRequest.InputSerialization.ParquetInput + 82, // 10: volume_server_pb.QueryRequest.OutputSerialization.csv_output:type_name -> volume_server_pb.QueryRequest.OutputSerialization.CSVOutput + 83, // 11: volume_server_pb.QueryRequest.OutputSerialization.json_output:type_name -> volume_server_pb.QueryRequest.OutputSerialization.JSONOutput 0, // 12: volume_server_pb.VolumeServer.BatchDelete:input_type -> volume_server_pb.BatchDeleteRequest 4, // 13: volume_server_pb.VolumeServer.VacuumVolumeCheck:input_type -> volume_server_pb.VacuumVolumeCheckRequest 6, // 14: volume_server_pb.VolumeServer.VacuumVolumeCompact:input_type -> volume_server_pb.VacuumVolumeCompactRequest @@ -5464,61 +5673,65 @@ var file_volume_server_proto_depIdxs = []int32{ 22, // 22: volume_server_pb.VolumeServer.VolumeUnmount:input_type -> volume_server_pb.VolumeUnmountRequest 24, // 23: volume_server_pb.VolumeServer.VolumeDelete:input_type -> volume_server_pb.VolumeDeleteRequest 26, // 24: volume_server_pb.VolumeServer.VolumeMarkReadonly:input_type -> volume_server_pb.VolumeMarkReadonlyRequest - 28, // 25: volume_server_pb.VolumeServer.VolumeConfigure:input_type -> volume_server_pb.VolumeConfigureRequest - 30, // 26: volume_server_pb.VolumeServer.VolumeCopy:input_type -> volume_server_pb.VolumeCopyRequest - 56, // 27: volume_server_pb.VolumeServer.ReadVolumeFileStatus:input_type -> volume_server_pb.ReadVolumeFileStatusRequest - 32, // 28: volume_server_pb.VolumeServer.CopyFile:input_type -> volume_server_pb.CopyFileRequest - 34, // 29: volume_server_pb.VolumeServer.VolumeTailSender:input_type -> volume_server_pb.VolumeTailSenderRequest - 36, // 30: volume_server_pb.VolumeServer.VolumeTailReceiver:input_type -> volume_server_pb.VolumeTailReceiverRequest - 38, // 31: volume_server_pb.VolumeServer.VolumeEcShardsGenerate:input_type -> volume_server_pb.VolumeEcShardsGenerateRequest - 40, // 32: volume_server_pb.VolumeServer.VolumeEcShardsRebuild:input_type -> volume_server_pb.VolumeEcShardsRebuildRequest - 42, // 33: volume_server_pb.VolumeServer.VolumeEcShardsCopy:input_type -> volume_server_pb.VolumeEcShardsCopyRequest - 44, // 34: volume_server_pb.VolumeServer.VolumeEcShardsDelete:input_type -> volume_server_pb.VolumeEcShardsDeleteRequest - 46, // 35: volume_server_pb.VolumeServer.VolumeEcShardsMount:input_type -> volume_server_pb.VolumeEcShardsMountRequest - 48, // 36: volume_server_pb.VolumeServer.VolumeEcShardsUnmount:input_type -> volume_server_pb.VolumeEcShardsUnmountRequest - 50, // 37: volume_server_pb.VolumeServer.VolumeEcShardRead:input_type -> volume_server_pb.VolumeEcShardReadRequest - 52, // 38: volume_server_pb.VolumeServer.VolumeEcBlobDelete:input_type -> volume_server_pb.VolumeEcBlobDeleteRequest - 54, // 39: volume_server_pb.VolumeServer.VolumeEcShardsToVolume:input_type -> volume_server_pb.VolumeEcShardsToVolumeRequest - 62, // 40: volume_server_pb.VolumeServer.VolumeTierMoveDatToRemote:input_type -> volume_server_pb.VolumeTierMoveDatToRemoteRequest - 64, // 41: volume_server_pb.VolumeServer.VolumeTierMoveDatFromRemote:input_type -> volume_server_pb.VolumeTierMoveDatFromRemoteRequest - 66, // 42: volume_server_pb.VolumeServer.VolumeServerStatus:input_type -> volume_server_pb.VolumeServerStatusRequest - 68, // 43: volume_server_pb.VolumeServer.Query:input_type -> volume_server_pb.QueryRequest - 70, // 44: volume_server_pb.VolumeServer.VolumeNeedleStatus:input_type -> volume_server_pb.VolumeNeedleStatusRequest - 1, // 45: volume_server_pb.VolumeServer.BatchDelete:output_type -> volume_server_pb.BatchDeleteResponse - 5, // 46: volume_server_pb.VolumeServer.VacuumVolumeCheck:output_type -> volume_server_pb.VacuumVolumeCheckResponse - 7, // 47: volume_server_pb.VolumeServer.VacuumVolumeCompact:output_type -> volume_server_pb.VacuumVolumeCompactResponse - 9, // 48: volume_server_pb.VolumeServer.VacuumVolumeCommit:output_type -> volume_server_pb.VacuumVolumeCommitResponse - 11, // 49: volume_server_pb.VolumeServer.VacuumVolumeCleanup:output_type -> volume_server_pb.VacuumVolumeCleanupResponse - 13, // 50: volume_server_pb.VolumeServer.DeleteCollection:output_type -> volume_server_pb.DeleteCollectionResponse - 15, // 51: volume_server_pb.VolumeServer.AllocateVolume:output_type -> volume_server_pb.AllocateVolumeResponse - 17, // 52: volume_server_pb.VolumeServer.VolumeSyncStatus:output_type -> volume_server_pb.VolumeSyncStatusResponse - 19, // 53: volume_server_pb.VolumeServer.VolumeIncrementalCopy:output_type -> volume_server_pb.VolumeIncrementalCopyResponse - 21, // 54: volume_server_pb.VolumeServer.VolumeMount:output_type -> volume_server_pb.VolumeMountResponse - 23, // 55: volume_server_pb.VolumeServer.VolumeUnmount:output_type -> volume_server_pb.VolumeUnmountResponse - 25, // 56: volume_server_pb.VolumeServer.VolumeDelete:output_type -> volume_server_pb.VolumeDeleteResponse - 27, // 57: volume_server_pb.VolumeServer.VolumeMarkReadonly:output_type -> volume_server_pb.VolumeMarkReadonlyResponse - 29, // 58: volume_server_pb.VolumeServer.VolumeConfigure:output_type -> volume_server_pb.VolumeConfigureResponse - 31, // 59: volume_server_pb.VolumeServer.VolumeCopy:output_type -> volume_server_pb.VolumeCopyResponse - 57, // 60: volume_server_pb.VolumeServer.ReadVolumeFileStatus:output_type -> volume_server_pb.ReadVolumeFileStatusResponse - 33, // 61: volume_server_pb.VolumeServer.CopyFile:output_type -> volume_server_pb.CopyFileResponse - 35, // 62: volume_server_pb.VolumeServer.VolumeTailSender:output_type -> volume_server_pb.VolumeTailSenderResponse - 37, // 63: volume_server_pb.VolumeServer.VolumeTailReceiver:output_type -> volume_server_pb.VolumeTailReceiverResponse - 39, // 64: volume_server_pb.VolumeServer.VolumeEcShardsGenerate:output_type -> volume_server_pb.VolumeEcShardsGenerateResponse - 41, // 65: volume_server_pb.VolumeServer.VolumeEcShardsRebuild:output_type -> volume_server_pb.VolumeEcShardsRebuildResponse - 43, // 66: volume_server_pb.VolumeServer.VolumeEcShardsCopy:output_type -> volume_server_pb.VolumeEcShardsCopyResponse - 45, // 67: volume_server_pb.VolumeServer.VolumeEcShardsDelete:output_type -> volume_server_pb.VolumeEcShardsDeleteResponse - 47, // 68: volume_server_pb.VolumeServer.VolumeEcShardsMount:output_type -> volume_server_pb.VolumeEcShardsMountResponse - 49, // 69: volume_server_pb.VolumeServer.VolumeEcShardsUnmount:output_type -> volume_server_pb.VolumeEcShardsUnmountResponse - 51, // 70: volume_server_pb.VolumeServer.VolumeEcShardRead:output_type -> volume_server_pb.VolumeEcShardReadResponse - 53, // 71: volume_server_pb.VolumeServer.VolumeEcBlobDelete:output_type -> volume_server_pb.VolumeEcBlobDeleteResponse - 55, // 72: volume_server_pb.VolumeServer.VolumeEcShardsToVolume:output_type -> volume_server_pb.VolumeEcShardsToVolumeResponse - 63, // 73: volume_server_pb.VolumeServer.VolumeTierMoveDatToRemote:output_type -> volume_server_pb.VolumeTierMoveDatToRemoteResponse - 65, // 74: volume_server_pb.VolumeServer.VolumeTierMoveDatFromRemote:output_type -> volume_server_pb.VolumeTierMoveDatFromRemoteResponse - 67, // 75: volume_server_pb.VolumeServer.VolumeServerStatus:output_type -> volume_server_pb.VolumeServerStatusResponse - 69, // 76: volume_server_pb.VolumeServer.Query:output_type -> volume_server_pb.QueriedStripe - 71, // 77: volume_server_pb.VolumeServer.VolumeNeedleStatus:output_type -> volume_server_pb.VolumeNeedleStatusResponse - 45, // [45:78] is the sub-list for method output_type - 12, // [12:45] is the sub-list for method input_type + 28, // 25: volume_server_pb.VolumeServer.VolumeMarkWritable:input_type -> volume_server_pb.VolumeMarkWritableRequest + 30, // 26: volume_server_pb.VolumeServer.VolumeConfigure:input_type -> volume_server_pb.VolumeConfigureRequest + 32, // 27: volume_server_pb.VolumeServer.VolumeStatus:input_type -> volume_server_pb.VolumeStatusRequest + 34, // 28: volume_server_pb.VolumeServer.VolumeCopy:input_type -> volume_server_pb.VolumeCopyRequest + 60, // 29: volume_server_pb.VolumeServer.ReadVolumeFileStatus:input_type -> volume_server_pb.ReadVolumeFileStatusRequest + 36, // 30: volume_server_pb.VolumeServer.CopyFile:input_type -> volume_server_pb.CopyFileRequest + 38, // 31: volume_server_pb.VolumeServer.VolumeTailSender:input_type -> volume_server_pb.VolumeTailSenderRequest + 40, // 32: volume_server_pb.VolumeServer.VolumeTailReceiver:input_type -> volume_server_pb.VolumeTailReceiverRequest + 42, // 33: volume_server_pb.VolumeServer.VolumeEcShardsGenerate:input_type -> volume_server_pb.VolumeEcShardsGenerateRequest + 44, // 34: volume_server_pb.VolumeServer.VolumeEcShardsRebuild:input_type -> volume_server_pb.VolumeEcShardsRebuildRequest + 46, // 35: volume_server_pb.VolumeServer.VolumeEcShardsCopy:input_type -> volume_server_pb.VolumeEcShardsCopyRequest + 48, // 36: volume_server_pb.VolumeServer.VolumeEcShardsDelete:input_type -> volume_server_pb.VolumeEcShardsDeleteRequest + 50, // 37: volume_server_pb.VolumeServer.VolumeEcShardsMount:input_type -> volume_server_pb.VolumeEcShardsMountRequest + 52, // 38: volume_server_pb.VolumeServer.VolumeEcShardsUnmount:input_type -> volume_server_pb.VolumeEcShardsUnmountRequest + 54, // 39: volume_server_pb.VolumeServer.VolumeEcShardRead:input_type -> volume_server_pb.VolumeEcShardReadRequest + 56, // 40: volume_server_pb.VolumeServer.VolumeEcBlobDelete:input_type -> volume_server_pb.VolumeEcBlobDeleteRequest + 58, // 41: volume_server_pb.VolumeServer.VolumeEcShardsToVolume:input_type -> volume_server_pb.VolumeEcShardsToVolumeRequest + 66, // 42: volume_server_pb.VolumeServer.VolumeTierMoveDatToRemote:input_type -> volume_server_pb.VolumeTierMoveDatToRemoteRequest + 68, // 43: volume_server_pb.VolumeServer.VolumeTierMoveDatFromRemote:input_type -> volume_server_pb.VolumeTierMoveDatFromRemoteRequest + 70, // 44: volume_server_pb.VolumeServer.VolumeServerStatus:input_type -> volume_server_pb.VolumeServerStatusRequest + 72, // 45: volume_server_pb.VolumeServer.Query:input_type -> volume_server_pb.QueryRequest + 74, // 46: volume_server_pb.VolumeServer.VolumeNeedleStatus:input_type -> volume_server_pb.VolumeNeedleStatusRequest + 1, // 47: volume_server_pb.VolumeServer.BatchDelete:output_type -> volume_server_pb.BatchDeleteResponse + 5, // 48: volume_server_pb.VolumeServer.VacuumVolumeCheck:output_type -> volume_server_pb.VacuumVolumeCheckResponse + 7, // 49: volume_server_pb.VolumeServer.VacuumVolumeCompact:output_type -> volume_server_pb.VacuumVolumeCompactResponse + 9, // 50: volume_server_pb.VolumeServer.VacuumVolumeCommit:output_type -> volume_server_pb.VacuumVolumeCommitResponse + 11, // 51: volume_server_pb.VolumeServer.VacuumVolumeCleanup:output_type -> volume_server_pb.VacuumVolumeCleanupResponse + 13, // 52: volume_server_pb.VolumeServer.DeleteCollection:output_type -> volume_server_pb.DeleteCollectionResponse + 15, // 53: volume_server_pb.VolumeServer.AllocateVolume:output_type -> volume_server_pb.AllocateVolumeResponse + 17, // 54: volume_server_pb.VolumeServer.VolumeSyncStatus:output_type -> volume_server_pb.VolumeSyncStatusResponse + 19, // 55: volume_server_pb.VolumeServer.VolumeIncrementalCopy:output_type -> volume_server_pb.VolumeIncrementalCopyResponse + 21, // 56: volume_server_pb.VolumeServer.VolumeMount:output_type -> volume_server_pb.VolumeMountResponse + 23, // 57: volume_server_pb.VolumeServer.VolumeUnmount:output_type -> volume_server_pb.VolumeUnmountResponse + 25, // 58: volume_server_pb.VolumeServer.VolumeDelete:output_type -> volume_server_pb.VolumeDeleteResponse + 27, // 59: volume_server_pb.VolumeServer.VolumeMarkReadonly:output_type -> volume_server_pb.VolumeMarkReadonlyResponse + 29, // 60: volume_server_pb.VolumeServer.VolumeMarkWritable:output_type -> volume_server_pb.VolumeMarkWritableResponse + 31, // 61: volume_server_pb.VolumeServer.VolumeConfigure:output_type -> volume_server_pb.VolumeConfigureResponse + 33, // 62: volume_server_pb.VolumeServer.VolumeStatus:output_type -> volume_server_pb.VolumeStatusResponse + 35, // 63: volume_server_pb.VolumeServer.VolumeCopy:output_type -> volume_server_pb.VolumeCopyResponse + 61, // 64: volume_server_pb.VolumeServer.ReadVolumeFileStatus:output_type -> volume_server_pb.ReadVolumeFileStatusResponse + 37, // 65: volume_server_pb.VolumeServer.CopyFile:output_type -> volume_server_pb.CopyFileResponse + 39, // 66: volume_server_pb.VolumeServer.VolumeTailSender:output_type -> volume_server_pb.VolumeTailSenderResponse + 41, // 67: volume_server_pb.VolumeServer.VolumeTailReceiver:output_type -> volume_server_pb.VolumeTailReceiverResponse + 43, // 68: volume_server_pb.VolumeServer.VolumeEcShardsGenerate:output_type -> volume_server_pb.VolumeEcShardsGenerateResponse + 45, // 69: volume_server_pb.VolumeServer.VolumeEcShardsRebuild:output_type -> volume_server_pb.VolumeEcShardsRebuildResponse + 47, // 70: volume_server_pb.VolumeServer.VolumeEcShardsCopy:output_type -> volume_server_pb.VolumeEcShardsCopyResponse + 49, // 71: volume_server_pb.VolumeServer.VolumeEcShardsDelete:output_type -> volume_server_pb.VolumeEcShardsDeleteResponse + 51, // 72: volume_server_pb.VolumeServer.VolumeEcShardsMount:output_type -> volume_server_pb.VolumeEcShardsMountResponse + 53, // 73: volume_server_pb.VolumeServer.VolumeEcShardsUnmount:output_type -> volume_server_pb.VolumeEcShardsUnmountResponse + 55, // 74: volume_server_pb.VolumeServer.VolumeEcShardRead:output_type -> volume_server_pb.VolumeEcShardReadResponse + 57, // 75: volume_server_pb.VolumeServer.VolumeEcBlobDelete:output_type -> volume_server_pb.VolumeEcBlobDeleteResponse + 59, // 76: volume_server_pb.VolumeServer.VolumeEcShardsToVolume:output_type -> volume_server_pb.VolumeEcShardsToVolumeResponse + 67, // 77: volume_server_pb.VolumeServer.VolumeTierMoveDatToRemote:output_type -> volume_server_pb.VolumeTierMoveDatToRemoteResponse + 69, // 78: volume_server_pb.VolumeServer.VolumeTierMoveDatFromRemote:output_type -> volume_server_pb.VolumeTierMoveDatFromRemoteResponse + 71, // 79: volume_server_pb.VolumeServer.VolumeServerStatus:output_type -> volume_server_pb.VolumeServerStatusResponse + 73, // 80: volume_server_pb.VolumeServer.Query:output_type -> volume_server_pb.QueriedStripe + 75, // 81: volume_server_pb.VolumeServer.VolumeNeedleStatus:output_type -> volume_server_pb.VolumeNeedleStatusResponse + 47, // [47:82] is the sub-list for method output_type + 12, // [12:47] is the sub-list for method input_type 12, // [12:12] is the sub-list for extension type_name 12, // [12:12] is the sub-list for extension extendee 0, // [0:12] is the sub-list for field type_name @@ -5867,7 +6080,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeConfigureRequest); i { + switch v := v.(*VolumeMarkWritableRequest); i { case 0: return &v.state case 1: @@ -5879,7 +6092,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeConfigureResponse); i { + switch v := v.(*VolumeMarkWritableResponse); i { case 0: return &v.state case 1: @@ -5891,7 +6104,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeCopyRequest); i { + switch v := v.(*VolumeConfigureRequest); i { case 0: return &v.state case 1: @@ -5903,7 +6116,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeCopyResponse); i { + switch v := v.(*VolumeConfigureResponse); i { case 0: return &v.state case 1: @@ -5915,7 +6128,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CopyFileRequest); i { + switch v := v.(*VolumeStatusRequest); i { case 0: return &v.state case 1: @@ -5927,7 +6140,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CopyFileResponse); i { + switch v := v.(*VolumeStatusResponse); i { case 0: return &v.state case 1: @@ -5939,7 +6152,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTailSenderRequest); i { + switch v := v.(*VolumeCopyRequest); i { case 0: return &v.state case 1: @@ -5951,7 +6164,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTailSenderResponse); i { + switch v := v.(*VolumeCopyResponse); i { case 0: return &v.state case 1: @@ -5963,7 +6176,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTailReceiverRequest); i { + switch v := v.(*CopyFileRequest); i { case 0: return &v.state case 1: @@ -5975,7 +6188,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTailReceiverResponse); i { + switch v := v.(*CopyFileResponse); i { case 0: return &v.state case 1: @@ -5987,7 +6200,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsGenerateRequest); i { + switch v := v.(*VolumeTailSenderRequest); i { case 0: return &v.state case 1: @@ -5999,7 +6212,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsGenerateResponse); i { + switch v := v.(*VolumeTailSenderResponse); i { case 0: return &v.state case 1: @@ -6011,7 +6224,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsRebuildRequest); i { + switch v := v.(*VolumeTailReceiverRequest); i { case 0: return &v.state case 1: @@ -6023,7 +6236,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsRebuildResponse); i { + switch v := v.(*VolumeTailReceiverResponse); i { case 0: return &v.state case 1: @@ -6035,7 +6248,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsCopyRequest); i { + switch v := v.(*VolumeEcShardsGenerateRequest); i { case 0: return &v.state case 1: @@ -6047,7 +6260,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsCopyResponse); i { + switch v := v.(*VolumeEcShardsGenerateResponse); i { case 0: return &v.state case 1: @@ -6059,7 +6272,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsDeleteRequest); i { + switch v := v.(*VolumeEcShardsRebuildRequest); i { case 0: return &v.state case 1: @@ -6071,7 +6284,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsDeleteResponse); i { + switch v := v.(*VolumeEcShardsRebuildResponse); i { case 0: return &v.state case 1: @@ -6083,7 +6296,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsMountRequest); i { + switch v := v.(*VolumeEcShardsCopyRequest); i { case 0: return &v.state case 1: @@ -6095,7 +6308,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsMountResponse); i { + switch v := v.(*VolumeEcShardsCopyResponse); i { case 0: return &v.state case 1: @@ -6107,7 +6320,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsUnmountRequest); i { + switch v := v.(*VolumeEcShardsDeleteRequest); i { case 0: return &v.state case 1: @@ -6119,7 +6332,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsUnmountResponse); i { + switch v := v.(*VolumeEcShardsDeleteResponse); i { case 0: return &v.state case 1: @@ -6131,7 +6344,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardReadRequest); i { + switch v := v.(*VolumeEcShardsMountRequest); i { case 0: return &v.state case 1: @@ -6143,7 +6356,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardReadResponse); i { + switch v := v.(*VolumeEcShardsMountResponse); i { case 0: return &v.state case 1: @@ -6155,7 +6368,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcBlobDeleteRequest); i { + switch v := v.(*VolumeEcShardsUnmountRequest); i { case 0: return &v.state case 1: @@ -6167,7 +6380,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcBlobDeleteResponse); i { + switch v := v.(*VolumeEcShardsUnmountResponse); i { case 0: return &v.state case 1: @@ -6179,7 +6392,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsToVolumeRequest); i { + switch v := v.(*VolumeEcShardReadRequest); i { case 0: return &v.state case 1: @@ -6191,7 +6404,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeEcShardsToVolumeResponse); i { + switch v := v.(*VolumeEcShardReadResponse); i { case 0: return &v.state case 1: @@ -6203,7 +6416,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVolumeFileStatusRequest); i { + switch v := v.(*VolumeEcBlobDeleteRequest); i { case 0: return &v.state case 1: @@ -6215,7 +6428,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVolumeFileStatusResponse); i { + switch v := v.(*VolumeEcBlobDeleteResponse); i { case 0: return &v.state case 1: @@ -6227,7 +6440,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DiskStatus); i { + switch v := v.(*VolumeEcShardsToVolumeRequest); i { case 0: return &v.state case 1: @@ -6239,7 +6452,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MemStatus); i { + switch v := v.(*VolumeEcShardsToVolumeResponse); i { case 0: return &v.state case 1: @@ -6251,7 +6464,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoteFile); i { + switch v := v.(*ReadVolumeFileStatusRequest); i { case 0: return &v.state case 1: @@ -6263,7 +6476,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeInfo); i { + switch v := v.(*ReadVolumeFileStatusResponse); i { case 0: return &v.state case 1: @@ -6275,7 +6488,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTierMoveDatToRemoteRequest); i { + switch v := v.(*DiskStatus); i { case 0: return &v.state case 1: @@ -6287,7 +6500,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTierMoveDatToRemoteResponse); i { + switch v := v.(*MemStatus); i { case 0: return &v.state case 1: @@ -6299,7 +6512,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTierMoveDatFromRemoteRequest); i { + switch v := v.(*RemoteFile); i { case 0: return &v.state case 1: @@ -6311,7 +6524,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeTierMoveDatFromRemoteResponse); i { + switch v := v.(*VolumeInfo); i { case 0: return &v.state case 1: @@ -6323,7 +6536,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeServerStatusRequest); i { + switch v := v.(*VolumeTierMoveDatToRemoteRequest); i { case 0: return &v.state case 1: @@ -6335,7 +6548,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeServerStatusResponse); i { + switch v := v.(*VolumeTierMoveDatToRemoteResponse); i { case 0: return &v.state case 1: @@ -6347,7 +6560,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { + switch v := v.(*VolumeTierMoveDatFromRemoteRequest); i { case 0: return &v.state case 1: @@ -6359,7 +6572,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueriedStripe); i { + switch v := v.(*VolumeTierMoveDatFromRemoteResponse); i { case 0: return &v.state case 1: @@ -6371,7 +6584,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeNeedleStatusRequest); i { + switch v := v.(*VolumeServerStatusRequest); i { case 0: return &v.state case 1: @@ -6383,7 +6596,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumeNeedleStatusResponse); i { + switch v := v.(*VolumeServerStatusResponse); i { case 0: return &v.state case 1: @@ -6395,7 +6608,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_Filter); i { + switch v := v.(*QueryRequest); i { case 0: return &v.state case 1: @@ -6407,7 +6620,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_InputSerialization); i { + switch v := v.(*QueriedStripe); i { case 0: return &v.state case 1: @@ -6419,7 +6632,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_OutputSerialization); i { + switch v := v.(*VolumeNeedleStatusRequest); i { case 0: return &v.state case 1: @@ -6431,7 +6644,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_InputSerialization_CSVInput); i { + switch v := v.(*VolumeNeedleStatusResponse); i { case 0: return &v.state case 1: @@ -6443,7 +6656,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_InputSerialization_JSONInput); i { + switch v := v.(*QueryRequest_Filter); i { case 0: return &v.state case 1: @@ -6455,7 +6668,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_InputSerialization_ParquetInput); i { + switch v := v.(*QueryRequest_InputSerialization); i { case 0: return &v.state case 1: @@ -6467,7 +6680,7 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest_OutputSerialization_CSVOutput); i { + switch v := v.(*QueryRequest_OutputSerialization); i { case 0: return &v.state case 1: @@ -6479,6 +6692,54 @@ func file_volume_server_proto_init() { } } file_volume_server_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest_InputSerialization_CSVInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_volume_server_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest_InputSerialization_JSONInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_volume_server_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest_InputSerialization_ParquetInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_volume_server_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest_OutputSerialization_CSVOutput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_volume_server_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryRequest_OutputSerialization_JSONOutput); i { case 0: return &v.state @@ -6497,7 +6758,7 @@ func file_volume_server_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_volume_server_proto_rawDesc, NumEnums: 0, - NumMessages: 80, + NumMessages: 84, NumExtensions: 0, NumServices: 1, }, @@ -6537,7 +6798,9 @@ type VolumeServerClient interface { VolumeUnmount(ctx context.Context, in *VolumeUnmountRequest, opts ...grpc.CallOption) (*VolumeUnmountResponse, error) VolumeDelete(ctx context.Context, in *VolumeDeleteRequest, opts ...grpc.CallOption) (*VolumeDeleteResponse, error) VolumeMarkReadonly(ctx context.Context, in *VolumeMarkReadonlyRequest, opts ...grpc.CallOption) (*VolumeMarkReadonlyResponse, error) + VolumeMarkWritable(ctx context.Context, in *VolumeMarkWritableRequest, opts ...grpc.CallOption) (*VolumeMarkWritableResponse, error) VolumeConfigure(ctx context.Context, in *VolumeConfigureRequest, opts ...grpc.CallOption) (*VolumeConfigureResponse, error) + VolumeStatus(ctx context.Context, in *VolumeStatusRequest, opts ...grpc.CallOption) (*VolumeStatusResponse, error) // copy the .idx .dat files, and mount this volume VolumeCopy(ctx context.Context, in *VolumeCopyRequest, opts ...grpc.CallOption) (*VolumeCopyResponse, error) ReadVolumeFileStatus(ctx context.Context, in *ReadVolumeFileStatusRequest, opts ...grpc.CallOption) (*ReadVolumeFileStatusResponse, error) @@ -6711,6 +6974,15 @@ func (c *volumeServerClient) VolumeMarkReadonly(ctx context.Context, in *VolumeM return out, nil } +func (c *volumeServerClient) VolumeMarkWritable(ctx context.Context, in *VolumeMarkWritableRequest, opts ...grpc.CallOption) (*VolumeMarkWritableResponse, error) { + out := new(VolumeMarkWritableResponse) + err := c.cc.Invoke(ctx, "/volume_server_pb.VolumeServer/VolumeMarkWritable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *volumeServerClient) VolumeConfigure(ctx context.Context, in *VolumeConfigureRequest, opts ...grpc.CallOption) (*VolumeConfigureResponse, error) { out := new(VolumeConfigureResponse) err := c.cc.Invoke(ctx, "/volume_server_pb.VolumeServer/VolumeConfigure", in, out, opts...) @@ -6720,6 +6992,15 @@ func (c *volumeServerClient) VolumeConfigure(ctx context.Context, in *VolumeConf return out, nil } +func (c *volumeServerClient) VolumeStatus(ctx context.Context, in *VolumeStatusRequest, opts ...grpc.CallOption) (*VolumeStatusResponse, error) { + out := new(VolumeStatusResponse) + err := c.cc.Invoke(ctx, "/volume_server_pb.VolumeServer/VolumeStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *volumeServerClient) VolumeCopy(ctx context.Context, in *VolumeCopyRequest, opts ...grpc.CallOption) (*VolumeCopyResponse, error) { out := new(VolumeCopyResponse) err := c.cc.Invoke(ctx, "/volume_server_pb.VolumeServer/VolumeCopy", in, out, opts...) @@ -7045,7 +7326,9 @@ type VolumeServerServer interface { VolumeUnmount(context.Context, *VolumeUnmountRequest) (*VolumeUnmountResponse, error) VolumeDelete(context.Context, *VolumeDeleteRequest) (*VolumeDeleteResponse, error) VolumeMarkReadonly(context.Context, *VolumeMarkReadonlyRequest) (*VolumeMarkReadonlyResponse, error) + VolumeMarkWritable(context.Context, *VolumeMarkWritableRequest) (*VolumeMarkWritableResponse, error) VolumeConfigure(context.Context, *VolumeConfigureRequest) (*VolumeConfigureResponse, error) + VolumeStatus(context.Context, *VolumeStatusRequest) (*VolumeStatusResponse, error) // copy the .idx .dat files, and mount this volume VolumeCopy(context.Context, *VolumeCopyRequest) (*VolumeCopyResponse, error) ReadVolumeFileStatus(context.Context, *ReadVolumeFileStatusRequest) (*ReadVolumeFileStatusResponse, error) @@ -7114,9 +7397,15 @@ func (*UnimplementedVolumeServerServer) VolumeDelete(context.Context, *VolumeDel func (*UnimplementedVolumeServerServer) VolumeMarkReadonly(context.Context, *VolumeMarkReadonlyRequest) (*VolumeMarkReadonlyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VolumeMarkReadonly not implemented") } +func (*UnimplementedVolumeServerServer) VolumeMarkWritable(context.Context, *VolumeMarkWritableRequest) (*VolumeMarkWritableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VolumeMarkWritable not implemented") +} func (*UnimplementedVolumeServerServer) VolumeConfigure(context.Context, *VolumeConfigureRequest) (*VolumeConfigureResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VolumeConfigure not implemented") } +func (*UnimplementedVolumeServerServer) VolumeStatus(context.Context, *VolumeStatusRequest) (*VolumeStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VolumeStatus not implemented") +} func (*UnimplementedVolumeServerServer) VolumeCopy(context.Context, *VolumeCopyRequest) (*VolumeCopyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VolumeCopy not implemented") } @@ -7416,6 +7705,24 @@ func _VolumeServer_VolumeMarkReadonly_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _VolumeServer_VolumeMarkWritable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VolumeMarkWritableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VolumeServerServer).VolumeMarkWritable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/volume_server_pb.VolumeServer/VolumeMarkWritable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VolumeServerServer).VolumeMarkWritable(ctx, req.(*VolumeMarkWritableRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _VolumeServer_VolumeConfigure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(VolumeConfigureRequest) if err := dec(in); err != nil { @@ -7434,6 +7741,24 @@ func _VolumeServer_VolumeConfigure_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _VolumeServer_VolumeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VolumeStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VolumeServerServer).VolumeStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/volume_server_pb.VolumeServer/VolumeStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VolumeServerServer).VolumeStatus(ctx, req.(*VolumeStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _VolumeServer_VolumeCopy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(VolumeCopyRequest) if err := dec(in); err != nil { @@ -7846,10 +8171,18 @@ var _VolumeServer_serviceDesc = grpc.ServiceDesc{ MethodName: "VolumeMarkReadonly", Handler: _VolumeServer_VolumeMarkReadonly_Handler, }, + { + MethodName: "VolumeMarkWritable", + Handler: _VolumeServer_VolumeMarkWritable_Handler, + }, { MethodName: "VolumeConfigure", Handler: _VolumeServer_VolumeConfigure_Handler, }, + { + MethodName: "VolumeStatus", + Handler: _VolumeServer_VolumeStatus_Handler, + }, { MethodName: "VolumeCopy", Handler: _VolumeServer_VolumeCopy_Handler, diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go index a058573a3..f81ec649d 100644 --- a/weed/server/volume_grpc_admin.go +++ b/weed/server/volume_grpc_admin.go @@ -149,7 +149,35 @@ func (vs *VolumeServer) VolumeMarkReadonly(ctx context.Context, req *volume_serv } return resp, err +} +func (vs *VolumeServer) VolumeMarkWritable(ctx context.Context, req *volume_server_pb.VolumeMarkWritableRequest) (*volume_server_pb.VolumeMarkWritableResponse, error) { + + resp := &volume_server_pb.VolumeMarkWritableResponse{} + + err := vs.store.MarkVolumeWritable(needle.VolumeId(req.VolumeId)) + + if err != nil { + glog.Errorf("volume mark writable %v: %v", req, err) + } else { + glog.V(2).Infof("volume mark writable %v", req) + } + + return resp, err +} + +func (vs *VolumeServer) VolumeStatus(ctx context.Context, req *volume_server_pb.VolumeStatusRequest) (*volume_server_pb.VolumeStatusResponse, error) { + + resp := &volume_server_pb.VolumeStatusResponse{} + + v := vs.store.GetVolume(needle.VolumeId(req.VolumeId)) + if v == nil { + return nil, fmt.Errorf("not found volume id %d", req.VolumeId) + } + + resp.IsReadOnly = v.IsReadOnly() + + return resp, nil } func (vs *VolumeServer) VolumeServerStatus(ctx context.Context, req *volume_server_pb.VolumeServerStatusRequest) (*volume_server_pb.VolumeServerStatusResponse, error) { diff --git a/weed/shell/command_volume_move.go b/weed/shell/command_volume_move.go index 392b947e7..37174d1d9 100644 --- a/weed/shell/command_volume_move.go +++ b/weed/shell/command_volume_move.go @@ -91,6 +91,43 @@ func LiveMoveVolume(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, so func copyVolume(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, sourceVolumeServer, targetVolumeServer string) (lastAppendAtNs uint64, err error) { + // check to see if the volume is already read-only and if its not then we need + // to mark it as read-only and then before we return we need to undo what we + // did + var shouldMarkWritable bool + defer func() { + if !shouldMarkWritable { + return + } + + clientErr := operation.WithVolumeServerClient(sourceVolumeServer, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { + _, writableErr := volumeServerClient.VolumeMarkWritable(context.Background(), &volume_server_pb.VolumeMarkWritableRequest{ + VolumeId: uint32(volumeId), + }) + return writableErr + }) + if clientErr != nil { + log.Printf("failed to mark volume %d as writable after copy from %s: %v", volumeId, sourceVolumeServer, clientErr) + } + }() + + err = operation.WithVolumeServerClient(sourceVolumeServer, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { + resp, statusErr := volumeServerClient.VolumeStatus(context.Background(), &volume_server_pb.VolumeStatusRequest{ + VolumeId: uint32(volumeId), + }) + if statusErr == nil && !resp.IsReadOnly { + shouldMarkWritable = true + _, readonlyErr := volumeServerClient.VolumeMarkReadonly(context.Background(), &volume_server_pb.VolumeMarkReadonlyRequest{ + VolumeId: uint32(volumeId), + }) + return readonlyErr + } + return statusErr + }) + if err != nil { + return + } + err = operation.WithVolumeServerClient(targetVolumeServer, grpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error { resp, replicateErr := volumeServerClient.VolumeCopy(context.Background(), &volume_server_pb.VolumeCopyRequest{ VolumeId: uint32(volumeId), diff --git a/weed/storage/store.go b/weed/storage/store.go index 68e1653c0..3f16688bf 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -307,7 +307,20 @@ func (s *Store) MarkVolumeReadonly(i needle.VolumeId) error { if v == nil { return fmt.Errorf("volume %d not found", i) } + v.noWriteLock.Lock() v.noWriteOrDelete = true + v.noWriteLock.Unlock() + return nil +} + +func (s *Store) MarkVolumeWritable(i needle.VolumeId) error { + v := s.findVolume(i) + if v == nil { + return fmt.Errorf("volume %d not found", i) + } + v.noWriteLock.Lock() + v.noWriteOrDelete = false + v.noWriteLock.Unlock() return nil } diff --git a/weed/storage/volume.go b/weed/storage/volume.go index 73fdb417d..2d46fbcdf 100644 --- a/weed/storage/volume.go +++ b/weed/storage/volume.go @@ -27,6 +27,7 @@ type Volume struct { needleMapKind NeedleMapType noWriteOrDelete bool // if readonly, either noWriteOrDelete or noWriteCanDelete noWriteCanDelete bool // if readonly, either noWriteOrDelete or noWriteCanDelete + noWriteLock sync.RWMutex hasRemoteFile bool // if the volume has a remote file MemoryMapMaxSizeMb uint32 @@ -58,6 +59,8 @@ func NewVolume(dirname string, collection string, id needle.VolumeId, needleMapK } func (v *Volume) String() string { + v.noWriteLock.RLock() + defer v.noWriteLock.RUnlock() return fmt.Sprintf("Id:%v, dir:%s, Collection:%s, dataFile:%v, nm:%v, noWrite:%v canDelete:%v", v.Id, v.dir, v.Collection, v.DataBackend, v.nm, v.noWriteOrDelete || v.noWriteCanDelete, v.noWriteCanDelete) } @@ -245,5 +248,7 @@ func (v *Volume) RemoteStorageNameKey() (storageName, storageKey string) { } func (v *Volume) IsReadOnly() bool { + v.noWriteLock.RLock() + defer v.noWriteLock.RUnlock() return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow } diff --git a/weed/storage/volume_super_block.go b/weed/storage/volume_super_block.go index 5e913e062..20223ac1b 100644 --- a/weed/storage/volume_super_block.go +++ b/weed/storage/volume_super_block.go @@ -26,8 +26,10 @@ func (v *Volume) maybeWriteSuperBlock() error { if dataFile, e = os.Create(v.DataBackend.Name()); e == nil { v.DataBackend = backend.NewDiskFile(dataFile) if _, e = v.DataBackend.WriteAt(v.SuperBlock.Bytes(), 0); e == nil { + v.noWriteLock.Lock() v.noWriteOrDelete = false v.noWriteCanDelete = false + v.noWriteLock.Unlock() } } } From c45ba5d7d4e7bdd21dd0868e6336d088b6483560 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 12:07:43 -0700 Subject: [PATCH 80/81] fix listObjectsV2 response format fix https://github.com/chrislusf/seaweedfs/issues/1426 issue 1 --- test/s3/basic/basic_test.go | 21 +++++++++++++++++++-- weed/Makefile | 4 ++++ weed/s3api/s3api_objects_list_handlers.go | 9 ++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/test/s3/basic/basic_test.go b/test/s3/basic/basic_test.go index 1f9e74fc1..653fa1237 100644 --- a/test/s3/basic/basic_test.go +++ b/test/s3/basic/basic_test.go @@ -61,7 +61,7 @@ func TestCreateBucket(t *testing.T) { } -func TestListBuckets(t *testing.T) { +func TestPutObject(t *testing.T) { input := &s3.PutObjectInput{ ACL: aws.String("authenticated-read"), @@ -89,7 +89,7 @@ func TestListBuckets(t *testing.T) { } -func TestPutObject(t *testing.T) { +func TestListBucket(t *testing.T) { result, err := svc.ListBuckets(nil) if err != nil { @@ -105,6 +105,23 @@ func TestPutObject(t *testing.T) { } +func TestListObjectV2(t *testing.T) { + + listObj, err := svc.ListObjectsV2(&s3.ListObjectsV2Input{ + Bucket: aws.String(Bucket), + Prefix: aws.String("foo"), + Delimiter: aws.String("/"), + }) + if err != nil { + exitErrorf("Unable to list objects, %v", err) + } + for _, content := range listObj.Contents { + fmt.Println(aws.StringValue(content.Key)) + } + fmt.Printf("list: %s\n", listObj) + +} + func exitErrorf(msg string, args ...interface{}) { fmt.Fprintf(os.Stderr, msg+"\n", args...) os.Exit(1) diff --git a/weed/Makefile b/weed/Makefile index 896067df0..ec95aeacb 100644 --- a/weed/Makefile +++ b/weed/Makefile @@ -13,3 +13,7 @@ clean: debug_mount: go build -gcflags="all=-N -l" dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- mount -dir=~/tmp/mm + +debug_server: + go build -gcflags="all=-N -l" + dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec weed -- server -dir=/Volumes/mobile_disk/99 -filer -volume.port=8343 -s3 -volume.max=0 diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index 46d5b90c7..3354dd2b3 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -112,12 +112,12 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m if strings.HasPrefix(reqDir, "/") { reqDir = reqDir[1:] } + bucketPrefix := fmt.Sprintf("%s/%s/", s3a.option.BucketsPath, bucket) + reqDir = fmt.Sprintf("%s%s", bucketPrefix, reqDir) if strings.HasSuffix(reqDir, "/") { // remove trailing "/" reqDir = reqDir[:len(reqDir)-1] } - bucketPrefix := fmt.Sprintf("%s/%s/", s3a.option.BucketsPath, bucket) - reqDir = fmt.Sprintf("%s%s", bucketPrefix, reqDir) var contents []ListEntry var commonPrefixes []PrefixEntry @@ -131,14 +131,13 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m _, isTruncated, nextMarker, doErr = s3a.doListFilerEntries(client, reqDir, prefix, maxKeys, marker, delimiter, func(dir string, entry *filer_pb.Entry) { if entry.IsDirectory { if delimiter == "/" { - prefix = fmt.Sprintf("%s%s/", dir, entry.Name) commonPrefixes = append(commonPrefixes, PrefixEntry{ - Prefix: prefix[len(bucketPrefix):], + Prefix: fmt.Sprintf("%s/%s/", dir, entry.Name)[len(bucketPrefix):], }) } } else { contents = append(contents, ListEntry{ - Key: fmt.Sprintf("%s%s", dir[len(bucketPrefix):], entry.Name), + Key: fmt.Sprintf("%s/%s", dir, entry.Name)[len(bucketPrefix):], LastModified: time.Unix(entry.Attributes.Mtime, 0).UTC(), ETag: "\"" + filer2.ETag(entry) + "\"", Size: int64(filer2.FileSize(entry)), From f48567c5c62bf8c8cebf568eeb919f25a4fc4289 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 19 Aug 2020 22:53:49 -0700 Subject: [PATCH 81/81] remove unused function --- weed/filesys/dirty_page.go | 3 --- weed/filesys/filehandle.go | 1 - 2 files changed, 4 deletions(-) diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index bfb417ea9..88a1a4f55 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -25,9 +25,6 @@ func newDirtyPages(file *File) *ContinuousDirtyPages { } } -func (pages *ContinuousDirtyPages) releaseResource() { -} - var counter = int32(0) func (pages *ContinuousDirtyPages) AddPage(offset int64, data []byte) (chunks []*filer_pb.FileChunk, err error) { diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 9186eddbb..94590f842 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -166,7 +166,6 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err if fh.f.isOpen <= 0 { fh.doFlush(ctx, req.Header) - fh.dirtyPages.releaseResource() fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle)) fh.f.entryViewCache = nil fh.f.reader = nil