http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/message/MessageQueue.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageQueue.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageQueue.java index 6274d96..fa2745d 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageQueue.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageQueue.java @@ -6,68 +6,58 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.message; import java.io.Serializable; - public class MessageQueue implements Comparable<MessageQueue>, Serializable { private static final long serialVersionUID = 6191200464116433425L; private String topic; private String brokerName; private int queueId; - public MessageQueue() { } - public MessageQueue(String topic, String brokerName, int queueId) { this.topic = topic; this.brokerName = brokerName; this.queueId = queueId; } - public String getTopic() { return topic; } - public void setTopic(String topic) { this.topic = topic; } - public String getBrokerName() { return brokerName; } - public void setBrokerName(String brokerName) { this.brokerName = brokerName; } - public int getQueueId() { return queueId; } - public void setQueueId(int queueId) { this.queueId = queueId; } - @Override public int hashCode() { final int prime = 31; @@ -78,7 +68,6 @@ public class MessageQueue implements Comparable<MessageQueue>, Serializable { return result; } - @Override public boolean equals(Object obj) { if (this == obj) @@ -87,7 +76,7 @@ public class MessageQueue implements Comparable<MessageQueue>, Serializable { return false; if (getClass() != obj.getClass()) return false; - MessageQueue other = (MessageQueue) obj; + MessageQueue other = (MessageQueue)obj; if (brokerName == null) { if (other.brokerName != null) return false; @@ -103,13 +92,11 @@ public class MessageQueue implements Comparable<MessageQueue>, Serializable { return true; } - @Override public String toString() { return "MessageQueue [topic=" + topic + ", brokerName=" + brokerName + ", queueId=" + queueId + "]"; } - @Override public int compareTo(MessageQueue o) { {
http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/message/MessageQueueForC.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageQueueForC.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageQueueForC.java index 4a8fb6f..f5c43c9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageQueueForC.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageQueueForC.java @@ -6,20 +6,19 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.message; import java.io.Serializable; - public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializable { private static final long serialVersionUID = 5320967846569962104L; @@ -28,7 +27,6 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa private int queueId; private long offset; - public MessageQueueForC(String topic, String brokerName, int queueId, long offset) { this.topic = topic; this.brokerName = brokerName; @@ -36,7 +34,6 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa this.offset = offset; } - @Override public int compareTo(MessageQueueForC o) { int result = this.topic.compareTo(o.topic); @@ -60,7 +57,6 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa } } - @Override public int hashCode() { final int prime = 31; @@ -71,7 +67,6 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa return result; } - @Override public boolean equals(Object obj) { if (this == obj) @@ -80,7 +75,7 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa return false; if (getClass() != obj.getClass()) return false; - MessageQueueForC other = (MessageQueueForC) obj; + MessageQueueForC other = (MessageQueueForC)obj; if (brokerName == null) { if (other.brokerName != null) return false; @@ -100,49 +95,40 @@ public class MessageQueueForC implements Comparable<MessageQueueForC>, Serializa return true; } - @Override public String toString() { return "MessageQueueForC [topic=" + topic + ", brokerName=" + brokerName + ", queueId=" + queueId - + ", offset=" + offset + "]"; + + ", offset=" + offset + "]"; } - public String getTopic() { return topic; } - public void setTopic(String topic) { this.topic = topic; } - public String getBrokerName() { return brokerName; } - public void setBrokerName(String brokerName) { this.brokerName = brokerName; } - public int getQueueId() { return queueId; } - public void setQueueId(int queueId) { this.queueId = queueId; } - public long getOffset() { return offset; } - public void setOffset(long offset) { this.offset = offset; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/message/MessageType.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageType.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageType.java index a1913a5..c649744 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageType.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageType.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.message; http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvConfig.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvConfig.java b/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvConfig.java index fe3e8e3..d58ccf2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvConfig.java +++ b/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvConfig.java @@ -6,13 +6,15 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Id: NamesrvConfig.java 1839 2013-05-16 02:12:02Z vintagew...@apache.org $ */ /** @@ -20,14 +22,12 @@ */ package org.apache.rocketmq.common.namesrv; +import java.io.File; import org.apache.rocketmq.common.MixAll; import org.apache.rocketmq.common.constant.LoggerName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; - - /** * */ @@ -53,37 +53,30 @@ public class NamesrvConfig { return rocketmqHome; } - public void setRocketmqHome(String rocketmqHome) { this.rocketmqHome = rocketmqHome; } - public String getKvConfigPath() { return kvConfigPath; } - public void setKvConfigPath(String kvConfigPath) { this.kvConfigPath = kvConfigPath; } - public String getProductEnvName() { return productEnvName; } - public void setProductEnvName(String productEnvName) { this.productEnvName = productEnvName; } - public boolean isClusterTest() { return clusterTest; } - public void setClusterTest(boolean clusterTest) { this.clusterTest = clusterTest; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvUtil.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvUtil.java b/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvUtil.java index 2b0a1ed..33ac4bd 100644 --- a/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvUtil.java +++ b/common/src/main/java/org/apache/rocketmq/common/namesrv/NamesrvUtil.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.namesrv; http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/namesrv/RegisterBrokerResult.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/namesrv/RegisterBrokerResult.java b/common/src/main/java/org/apache/rocketmq/common/namesrv/RegisterBrokerResult.java index d74b477..f94d138 100644 --- a/common/src/main/java/org/apache/rocketmq/common/namesrv/RegisterBrokerResult.java +++ b/common/src/main/java/org/apache/rocketmq/common/namesrv/RegisterBrokerResult.java @@ -6,51 +6,44 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.namesrv; import org.apache.rocketmq.common.protocol.body.KVTable; - public class RegisterBrokerResult { private String haServerAddr; private String masterAddr; private KVTable kvTable; - public String getHaServerAddr() { return haServerAddr; } - public void setHaServerAddr(String haServerAddr) { this.haServerAddr = haServerAddr; } - public String getMasterAddr() { return masterAddr; } - public void setMasterAddr(String masterAddr) { this.masterAddr = masterAddr; } - public KVTable getKvTable() { return kvTable; } - public void setKvTable(KVTable kvTable) { this.kvTable = kvTable; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/namesrv/TopAddressing.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/namesrv/TopAddressing.java b/common/src/main/java/org/apache/rocketmq/common/namesrv/TopAddressing.java index 15a2f13..4f0dfce 100644 --- a/common/src/main/java/org/apache/rocketmq/common/namesrv/TopAddressing.java +++ b/common/src/main/java/org/apache/rocketmq/common/namesrv/TopAddressing.java @@ -6,13 +6,15 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * $Id: TopAddressing.java 1831 2013-05-16 01:39:51Z vintagew...@apache.org $ */ /** @@ -20,6 +22,7 @@ */ package org.apache.rocketmq.common.namesrv; +import java.io.IOException; import org.apache.rocketmq.common.MixAll; import org.apache.rocketmq.common.UtilAll; import org.apache.rocketmq.common.constant.LoggerName; @@ -28,26 +31,36 @@ import org.apache.rocketmq.common.utils.HttpTinyClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; - - public class TopAddressing { private static final Logger log = LoggerFactory.getLogger(LoggerName.COMMON_LOGGER_NAME); private String nsAddr; private String wsAddr; private String unitName; - public TopAddressing(final String wsAddr) { this(wsAddr, null); } - public TopAddressing(final String wsAddr, final String unitName) { this.wsAddr = wsAddr; this.unitName = unitName; } + private static String clearNewLine(final String str) { + String newString = str.trim(); + int index = newString.indexOf("\r"); + if (index != -1) { + return newString.substring(0, index); + } + + index = newString.indexOf("\n"); + if (index != -1) { + return newString.substring(0, index); + } + + return newString; + } + public final String fetchNSAddr() { return fetchNSAddr(true, 3000); } @@ -77,7 +90,7 @@ public class TopAddressing { if (verbose) { String errorMsg = - "connect to " + url + " failed, maybe the domain name " + MixAll.WS_DOMAIN_NAME + " not bind in /etc/hosts"; + "connect to " + url + " failed, maybe the domain name " + MixAll.WS_DOMAIN_NAME + " not bind in /etc/hosts"; errorMsg += FAQUrl.suggestTodo(FAQUrl.NAME_SERVER_ADDR_NOT_EXIST_URL); log.warn(errorMsg); @@ -85,26 +98,10 @@ public class TopAddressing { return null; } - private static String clearNewLine(final String str) { - String newString = str.trim(); - int index = newString.indexOf("\r"); - if (index != -1) { - return newString.substring(0, index); - } - - index = newString.indexOf("\n"); - if (index != -1) { - return newString.substring(0, index); - } - - return newString; - } - public String getNsAddr() { return nsAddr; } - public void setNsAddr(String nsAddr) { this.nsAddr = nsAddr; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/MQProtosHelper.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/MQProtosHelper.java b/common/src/main/java/org/apache/rocketmq/common/protocol/MQProtosHelper.java index 0ea12eb..bbe80f0 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/MQProtosHelper.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/MQProtosHelper.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol; @@ -24,15 +24,14 @@ import org.apache.rocketmq.remoting.exception.RemotingSendRequestException; import org.apache.rocketmq.remoting.exception.RemotingTimeoutException; import org.apache.rocketmq.remoting.protocol.RemotingCommand; - public class MQProtosHelper { public static boolean registerBrokerToNameServer(final String nsaddr, final String brokerAddr, - final long timeoutMillis) { + final long timeoutMillis) { RegisterBrokerRequestHeader requestHeader = new RegisterBrokerRequestHeader(); requestHeader.setBrokerAddr(brokerAddr); RemotingCommand request = - RemotingCommand.createRequestCommand(RequestCode.REGISTER_BROKER, requestHeader); + RemotingCommand.createRequestCommand(RequestCode.REGISTER_BROKER, requestHeader); try { RemotingCommand response = RemotingHelper.invokeSync(nsaddr, request, timeoutMillis); http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/RequestCode.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/RequestCode.java b/common/src/main/java/org/apache/rocketmq/common/protocol/RequestCode.java index d878726..217dba5 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/RequestCode.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/RequestCode.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol; @@ -87,7 +87,6 @@ public class RequestCode { public static final int GET_PRODUCER_CONNECTION_LIST = 204; public static final int WIPE_WRITE_PERM_OF_BROKER = 205; - public static final int GET_ALL_TOPIC_LIST_FROM_NAMESERVER = 206; public static final int DELETE_SUBSCRIPTIONGROUP = 207; @@ -103,13 +102,11 @@ public class RequestCode { public static final int WHO_CONSUME_THE_MESSAGE = 214; - public static final int DELETE_TOPIC_IN_BROKER = 215; public static final int DELETE_TOPIC_IN_NAMESRV = 216; public static final int GET_KVLIST_BY_NAMESPACE = 219; - public static final int RESET_CONSUMER_CLIENT_OFFSET = 220; public static final int GET_CONSUMER_STATUS_FROM_CLIENT = 221; @@ -118,7 +115,6 @@ public class RequestCode { public static final int INVOKE_BROKER_TO_GET_CONSUMER_STATUS = 223; - public static final int QUERY_TOPIC_CONSUME_BY_WHO = 300; public static final int GET_TOPICS_BY_CLUSTER = 224; http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/ResponseCode.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/ResponseCode.java b/common/src/main/java/org/apache/rocketmq/common/protocol/ResponseCode.java index a5b4e2e..11ed9c3 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/ResponseCode.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/ResponseCode.java @@ -6,20 +6,19 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol; import org.apache.rocketmq.remoting.protocol.RemotingSysResponseCode; - public class ResponseCode extends RemotingSysResponseCode { public static final int FLUSH_DISK_TIMEOUT = 10; @@ -63,15 +62,11 @@ public class ResponseCode extends RemotingSysResponseCode { public static final int TRANSACTION_STATE_GROUP_WRONG = 203; public static final int NO_BUYER_ID = 204; - public static final int NOT_IN_CURRENT_UNIT = 205; - public static final int CONSUMER_NOT_ONLINE = 206; - public static final int CONSUME_MSG_TIMEOUT = 207; - public static final int NO_MESSAGE = 208; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsData.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsData.java index f1ac124..4aa3279 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsData.java @@ -6,20 +6,19 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - public class BrokerStatsData extends RemotingSerializable { private BrokerStatsItem statsMinute; @@ -28,32 +27,26 @@ public class BrokerStatsData extends RemotingSerializable { private BrokerStatsItem statsDay; - public BrokerStatsItem getStatsMinute() { return statsMinute; } - public void setStatsMinute(BrokerStatsItem statsMinute) { this.statsMinute = statsMinute; } - public BrokerStatsItem getStatsHour() { return statsHour; } - public void setStatsHour(BrokerStatsItem statsHour) { this.statsHour = statsHour; } - public BrokerStatsItem getStatsDay() { return statsDay; } - public void setStatsDay(BrokerStatsItem statsDay) { this.statsDay = statsDay; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsItem.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsItem.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsItem.java index 904770f..e789e0a 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsItem.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/BrokerStatsItem.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; @@ -22,32 +22,26 @@ public class BrokerStatsItem { private double tps; private double avgpt; - public long getSum() { return sum; } - public void setSum(long sum) { this.sum = sum; } - public double getTps() { return tps; } - public void setTps(double tps) { this.tps = tps; } - public double getAvgpt() { return avgpt; } - public void setAvgpt(double avgpt) { this.avgpt = avgpt; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/CMResult.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/CMResult.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/CMResult.java index 85eda7b..7dee8fb 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/CMResult.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/CMResult.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ClusterInfo.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ClusterInfo.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ClusterInfo.java index a88616f..dfb045d 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ClusterInfo.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ClusterInfo.java @@ -6,51 +6,44 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.common.protocol.route.BrokerData; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; - +import org.apache.rocketmq.common.protocol.route.BrokerData; +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; public class ClusterInfo extends RemotingSerializable { private HashMap<String/* brokerName */, BrokerData> brokerAddrTable; private HashMap<String/* clusterName */, Set<String/* brokerName */>> clusterAddrTable; - public HashMap<String, BrokerData> getBrokerAddrTable() { return brokerAddrTable; } - public void setBrokerAddrTable(HashMap<String, BrokerData> brokerAddrTable) { this.brokerAddrTable = brokerAddrTable; } - public HashMap<String, Set<String>> getClusterAddrTable() { return clusterAddrTable; } - public void setClusterAddrTable(HashMap<String, Set<String>> clusterAddrTable) { this.clusterAddrTable = clusterAddrTable; } - public String[] retrieveAllAddrByCluster(String cluster) { List<String> addrs = new ArrayList<String>(); if (clusterAddrTable.containsKey(cluster)) { @@ -63,11 +56,10 @@ public class ClusterInfo extends RemotingSerializable { } } - return addrs.toArray(new String[]{}); + return addrs.toArray(new String[] {}); } - public String[] retrieveAllClusterNames() { - return clusterAddrTable.keySet().toArray(new String[]{}); + return clusterAddrTable.keySet().toArray(new String[] {}); } } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/Connection.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/Connection.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/Connection.java index 76f0921..c9da104 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/Connection.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/Connection.java @@ -6,62 +6,53 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; import org.apache.rocketmq.remoting.protocol.LanguageCode; - public class Connection { private String clientId; private String clientAddr; private LanguageCode language; private int version; - public String getClientId() { return clientId; } - public void setClientId(String clientId) { this.clientId = clientId; } - public String getClientAddr() { return clientAddr; } - public void setClientAddr(String clientAddr) { this.clientAddr = clientAddr; } - public LanguageCode getLanguage() { return language; } - public void setLanguage(LanguageCode language) { this.language = language; } - public int getVersion() { return version; } - public void setVersion(int version) { this.version = version; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeByWho.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeByWho.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeByWho.java index 8342144..8eb62a1 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeByWho.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeByWho.java @@ -6,20 +6,18 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashSet; - +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * @@ -31,52 +29,42 @@ public class ConsumeByWho extends RemotingSerializable { private int queueId; private long offset; - public HashSet<String> getConsumedGroup() { return consumedGroup; } - public void setConsumedGroup(HashSet<String> consumedGroup) { this.consumedGroup = consumedGroup; } - public HashSet<String> getNotConsumedGroup() { return notConsumedGroup; } - public void setNotConsumedGroup(HashSet<String> notConsumedGroup) { this.notConsumedGroup = notConsumedGroup; } - public String getTopic() { return topic; } - public void setTopic(String topic) { this.topic = topic; } - public int getQueueId() { return queueId; } - public void setQueueId(int queueId) { this.queueId = queueId; } - public long getOffset() { return offset; } - public void setOffset(long offset) { this.offset = offset; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeMessageDirectlyResult.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeMessageDirectlyResult.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeMessageDirectlyResult.java index 9c63010..2020659 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeMessageDirectlyResult.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeMessageDirectlyResult.java @@ -6,20 +6,19 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - public class ConsumeMessageDirectlyResult extends RemotingSerializable { private boolean order = false; private boolean autoCommit = true; @@ -27,61 +26,50 @@ public class ConsumeMessageDirectlyResult extends RemotingSerializable { private String remark; private long spentTimeMills; - public boolean isOrder() { return order; } - public void setOrder(boolean order) { this.order = order; } - public boolean isAutoCommit() { return autoCommit; } - public void setAutoCommit(boolean autoCommit) { this.autoCommit = autoCommit; } - public String getRemark() { return remark; } - public void setRemark(String remark) { this.remark = remark; } - public CMResult getConsumeResult() { return consumeResult; } - public void setConsumeResult(CMResult consumeResult) { this.consumeResult = consumeResult; } - public long getSpentTimeMills() { return spentTimeMills; } - public void setSpentTimeMills(long spentTimeMills) { this.spentTimeMills = spentTimeMills; } - @Override public String toString() { return "ConsumeMessageDirectlyResult [order=" + order + ", autoCommit=" + autoCommit - + ", consumeResult=" + consumeResult + ", remark=" + remark + ", spentTimeMills=" - + spentTimeMills + "]"; + + ", consumeResult=" + consumeResult + ", remark=" + remark + ", spentTimeMills=" + + spentTimeMills + "]"; } } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatsList.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatsList.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatsList.java index c907555..07dc3e4 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatsList.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatsList.java @@ -6,23 +6,21 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.common.admin.ConsumeStats; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.ArrayList; import java.util.List; import java.util.Map; - +import org.apache.rocketmq.common.admin.ConsumeStats; +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; public class ConsumeStatsList extends RemotingSerializable { private List<Map<String/*subscriptionGroupName*/, List<ConsumeStats>>> consumeStatsList = new ArrayList<Map<String/*subscriptionGroupName*/, List<ConsumeStats>>>(); http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatus.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatus.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatus.java index 35b6a02..a227645 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatus.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumeStatus.java @@ -6,13 +6,13 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; @@ -26,62 +26,50 @@ public class ConsumeStatus { private long consumeFailedMsgs; - public double getPullRT() { return pullRT; } - public void setPullRT(double pullRT) { this.pullRT = pullRT; } - public double getPullTPS() { return pullTPS; } - public void setPullTPS(double pullTPS) { this.pullTPS = pullTPS; } - public double getConsumeRT() { return consumeRT; } - public void setConsumeRT(double consumeRT) { this.consumeRT = consumeRT; } - public double getConsumeOKTPS() { return consumeOKTPS; } - public void setConsumeOKTPS(double consumeOKTPS) { this.consumeOKTPS = consumeOKTPS; } - public double getConsumeFailedTPS() { return consumeFailedTPS; } - public void setConsumeFailedTPS(double consumeFailedTPS) { this.consumeFailedTPS = consumeFailedTPS; } - public long getConsumeFailedMsgs() { return consumeFailedMsgs; } - public void setConsumeFailedMsgs(long consumeFailedMsgs) { this.consumeFailedMsgs = consumeFailedMsgs; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerConnection.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerConnection.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerConnection.java index bc2acad..1de12e1 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerConnection.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerConnection.java @@ -6,36 +6,33 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; +import java.util.HashSet; +import java.util.concurrent.ConcurrentHashMap; import org.apache.rocketmq.common.consumer.ConsumeFromWhere; import org.apache.rocketmq.common.protocol.heartbeat.ConsumeType; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; import org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData; import org.apache.rocketmq.remoting.protocol.RemotingSerializable; -import java.util.HashSet; -import java.util.concurrent.ConcurrentHashMap; - - public class ConsumerConnection extends RemotingSerializable { private HashSet<Connection> connectionSet = new HashSet<Connection>(); private ConcurrentHashMap<String/* Topic */, SubscriptionData> subscriptionTable = - new ConcurrentHashMap<String, SubscriptionData>(); + new ConcurrentHashMap<String, SubscriptionData>(); private ConsumeType consumeType; private MessageModel messageModel; private ConsumeFromWhere consumeFromWhere; - public int computeMinVersion() { int minVersion = Integer.MAX_VALUE; for (Connection c : this.connectionSet) { @@ -47,52 +44,42 @@ public class ConsumerConnection extends RemotingSerializable { return minVersion; } - public HashSet<Connection> getConnectionSet() { return connectionSet; } - public void setConnectionSet(HashSet<Connection> connectionSet) { this.connectionSet = connectionSet; } - public ConcurrentHashMap<String, SubscriptionData> getSubscriptionTable() { return subscriptionTable; } - public void setSubscriptionTable(ConcurrentHashMap<String, SubscriptionData> subscriptionTable) { this.subscriptionTable = subscriptionTable; } - public ConsumeType getConsumeType() { return consumeType; } - public void setConsumeType(ConsumeType consumeType) { this.consumeType = consumeType; } - public MessageModel getMessageModel() { return messageModel; } - public void setMessageModel(MessageModel messageModel) { this.messageModel = messageModel; } - public ConsumeFromWhere getConsumeFromWhere() { return consumeFromWhere; } - public void setConsumeFromWhere(ConsumeFromWhere consumeFromWhere) { this.consumeFromWhere = consumeFromWhere; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerOffsetSerializeWrapper.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerOffsetSerializeWrapper.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerOffsetSerializeWrapper.java index 1ce7cf4..520a99b 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerOffsetSerializeWrapper.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerOffsetSerializeWrapper.java @@ -6,32 +6,28 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.concurrent.ConcurrentHashMap; - +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; public class ConsumerOffsetSerializeWrapper extends RemotingSerializable { private ConcurrentHashMap<String/* topic@group */, ConcurrentHashMap<Integer, Long>> offsetTable = - new ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>>(512); - + new ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>>(512); public ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> getOffsetTable() { return offsetTable; } - public void setOffsetTable(ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> offsetTable) { this.offsetTable = offsetTable; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerRunningInfo.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerRunningInfo.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerRunningInfo.java index 9b0b383..9836b8d 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerRunningInfo.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ConsumerRunningInfo.java @@ -17,14 +17,16 @@ package org.apache.rocketmq.common.protocol.body; +import java.util.Iterator; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.TreeMap; +import java.util.TreeSet; import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.common.protocol.heartbeat.ConsumeType; import org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData; import org.apache.rocketmq.remoting.protocol.RemotingSerializable; -import java.util.*; -import java.util.Map.Entry; - public class ConsumerRunningInfo extends RemotingSerializable { public static final String PROP_NAMESERVER_ADDR = "PROP_NAMESERVER_ADDR"; public static final String PROP_THREADPOOL_CORE_SIZE = "PROP_THREADPOOL_CORE_SIZE"; @@ -33,7 +35,6 @@ public class ConsumerRunningInfo extends RemotingSerializable { public static final String PROP_CLIENT_VERSION = "PROP_CLIENT_VERSION"; public static final String PROP_CONSUMER_START_TIMESTAMP = "PROP_CONSUMER_START_TIMESTAMP"; - private Properties properties = new Properties(); private TreeSet<SubscriptionData> subscriptionSet = new TreeSet<SubscriptionData>(); @@ -52,7 +53,7 @@ public class ConsumerRunningInfo extends RemotingSerializable { String property = prev.getProperties().getProperty(ConsumerRunningInfo.PROP_CONSUME_TYPE); if (property == null) { - property = ((ConsumeType) prev.getProperties().get(ConsumerRunningInfo.PROP_CONSUME_TYPE)).name(); + property = ((ConsumeType)prev.getProperties().get(ConsumerRunningInfo.PROP_CONSUME_TYPE)).name(); } push = ConsumeType.valueOf(property) == ConsumeType.CONSUME_PASSIVELY; } @@ -97,22 +98,6 @@ public class ConsumerRunningInfo extends RemotingSerializable { return true; } - public Properties getProperties() { - return properties; - } - - public void setProperties(Properties properties) { - this.properties = properties; - } - - public TreeSet<SubscriptionData> getSubscriptionSet() { - return subscriptionSet; - } - - public void setSubscriptionSet(TreeSet<SubscriptionData> subscriptionSet) { - this.subscriptionSet = subscriptionSet; - } - public static boolean analyzeRebalance(final TreeMap<String/* clientId */, ConsumerRunningInfo> criTable) { return true; } @@ -124,7 +109,7 @@ public class ConsumerRunningInfo extends RemotingSerializable { String property = info.getProperties().getProperty(ConsumerRunningInfo.PROP_CONSUME_TYPE); if (property == null) { - property = ((ConsumeType) info.getProperties().get(ConsumerRunningInfo.PROP_CONSUME_TYPE)).name(); + property = ((ConsumeType)info.getProperties().get(ConsumerRunningInfo.PROP_CONSUME_TYPE)).name(); } push = ConsumeType.valueOf(property) == ConsumeType.CONSUME_PASSIVELY; } @@ -142,32 +127,30 @@ public class ConsumerRunningInfo extends RemotingSerializable { MessageQueue mq = next.getKey(); ProcessQueueInfo pq = next.getValue(); - if (orderMsg) { if (!pq.isLocked()) { sb.append(String.format("%s %s can't lock for a while, %dms%n", // - clientId, // - mq, // - System.currentTimeMillis() - pq.getLastLockTimestamp())); + clientId, // + mq, // + System.currentTimeMillis() - pq.getLastLockTimestamp())); } else { if (pq.isDroped() && (pq.getTryUnlockTimes() > 0)) { sb.append(String.format("%s %s unlock %d times, still failed%n", // - clientId, // - mq, // - pq.getTryUnlockTimes())); + clientId, // + mq, // + pq.getTryUnlockTimes())); } } - } else { long diff = System.currentTimeMillis() - pq.getLastConsumeTimestamp(); if (diff > (1000 * 60) && pq.getCachedMsgCount() > 0) { sb.append(String.format("%s %s can't consume for a while, maybe blocked, %dms%n", // - clientId, // - mq, // - diff)); + clientId, // + mq, // + diff)); } } } @@ -176,6 +159,22 @@ public class ConsumerRunningInfo extends RemotingSerializable { return sb.toString(); } + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + public TreeSet<SubscriptionData> getSubscriptionSet() { + return subscriptionSet; + } + + public void setSubscriptionSet(TreeSet<SubscriptionData> subscriptionSet) { + this.subscriptionSet = subscriptionSet; + } + public TreeMap<MessageQueue, ProcessQueueInfo> getMqTable() { return mqTable; } @@ -213,10 +212,10 @@ public class ConsumerRunningInfo extends RemotingSerializable { while (it.hasNext()) { SubscriptionData next = it.next(); String item = String.format("%03d Topic: %-40s ClassFilter: %-8s SubExpression: %s%n", // - ++i, // - next.getTopic(), // - next.isClassFilterMode(), // - next.getSubString()); + ++i, // + next.getTopic(), // + next.isClassFilterMode(), // + next.getSubString()); sb.append(item); } @@ -225,20 +224,20 @@ public class ConsumerRunningInfo extends RemotingSerializable { { sb.append("\n\n#Consumer Offset#\n"); sb.append(String.format("%-32s %-32s %-4s %-20s%n", // - "#Topic", // - "#Broker Name", // - "#QID", // - "#Consumer Offset"// + "#Topic", // + "#Broker Name", // + "#QID", // + "#Consumer Offset"// )); Iterator<Entry<MessageQueue, ProcessQueueInfo>> it = this.mqTable.entrySet().iterator(); while (it.hasNext()) { Entry<MessageQueue, ProcessQueueInfo> next = it.next(); String item = String.format("%-32s %-32s %-4d %-20d%n", // - next.getKey().getTopic(), // - next.getKey().getBrokerName(), // - next.getKey().getQueueId(), // - next.getValue().getCommitOffset()); + next.getKey().getTopic(), // + next.getKey().getBrokerName(), // + next.getKey().getQueueId(), // + next.getValue().getCommitOffset()); sb.append(item); } @@ -247,20 +246,20 @@ public class ConsumerRunningInfo extends RemotingSerializable { { sb.append("\n\n#Consumer MQ Detail#\n"); sb.append(String.format("%-32s %-32s %-4s %-20s%n", // - "#Topic", // - "#Broker Name", // - "#QID", // - "#ProcessQueueInfo"// + "#Topic", // + "#Broker Name", // + "#QID", // + "#ProcessQueueInfo"// )); Iterator<Entry<MessageQueue, ProcessQueueInfo>> it = this.mqTable.entrySet().iterator(); while (it.hasNext()) { Entry<MessageQueue, ProcessQueueInfo> next = it.next(); String item = String.format("%-32s %-32s %-4d %s%n", // - next.getKey().getTopic(), // - next.getKey().getBrokerName(), // - next.getKey().getQueueId(), // - next.getValue().toString()); + next.getKey().getTopic(), // + next.getKey().getBrokerName(), // + next.getKey().getQueueId(), // + next.getValue().toString()); sb.append(item); } @@ -269,26 +268,26 @@ public class ConsumerRunningInfo extends RemotingSerializable { { sb.append("\n\n#Consumer RT&TPS#\n"); sb.append(String.format("%-32s %14s %14s %14s %14s %18s %25s%n", // - "#Topic", // - "#Pull RT", // - "#Pull TPS", // - "#Consume RT", // - "#ConsumeOK TPS", // - "#ConsumeFailed TPS", // - "#ConsumeFailedMsgsInHour"// + "#Topic", // + "#Pull RT", // + "#Pull TPS", // + "#Consume RT", // + "#ConsumeOK TPS", // + "#ConsumeFailed TPS", // + "#ConsumeFailedMsgsInHour"// )); Iterator<Entry<String, ConsumeStatus>> it = this.statusTable.entrySet().iterator(); while (it.hasNext()) { Entry<String, ConsumeStatus> next = it.next(); String item = String.format("%-32s %14.2f %14.2f %14.2f %14.2f %18.2f %25d%n", // - next.getKey(), // - next.getValue().getPullRT(), // - next.getValue().getPullTPS(), // - next.getValue().getConsumeRT(), // - next.getValue().getConsumeOKTPS(), // - next.getValue().getConsumeFailedTPS(), // - next.getValue().getConsumeFailedMsgs()// + next.getKey(), // + next.getValue().getPullRT(), // + next.getValue().getPullTPS(), // + next.getValue().getConsumeRT(), // + next.getValue().getConsumeOKTPS(), // + next.getValue().getConsumeFailedTPS(), // + next.getValue().getConsumeFailedMsgs()// ); sb.append(item); @@ -307,7 +306,6 @@ public class ConsumerRunningInfo extends RemotingSerializable { return jstack; } - public void setJstack(String jstack) { this.jstack = jstack; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/GetConsumerStatusBody.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/GetConsumerStatusBody.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/GetConsumerStatusBody.java index d37116c..1bbd631 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/GetConsumerStatusBody.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/GetConsumerStatusBody.java @@ -6,46 +6,40 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.common.message.MessageQueue; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashMap; import java.util.Map; - +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; @Deprecated public class GetConsumerStatusBody extends RemotingSerializable { private Map<MessageQueue, Long> messageQueueTable = new HashMap<MessageQueue, Long>(); private Map<String, Map<MessageQueue, Long>> consumerTable = - new HashMap<String, Map<MessageQueue, Long>>(); - + new HashMap<String, Map<MessageQueue, Long>>(); public Map<MessageQueue, Long> getMessageQueueTable() { return messageQueueTable; } - public void setMessageQueueTable(Map<MessageQueue, Long> messageQueueTable) { this.messageQueueTable = messageQueueTable; } - public Map<String, Map<MessageQueue, Long>> getConsumerTable() { return consumerTable; } - public void setConsumerTable(Map<String, Map<MessageQueue, Long>> consumerTable) { this.consumerTable = consumerTable; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/GroupList.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/GroupList.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/GroupList.java index e67dd8c..9f4918b 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/GroupList.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/GroupList.java @@ -6,20 +6,18 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashSet; - +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * @@ -27,12 +25,10 @@ import java.util.HashSet; public class GroupList extends RemotingSerializable { private HashSet<String> groupList = new HashSet<String>(); - public HashSet<String> getGroupList() { return groupList; } - public void setGroupList(HashSet<String> groupList) { this.groupList = groupList; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/KVTable.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/KVTable.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/KVTable.java index 18b20a2..7904f76 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/KVTable.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/KVTable.java @@ -6,20 +6,18 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashMap; - +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * @@ -27,12 +25,10 @@ import java.util.HashMap; public class KVTable extends RemotingSerializable { private HashMap<String, String> table = new HashMap<String, String>(); - public HashMap<String, String> getTable() { return table; } - public void setTable(HashMap<String, String> table) { this.table = table; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchRequestBody.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchRequestBody.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchRequestBody.java index 59768ff..97fac5a 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchRequestBody.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchRequestBody.java @@ -6,23 +6,21 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.common.message.MessageQueue; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashSet; import java.util.Set; - +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * @@ -32,32 +30,26 @@ public class LockBatchRequestBody extends RemotingSerializable { private String clientId; private Set<MessageQueue> mqSet = new HashSet<MessageQueue>(); - public String getConsumerGroup() { return consumerGroup; } - public void setConsumerGroup(String consumerGroup) { this.consumerGroup = consumerGroup; } - public String getClientId() { return clientId; } - public void setClientId(String clientId) { this.clientId = clientId; } - public Set<MessageQueue> getMqSet() { return mqSet; } - public void setMqSet(Set<MessageQueue> mqSet) { this.mqSet = mqSet; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchResponseBody.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchResponseBody.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchResponseBody.java index e1a5117..5108438 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchResponseBody.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/LockBatchResponseBody.java @@ -6,23 +6,21 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.common.message.MessageQueue; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashSet; import java.util.Set; - +import org.apache.rocketmq.common.message.MessageQueue; +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * @@ -31,12 +29,10 @@ public class LockBatchResponseBody extends RemotingSerializable { private Set<MessageQueue> lockOKMQSet = new HashSet<MessageQueue>(); - public Set<MessageQueue> getLockOKMQSet() { return lockOKMQSet; } - public void setLockOKMQSet(Set<MessageQueue> lockOKMQSet) { this.lockOKMQSet = lockOKMQSet; } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProcessQueueInfo.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProcessQueueInfo.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProcessQueueInfo.java index 0ceaa69..65703f3 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProcessQueueInfo.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProcessQueueInfo.java @@ -6,20 +6,19 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; import org.apache.rocketmq.common.UtilAll; - public class ProcessQueueInfo { private long commitOffset; @@ -39,147 +38,120 @@ public class ProcessQueueInfo { private long lastPullTimestamp; private long lastConsumeTimestamp; - public long getCommitOffset() { return commitOffset; } - public void setCommitOffset(long commitOffset) { this.commitOffset = commitOffset; } - public long getCachedMsgMinOffset() { return cachedMsgMinOffset; } - public void setCachedMsgMinOffset(long cachedMsgMinOffset) { this.cachedMsgMinOffset = cachedMsgMinOffset; } - public long getCachedMsgMaxOffset() { return cachedMsgMaxOffset; } - public void setCachedMsgMaxOffset(long cachedMsgMaxOffset) { this.cachedMsgMaxOffset = cachedMsgMaxOffset; } - public int getCachedMsgCount() { return cachedMsgCount; } - public void setCachedMsgCount(int cachedMsgCount) { this.cachedMsgCount = cachedMsgCount; } - public long getTransactionMsgMinOffset() { return transactionMsgMinOffset; } - public void setTransactionMsgMinOffset(long transactionMsgMinOffset) { this.transactionMsgMinOffset = transactionMsgMinOffset; } - public long getTransactionMsgMaxOffset() { return transactionMsgMaxOffset; } - public void setTransactionMsgMaxOffset(long transactionMsgMaxOffset) { this.transactionMsgMaxOffset = transactionMsgMaxOffset; } - public int getTransactionMsgCount() { return transactionMsgCount; } - public void setTransactionMsgCount(int transactionMsgCount) { this.transactionMsgCount = transactionMsgCount; } - public boolean isLocked() { return locked; } - public void setLocked(boolean locked) { this.locked = locked; } - public long getTryUnlockTimes() { return tryUnlockTimes; } - public void setTryUnlockTimes(long tryUnlockTimes) { this.tryUnlockTimes = tryUnlockTimes; } - public long getLastLockTimestamp() { return lastLockTimestamp; } - public void setLastLockTimestamp(long lastLockTimestamp) { this.lastLockTimestamp = lastLockTimestamp; } - public boolean isDroped() { return droped; } - public void setDroped(boolean droped) { this.droped = droped; } - public long getLastPullTimestamp() { return lastPullTimestamp; } - public void setLastPullTimestamp(long lastPullTimestamp) { this.lastPullTimestamp = lastPullTimestamp; } - public long getLastConsumeTimestamp() { return lastConsumeTimestamp; } - public void setLastConsumeTimestamp(long lastConsumeTimestamp) { this.lastConsumeTimestamp = lastConsumeTimestamp; } - @Override public String toString() { return "ProcessQueueInfo [commitOffset=" + commitOffset + ", cachedMsgMinOffset=" - + cachedMsgMinOffset + ", cachedMsgMaxOffset=" + cachedMsgMaxOffset + ", cachedMsgCount=" - + cachedMsgCount + ", transactionMsgMinOffset=" + transactionMsgMinOffset - + ", transactionMsgMaxOffset=" + transactionMsgMaxOffset + ", transactionMsgCount=" - + transactionMsgCount + ", locked=" + locked + ", tryUnlockTimes=" + tryUnlockTimes - + ", lastLockTimestamp=" + UtilAll.timeMillisToHumanString(lastLockTimestamp) + ", droped=" - + droped + ", lastPullTimestamp=" + UtilAll.timeMillisToHumanString(lastPullTimestamp) - + ", lastConsumeTimestamp=" + UtilAll.timeMillisToHumanString(lastConsumeTimestamp) + "]"; + + cachedMsgMinOffset + ", cachedMsgMaxOffset=" + cachedMsgMaxOffset + ", cachedMsgCount=" + + cachedMsgCount + ", transactionMsgMinOffset=" + transactionMsgMinOffset + + ", transactionMsgMaxOffset=" + transactionMsgMaxOffset + ", transactionMsgCount=" + + transactionMsgCount + ", locked=" + locked + ", tryUnlockTimes=" + tryUnlockTimes + + ", lastLockTimestamp=" + UtilAll.timeMillisToHumanString(lastLockTimestamp) + ", droped=" + + droped + ", lastPullTimestamp=" + UtilAll.timeMillisToHumanString(lastPullTimestamp) + + ", lastConsumeTimestamp=" + UtilAll.timeMillisToHumanString(lastConsumeTimestamp) + "]"; } } http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/388ba7a5/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProducerConnection.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProducerConnection.java b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProducerConnection.java index 99ac6ba..bc04337 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProducerConnection.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/body/ProducerConnection.java @@ -6,31 +6,27 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.rocketmq.common.protocol.body; -import org.apache.rocketmq.remoting.protocol.RemotingSerializable; - import java.util.HashSet; - +import org.apache.rocketmq.remoting.protocol.RemotingSerializable; public class ProducerConnection extends RemotingSerializable { private HashSet<Connection> connectionSet = new HashSet<Connection>(); - public HashSet<Connection> getConnectionSet() { return connectionSet; } - public void setConnectionSet(HashSet<Connection> connectionSet) { this.connectionSet = connectionSet; }