aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_super_block.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-04-19 12:29:49 -0700
committerChris Lu <chris.lu@gmail.com>2019-04-19 12:29:49 -0700
commit3b3651dea3277a8f816226ba191d106ede70f2dd (patch)
treecc42eea0d125f9f899a23bb6a50d2a0c27c89db9 /weed/storage/volume_super_block.go
parent730a032137df3d13d5dc4d21f25133edd5e5fa23 (diff)
downloadseaweedfs-3b3651dea3277a8f816226ba191d106ede70f2dd.tar.xz
seaweedfs-3b3651dea3277a8f816226ba191d106ede70f2dd.zip
volume: atomic copying file, adds version and stopOffset
Diffstat (limited to 'weed/storage/volume_super_block.go')
-rw-r--r--weed/storage/volume_super_block.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/weed/storage/volume_super_block.go b/weed/storage/volume_super_block.go
index cdb668888..164c887e1 100644
--- a/weed/storage/volume_super_block.go
+++ b/weed/storage/volume_super_block.go
@@ -24,12 +24,12 @@ const (
* Rest bytes: Reserved
*/
type SuperBlock struct {
- version needle.Version
- ReplicaPlacement *ReplicaPlacement
- Ttl *needle.TTL
- CompactRevision uint16
- Extra *master_pb.SuperBlockExtra
- extraSize uint16
+ version needle.Version
+ ReplicaPlacement *ReplicaPlacement
+ Ttl *needle.TTL
+ CompactionRevision uint16
+ Extra *master_pb.SuperBlockExtra
+ extraSize uint16
}
func (s *SuperBlock) BlockSize() int {
@@ -48,7 +48,7 @@ func (s *SuperBlock) Bytes() []byte {
header[0] = byte(s.version)
header[1] = s.ReplicaPlacement.Byte()
s.Ttl.ToBytes(header[2:4])
- util.Uint16toBytes(header[4:6], s.CompactRevision)
+ util.Uint16toBytes(header[4:6], s.CompactionRevision)
if s.Extra != nil {
extraData, err := proto.Marshal(s.Extra)
@@ -112,7 +112,7 @@ func ReadSuperBlock(dataFile *os.File) (superBlock SuperBlock, err error) {
return
}
superBlock.Ttl = needle.LoadTTLFromBytes(header[2:4])
- superBlock.CompactRevision = util.BytesToUint16(header[4:6])
+ superBlock.CompactionRevision = util.BytesToUint16(header[4:6])
superBlock.extraSize = util.BytesToUint16(header[6:8])
if superBlock.extraSize > 0 {