Browse Source

rename

pull/1383/head
Chris Lu 5 years ago
parent
commit
49929e0869
  1. 6
      weed/filer2/filer.go
  2. 2
      weed/filer2/filer_notify.go
  3. 4
      weed/server/filer_grpc_server_sub_meta.go

6
weed/filer2/filer.go

@ -35,7 +35,7 @@ type Filer struct {
FsyncBuckets []string
buckets *FilerBuckets
Cipher bool
MetaLogBuffer *log_buffer.LogBuffer
LocalMetaLogBuffer *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.LocalMetaLogBuffer = log_buffer.NewLogBuffer(time.Minute, f.logFlushFunc, notifyFn)
f.metaLogCollection = collection
f.metaLogReplication = replication
@ -318,6 +318,6 @@ func (f *Filer) cacheSetDirectory(dirpath string, dirEntry *Entry, level int) {
}
func (f *Filer) Shutdown() {
f.MetaLogBuffer.Shutdown()
f.LocalMetaLogBuffer.Shutdown()
f.store.Shutdown()
}

2
weed/filer2/filer_notify.go

@ -67,7 +67,7 @@ func (f *Filer) logMetaEvent(ctx context.Context, fullpath string, eventNotifica
return
}
f.MetaLogBuffer.AddToBuffer([]byte(dir), data)
f.LocalMetaLogBuffer.AddToBuffer([]byte(dir), data)
}

4
weed/server/filer_grpc_server_sub_meta.go

@ -37,7 +37,7 @@ func (fs *FilerServer) SubscribeMetadata(req *filer_pb.SubscribeMetadataRequest,
lastReadTime = time.Unix(0, processedTsNs)
}
err = fs.filer.MetaLogBuffer.LoopProcessLogData(lastReadTime, func() bool {
err = fs.filer.LocalMetaLogBuffer.LoopProcessLogData(lastReadTime, func() bool {
fs.listenersLock.Lock()
fs.listenersCond.Wait()
fs.listenersLock.Unlock()
@ -63,7 +63,7 @@ func (fs *FilerServer) SubscribeLocalMetadata(req *filer_pb.SubscribeMetadataReq
eachLogEntryFn := eachLogEntryFn(eachEventNotificationFn)
err := fs.filer.MetaLogBuffer.LoopProcessLogData(lastReadTime, func() bool {
err := fs.filer.LocalMetaLogBuffer.LoopProcessLogData(lastReadTime, func() bool {
fs.listenersLock.Lock()
fs.listenersCond.Wait()
fs.listenersLock.Unlock()

Loading…
Cancel
Save