extend export command to show tombstone + change output format to CSV

merging https://github.com/chrislusf/seaweedfs/pull/610 and add "-limit" option
This commit is contained in:
Chris Lu
2018-07-14 20:51:17 -07:00
parent 85eae57e4c
commit 3edfe1d28f
3 changed files with 90 additions and 52 deletions

View File

@@ -258,3 +258,7 @@ func ParseNeedleIdCookie(key_hash_string string) (NeedleId, Cookie, error) {
}
return needleId, cookie, nil
}
func (n *Needle) LastModifiedString() string {
return time.Unix(int64(n.LastModified), 0).Format("2006-01-02T15:04:05")
}

View File

@@ -217,7 +217,11 @@ func ScanVolumeFile(dirname string, collection string, id VolumeId,
glog.V(4).Infof("Adjusting n.Size %d=>0 rest:%d=>%d %+v", oldSize, oldRest, rest, n)
}
}
if err = visitNeedle(n, offset); err != nil {
err = visitNeedle(n, offset)
if err == io.EOF {
return nil
}
if err != nil {
glog.V(0).Infof("visit needle error: %v", err)
}
offset += NeedleEntrySize + rest