forked from TrueCloudLab/frostfs-node
4437cd7113
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
11 lines
333 B
Go
11 lines
333 B
Go
package pilorama
|
|
|
|
// nextTimestamp accepts the latest local timestamp, node position in a container and container size.
|
|
// Returns the next timestamp which can be generated by this node.
|
|
func nextTimestamp(ts Timestamp, pos, size uint64) Timestamp {
|
|
base := ts/size*size + pos
|
|
if ts < base {
|
|
return base
|
|
}
|
|
return base + size
|
|
}
|