diff options
Diffstat (limited to 'weed/wdclient/wdclient.go')
| -rw-r--r-- | weed/wdclient/wdclient.go | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/weed/wdclient/wdclient.go b/weed/wdclient/wdclient.go index cbe03359f..b16e239fb 100644 --- a/weed/wdclient/wdclient.go +++ b/weed/wdclient/wdclient.go @@ -2,41 +2,18 @@ package wdclient import ( "context" - "code.uber.internal/fraud/alpine/.gen/proto/go/fraud/alpine" ) type SeaweedClient struct { - ctx context.Context - Master string - ClientName string - ClusterListener *clusterlistener.ClusterListener + ctx context.Context + Master string + ClientName string } -// NewSeaweedClient creates a SeaweedFS client which contains a listener for the Seaweed system topology changes -func NewSeaweedClient(ctx context.Context, clientName, master string) *SeaweedClient { - c := &SeaweedClient{ - ctx: ctx, - Master: master, - ClusterListener: clusterlistener.NewClusterListener(clientName), - ClientName: clientName, - } - c.ClusterListener.StartListener(ctx, c.Master) +func NewSeaweedClient(ctx context.Context, clientName string, masters []string) *SeaweedClient { + return &SeaweedClient{ + ctx: ctx, + ClientName: clientName, - conn, err := grpc.Dial(c.Master, grpc.WithInsecure()) - if err != nil { - glog.Fatalf("%s fail to dial %v: %v", c.ClientName, c.Master, err) } - c.MasterClient = pb.NewAlpineMasterClient(conn) - - return c -} - -// NewClusterClient create a lightweight client to access a specific cluster -// TODO The call will block if the keyspace is not created in this data center. -func (c *SeaweedClient) NewClusterClient(keyspace string) (clusterClient *ClusterClient) { - - return &ClusterClient{ - keyspace: keyspace, - } - } |
