fix leader master /dir/lookup api

Signed-off-by: Lei Liu <lei01.liu@horizon.ai>
This commit is contained in:
Lei Liu
2019-10-30 15:49:58 +08:00
parent 57e441d67b
commit f2f90436ef
4 changed files with 15 additions and 9 deletions

View File

@@ -15,12 +15,12 @@ func NewMemorySequencer() (m *MemorySequencer) {
return
}
func (m *MemorySequencer) NextFileId(count uint64) (uint64, uint64) {
func (m *MemorySequencer) NextFileId(count uint64) uint64 {
m.sequenceLock.Lock()
defer m.sequenceLock.Unlock()
ret := m.counter
m.counter += uint64(count)
return ret, count
m.counter += count
return ret
}
func (m *MemorySequencer) SetMax(seenValue uint64) {

View File

@@ -1,7 +1,7 @@
package sequence
type Sequencer interface {
NextFileId(count uint64) (uint64, uint64)
NextFileId(count uint64) uint64
SetMax(uint64)
Peek() uint64
}