|
|
@ -19,8 +19,8 @@ func NewLocalTopicManager() *LocalTopicManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// AddTopicPartition adds a topic to the local topic manager
|
|
|
|
func (manager *LocalTopicManager) AddTopicPartition(topic Topic, localPartition *LocalPartition) { |
|
|
|
// AddLocalPartition adds a topic to the local topic manager
|
|
|
|
func (manager *LocalTopicManager) AddLocalPartition(topic Topic, localPartition *LocalPartition) { |
|
|
|
localTopic, ok := manager.topics.Get(topic.String()) |
|
|
|
if !ok { |
|
|
|
localTopic = NewLocalTopic(topic) |
|
|
@ -34,8 +34,8 @@ func (manager *LocalTopicManager) AddTopicPartition(topic Topic, localPartition |
|
|
|
localTopic.Partitions = append(localTopic.Partitions, localPartition) |
|
|
|
} |
|
|
|
|
|
|
|
// GetTopicPartition gets a topic from the local topic manager
|
|
|
|
func (manager *LocalTopicManager) GetTopicPartition(topic Topic, partition Partition) *LocalPartition { |
|
|
|
// GetLocalPartition gets a topic from the local topic manager
|
|
|
|
func (manager *LocalTopicManager) GetLocalPartition(topic Topic, partition Partition) *LocalPartition { |
|
|
|
localTopic, ok := manager.topics.Get(topic.String()) |
|
|
|
if !ok { |
|
|
|
return nil |
|
|
@ -48,7 +48,7 @@ func (manager *LocalTopicManager) RemoveTopic(topic Topic) { |
|
|
|
manager.topics.Remove(topic.String()) |
|
|
|
} |
|
|
|
|
|
|
|
func (manager *LocalTopicManager) RemoveTopicPartition(topic Topic, partition Partition) (removed bool) { |
|
|
|
func (manager *LocalTopicManager) RemoveLocalPartition(topic Topic, partition Partition) (removed bool) { |
|
|
|
localTopic, ok := manager.topics.Get(topic.String()) |
|
|
|
if !ok { |
|
|
|
return false |
|
|
|