aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-05-12 21:26:49 -0700
committerChris Lu <chris.lu@gmail.com>2020-05-12 21:26:49 -0700
commit25257acd51085c3be360f6f516e7019b79c1b813 (patch)
tree883d40afe615c1e5e246c320d4679f9980746d26
parenta7959c1c488f5662dc2f867e0dbeeebf3899bbe3 (diff)
downloadseaweedfs-25257acd51085c3be360f6f516e7019b79c1b813.tar.xz
seaweedfs-25257acd51085c3be360f6f516e7019b79c1b813.zip
rename
-rw-r--r--weed/messaging/broker/topic_manager.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/weed/messaging/broker/topic_manager.go b/weed/messaging/broker/topic_manager.go
index e5cebb42d..7cc8601eb 100644
--- a/weed/messaging/broker/topic_manager.go
+++ b/weed/messaging/broker/topic_manager.go
@@ -36,14 +36,14 @@ type TopicCursor struct {
type TopicManager struct {
sync.Mutex
- topicControls map[TopicPartition]*TopicCursor
- broker *MessageBroker
+ topicCursors map[TopicPartition]*TopicCursor
+ broker *MessageBroker
}
func NewTopicManager(messageBroker *MessageBroker) *TopicManager {
return &TopicManager{
- topicControls: make(map[TopicPartition]*TopicCursor),
- broker: messageBroker,
+ topicCursors: make(map[TopicPartition]*TopicCursor),
+ broker: messageBroker,
}
}
@@ -79,10 +79,10 @@ func (tm *TopicManager) RequestLock(partition TopicPartition, topicConfig *messa
tm.Lock()
defer tm.Unlock()
- lock, found := tm.topicControls[partition]
+ lock, found := tm.topicCursors[partition]
if !found {
lock = &TopicCursor{}
- tm.topicControls[partition] = lock
+ tm.topicCursors[partition] = lock
lock.subscriptions = NewTopicPartitionSubscriptions()
lock.logBuffer = tm.buildLogBuffer(lock, partition, topicConfig)
}
@@ -98,7 +98,7 @@ func (tm *TopicManager) ReleaseLock(partition TopicPartition, isPublisher bool)
tm.Lock()
defer tm.Unlock()
- lock, found := tm.topicControls[partition]
+ lock, found := tm.topicCursors[partition]
if !found {
return
}
@@ -108,7 +108,7 @@ func (tm *TopicManager) ReleaseLock(partition TopicPartition, isPublisher bool)
lock.subscriberCount--
}
if lock.subscriberCount <= 0 && lock.publisherCount <= 0 {
- delete(tm.topicControls, partition)
+ delete(tm.topicCursors, partition)
lock.logBuffer.Shutdown()
}
}
@@ -117,7 +117,7 @@ func (tm *TopicManager) ListTopicPartitions() (tps []TopicPartition) {
tm.Lock()
defer tm.Unlock()
- for k := range tm.topicControls {
+ for k := range tm.topicCursors {
tps = append(tps, k)
}
return