mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
20 lines
323 B
Go
20 lines
323 B
Go
|
package sequence
|
||
|
|
||
|
import ()
|
||
|
|
||
|
// just for testing
|
||
|
type MemorySequencer struct {
|
||
|
counter uint64
|
||
|
}
|
||
|
|
||
|
func NewMemorySequencer() (m *MemorySequencer) {
|
||
|
m = &MemorySequencer{counter: 1}
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (m *MemorySequencer) NextFileId(count int) (uint64, int) {
|
||
|
ret := m.counter
|
||
|
m.counter += uint64(count)
|
||
|
return ret, count
|
||
|
}
|