fix import cycle

This commit is contained in:
Chris Lu
2020-12-06 20:12:52 -08:00
parent ae5eb85a06
commit 9acda432fe
3 changed files with 28 additions and 24 deletions

View File

@@ -1,13 +1,9 @@
package filer_pb
import (
"bytes"
"context"
"errors"
"fmt"
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/wdclient"
"math"
"strings"
"github.com/chrislusf/seaweedfs/weed/glog"
@@ -126,25 +122,6 @@ func LookupEntry(client SeaweedFilerClient, request *LookupDirectoryEntryRequest
return resp, nil
}
func ReadEntry(masterClient *wdclient.MasterClient, filerClient SeaweedFilerClient, dir, name string, byteBuffer *bytes.Buffer) error {
request := &LookupDirectoryEntryRequest{
Directory: filer.DirectoryEtc,
Name: filer.FilerConfName,
}
respLookupEntry, err := LookupEntry(filerClient, request)
if err != nil {
return err
}
if len(respLookupEntry.Entry.Content) > 0 {
_, err = byteBuffer.Write(respLookupEntry.Entry.Content)
return err
}
return filer.StreamContent(masterClient, byteBuffer, respLookupEntry.Entry.Chunks, 0, math.MaxInt64)
}
var ErrNotFound = errors.New("filer: no entry is found in filer store")
func IsCreate(event *SubscribeMetadataResponse) bool {