diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-05-25 23:50:19 -0700 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-05-25 23:50:19 -0700 |
| commit | 36a31771f1131f31b6783a8125e033b81a24e1a2 (patch) | |
| tree | 53f7df9ada1ad136a008efbdad688bda81bc688f | |
| parent | 8f88d382a5544fdcbda3494feaf6e4b533c2436d (diff) | |
| download | seaweedfs-36a31771f1131f31b6783a8125e033b81a24e1a2.tar.xz seaweedfs-36a31771f1131f31b6783a8125e033b81a24e1a2.zip | |
Add Key String() function
| -rw-r--r-- | go/storage/compact_map.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/go/storage/compact_map.go b/go/storage/compact_map.go index ef0a3951f..ff3621910 100644 --- a/go/storage/compact_map.go +++ b/go/storage/compact_map.go @@ -1,5 +1,7 @@ package storage +import "strconv" + type NeedleValue struct { Key Key Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G @@ -12,6 +14,10 @@ const ( type Key uint64 +func (k Key) String() string { + return strconv.FormatUint(uint64(k), 10) +} + type CompactSection struct { values []NeedleValue overflow map[Key]NeedleValue |
