SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
refactor out FilerClientAccessor
chrislu25b2850e7d2f
diff --git a/weed/mq/sub_coordinator/filer_client_accessor.go b/weed/filer_client/filer_client_accessor.gosimilarity index 98%rename from weed/mq/sub_coordinator/filer_client_accessor.gorename to weed/filer_client/filer_client_accessor.goindex dc50ac1282..be70f2b821 100644--- a/weed/mq/sub_coordinator/filer_client_accessor.go+++ b/weed/filer_client/filer_client_accessor.go@@ -1,4 +1,4 @@-package sub_coordinator+package filer_clientimport ("bytes"diff --git a/weed/mq/broker/broker_server.go b/weed/mq/broker/broker_server.goindex f0a1f1254d..f002bf31a7 100644--- a/weed/mq/broker/broker_server.go+++ b/weed/mq/broker/broker_server.go@@ -1,6 +1,7 @@package brokerimport (+ "github.com/seaweedfs/seaweedfs/weed/filer_client""github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer""github.com/seaweedfs/seaweedfs/weed/mq/sub_coordinator"@@ -47,7 +48,7 @@ type MessageQueueBroker struct {lockAsBalancer *cluster.LiveLockSubCoordinator *sub_coordinator.SubCoordinatoraccessLock sync.Mutex- fca *sub_coordinator.FilerClientAccessor+ fca *filer_client.FilerClientAccessor}func NewMessageBroker(option *MessageQueueBrokerOption, grpcDialOption grpc.DialOption) (mqBroker *MessageQueueBroker, err error) {@@ -64,7 +65,7 @@ func NewMessageBroker(option *MessageQueueBrokerOption, grpcDialOption grpc.DialPubBalancer: pubBalancer,SubCoordinator: subCoordinator,}- fca := &sub_coordinator.FilerClientAccessor{+ fca := &filer_client.FilerClientAccessor{GetFiler: mqBroker.GetFiler,GetGrpcDialOption: mqBroker.GetGrpcDialOption,}diff --git a/weed/mq/sub_coordinator/consumer_group.go b/weed/mq/sub_coordinator/consumer_group.goindex 2474342889..80a2d5f80c 100644--- a/weed/mq/sub_coordinator/consumer_group.go+++ b/weed/mq/sub_coordinator/consumer_group.go@@ -3,6 +3,7 @@ package sub_coordinatorimport ("fmt"cmap "github.com/orcaman/concurrent-map/v2"+ "github.com/seaweedfs/seaweedfs/weed/filer_client""github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/mq/topic""github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"@@ -15,11 +16,11 @@ type ConsumerGroup struct {ConsumerGroupInstances cmap.ConcurrentMap[string, *ConsumerGroupInstance]Market *MarketreBalanceTimer *time.Timer- filerClientAccessor *FilerClientAccessor+ filerClientAccessor *filer_client.FilerClientAccessorstopCh chan struct{}}-func NewConsumerGroup(t *mq_pb.Topic, reblanceSeconds int32, filerClientAccessor *FilerClientAccessor) *ConsumerGroup {+func NewConsumerGroup(t *mq_pb.Topic, reblanceSeconds int32, filerClientAccessor *filer_client.FilerClientAccessor) *ConsumerGroup {cg := &ConsumerGroup{topic: topic.FromPbTopic(t),ConsumerGroupInstances: cmap.New[*ConsumerGroupInstance](),diff --git a/weed/mq/sub_coordinator/sub_coordinator.go b/weed/mq/sub_coordinator/sub_coordinator.goindex 0042b8e946..47101eee41 100644--- a/weed/mq/sub_coordinator/sub_coordinator.go+++ b/weed/mq/sub_coordinator/sub_coordinator.go@@ -3,6 +3,7 @@ package sub_coordinatorimport ("fmt"cmap "github.com/orcaman/concurrent-map/v2"+ "github.com/seaweedfs/seaweedfs/weed/filer_client""github.com/seaweedfs/seaweedfs/weed/pb/mq_pb")@@ -18,7 +19,7 @@ type TopicConsumerGroups struct {type SubCoordinator struct {// map topic name to consumer groupsTopicSubscribers cmap.ConcurrentMap[string, *TopicConsumerGroups]- FilerClientAccessor *FilerClientAccessor+ FilerClientAccessor *filer_client.FilerClientAccessor}func NewSubCoordinator() *SubCoordinator {