aboutsummaryrefslogtreecommitdiff
path: root/weed/storage
diff options
context:
space:
mode:
authorChris Lu <chris.lu@uber.com>2019-03-17 23:28:43 -0700
committerChris Lu <chris.lu@uber.com>2019-03-17 23:28:43 -0700
commit44647a46c0dc82350cc994da0784f3c3936270d6 (patch)
treee2255ae420748b3c39af9868fd98857715e05076 /weed/storage
parent8b26d1574005a993659245599d3db40d3308e011 (diff)
downloadseaweedfs-44647a46c0dc82350cc994da0784f3c3936270d6.tar.xz
seaweedfs-44647a46c0dc82350cc994da0784f3c3936270d6.zip
needle scanner read appendAtNs
Diffstat (limited to 'weed/storage')
-rw-r--r--weed/storage/needle_read_write.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/storage/needle_read_write.go b/weed/storage/needle_read_write.go
index c99395f8b..e69d70dc3 100644
--- a/weed/storage/needle_read_write.go
+++ b/weed/storage/needle_read_write.go
@@ -283,6 +283,7 @@ func NeedleBodyLength(needleSize uint32, version Version) int64 {
//n should be a needle already read the header
//the input stream will read until next file entry
func (n *Needle) ReadNeedleBody(r *os.File, version Version, offset int64, bodyLength int64) (err error) {
+
if bodyLength <= 0 {
return nil
}
@@ -301,6 +302,11 @@ func (n *Needle) ReadNeedleBody(r *os.File, version Version, offset int64, bodyL
}
n.readNeedleDataVersion2(bytes[0:n.Size])
n.Checksum = NewCRC(n.Data)
+
+ if version == Version3 {
+ tsOffset := n.Size+NeedleChecksumSize
+ n.AppendAtNs = util.BytesToUint64(bytes[tsOffset : tsOffset+TimestampSize])
+ }
default:
err = fmt.Errorf("Unsupported Version! (%d)", version)
}