Skip to content

Commit e7deabc

Browse files
committed
Request and Response for GetLiteClientInfo、GetLiteGroupInfo、GetLiteTopicInfo.
Change-Id: I2324ee45d22b500b8c9f0c7b33b8044b66a187d9
1 parent 746d39a commit e7deabc

File tree

6 files changed

+440
-0
lines changed

6 files changed

+440
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.rocketmq.remoting.protocol.body;
19+
20+
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
21+
22+
import java.util.Set;
23+
24+
public class GetLiteClientInfoResponseBody extends RemotingSerializable {
25+
26+
private String parentTopic;
27+
private String group;
28+
private String clientId;
29+
private long lastAccessTime;
30+
private long lastConsumeTime;
31+
private int liteTopicCount;
32+
private Set<String> liteTopicSet;
33+
34+
public String getParentTopic() {
35+
return parentTopic;
36+
}
37+
38+
public void setParentTopic(String parentTopic) {
39+
this.parentTopic = parentTopic;
40+
}
41+
42+
public String getGroup() {
43+
return group;
44+
}
45+
46+
public void setGroup(String group) {
47+
this.group = group;
48+
}
49+
50+
public String getClientId() {
51+
return clientId;
52+
}
53+
54+
public void setClientId(String clientId) {
55+
this.clientId = clientId;
56+
}
57+
58+
public long getLastAccessTime() {
59+
return lastAccessTime;
60+
}
61+
62+
public void setLastAccessTime(long lastAccessTime) {
63+
this.lastAccessTime = lastAccessTime;
64+
}
65+
66+
public long getLastConsumeTime() {
67+
return lastConsumeTime;
68+
}
69+
70+
public void setLastConsumeTime(long lastConsumeTime) {
71+
this.lastConsumeTime = lastConsumeTime;
72+
}
73+
74+
public int getLiteTopicCount() {
75+
return liteTopicCount;
76+
}
77+
78+
public void setLiteTopicCount(int liteTopicCount) {
79+
this.liteTopicCount = liteTopicCount;
80+
}
81+
82+
public Set<String> getLiteTopicSet() {
83+
return liteTopicSet;
84+
}
85+
86+
public void setLiteTopicSet(Set<String> liteTopicSet) {
87+
this.liteTopicSet = liteTopicSet;
88+
}
89+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.rocketmq.remoting.protocol.body;
18+
19+
import java.util.List;
20+
import org.apache.rocketmq.common.lite.LiteLagInfo;
21+
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
22+
import org.apache.rocketmq.remoting.protocol.admin.OffsetWrapper;
23+
24+
public class GetLiteGroupInfoResponseBody extends RemotingSerializable {
25+
private String group;
26+
private String parentTopic;
27+
private String liteTopic;
28+
// total log info
29+
private long earliestUnconsumedTimestamp = -1;
30+
private long totalLagCount;
31+
// lite topic detail info
32+
private OffsetWrapper liteTopicOffsetWrapper; // if lite topic specified
33+
// topK info
34+
private List<LiteLagInfo> lagCountTopK;
35+
private List<LiteLagInfo> lagTimestampTopK;
36+
37+
public String getGroup() {
38+
return group;
39+
}
40+
41+
public void setGroup(String group) {
42+
this.group = group;
43+
}
44+
45+
public String getParentTopic() {
46+
return parentTopic;
47+
}
48+
49+
public void setParentTopic(String parentTopic) {
50+
this.parentTopic = parentTopic;
51+
}
52+
53+
public String getLiteTopic() {
54+
return liteTopic;
55+
}
56+
57+
public void setLiteTopic(String liteTopic) {
58+
this.liteTopic = liteTopic;
59+
}
60+
61+
public long getEarliestUnconsumedTimestamp() {
62+
return earliestUnconsumedTimestamp;
63+
}
64+
65+
public void setEarliestUnconsumedTimestamp(long earliestUnconsumedTimestamp) {
66+
this.earliestUnconsumedTimestamp = earliestUnconsumedTimestamp;
67+
}
68+
69+
public long getTotalLagCount() {
70+
return totalLagCount;
71+
}
72+
73+
public void setTotalLagCount(long totalLagCount) {
74+
this.totalLagCount = totalLagCount;
75+
}
76+
77+
public OffsetWrapper getLiteTopicOffsetWrapper() {
78+
return liteTopicOffsetWrapper;
79+
}
80+
81+
public void setLiteTopicOffsetWrapper(OffsetWrapper liteTopicOffsetWrapper) {
82+
this.liteTopicOffsetWrapper = liteTopicOffsetWrapper;
83+
}
84+
85+
public List<LiteLagInfo> getLagCountTopK() {
86+
return lagCountTopK;
87+
}
88+
89+
public void setLagCountTopK(List<LiteLagInfo> lagCountTopK) {
90+
this.lagCountTopK = lagCountTopK;
91+
}
92+
93+
public List<LiteLagInfo> getLagTimestampTopK() {
94+
return lagTimestampTopK;
95+
}
96+
97+
public void setLagTimestampTopK(List<LiteLagInfo> lagTimestampTopK) {
98+
this.lagTimestampTopK = lagTimestampTopK;
99+
}
100+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.rocketmq.remoting.protocol.body;
19+
20+
import org.apache.rocketmq.common.entity.ClientGroup;
21+
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
22+
import org.apache.rocketmq.remoting.protocol.admin.TopicOffset;
23+
24+
import java.util.Set;
25+
26+
public class GetLiteTopicInfoResponseBody extends RemotingSerializable {
27+
28+
private String parentTopic;
29+
private String liteTopic;
30+
private Set<ClientGroup> subscriber;
31+
private TopicOffset topicOffset;
32+
private boolean shardingToBroker;
33+
34+
public String getParentTopic() {
35+
return parentTopic;
36+
}
37+
38+
public void setParentTopic(String parentTopic) {
39+
this.parentTopic = parentTopic;
40+
}
41+
42+
public String getLiteTopic() {
43+
return liteTopic;
44+
}
45+
46+
public void setLiteTopic(String liteTopic) {
47+
this.liteTopic = liteTopic;
48+
}
49+
50+
public Set<ClientGroup> getSubscriber() {
51+
return subscriber;
52+
}
53+
54+
public void setSubscriber(Set<ClientGroup> subscriber) {
55+
this.subscriber = subscriber;
56+
}
57+
58+
public TopicOffset getTopicOffset() {
59+
return topicOffset;
60+
}
61+
62+
public void setTopicOffset(TopicOffset topicOffset) {
63+
this.topicOffset = topicOffset;
64+
}
65+
66+
public boolean isShardingToBroker() {
67+
return shardingToBroker;
68+
}
69+
70+
public void setShardingToBroker(boolean shardingToBroker) {
71+
this.shardingToBroker = shardingToBroker;
72+
}
73+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.rocketmq.remoting.protocol.header;
19+
20+
import org.apache.rocketmq.remoting.CommandCustomHeader;
21+
import org.apache.rocketmq.remoting.exception.RemotingCommandException;
22+
23+
public class GetLiteClientInfoRequestHeader implements CommandCustomHeader {
24+
25+
private String parentTopic;
26+
private String group;
27+
private String clientId;
28+
private int maxCount = 1000;
29+
30+
@Override
31+
public void checkFields() throws RemotingCommandException {
32+
if (maxCount <= 0) {
33+
throw new RemotingCommandException("[maxCount] field invalid");
34+
}
35+
}
36+
37+
public String getParentTopic() {
38+
return parentTopic;
39+
}
40+
41+
public void setParentTopic(String parentTopic) {
42+
this.parentTopic = parentTopic;
43+
}
44+
45+
public String getGroup() {
46+
return group;
47+
}
48+
49+
public void setGroup(String group) {
50+
this.group = group;
51+
}
52+
53+
public String getClientId() {
54+
return clientId;
55+
}
56+
57+
public void setClientId(String clientId) {
58+
this.clientId = clientId;
59+
}
60+
61+
public int getMaxCount() {
62+
return maxCount;
63+
}
64+
65+
public void setMaxCount(int maxCount) {
66+
this.maxCount = maxCount;
67+
}
68+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.rocketmq.remoting.protocol.header;
18+
19+
import org.apache.rocketmq.common.resource.ResourceType;
20+
import org.apache.rocketmq.common.resource.RocketMQResource;
21+
import org.apache.rocketmq.remoting.CommandCustomHeader;
22+
import org.apache.rocketmq.remoting.annotation.CFNotNull;
23+
import org.apache.rocketmq.remoting.exception.RemotingCommandException;
24+
25+
public class GetLiteGroupInfoRequestHeader implements CommandCustomHeader {
26+
27+
@CFNotNull
28+
@RocketMQResource(ResourceType.GROUP)
29+
private String group;
30+
31+
private String liteTopic;
32+
33+
private int topK;
34+
35+
public String getGroup() {
36+
return group;
37+
}
38+
39+
public void setGroup(String group) {
40+
this.group = group;
41+
}
42+
43+
public String getLiteTopic() {
44+
return liteTopic;
45+
}
46+
47+
public void setLiteTopic(String liteTopic) {
48+
this.liteTopic = liteTopic;
49+
}
50+
51+
public int getTopK() {
52+
return topK;
53+
}
54+
55+
public void setTopK(int topK) {
56+
this.topK = topK;
57+
}
58+
59+
@Override
60+
public void checkFields() throws RemotingCommandException {
61+
}
62+
}

0 commit comments

Comments
 (0)