forked from TrueCloudLab/frostfs-node
[#1442] pilorama: Generate timestamp based on node position in the container
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
3caa982283
commit
4437cd7113
13 changed files with 333 additions and 169 deletions
|
@ -133,11 +133,11 @@ func (s *state) removeChild(child, parent Node) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *state) timestamp() Timestamp {
|
||||
func (s *state) timestamp(pos, size int) Timestamp {
|
||||
if len(s.operations) == 0 {
|
||||
return 0
|
||||
return nextTimestamp(0, uint64(pos), uint64(size))
|
||||
}
|
||||
return s.operations[len(s.operations)-1].Time + 1
|
||||
return nextTimestamp(s.operations[len(s.operations)-1].Time, uint64(pos), uint64(size))
|
||||
}
|
||||
|
||||
func (s *state) findSpareID() Node {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue