mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-10 00:07:44 +02:00
flush to disk
Need to do: read from disk
This commit is contained in:
1 parent
fbb4917e2f
commit
d51efddf5c
5 files changed
+125
-10
No files matched your search
@@ -22,6 +22,8 @@ type dataToFlush struct {
|
||||
data *bytes.Buffer
|
||||
}
|
||||
|
||||
type LogFlushFuncType func(startTime, stopTime time.Time, buf []byte)
|
||||
|
||||
type LogBuffer struct {
|
||||
name string
|
||||
prevBuffers *SealedBuffers
|
||||
@@ -34,7 +36,7 @@ type LogBuffer struct {
|
||||
lastFlushTime time.Time
|
||||
sizeBuf []byte
|
||||
flushInterval time.Duration
|
||||
flushFn func(startTime, stopTime time.Time, buf []byte)
|
||||
flushFn LogFlushFuncType
|
||||
notifyFn func()
|
||||
isStopping *atomic.Bool
|
||||
flushChan chan *dataToFlush
|
||||
@@ -42,7 +44,7 @@ type LogBuffer struct {
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
func NewLogBuffer(name string, flushInterval time.Duration, flushFn func(startTime, stopTime time.Time, buf []byte), notifyFn func()) *LogBuffer {
|
||||
func NewLogBuffer(name string, flushInterval time.Duration, flushFn LogFlushFuncType, notifyFn func()) *LogBuffer {
|
||||
lb := &LogBuffer{
|
||||
name: name,
|
||||
prevBuffers: newSealedBuffers(PreviousBufferCount),
|
||||
|
||||
Reference in new issue
Block a user