diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index 07eb994e8..ee245fa34 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -35,7 +35,7 @@ type Filer struct { FsyncBuckets []string buckets *FilerBuckets Cipher bool - metaLogBuffer *log_buffer.LogBuffer + MetaLogBuffer *log_buffer.LogBuffer metaLogCollection string metaLogReplication string } @@ -47,7 +47,7 @@ func NewFiler(masters []string, grpcDialOption grpc.DialOption, filerHost string fileIdDeletionQueue: util.NewUnboundedQueue(), GrpcDialOption: grpcDialOption, } - f.metaLogBuffer = log_buffer.NewLogBuffer(time.Minute, f.logFlushFunc, notifyFn) + f.MetaLogBuffer = log_buffer.NewLogBuffer(time.Minute, f.logFlushFunc, notifyFn) f.metaLogCollection = collection f.metaLogReplication = replication @@ -316,6 +316,6 @@ func (f *Filer) cacheSetDirectory(dirpath string, dirEntry *Entry, level int) { } func (f *Filer) Shutdown() { - f.metaLogBuffer.Shutdown() + f.MetaLogBuffer.Shutdown() f.store.Shutdown() } diff --git a/weed/filer2/filer_notify.go b/weed/filer2/filer_notify.go index 94fbae4c4..ac7ae4e4c 100644 --- a/weed/filer2/filer_notify.go +++ b/weed/filer2/filer_notify.go @@ -64,7 +64,7 @@ func (f *Filer) logMetaEvent(fullpath string, eventNotification *filer_pb.EventN return } - f.metaLogBuffer.AddToBuffer([]byte(dir), data) + f.MetaLogBuffer.AddToBuffer([]byte(dir), data) } @@ -83,11 +83,11 @@ func (f *Filer) logFlushFunc(startTime, stopTime time.Time, buf []byte) { func (f *Filer) ReadLogBuffer(lastReadTime time.Time, eachEventFn func(fullpath string, eventNotification *filer_pb.EventNotification) error) (newLastReadTime time.Time, err error) { var bytesBuf *bytes.Buffer - bytesBuf = f.metaLogBuffer.ReadFromBuffer(lastReadTime) + bytesBuf = f.MetaLogBuffer.ReadFromBuffer(lastReadTime) if bytesBuf == nil { return } - defer f.metaLogBuffer.ReleaseMeory(bytesBuf) + defer f.MetaLogBuffer.ReleaseMeory(bytesBuf) buf := bytesBuf.Bytes() var processedTs int64 diff --git a/weed/server/filer_grpc_server_listen.go b/weed/server/filer_grpc_server_listen.go index ea3abe28f..e3de57145 100644 --- a/weed/server/filer_grpc_server_listen.go +++ b/weed/server/filer_grpc_server_listen.go @@ -22,6 +22,7 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest, if req.SinceNs > 0 { lastReadTime = time.Unix(0, req.SinceNs) } + var readErr error for { diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 4333df1b4..06bec2e88 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -12,7 +12,8 @@ import ( ) func (logBuffer *LogBuffer) LoopProcessLogData( - startTreadTime time.Time, waitForDataFn func() bool, eachLogDataFn func(logEntry *filer_pb.LogEntry) error) (processed int64, err error) { + startTreadTime time.Time, waitForDataFn func() bool, + eachLogDataFn func(logEntry *filer_pb.LogEntry) error) (processed int64, err error) { // loop through all messages var bytesBuf *bytes.Buffer lastReadTime := startTreadTime