MCPcopy
hub / github.com/redpanda-data/console / Set

Method Set

backend/pkg/console/log_dir_topic.go:44–56  ·  view source on GitHub ↗

Set adds or updates partitions for a topic to the topics set. If no partitions are added, this still creates the topic.

(t string, ps ...partitionInfo)

Source from the content-addressed store, hash-verified

42// Set adds or updates partitions for a topic to the topics set. If no partitions are
43// added, this still creates the topic.
44func (ts *topicsSetWithLogDirs) Set(t string, ps ...partitionInfo) {
45 if *ts == nil {
46 *ts = make(map[string]map[int32]partitionInfo)
47 }
48 existing := (*ts)[t]
49 if existing == nil {
50 existing = make(map[int32]partitionInfo, len(ps))
51 (*ts)[t] = existing
52 }
53 for _, p := range ps {
54 existing[p.PartitionID] = p
55 }
56}
57
58// EachPartition calls fn for each partition in any directory.
59func (ts topicsSetWithLogDirs) EachPartition(fn func(p partitionInfo)) {

Callers 3

logDirsByTopicMethod · 0.95
TestTopicsSetWithLogDirsFunction · 0.95
setupInterpreterMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestTopicsSetWithLogDirsFunction · 0.76