forked from TrueCloudLab/frostfs-node
12 lines
333 B
Go
12 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
|
||
|
}
|