Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor updates to topics commands and Services #127

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 23.03.2-SNAPSHOT
- 22.06.6-SNAPSHOT
- 23.09.1-SNAPSHOT
- 22.06.7-SNAPSHOT

# Checkout the source, we need a depth of zero to fetch all of the history otherwise
# the copyright check cannot work out the date of the files from Git.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-create-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- 22.06.6-SNAPSHOT
- 22.06.5
- 22.06.4
- 23.03.1
- 23.09
javaVersion:
- 17

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/compatability-tests-released.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 23.03
- 23.03.1
- 22.06.4
- 23.09
- 22.06.5
- 22.06.6-SNAPSHOT
- 14.1.1-0-13
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/compatability-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
fail-fast: false
matrix:
coherenceVersion:
- 23.03.1
- 22.06.4
- 23.09
- 22.06.5
- 22.06.6-SNAPSHOT
- 14.1.1-0-14
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/20_services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ cohctl get services -c local
Output:
[source,bash]
----
SERVICE NAME TYPE MEMBERS STATUS HA STORAGE PARTITIONS
Proxy Proxy 2 n/a -1 -1
PartitionedTopic DistributedCache 2 NODE-SAFE 2 257
PartitionedCache2 DistributedCache 2 NODE-SAFE 2 257
PartitionedCache DistributedCache 2 NODE-SAFE 2 257
ManagementHttpProxy Proxy 1 n/a -1 -1
SERVICE NAME TYPE MEMBERS STATUS HA STORAGE SENIOR PARTITIONS
Proxy Proxy 2 n/a -1 1 -1
PartitionedTopic DistributedCache 2 NODE-SAFE 2 2 257
PartitionedCache2 DistributedCache 2 NODE-SAFE 2 2 257
PartitionedCache DistributedCache 2 NODE-SAFE 2 1 257
ManagementHttpProxy Proxy 1 n/a -1 1 -1
----

[source,bash]
Expand Down
7 changes: 3 additions & 4 deletions docs/reference/30_topics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ Output:
Service: PartitionedTopic
Topic: private-messages

NODE ID SUBSCRIBER ID STATE CHANNELS SUBSCRIBER GROUP RECEIVED ERRORS BACKLOG TYPE
4 17663538530 Connected 17 1 0 0 0 Anonymous
5 23267662748 Connected 17 1 0 0 0 Anonymous
6 26845397584 Connected 17 1 0 0 0 Anonymous
NODE ID SUBSCRIBER ID STATE CHANNELS SUBSCRIBER GROUP RECEIVED ERRORS BACKLOG TYPE OWNED CHANNELS
4 17663538530 Connected 9/17 1 0 0 0 Durable 0,1,2,3,4,5,6,7,16
5 23267662748 Connected 8/17 1 0 0 0 Durable 8,9,10,11,12,13,14,15
----


Expand Down
18 changes: 9 additions & 9 deletions pkg/cmd/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,12 @@ func FormatTopicsSubscribers(topicsSubscribers []config.TopicsSubscriberDetail)
})

table := newFormattedTable().WithHeader(NodeIDColumn, SubscriberIDColumn, "STATE", ChannelsColumn, SubscriberGroupColumn,
"RECEIVED", "ERRORS", "BACKLOG", "DISCONNECTS", "TYPE")
"RECEIVED", "ERRORS", "BACKLOG", "DISCONNECTS", "TYPE", "OWNED CHANNELS")
if OutputFormat == constants.WIDE {
table.WithAlignment(R, R, L, L, L, R, R, R, R, L, L, L)
table.AddHeaderColumns("OWNED CHANNELS")
table.AddHeaderColumns(MemberColumn)
} else {
table.WithAlignment(R, R, L, L, L, R, R, R, R, L)
table.WithAlignment(R, R, L, L, L, R, R, R, R, L, L)
}
table.AddFormattingFunction(6, errorFormatter)
table.AddFormattingFunction(7, errorFormatter)
Expand Down Expand Up @@ -560,10 +559,10 @@ func FormatTopicsSubscribers(topicsSubscribers []config.TopicsSubscriberDetail)

table.AddRow(formatSmallInteger(int32(nodeID)), fmt.Sprintf("%v", value.ID),
value.StateName, channels, subGroup, formatLargeInteger(value.ReceivedCount),
formatLargeInteger(value.ReceiveErrors), formatLargeInteger(value.Backlog), formatLargeInteger(value.Disconnections), value.SubType)
formatLargeInteger(value.ReceiveErrors), formatLargeInteger(value.Backlog), formatLargeInteger(value.Disconnections), value.SubType,
channelsOwned)

if OutputFormat == constants.WIDE {
table.AddColumnsToRow(channelsOwned)
table.AddColumnsToRow(value.Member)
}
}
Expand Down Expand Up @@ -1525,13 +1524,13 @@ func FormatServices(services []config.ServiceSummary) string {
return strings.Compare(services[p].ServiceName, services[q].ServiceName) < 0
})

table := newFormattedTable().WithHeader(ServiceNameColumn, "TYPE", MembersColumn, "STATUS HA", "STORAGE", partitions)
table := newFormattedTable().WithHeader(ServiceNameColumn, "TYPE", MembersColumn, "STATUS HA", "STORAGE", "SENIOR", partitions)
if OutputFormat == constants.WIDE {
table.WithAlignment(L, L, R, L, R, R, R, R, R, L, L)
table.WithAlignment(L, L, R, L, R, R, R, R, R, R, L, L)
table.AddHeaderColumns(endangered, "VULNERABLE", "UNBALANCED", "STATUS", "SUSPENDED")
table.AddFormattingFunction(9, statusHAFormatter)
} else {
table.WithAlignment(L, L, R, L, R, R)
table.WithAlignment(L, L, R, L, R, R, R)
}

table.AddFormattingFunction(3, statusHAFormatter)
Expand Down Expand Up @@ -1562,7 +1561,8 @@ func FormatServices(services []config.ServiceSummary) string {
}

table.AddRow(value.ServiceName, value.ServiceType, formatSmallInteger(value.MemberCount),
value.StatusHA, formatSmallInteger(value.StorageEnabledCount), formatSmallInteger(value.PartitionsAll))
value.StatusHA, formatSmallInteger(value.StorageEnabledCount), formatSmallInteger(value.SeniorMemberID),
formatSmallInteger(value.PartitionsAll))

if OutputFormat == constants.WIDE {
table.AddColumnsToRow(formatSmallInteger(value.PartitionsEndangered),
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ type ServiceSummary struct {
PartitionsUnbalanced int32 `json:"partitionsUnbalanced"`
StorageEnabled bool `json:"storageEnabled"`
QuorumStatus string `json:"quorumStatus"`
SeniorMemberID int32 `json:"seniorMemberId"`

// persistence related
PersistenceMode string `json:"persistenceMode"`
Expand Down