From 853b167bda89c58dc1bdffceb95ee4698e5d9e53 Mon Sep 17 00:00:00 2001 From: yukon Date: Wed, 28 Dec 2016 16:11:32 +0800 Subject: [PATCH] ROCKETMQ-18 Fix the conflicts between code and check style. --- .../rocketmq/broker/BrokerController.java | 4 +- .../apache/rocketmq/broker/BrokerStartup.java | 2 +- .../broker/client/ClientChannelInfo.java | 4 +- .../broker/latency/BrokerFastFailure.java | 4 +- .../broker/longpolling/ManyPullRequest.java | 2 +- .../rocketmq/broker/out/BrokerOuterAPI.java | 2 +- .../broker/plugin/MessageStoreFactory.java | 2 +- .../AbstractSendMessageProcessor.java | 6 +- .../processor/AdminBrokerProcessor.java | 62 ++++++++-------- .../processor/ClientManageProcessor.java | 2 +- .../processor/ConsumerManageProcessor.java | 8 +-- .../processor/EndTransactionProcessor.java | 2 +- .../processor/PullMessageProcessor.java | 6 +- .../processor/QueryMessageProcessor.java | 6 +- .../processor/SendMessageProcessor.java | 8 +-- .../rocketmq/broker/BrokerTestHarness.java | 2 + .../rocketmq/broker/api/SendMessageTest.java | 2 + .../offset/ConsumerOffsetManagerTest.java | 2 + .../broker/topic/TopicConfigManagerTest.java | 2 + .../apache/rocketmq/client/ClientConfig.java | 1 - .../org/apache/rocketmq/client/MQAdmin.java | 70 +++++-------------- .../apache/rocketmq/client/Validators.java | 9 +-- .../consumer/DefaultMQPullConsumer.java | 1 - .../rocketmq/client/consumer/MQConsumer.java | 8 +-- .../client/consumer/MQPullConsumer.java | 33 ++------- .../client/consumer/MQPushConsumer.java | 20 ++---- .../client/consumer/MessageQueueListener.java | 10 +-- .../client/consumer/PullCallback.java | 1 - .../listener/ConsumeOrderlyContext.java | 1 - .../consumer/listener/MessageListener.java | 1 - .../listener/MessageListenerConcurrently.java | 6 +- .../listener/MessageListenerOrderly.java | 6 +- .../store/OffsetSerializeWrapper.java | 1 - .../client/consumer/store/OffsetStore.java | 4 -- .../client/impl/ClientRemotingProcessor.java | 12 ++-- .../rocketmq/client/impl/MQAdminImpl.java | 2 +- .../rocketmq/client/impl/MQClientAPIImpl.java | 18 ++--- .../consumer/DefaultMQPushConsumerImpl.java | 8 +-- .../client/impl/consumer/MQConsumerInner.java | 1 - .../impl/consumer/MessageQueueLock.java | 1 - .../client/impl/consumer/ProcessQueue.java | 3 - .../client/impl/consumer/PullAPIWrapper.java | 2 +- .../impl/consumer/PullMessageService.java | 2 +- .../client/impl/consumer/PullRequest.java | 2 +- .../impl/consumer/RebalanceService.java | 1 - .../client/impl/factory/MQClientInstance.java | 10 +-- .../impl/producer/DefaultMQProducerImpl.java | 6 +- .../latency/LatencyFaultToleranceImpl.java | 6 +- .../client/stat/ConsumerStatsManager.java | 10 +-- .../apache/rocketmq/common/Configuration.java | 3 +- .../rocketmq/common/CountDownLatch2.java | 2 +- .../apache/rocketmq/common/DataVersion.java | 4 +- .../org/apache/rocketmq/common/MixAll.java | 4 +- .../apache/rocketmq/common/TopicConfig.java | 2 +- .../org/apache/rocketmq/common/UtilAll.java | 40 +++++------ .../common/filter/impl/PolishExpr.java | 17 ++--- .../common/message/MessageClientIDSetter.java | 12 ++-- .../common/message/MessageDecoder.java | 14 ++-- .../rocketmq/common/message/MessageExt.java | 6 +- .../rocketmq/common/message/MessageQueue.java | 2 +- .../common/message/MessageQueueForC.java | 2 +- .../common/namesrv/NamesrvConfig.java | 2 + .../common/namesrv/TopAddressing.java | 2 + .../protocol/body/ConsumerRunningInfo.java | 4 +- .../CheckTransactionStateRequestHeader.java | 2 + .../CheckTransactionStateResponseHeader.java | 2 + .../header/CloneGroupOffsetRequestHeader.java | 2 + .../header/CreateTopicRequestHeader.java | 2 + .../header/DeleteTopicRequestHeader.java | 2 + .../header/EndTransactionRequestHeader.java | 2 + .../header/EndTransactionResponseHeader.java | 2 + .../GetAllTopicConfigResponseHeader.java | 2 + .../header/GetBrokerConfigResponseHeader.java | 2 + .../GetEarliestMsgStoretimeRequestHeader.java | 2 + ...GetEarliestMsgStoretimeResponseHeader.java | 2 + .../header/GetMaxOffsetRequestHeader.java | 2 + .../header/GetMaxOffsetResponseHeader.java | 2 + .../header/GetMinOffsetRequestHeader.java | 2 + .../header/GetMinOffsetResponseHeader.java | 2 + .../header/PullMessageRequestHeader.java | 2 + .../header/PullMessageResponseHeader.java | 2 + .../QueryConsumerOffsetRequestHeader.java | 2 + .../QueryConsumerOffsetResponseHeader.java | 2 + .../header/QueryCorrectionOffsetHeader.java | 2 + .../header/QueryMessageRequestHeader.java | 2 + .../header/QueryMessageResponseHeader.java | 2 + .../QueryTopicConsumeByWhoRequestHeader.java | 2 + .../header/SearchOffsetRequestHeader.java | 2 + .../header/SearchOffsetResponseHeader.java | 2 + .../header/SendMessageRequestHeader.java | 2 + .../header/SendMessageResponseHeader.java | 2 + .../UpdateConsumerOffsetRequestHeader.java | 2 + .../UpdateConsumerOffsetResponseHeader.java | 2 + .../header/ViewMessageRequestHeader.java | 2 + .../header/ViewMessageResponseHeader.java | 2 + .../namesrv/GetRouteInfoRequestHeader.java | 2 + .../namesrv/GetRouteInfoResponseHeader.java | 2 + .../namesrv/RegisterBrokerRequestHeader.java | 2 + .../RegisterOrderTopicRequestHeader.java | 2 + .../UnRegisterBrokerRequestHeader.java | 2 + .../protocol/heartbeat/ConsumeType.java | 2 + .../protocol/heartbeat/ConsumerData.java | 2 + .../protocol/heartbeat/HeartbeatData.java | 2 + .../protocol/heartbeat/MessageModel.java | 2 + .../protocol/heartbeat/ProducerData.java | 2 + .../protocol/heartbeat/SubscriptionData.java | 4 +- .../common/protocol/route/BrokerData.java | 4 +- .../common/protocol/route/QueueData.java | 4 +- .../common/protocol/route/TopicRouteData.java | 4 +- .../common/queue/ConcurrentTreeMap.java | 1 - .../rocketmq/common/queue/RoundQueue.java | 1 - .../subscription/SubscriptionGroupConfig.java | 6 +- .../rocketmq/common/utils/ChannelUtil.java | 2 +- .../rocketmq/common/utils/HttpTinyClient.java | 18 ++--- .../rocketmq/common/utils/IOTinyUtils.java | 9 +-- .../rocketmq/example/benchmark/Consumer.java | 6 +- .../rocketmq/example/benchmark/Producer.java | 4 +- .../benchmark/TransactionProducer.java | 4 +- .../example/ordermessage/Producer.java | 2 +- .../filtersrv/FilterServerOuterAPI.java | 2 +- .../rocketmq/filtersrv/FiltersrvStartup.java | 2 +- .../rocketmq/filtersrv/filter/DynaCode.java | 2 +- .../filtersrv/filter/FilterClassManager.java | 4 +- .../processor/DefaultRequestProcessor.java | 10 +-- .../rocketmq/namesrv/NamesrvStartup.java | 2 +- .../ClusterTestRequestProcessor.java | 2 +- .../processor/DefaultRequestProcessor.java | 30 ++++---- .../namesrv/routeinfo/RouteInfoManager.java | 2 +- pom.xml | 4 +- .../remoting/common/RemotingHelper.java | 6 +- .../remoting/common/RemotingUtil.java | 4 +- .../remoting/common/ServiceThread.java | 2 - .../rocketmq/remoting/netty/NettyDecoder.java | 2 +- .../remoting/netty/NettyRemotingClient.java | 2 +- .../remoting/netty/NettyRemotingServer.java | 4 +- .../remoting/netty/NettyRequestProcessor.java | 2 - .../remoting/netty/NettyServerConfig.java | 2 +- .../rocketmq/remoting/netty/RequestTask.java | 4 +- .../remoting/protocol/LanguageCode.java | 18 ++--- .../remoting/protocol/RemotingCommand.java | 8 +-- .../protocol/RocketMQSerializable.java | 6 +- .../remoting/protocol/SerializeType.java | 4 +- .../org/apache/rocketmq/remoting/MixTest.java | 2 + .../rocketmq/remoting/NettyRPCTest.java | 65 +++++++---------- .../store/AllocateMappedFileService.java | 2 +- .../rocketmq/store/AppendMessageCallback.java | 3 - .../rocketmq/store/AppendMessageResult.java | 1 - .../rocketmq/store/AppendMessageStatus.java | 2 - .../org/apache/rocketmq/store/CommitLog.java | 10 +-- .../apache/rocketmq/store/ConsumeQueue.java | 6 +- .../rocketmq/store/DefaultMessageStore.java | 48 ++++++------- .../rocketmq/store/GetMessageResult.java | 2 +- .../org/apache/rocketmq/store/MappedFile.java | 8 +-- .../rocketmq/store/MappedFileQueue.java | 20 +++--- .../org/apache/rocketmq/store/StoreUtil.java | 2 +- .../rocketmq/store/TransientStorePool.java | 4 +- .../store/config/MessageStoreConfig.java | 21 +++--- .../apache/rocketmq/store/ha/HAService.java | 2 +- .../rocketmq/store/index/IndexFile.java | 17 ++--- .../rocketmq/store/index/IndexService.java | 2 +- .../schedule/ScheduleMessageService.java | 2 - .../org/apache/rocketmq/store/util/LibC.java | 2 +- .../rocketmq/store/MappedFileQueueTest.java | 2 + .../apache/rocketmq/store/MappedFileTest.java | 2 + .../rocketmq/store/StoreCheckpointTest.java | 2 + .../rocketmq/store/index/IndexFileTest.java | 2 + .../store/schedule/ScheduleMessageTest.java | 2 + .../rmq_checkstyle.xml | 4 +- .../tools/admin/DefaultMQAdminExtImpl.java | 2 +- .../tools/command/MQAdminStartup.java | 2 +- .../cluster/CLusterSendMsgRTCommand.java | 2 +- .../consumer/ConsumerProgressSubCommand.java | 4 +- .../message/CheckMsgSendRTCommand.java | 4 +- .../message/PrintMessageByQueueCommand.java | 2 +- .../message/QueryMsgByIdSubCommand.java | 2 +- 175 files changed, 494 insertions(+), 534 deletions(-) rename checkstyle/checkstyle.xml => style/rmq_checkstyle.xml (98%) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java index 501c1c5d..f2fea43a 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java @@ -205,7 +205,7 @@ public class BrokerController { this.messageStore = new DefaultMessageStore(this.messageStoreConfig, this.brokerStatsManager, this.messageArrivingListener, this.brokerConfig); - this.brokerStats = new BrokerStats((DefaultMessageStore)this.messageStore); + this.brokerStats = new BrokerStats((DefaultMessageStore) this.messageStore); //load plugin MessageStorePluginContext context = new MessageStorePluginContext(messageStoreConfig, brokerStatsManager, messageArrivingListener, brokerConfig); this.messageStore = MessageStoreFactory.build(context, this.messageStore); @@ -219,7 +219,7 @@ public class BrokerController { if (result) { this.remotingServer = new NettyRemotingServer(this.nettyServerConfig, this.clientHousekeepingService); - NettyServerConfig fastConfig = (NettyServerConfig)this.nettyServerConfig.clone(); + NettyServerConfig fastConfig = (NettyServerConfig) this.nettyServerConfig.clone(); fastConfig.setListenPort(nettyServerConfig.getListenPort() - 2); this.fastRemotingServer = new NettyRemotingServer(fastConfig, this.clientHousekeepingService); this.sendMessageExecutor = new BrokerFixedThreadPoolExecutor( diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java index dfa97c1b..4c23eb06 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java @@ -178,7 +178,7 @@ public class BrokerStartup { } messageStoreConfig.setHaListenPort(nettyServerConfig.getListenPort() + 1); - LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(lc); lc.reset(); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/client/ClientChannelInfo.java b/broker/src/main/java/org/apache/rocketmq/broker/client/ClientChannelInfo.java index 24cddb90..b37fce59 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/client/ClientChannelInfo.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/client/ClientChannelInfo.java @@ -68,7 +68,7 @@ public class ClientChannelInfo { result = prime * result + ((channel == null) ? 0 : channel.hashCode()); result = prime * result + ((clientId == null) ? 0 : clientId.hashCode()); result = prime * result + ((language == null) ? 0 : language.hashCode()); - result = prime * result + (int)(lastUpdateTimestamp ^ (lastUpdateTimestamp >>> 32)); + result = prime * result + (int) (lastUpdateTimestamp ^ (lastUpdateTimestamp >>> 32)); result = prime * result + version; return result; } @@ -81,7 +81,7 @@ public class ClientChannelInfo { return false; if (getClass() != obj.getClass()) return false; - ClientChannelInfo other = (ClientChannelInfo)obj; + ClientChannelInfo other = (ClientChannelInfo) obj; if (channel == null) { if (other.channel != null) return false; diff --git a/broker/src/main/java/org/apache/rocketmq/broker/latency/BrokerFastFailure.java b/broker/src/main/java/org/apache/rocketmq/broker/latency/BrokerFastFailure.java index f616e338..f885b715 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/latency/BrokerFastFailure.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/latency/BrokerFastFailure.java @@ -39,8 +39,8 @@ public class BrokerFastFailure { public static RequestTask castRunnable(final Runnable runnable) { try { - FutureTaskExt object = (FutureTaskExt)runnable; - return (RequestTask)object.getRunnable(); + FutureTaskExt object = (FutureTaskExt) runnable; + return (RequestTask) object.getRunnable(); } catch (Throwable e) { log.error(String.format("castRunnable exception, %s", runnable.getClass().getName()), e); } diff --git a/broker/src/main/java/org/apache/rocketmq/broker/longpolling/ManyPullRequest.java b/broker/src/main/java/org/apache/rocketmq/broker/longpolling/ManyPullRequest.java index 0ee02ad6..30edf347 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/longpolling/ManyPullRequest.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/longpolling/ManyPullRequest.java @@ -32,7 +32,7 @@ public class ManyPullRequest { public synchronized List cloneListAndClear() { if (!this.pullRequestList.isEmpty()) { - List result = (ArrayList)this.pullRequestList.clone(); + List result = (ArrayList) this.pullRequestList.clone(); this.pullRequestList.clear(); return result; } diff --git a/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java b/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java index 25b333a9..18666288 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java @@ -169,7 +169,7 @@ public class BrokerOuterAPI { switch (response.getCode()) { case ResponseCode.SUCCESS: { RegisterBrokerResponseHeader responseHeader = - (RegisterBrokerResponseHeader)response.decodeCommandCustomHeader(RegisterBrokerResponseHeader.class); + (RegisterBrokerResponseHeader) response.decodeCommandCustomHeader(RegisterBrokerResponseHeader.class); RegisterBrokerResult result = new RegisterBrokerResult(); result.setMasterAddr(responseHeader.getMasterAddr()); result.setHaServerAddr(responseHeader.getHaServerAddr()); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/plugin/MessageStoreFactory.java b/broker/src/main/java/org/apache/rocketmq/broker/plugin/MessageStoreFactory.java index 294bf8c2..ac7f949f 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/plugin/MessageStoreFactory.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/plugin/MessageStoreFactory.java @@ -34,7 +34,7 @@ public final class MessageStoreFactory { String pluginClass = pluginClasses[i]; try { @SuppressWarnings("unchecked") - Class clazz = (Class)Class.forName(pluginClass); + Class clazz = (Class) Class.forName(pluginClass); Constructor construct = clazz.getConstructor(MessageStorePluginContext.class, MessageStore.class); messageStore = construct.newInstance(context, messageStore); } catch (Throwable e) { diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/AbstractSendMessageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/AbstractSendMessageProcessor.java index 75e57667..06e546bc 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/AbstractSendMessageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/AbstractSendMessageProcessor.java @@ -283,12 +283,12 @@ public abstract class AbstractSendMessageProcessor implements NettyRequestProces switch (request.getCode()) { case RequestCode.SEND_MESSAGE_V2: requestHeaderV2 = - (SendMessageRequestHeaderV2)request + (SendMessageRequestHeaderV2) request .decodeCommandCustomHeader(SendMessageRequestHeaderV2.class); case RequestCode.SEND_MESSAGE: if (null == requestHeaderV2) { requestHeader = - (SendMessageRequestHeader)request + (SendMessageRequestHeader) request .decodeCommandCustomHeader(SendMessageRequestHeader.class); } else { requestHeader = SendMessageRequestHeaderV2.createSendMessageRequestHeaderV1(requestHeaderV2); @@ -305,7 +305,7 @@ public abstract class AbstractSendMessageProcessor implements NettyRequestProces try { if (response != null) { final SendMessageResponseHeader responseHeader = - (SendMessageResponseHeader)response.readCustomHeader(); + (SendMessageResponseHeader) response.readCustomHeader(); context.setMsgId(responseHeader.getMsgId()); context.setQueueId(responseHeader.getQueueId()); context.setQueueOffset(responseHeader.getQueueOffset()); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java index 722bec22..13980572 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java @@ -202,7 +202,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand updateAndCreateTopic(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final CreateTopicRequestHeader requestHeader = - (CreateTopicRequestHeader)request.decodeCommandCustomHeader(CreateTopicRequestHeader.class); + (CreateTopicRequestHeader) request.decodeCommandCustomHeader(CreateTopicRequestHeader.class); log.info("updateAndCreateTopic called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel())); if (requestHeader.getTopic().equals(this.brokerController.getBrokerConfig().getBrokerClusterName())) { @@ -237,7 +237,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand deleteTopic(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); DeleteTopicRequestHeader requestHeader = - (DeleteTopicRequestHeader)request.decodeCommandCustomHeader(DeleteTopicRequestHeader.class); + (DeleteTopicRequestHeader) request.decodeCommandCustomHeader(DeleteTopicRequestHeader.class); log.info("deleteTopic called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel())); @@ -318,7 +318,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getBrokerConfig(ChannelHandlerContext ctx, RemotingCommand request) { final RemotingCommand response = RemotingCommand.createResponseCommand(GetBrokerConfigResponseHeader.class); - final GetBrokerConfigResponseHeader responseHeader = (GetBrokerConfigResponseHeader)response.readCustomHeader(); + final GetBrokerConfigResponseHeader responseHeader = (GetBrokerConfigResponseHeader) response.readCustomHeader(); String content = this.brokerController.getConfiguration().getAllConfigsFormatString(); if (content != null && content.length() > 0) { @@ -342,9 +342,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand searchOffsetByTimestamp(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(SearchOffsetResponseHeader.class); - final SearchOffsetResponseHeader responseHeader = (SearchOffsetResponseHeader)response.readCustomHeader(); + final SearchOffsetResponseHeader responseHeader = (SearchOffsetResponseHeader) response.readCustomHeader(); final SearchOffsetRequestHeader requestHeader = - (SearchOffsetRequestHeader)request.decodeCommandCustomHeader(SearchOffsetRequestHeader.class); + (SearchOffsetRequestHeader) request.decodeCommandCustomHeader(SearchOffsetRequestHeader.class); long offset = this.brokerController.getMessageStore().getOffsetInQueueByTime(requestHeader.getTopic(), requestHeader.getQueueId(), requestHeader.getTimestamp()); @@ -358,9 +358,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getMaxOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(GetMaxOffsetResponseHeader.class); - final GetMaxOffsetResponseHeader responseHeader = (GetMaxOffsetResponseHeader)response.readCustomHeader(); + final GetMaxOffsetResponseHeader responseHeader = (GetMaxOffsetResponseHeader) response.readCustomHeader(); final GetMaxOffsetRequestHeader requestHeader = - (GetMaxOffsetRequestHeader)request.decodeCommandCustomHeader(GetMaxOffsetRequestHeader.class); + (GetMaxOffsetRequestHeader) request.decodeCommandCustomHeader(GetMaxOffsetRequestHeader.class); long offset = this.brokerController.getMessageStore().getMaxOffsetInQuque(requestHeader.getTopic(), requestHeader.getQueueId()); @@ -373,9 +373,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getMinOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(GetMinOffsetResponseHeader.class); - final GetMinOffsetResponseHeader responseHeader = (GetMinOffsetResponseHeader)response.readCustomHeader(); + final GetMinOffsetResponseHeader responseHeader = (GetMinOffsetResponseHeader) response.readCustomHeader(); final GetMinOffsetRequestHeader requestHeader = - (GetMinOffsetRequestHeader)request.decodeCommandCustomHeader(GetMinOffsetRequestHeader.class); + (GetMinOffsetRequestHeader) request.decodeCommandCustomHeader(GetMinOffsetRequestHeader.class); long offset = this.brokerController.getMessageStore().getMinOffsetInQuque(requestHeader.getTopic(), requestHeader.getQueueId()); @@ -387,9 +387,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getEarliestMsgStoretime(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(GetEarliestMsgStoretimeResponseHeader.class); - final GetEarliestMsgStoretimeResponseHeader responseHeader = (GetEarliestMsgStoretimeResponseHeader)response.readCustomHeader(); + final GetEarliestMsgStoretimeResponseHeader responseHeader = (GetEarliestMsgStoretimeResponseHeader) response.readCustomHeader(); final GetEarliestMsgStoretimeRequestHeader requestHeader = - (GetEarliestMsgStoretimeRequestHeader)request.decodeCommandCustomHeader(GetEarliestMsgStoretimeRequestHeader.class); + (GetEarliestMsgStoretimeRequestHeader) request.decodeCommandCustomHeader(GetEarliestMsgStoretimeRequestHeader.class); long timestamp = this.brokerController.getMessageStore().getEarliestMessageTime(requestHeader.getTopic(), requestHeader.getQueueId()); @@ -491,7 +491,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand deleteSubscriptionGroup(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); DeleteSubscriptionGroupRequestHeader requestHeader = - (DeleteSubscriptionGroupRequestHeader)request.decodeCommandCustomHeader(DeleteSubscriptionGroupRequestHeader.class); + (DeleteSubscriptionGroupRequestHeader) request.decodeCommandCustomHeader(DeleteSubscriptionGroupRequestHeader.class); log.info("deleteSubscriptionGroup called by {}", RemotingHelper.parseChannelRemoteAddr(ctx.channel())); @@ -505,7 +505,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getTopicStatsInfo(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetTopicStatsInfoRequestHeader requestHeader = - (GetTopicStatsInfoRequestHeader)request.decodeCommandCustomHeader(GetTopicStatsInfoRequestHeader.class); + (GetTopicStatsInfoRequestHeader) request.decodeCommandCustomHeader(GetTopicStatsInfoRequestHeader.class); final String topic = requestHeader.getTopic(); TopicConfig topicConfig = this.brokerController.getTopicConfigManager().selectTopicConfig(topic); @@ -553,7 +553,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getConsumerConnectionList(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumerConnectionListRequestHeader requestHeader = - (GetConsumerConnectionListRequestHeader)request.decodeCommandCustomHeader(GetConsumerConnectionListRequestHeader.class); + (GetConsumerConnectionListRequestHeader) request.decodeCommandCustomHeader(GetConsumerConnectionListRequestHeader.class); ConsumerGroupInfo consumerGroupInfo = this.brokerController.getConsumerManager().getConsumerGroupInfo(requestHeader.getConsumerGroup()); @@ -592,7 +592,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getProducerConnectionList(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetProducerConnectionListRequestHeader requestHeader = - (GetProducerConnectionListRequestHeader)request.decodeCommandCustomHeader(GetProducerConnectionListRequestHeader.class); + (GetProducerConnectionListRequestHeader) request.decodeCommandCustomHeader(GetProducerConnectionListRequestHeader.class); ProducerConnection bodydata = new ProducerConnection(); HashMap channelInfoHashMap = @@ -625,7 +625,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getConsumeStats(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumeStatsRequestHeader requestHeader = - (GetConsumeStatsRequestHeader)request.decodeCommandCustomHeader(GetConsumeStatsRequestHeader.class); + (GetConsumeStatsRequestHeader) request.decodeCommandCustomHeader(GetConsumeStatsRequestHeader.class); ConsumeStats consumeStats = new ConsumeStats(); @@ -733,7 +733,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand getAllDelayOffset(ChannelHandlerContext ctx, RemotingCommand request) { final RemotingCommand response = RemotingCommand.createResponseCommand(null); - String content = ((DefaultMessageStore)this.brokerController.getMessageStore()).getScheduleMessageService().encode(); + String content = ((DefaultMessageStore) this.brokerController.getMessageStore()).getScheduleMessageService().encode(); if (content != null && content.length() > 0) { try { response.setBody(content.getBytes(MixAll.DEFAULT_CHARSET)); @@ -759,7 +759,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { public RemotingCommand resetOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final ResetOffsetRequestHeader requestHeader = - (ResetOffsetRequestHeader)request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class); + (ResetOffsetRequestHeader) request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class); log.info("[reset-offset] reset offset started by {}. topic={}, group={}, timestamp={}, isForce={}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getTopic(), requestHeader.getGroup(), requestHeader.getTimestamp(), requestHeader.isForce()); @@ -776,7 +776,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { public RemotingCommand getConsumerStatus(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final GetConsumerStatusRequestHeader requestHeader = - (GetConsumerStatusRequestHeader)request.decodeCommandCustomHeader(GetConsumerStatusRequestHeader.class); + (GetConsumerStatusRequestHeader) request.decodeCommandCustomHeader(GetConsumerStatusRequestHeader.class); log.info("[get-consumer-status] get consumer status by {}. topic={}, group={}", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getTopic(), requestHeader.getGroup()); @@ -788,7 +788,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand queryTopicConsumeByWho(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); QueryTopicConsumeByWhoRequestHeader requestHeader = - (QueryTopicConsumeByWhoRequestHeader)request.decodeCommandCustomHeader(QueryTopicConsumeByWhoRequestHeader.class); + (QueryTopicConsumeByWhoRequestHeader) request.decodeCommandCustomHeader(QueryTopicConsumeByWhoRequestHeader.class); HashSet groups = this.brokerController.getConsumerManager().queryTopicConsumeByWho(requestHeader.getTopic()); @@ -809,9 +809,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand registerFilterServer(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(RegisterFilterServerResponseHeader.class); - final RegisterFilterServerResponseHeader responseHeader = (RegisterFilterServerResponseHeader)response.readCustomHeader(); + final RegisterFilterServerResponseHeader responseHeader = (RegisterFilterServerResponseHeader) response.readCustomHeader(); final RegisterFilterServerRequestHeader requestHeader = - (RegisterFilterServerRequestHeader)request.decodeCommandCustomHeader(RegisterFilterServerRequestHeader.class); + (RegisterFilterServerRequestHeader) request.decodeCommandCustomHeader(RegisterFilterServerRequestHeader.class); this.brokerController.getFilterServerManager().registerFilterServer(ctx.channel(), requestHeader.getFilterServerAddr()); @@ -826,7 +826,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand queryConsumeTimeSpan(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); QueryConsumeTimeSpanRequestHeader requestHeader = - (QueryConsumeTimeSpanRequestHeader)request.decodeCommandCustomHeader(QueryConsumeTimeSpanRequestHeader.class); + (QueryConsumeTimeSpanRequestHeader) request.decodeCommandCustomHeader(QueryConsumeTimeSpanRequestHeader.class); final String topic = requestHeader.getTopic(); TopicConfig topicConfig = this.brokerController.getTopicConfigManager().selectTopicConfig(topic); @@ -916,7 +916,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { */ private RemotingCommand getConsumerRunningInfo(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final GetConsumerRunningInfoRequestHeader requestHeader = - (GetConsumerRunningInfoRequestHeader)request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); + (GetConsumerRunningInfoRequestHeader) request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); return this.callConsumer(RequestCode.GET_CONSUMER_RUNNING_INFO, request, requestHeader.getConsumerGroup(), requestHeader.getClientId()); @@ -925,7 +925,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand queryCorrectionOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); QueryCorrectionOffsetHeader requestHeader = - (QueryCorrectionOffsetHeader)request.decodeCommandCustomHeader(QueryCorrectionOffsetHeader.class); + (QueryCorrectionOffsetHeader) request.decodeCommandCustomHeader(QueryCorrectionOffsetHeader.class); Map correctionOffset = this.brokerController.getConsumerOffsetManager() .queryMinOffsetInAllGroup(requestHeader.getTopic(), requestHeader.getFilterGroups()); @@ -950,7 +950,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { } private RemotingCommand consumeMessageDirectly(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { - final ConsumeMessageDirectlyResultRequestHeader requestHeader = (ConsumeMessageDirectlyResultRequestHeader)request + final ConsumeMessageDirectlyResultRequestHeader requestHeader = (ConsumeMessageDirectlyResultRequestHeader) request .decodeCommandCustomHeader(ConsumeMessageDirectlyResultRequestHeader.class); request.getExtFields().put("brokerName", this.brokerController.getBrokerConfig().getBrokerName()); @@ -976,7 +976,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand cloneGroupOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); CloneGroupOffsetRequestHeader requestHeader = - (CloneGroupOffsetRequestHeader)request.decodeCommandCustomHeader(CloneGroupOffsetRequestHeader.class); + (CloneGroupOffsetRequestHeader) request.decodeCommandCustomHeader(CloneGroupOffsetRequestHeader.class); Set topics; if (UtilAll.isBlank(requestHeader.getTopic())) { @@ -1018,9 +1018,9 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { private RemotingCommand ViewBrokerStatsData(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final ViewBrokerStatsDataRequestHeader requestHeader = - (ViewBrokerStatsDataRequestHeader)request.decodeCommandCustomHeader(ViewBrokerStatsDataRequestHeader.class); + (ViewBrokerStatsDataRequestHeader) request.decodeCommandCustomHeader(ViewBrokerStatsDataRequestHeader.class); final RemotingCommand response = RemotingCommand.createResponseCommand(null); - DefaultMessageStore messageStore = (DefaultMessageStore)this.brokerController.getMessageStore(); + DefaultMessageStore messageStore = (DefaultMessageStore) this.brokerController.getMessageStore(); StatsItem statsItem = messageStore.getBrokerStatsManager().getStatsItem(requestHeader.getStatsName(), requestHeader.getStatsKey()); if (null == statsItem) { @@ -1068,7 +1068,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); GetConsumeStatsInBrokerHeader requestHeader = - (GetConsumeStatsInBrokerHeader)request.decodeCommandCustomHeader(GetConsumeStatsInBrokerHeader.class); + (GetConsumeStatsInBrokerHeader) request.decodeCommandCustomHeader(GetConsumeStatsInBrokerHeader.class); boolean isOrder = requestHeader.isOrder(); ConcurrentHashMap subscriptionGroups = brokerController.getSubscriptionGroupManager().getSubscriptionGroupTable(); @@ -1185,7 +1185,7 @@ public class AdminBrokerProcessor implements NettyRequestProcessor { runtimeInfo.put("earliestMessageTimeStamp", String.valueOf(this.brokerController.getMessageStore().getEarliestMessageTime())); runtimeInfo.put("startAcceptSendRequestTimeStamp", String.valueOf(this.brokerController.getBrokerConfig().getStartAcceptSendRequestTimeStamp())); if (this.brokerController.getMessageStore() instanceof DefaultMessageStore) { - DefaultMessageStore defaultMessageStore = (DefaultMessageStore)this.brokerController.getMessageStore(); + DefaultMessageStore defaultMessageStore = (DefaultMessageStore) this.brokerController.getMessageStore(); runtimeInfo.put("remainTransientStoreBufferNumbs", String.valueOf(defaultMessageStore.remainTransientStoreBufferNumbs())); if (defaultMessageStore.getMessageStoreConfig().isTransientStorePoolEnable()) { runtimeInfo.put("remainHowManyDataToCommit", MixAll.humanReadableByteCount(defaultMessageStore.getCommitLog().remainHowManyDataToCommit(), false)); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/ClientManageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/ClientManageProcessor.java index 717afaf3..74046a69 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/ClientManageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/ClientManageProcessor.java @@ -125,7 +125,7 @@ public class ClientManageProcessor implements NettyRequestProcessor { final RemotingCommand response = RemotingCommand.createResponseCommand(UnregisterClientResponseHeader.class); final UnregisterClientRequestHeader requestHeader = - (UnregisterClientRequestHeader)request + (UnregisterClientRequestHeader) request .decodeCommandCustomHeader(UnregisterClientRequestHeader.class); ClientChannelInfo clientChannelInfo = new ClientChannelInfo( diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/ConsumerManageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/ConsumerManageProcessor.java index d2e6d7d0..b7323267 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/ConsumerManageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/ConsumerManageProcessor.java @@ -72,7 +72,7 @@ public class ConsumerManageProcessor implements NettyRequestProcessor { final RemotingCommand response = RemotingCommand.createResponseCommand(GetConsumerListByGroupResponseHeader.class); final GetConsumerListByGroupRequestHeader requestHeader = - (GetConsumerListByGroupRequestHeader)request + (GetConsumerListByGroupRequestHeader) request .decodeCommandCustomHeader(GetConsumerListByGroupRequestHeader.class); ConsumerGroupInfo consumerGroupInfo = @@ -106,7 +106,7 @@ public class ConsumerManageProcessor implements NettyRequestProcessor { final RemotingCommand response = RemotingCommand.createResponseCommand(UpdateConsumerOffsetResponseHeader.class); final UpdateConsumerOffsetRequestHeader requestHeader = - (UpdateConsumerOffsetRequestHeader)request + (UpdateConsumerOffsetRequestHeader) request .decodeCommandCustomHeader(UpdateConsumerOffsetRequestHeader.class); this.brokerController.getConsumerOffsetManager().commitOffset(RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getConsumerGroup(), requestHeader.getTopic(), requestHeader.getQueueId(), requestHeader.getCommitOffset()); @@ -120,9 +120,9 @@ public class ConsumerManageProcessor implements NettyRequestProcessor { final RemotingCommand response = RemotingCommand.createResponseCommand(QueryConsumerOffsetResponseHeader.class); final QueryConsumerOffsetResponseHeader responseHeader = - (QueryConsumerOffsetResponseHeader)response.readCustomHeader(); + (QueryConsumerOffsetResponseHeader) response.readCustomHeader(); final QueryConsumerOffsetRequestHeader requestHeader = - (QueryConsumerOffsetRequestHeader)request + (QueryConsumerOffsetRequestHeader) request .decodeCommandCustomHeader(QueryConsumerOffsetRequestHeader.class); long offset = diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/EndTransactionProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/EndTransactionProcessor.java index 6a34a69c..5bf512f3 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/EndTransactionProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/EndTransactionProcessor.java @@ -49,7 +49,7 @@ public class EndTransactionProcessor implements NettyRequestProcessor { public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final EndTransactionRequestHeader requestHeader = - (EndTransactionRequestHeader)request.decodeCommandCustomHeader(EndTransactionRequestHeader.class); + (EndTransactionRequestHeader) request.decodeCommandCustomHeader(EndTransactionRequestHeader.class); if (requestHeader.getFromTransactionCheck()) { switch (requestHeader.getCommitOrRollback()) { diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java index 7169b9c9..54e56cd8 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java @@ -81,9 +81,9 @@ public class PullMessageProcessor implements NettyRequestProcessor { private RemotingCommand processRequest(final Channel channel, RemotingCommand request, boolean brokerAllowSuspend) throws RemotingCommandException { RemotingCommand response = RemotingCommand.createResponseCommand(PullMessageResponseHeader.class); - final PullMessageResponseHeader responseHeader = (PullMessageResponseHeader)response.readCustomHeader(); + final PullMessageResponseHeader responseHeader = (PullMessageResponseHeader) response.readCustomHeader(); final PullMessageRequestHeader requestHeader = - (PullMessageRequestHeader)request.decodeCommandCustomHeader(PullMessageRequestHeader.class); + (PullMessageRequestHeader) request.decodeCommandCustomHeader(PullMessageRequestHeader.class); response.setOpaque(request.getOpaque()); @@ -335,7 +335,7 @@ public class PullMessageProcessor implements NettyRequestProcessor { final byte[] r = this.readGetMessageResult(getMessageResult, requestHeader.getConsumerGroup(), requestHeader.getTopic(), requestHeader.getQueueId()); this.brokerController.getBrokerStatsManager().incGroupGetLatency(requestHeader.getConsumerGroup(), requestHeader.getTopic(), requestHeader.getQueueId(), - (int)(this.brokerController.getMessageStore().now() - beginTimeMills)); + (int) (this.brokerController.getMessageStore().now() - beginTimeMills)); response.setBody(r); } else { try { diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/QueryMessageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/QueryMessageProcessor.java index 04f206f0..9df5a01c 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/QueryMessageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/QueryMessageProcessor.java @@ -72,9 +72,9 @@ public class QueryMessageProcessor implements NettyRequestProcessor { final RemotingCommand response = RemotingCommand.createResponseCommand(QueryMessageResponseHeader.class); final QueryMessageResponseHeader responseHeader = - (QueryMessageResponseHeader)response.readCustomHeader(); + (QueryMessageResponseHeader) response.readCustomHeader(); final QueryMessageRequestHeader requestHeader = - (QueryMessageRequestHeader)request + (QueryMessageRequestHeader) request .decodeCommandCustomHeader(QueryMessageRequestHeader.class); response.setOpaque(request.getOpaque()); @@ -127,7 +127,7 @@ public class QueryMessageProcessor implements NettyRequestProcessor { throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final ViewMessageRequestHeader requestHeader = - (ViewMessageRequestHeader)request.decodeCommandCustomHeader(ViewMessageRequestHeader.class); + (ViewMessageRequestHeader) request.decodeCommandCustomHeader(ViewMessageRequestHeader.class); response.setOpaque(request.getOpaque()); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java index 1b952051..ea8c44ba 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java @@ -89,7 +89,7 @@ public class SendMessageProcessor extends AbstractSendMessageProcessor implement throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final ConsumerSendMsgBackRequestHeader requestHeader = - (ConsumerSendMsgBackRequestHeader)request.decodeCommandCustomHeader(ConsumerSendMsgBackRequestHeader.class); + (ConsumerSendMsgBackRequestHeader) request.decodeCommandCustomHeader(ConsumerSendMsgBackRequestHeader.class); if (this.hasConsumeMessageHook() && !UtilAll.isBlank(requestHeader.getOriginMsgId())) { @@ -244,7 +244,7 @@ public class SendMessageProcessor extends AbstractSendMessageProcessor implement final SendMessageRequestHeader requestHeader) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(SendMessageResponseHeader.class); - final SendMessageResponseHeader responseHeader = (SendMessageResponseHeader)response.readCustomHeader(); + final SendMessageResponseHeader responseHeader = (SendMessageResponseHeader) response.readCustomHeader(); response.setOpaque(request.getOpaque()); @@ -415,7 +415,7 @@ public class SendMessageProcessor extends AbstractSendMessageProcessor implement int commercialBaseCount = brokerController.getBrokerConfig().getCommercialBaseCount(); int wroteSize = putMessageResult.getAppendMessageResult().getWroteBytes(); - int incValue = (int)Math.ceil(wroteSize / BrokerStatsManager.SIZE_PER_COUNT) * commercialBaseCount; + int incValue = (int) Math.ceil(wroteSize / BrokerStatsManager.SIZE_PER_COUNT) * commercialBaseCount; sendMessageContext.setCommercialSendStats(BrokerStatsManager.StatsType.SEND_SUCCESS); sendMessageContext.setCommercialSendTimes(incValue); @@ -426,7 +426,7 @@ public class SendMessageProcessor extends AbstractSendMessageProcessor implement } else { if (hasSendMessageHook()) { int wroteSize = request.getBody().length; - int incValue = (int)Math.ceil(wroteSize / BrokerStatsManager.SIZE_PER_COUNT); + int incValue = (int) Math.ceil(wroteSize / BrokerStatsManager.SIZE_PER_COUNT); sendMessageContext.setCommercialSendStats(BrokerStatsManager.StatsType.SEND_FAILURE); sendMessageContext.setCommercialSendTimes(incValue); diff --git a/broker/src/test/java/org/apache/rocketmq/broker/BrokerTestHarness.java b/broker/src/test/java/org/apache/rocketmq/broker/BrokerTestHarness.java index 5e944d8e..1eefb259 100644 --- a/broker/src/test/java/org/apache/rocketmq/broker/BrokerTestHarness.java +++ b/broker/src/test/java/org/apache/rocketmq/broker/BrokerTestHarness.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SendMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: SendMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/broker/src/test/java/org/apache/rocketmq/broker/api/SendMessageTest.java b/broker/src/test/java/org/apache/rocketmq/broker/api/SendMessageTest.java index 38d885e5..1ab00933 100644 --- a/broker/src/test/java/org/apache/rocketmq/broker/api/SendMessageTest.java +++ b/broker/src/test/java/org/apache/rocketmq/broker/api/SendMessageTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SendMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: SendMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/broker/src/test/java/org/apache/rocketmq/broker/offset/ConsumerOffsetManagerTest.java b/broker/src/test/java/org/apache/rocketmq/broker/offset/ConsumerOffsetManagerTest.java index 89813fc6..a4eb6591 100644 --- a/broker/src/test/java/org/apache/rocketmq/broker/offset/ConsumerOffsetManagerTest.java +++ b/broker/src/test/java/org/apache/rocketmq/broker/offset/ConsumerOffsetManagerTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ConsumerOffsetManagerTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: ConsumerOffsetManagerTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/broker/src/test/java/org/apache/rocketmq/broker/topic/TopicConfigManagerTest.java b/broker/src/test/java/org/apache/rocketmq/broker/topic/TopicConfigManagerTest.java index 2f85dbc2..68979677 100644 --- a/broker/src/test/java/org/apache/rocketmq/broker/topic/TopicConfigManagerTest.java +++ b/broker/src/test/java/org/apache/rocketmq/broker/topic/TopicConfigManagerTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: TopicConfigManagerTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: TopicConfigManagerTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java index 9c7a0cdc..1c80a2be 100644 --- a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java +++ b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java @@ -22,7 +22,6 @@ import org.apache.rocketmq.remoting.common.RemotingUtil; /** * Client Common configuration - * */ public class ClientConfig { public static final String SEND_MESSAGE_WITH_VIP_CHANNEL_PROPERTY = "com.rocketmq.sendMessageWithVIPChannel"; diff --git a/client/src/main/java/org/apache/rocketmq/client/MQAdmin.java b/client/src/main/java/org/apache/rocketmq/client/MQAdmin.java index 76975206..b8d5b232 100644 --- a/client/src/main/java/org/apache/rocketmq/client/MQAdmin.java +++ b/client/src/main/java/org/apache/rocketmq/client/MQAdmin.java @@ -24,19 +24,14 @@ import org.apache.rocketmq.remoting.exception.RemotingException; /** * Base interface for MQ management - * */ public interface MQAdmin { /** * Creates an topic * - * @param key - * accesskey - * @param newTopic - * topic name - * @param queueNum - * topic's queue number - * + * @param key accesskey + * @param newTopic topic name + * @param queueNum topic's queue number * @throws MQClientException */ void createTopic(final String key, final String newTopic, final int queueNum) @@ -45,15 +40,10 @@ public interface MQAdmin { /** * Creates an topic * - * @param key - * accesskey - * @param newTopic - * topic name - * @param queueNum - * topic's queue number - * @param topicSysFlag - * topic system flag - * + * @param key accesskey + * @param newTopic topic name + * @param queueNum topic's queue number + * @param topicSysFlag topic system flag * @throws MQClientException */ void createTopic(String key, String newTopic, int queueNum, int topicSysFlag) @@ -63,13 +53,9 @@ public interface MQAdmin { * Gets the message queue offset according to some time in milliseconds
* be cautious to call because of more IO overhead * - * @param mq - * Instance of MessageQueue - * @param timestamp - * from when in milliseconds. - * + * @param mq Instance of MessageQueue + * @param timestamp from when in milliseconds. * @return offset - * * @throws MQClientException */ long searchOffset(final MessageQueue mq, final long timestamp) throws MQClientException; @@ -77,11 +63,8 @@ public interface MQAdmin { /** * Gets the max offset * - * @param mq - * Instance of MessageQueue - * + * @param mq Instance of MessageQueue * @return the max offset - * * @throws MQClientException */ long maxOffset(final MessageQueue mq) throws MQClientException; @@ -89,11 +72,8 @@ public interface MQAdmin { /** * Gets the minimum offset * - * @param mq - * Instance of MessageQueue - * + * @param mq Instance of MessageQueue * @return the minimum offset - * * @throws MQClientException */ long minOffset(final MessageQueue mq) throws MQClientException; @@ -101,11 +81,8 @@ public interface MQAdmin { /** * Gets the earliest stored message time * - * @param mq - * Instance of MessageQueue - * + * @param mq Instance of MessageQueue * @return the time in microseconds - * * @throws MQClientException */ long earliestMsgStoreTime(final MessageQueue mq) throws MQClientException; @@ -113,11 +90,8 @@ public interface MQAdmin { /** * Query message according tto message id * - * @param offsetMsgId - * message id - * + * @param offsetMsgId message id * @return message - * * @throws InterruptedException * @throws MQBrokerException * @throws RemotingException @@ -129,19 +103,12 @@ public interface MQAdmin { /** * Query messages * - * @param topic - * message topic - * @param key - * message key index word - * @param maxNum - * max message number - * @param begin - * from when - * @param end - * to when - * + * @param topic message topic + * @param key message key index word + * @param maxNum max message number + * @param begin from when + * @param end to when * @return Instance of QueryResult - * * @throws MQClientException * @throws InterruptedException */ @@ -149,7 +116,6 @@ public interface MQAdmin { final long end) throws MQClientException, InterruptedException; /** - * @param topic * @param msgId * @return The {@code MessageExt} of given msgId diff --git a/client/src/main/java/org/apache/rocketmq/client/Validators.java b/client/src/main/java/org/apache/rocketmq/client/Validators.java index fa9e4e60..845886a1 100644 --- a/client/src/main/java/org/apache/rocketmq/client/Validators.java +++ b/client/src/main/java/org/apache/rocketmq/client/Validators.java @@ -28,7 +28,6 @@ import org.apache.rocketmq.common.protocol.ResponseCode; /** * Common Validator - * */ public class Validators { public static final String VALID_PATTERN_STR = "^[%|a-zA-Z0-9_-]+$"; @@ -38,7 +37,6 @@ public class Validators { /** * @param origin * @param patternStr - * * @return The resulting {@code String} */ public static String getGroupWithRegularExpression(String origin, String patternStr) { @@ -54,7 +52,6 @@ public class Validators { * Validate group * * @param group - * * @throws MQClientException */ public static void checkGroup(String group) throws MQClientException { @@ -74,9 +71,7 @@ public class Validators { /** * @param origin * @param pattern - * - * @return true if, and only if, the entire origin sequence - * matches this matcher's pattern + * @return true if, and only if, the entire origin sequence matches this matcher's pattern */ public static boolean regularExpressionMatcher(String origin, Pattern pattern) { if (pattern == null) { @@ -91,7 +86,6 @@ public class Validators { * * @param msg * @param defaultMQProducer - * * @throws MQClientException */ public static void checkMessage(Message msg, DefaultMQProducer defaultMQProducer) @@ -120,7 +114,6 @@ public class Validators { * Validate topic * * @param topic - * * @throws MQClientException */ public static void checkTopic(String topic) throws MQClientException { diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumer.java b/client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumer.java index 8eb1258f..e438b61b 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumer.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPullConsumer.java @@ -35,7 +35,6 @@ import org.apache.rocketmq.remoting.exception.RemotingException; /** * Default pulling consumer - * */ public class DefaultMQPullConsumer extends ClientConfig implements MQPullConsumer { protected final transient DefaultMQPullConsumerImpl defaultMQPullConsumerImpl; diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/MQConsumer.java b/client/src/main/java/org/apache/rocketmq/client/consumer/MQConsumer.java index 343a0a25..ee145e7f 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/MQConsumer.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/MQConsumer.java @@ -26,7 +26,6 @@ import org.apache.rocketmq.remoting.exception.RemotingException; /** * Message queue consumer interface - * */ public interface MQConsumer extends MQAdmin { /** @@ -34,7 +33,6 @@ public interface MQConsumer extends MQAdmin { * * @param msg * @param delayLevel - * * @throws InterruptedException * @throws MQBrokerException * @throws RemotingException @@ -50,7 +48,6 @@ public interface MQConsumer extends MQAdmin { * @param msg * @param delayLevel * @param brokerName - * * @throws RemotingException * @throws MQBrokerException * @throws InterruptedException @@ -62,11 +59,8 @@ public interface MQConsumer extends MQAdmin { /** * Fetch message queues from consumer cache according to the topic * - * @param topic - * message topic - * + * @param topic message topic * @return queue set - * * @throws MQClientException */ Set fetchSubscribeMessageQueues(final String topic) throws MQClientException; diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/MQPullConsumer.java b/client/src/main/java/org/apache/rocketmq/client/consumer/MQPullConsumer.java index d199f8aa..1bca5361 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/MQPullConsumer.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/MQPullConsumer.java @@ -25,7 +25,6 @@ import org.apache.rocketmq.remoting.exception.RemotingException; /** * Pulling consumer interface - * */ public interface MQPullConsumer extends MQConsumer { /** @@ -51,18 +50,12 @@ public interface MQPullConsumer extends MQConsumer { /** * Pulling the messages,not blocking * - * @param mq - * from which message queue - * @param subExpression - * subscription expression.it only support or operation such as "tag1 || tag2 || tag3"
- * if null or * expression,meaning subscribe all - * @param offset - * from where to pull - * @param maxNums - * max pulling numbers - * + * @param mq from which message queue + * @param subExpression subscription expression.it only support or operation such as "tag1 || tag2 || tag3"
if null or * expression,meaning subscribe + * all + * @param offset from where to pull + * @param maxNums max pulling numbers * @return The resulting {@code PullRequest} - * * @throws MQClientException * @throws InterruptedException * @throws MQBrokerException @@ -80,9 +73,7 @@ public interface MQPullConsumer extends MQConsumer { * @param offset * @param maxNums * @param timeout - * * @return The resulting {@code PullRequest} - * * @throws MQClientException * @throws RemotingException * @throws MQBrokerException @@ -100,7 +91,6 @@ public interface MQPullConsumer extends MQConsumer { * @param offset * @param maxNums * @param pullCallback - * * @throws MQClientException * @throws RemotingException * @throws InterruptedException @@ -118,7 +108,6 @@ public interface MQPullConsumer extends MQConsumer { * @param maxNums * @param pullCallback * @param timeout - * * @throws MQClientException * @throws RemotingException * @throws InterruptedException @@ -134,9 +123,7 @@ public interface MQPullConsumer extends MQConsumer { * @param subExpression * @param offset * @param maxNums - * * @return The resulting {@code PullRequest} - * * @throws MQClientException * @throws RemotingException * @throws MQBrokerException @@ -154,7 +141,6 @@ public interface MQPullConsumer extends MQConsumer { * @param offset * @param maxNums * @param pullCallback - * * @throws MQClientException * @throws RemotingException * @throws InterruptedException @@ -168,7 +154,6 @@ public interface MQPullConsumer extends MQConsumer { * * @param mq * @param offset - * * @throws MQClientException */ void updateConsumeOffset(final MessageQueue mq, final long offset) throws MQClientException; @@ -178,9 +163,7 @@ public interface MQPullConsumer extends MQConsumer { * * @param mq * @param fromStore - * * @return The fetched offset of given queue - * * @throws MQClientException */ long fetchConsumeOffset(final MessageQueue mq, final boolean fromStore) throws MQClientException; @@ -188,11 +171,8 @@ public interface MQPullConsumer extends MQConsumer { /** * Fetch the message queues according to the topic * - * @param topic - * message topic - * + * @param topic message topic * @return message queue set - * * @throws MQClientException */ Set fetchMessageQueuesInBalance(final String topic) throws MQClientException; @@ -205,7 +185,6 @@ public interface MQPullConsumer extends MQConsumer { * @param delayLevel * @param brokerName * @param consumerGroup - * * @throws RemotingException * @throws MQBrokerException * @throws InterruptedException diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/MQPushConsumer.java b/client/src/main/java/org/apache/rocketmq/client/consumer/MQPushConsumer.java index 1b969bdf..cef85071 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/MQPushConsumer.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/MQPushConsumer.java @@ -23,7 +23,6 @@ import org.apache.rocketmq.client.exception.MQClientException; /** * Push consumer - * */ public interface MQPushConsumer extends MQConsumer { /** @@ -54,11 +53,8 @@ public interface MQPushConsumer extends MQConsumer { * Subscribe some topic * * @param topic - * @param subExpression - * subscription expression.it only support or operation such as - * "tag1 || tag2 || tag3"
- * if null or * expression,meaning subscribe all - * + * @param subExpression subscription expression.it only support or operation such as "tag1 || tag2 || tag3"
if null or * expression,meaning subscribe + * all * @throws MQClientException */ void subscribe(final String topic, final String subExpression) throws MQClientException; @@ -67,13 +63,8 @@ public interface MQPushConsumer extends MQConsumer { * Subscribe some topic * * @param topic - * @param fullClassName - * full class name,must extend - * org.apache.rocketmq.common.filter. MessageFilter - * @param filterClassSource - * class source code,used UTF-8 file encoding,must be responsible - * for your code safety - * + * @param fullClassName full class name,must extend org.apache.rocketmq.common.filter. MessageFilter + * @param filterClassSource class source code,used UTF-8 file encoding,must be responsible for your code safety * @throws MQClientException */ void subscribe(final String topic, final String fullClassName, final String filterClassSource) throws MQClientException; @@ -81,8 +72,7 @@ public interface MQPushConsumer extends MQConsumer { /** * Unsubscribe consumption some topic * - * @param topic - * message topic + * @param topic message topic */ void unsubscribe(final String topic); diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/MessageQueueListener.java b/client/src/main/java/org/apache/rocketmq/client/consumer/MessageQueueListener.java index 0cc2dc47..66e8757a 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/MessageQueueListener.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/MessageQueueListener.java @@ -21,16 +21,12 @@ import org.apache.rocketmq.common.message.MessageQueue; /** * A MessageQueueListener is implemented by the application and may be specified when a message queue changed - * */ public interface MessageQueueListener { /** - * @param topic - * message topic - * @param mqAll - * all queues in this message topic - * @param mqDivided - * collection of queues,assigned to the current consumer + * @param topic message topic + * @param mqAll all queues in this message topic + * @param mqDivided collection of queues,assigned to the current consumer */ void messageQueueChanged(final String topic, final Set mqAll, final Set mqDivided); diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/PullCallback.java b/client/src/main/java/org/apache/rocketmq/client/consumer/PullCallback.java index 06e47d95..cfbc83ea 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/PullCallback.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/PullCallback.java @@ -18,7 +18,6 @@ package org.apache.rocketmq.client.consumer; /** * Async message pulling interface - * */ public interface PullCallback { void onSuccess(final PullResult pullResult); diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/ConsumeOrderlyContext.java b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/ConsumeOrderlyContext.java index 405781b4..7280ff4e 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/ConsumeOrderlyContext.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/ConsumeOrderlyContext.java @@ -20,7 +20,6 @@ import org.apache.rocketmq.common.message.MessageQueue; /** * Consumer Orderly consumption context - * */ public class ConsumeOrderlyContext { private final MessageQueue messageQueue; diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListener.java b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListener.java index 2a9e5c95..338c1568 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListener.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListener.java @@ -18,7 +18,6 @@ package org.apache.rocketmq.client.consumer.listener; /** * A MessageListener object is used to receive asynchronously delivered messages. - * */ public interface MessageListener { } diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerConcurrently.java b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerConcurrently.java index c0831573..fcf0e74b 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerConcurrently.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerConcurrently.java @@ -21,17 +21,13 @@ import org.apache.rocketmq.common.message.MessageExt; /** * A MessageListenerConcurrently object is used to receive asynchronously delivered messages concurrently - * */ public interface MessageListenerConcurrently extends MessageListener { /** * It is not recommend to throw exception,rather than returning ConsumeConcurrentlyStatus.RECONSUME_LATER if consumption failure * - * @param msgs - * msgs.size() >= 1
- * DefaultMQPushConsumer.consumeMessageBatchMaxSize=1,you can modify here + * @param msgs msgs.size() >= 1
DefaultMQPushConsumer.consumeMessageBatchMaxSize=1,you can modify here * @param context - * * @return The consume status */ ConsumeConcurrentlyStatus consumeMessage(final List msgs, diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerOrderly.java b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerOrderly.java index 57a553a6..5db8462f 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerOrderly.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/listener/MessageListenerOrderly.java @@ -21,17 +21,13 @@ import org.apache.rocketmq.common.message.MessageExt; /** * A MessageListenerConcurrently object is used to receive asynchronously delivered messages orderly.one queue,one thread - * */ public interface MessageListenerOrderly extends MessageListener { /** * It is not recommend to throw exception,rather than returning ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT if consumption failure * - * @param msgs - * msgs.size() >= 1
- * DefaultMQPushConsumer.consumeMessageBatchMaxSize=1,you can modify here + * @param msgs msgs.size() >= 1
DefaultMQPushConsumer.consumeMessageBatchMaxSize=1,you can modify here * @param context - * * @return The consume status */ ConsumeOrderlyStatus consumeMessage(final List msgs, diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetSerializeWrapper.java b/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetSerializeWrapper.java index 4954f6f5..055d5b74 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetSerializeWrapper.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetSerializeWrapper.java @@ -23,7 +23,6 @@ import org.apache.rocketmq.remoting.protocol.RemotingSerializable; /** * Wrapper class for offset serialization - * */ public class OffsetSerializeWrapper extends RemotingSerializable { private ConcurrentHashMap offsetTable = diff --git a/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetStore.java b/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetStore.java index 592796f6..00008e52 100644 --- a/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetStore.java +++ b/client/src/main/java/org/apache/rocketmq/client/consumer/store/OffsetStore.java @@ -25,7 +25,6 @@ import org.apache.rocketmq.remoting.exception.RemotingException; /** * Offset store interface - * */ public interface OffsetStore { /** @@ -49,7 +48,6 @@ public interface OffsetStore { * * @param mq * @param type - * * @return The fetched offset */ long readOffset(final MessageQueue mq, final ReadOffsetType type); @@ -77,13 +75,11 @@ public interface OffsetStore { /** * @param topic - * * @return The cloned offset table of given topic */ Map cloneOffsetTable(String topic); /** - * * @param mq * @param offset * @param isOneway diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/ClientRemotingProcessor.java b/client/src/main/java/org/apache/rocketmq/client/impl/ClientRemotingProcessor.java index 46ce08ca..5486229d 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/ClientRemotingProcessor.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/ClientRemotingProcessor.java @@ -84,7 +84,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { public RemotingCommand checkTransactionState(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final CheckTransactionStateRequestHeader requestHeader = - (CheckTransactionStateRequestHeader)request.decodeCommandCustomHeader(CheckTransactionStateRequestHeader.class); + (CheckTransactionStateRequestHeader) request.decodeCommandCustomHeader(CheckTransactionStateRequestHeader.class); final ByteBuffer byteBuffer = ByteBuffer.wrap(request.getBody()); final MessageExt messageExt = MessageDecoder.decode(byteBuffer); if (messageExt != null) { @@ -110,7 +110,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { public RemotingCommand notifyConsumerIdsChanged(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { try { final NotifyConsumerIdsChangedRequestHeader requestHeader = - (NotifyConsumerIdsChangedRequestHeader)request.decodeCommandCustomHeader(NotifyConsumerIdsChangedRequestHeader.class); + (NotifyConsumerIdsChangedRequestHeader) request.decodeCommandCustomHeader(NotifyConsumerIdsChangedRequestHeader.class); log.info("receive broker's notification[{}], the consumer group: {} changed, rebalance immediately", RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getConsumerGroup()); @@ -123,7 +123,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { public RemotingCommand resetOffset(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final ResetOffsetRequestHeader requestHeader = - (ResetOffsetRequestHeader)request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class); + (ResetOffsetRequestHeader) request.decodeCommandCustomHeader(ResetOffsetRequestHeader.class); log.info("invoke reset offset operation from broker. brokerAddr={}, topic={}, group={}, timestamp={}", new Object[] { RemotingHelper.parseChannelRemoteAddr(ctx.channel()), requestHeader.getTopic(), requestHeader.getGroup(), @@ -141,7 +141,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { public RemotingCommand getConsumeStatus(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumerStatusRequestHeader requestHeader = - (GetConsumerStatusRequestHeader)request.decodeCommandCustomHeader(GetConsumerStatusRequestHeader.class); + (GetConsumerStatusRequestHeader) request.decodeCommandCustomHeader(GetConsumerStatusRequestHeader.class); Map offsetTable = this.mqClientFactory.getConsumerStatus(requestHeader.getTopic(), requestHeader.getGroup()); GetConsumerStatusBody body = new GetConsumerStatusBody(); @@ -154,7 +154,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { private RemotingCommand getConsumerRunningInfo(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumerRunningInfoRequestHeader requestHeader = - (GetConsumerRunningInfoRequestHeader)request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); + (GetConsumerRunningInfoRequestHeader) request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); ConsumerRunningInfo consumerRunningInfo = this.mqClientFactory.consumerRunningInfo(requestHeader.getConsumerGroup()); if (null != consumerRunningInfo) { @@ -177,7 +177,7 @@ public class ClientRemotingProcessor implements NettyRequestProcessor { private RemotingCommand consumeMessageDirectly(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final ConsumeMessageDirectlyResultRequestHeader requestHeader = - (ConsumeMessageDirectlyResultRequestHeader)request + (ConsumeMessageDirectlyResultRequestHeader) request .decodeCommandCustomHeader(ConsumeMessageDirectlyResultRequestHeader.class); final MessageExt msg = MessageDecoder.decode(ByteBuffer.wrap(request.getBody())); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java index 5fdcab24..79338b02 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java @@ -307,7 +307,7 @@ public class MQAdminImpl { QueryMessageResponseHeader responseHeader = null; try { responseHeader = - (QueryMessageResponseHeader)response + (QueryMessageResponseHeader) response .decodeCommandCustomHeader(QueryMessageResponseHeader.class); } catch (RemotingCommandException e) { log.error("decodeCommandCustomHeader exception", e); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index 2dd92003..73dfcc5d 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -505,7 +505,7 @@ public class MQClientAPIImpl { } SendMessageResponseHeader responseHeader = - (SendMessageResponseHeader)response.decodeCommandCustomHeader(SendMessageResponseHeader.class); + (SendMessageResponseHeader) response.decodeCommandCustomHeader(SendMessageResponseHeader.class); MessageQueue messageQueue = new MessageQueue(msg.getTopic(), brokerName, responseHeader.getQueueId()); @@ -622,7 +622,7 @@ public class MQClientAPIImpl { } PullMessageResponseHeader responseHeader = - (PullMessageResponseHeader)response.decodeCommandCustomHeader(PullMessageResponseHeader.class); + (PullMessageResponseHeader) response.decodeCommandCustomHeader(PullMessageResponseHeader.class); return new PullResultExt(pullStatus, responseHeader.getNextBeginOffset(), responseHeader.getMinOffset(), responseHeader.getMaxOffset(), null, responseHeader.getSuggestWhichBrokerId(), response.getBody()); @@ -664,7 +664,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { SearchOffsetResponseHeader responseHeader = - (SearchOffsetResponseHeader)response.decodeCommandCustomHeader(SearchOffsetResponseHeader.class); + (SearchOffsetResponseHeader) response.decodeCommandCustomHeader(SearchOffsetResponseHeader.class); return responseHeader.getOffset(); } default: @@ -687,7 +687,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { GetMaxOffsetResponseHeader responseHeader = - (GetMaxOffsetResponseHeader)response.decodeCommandCustomHeader(GetMaxOffsetResponseHeader.class); + (GetMaxOffsetResponseHeader) response.decodeCommandCustomHeader(GetMaxOffsetResponseHeader.class); return responseHeader.getOffset(); } @@ -738,7 +738,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { GetMinOffsetResponseHeader responseHeader = - (GetMinOffsetResponseHeader)response.decodeCommandCustomHeader(GetMinOffsetResponseHeader.class); + (GetMinOffsetResponseHeader) response.decodeCommandCustomHeader(GetMinOffsetResponseHeader.class); return responseHeader.getOffset(); } @@ -762,7 +762,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { GetEarliestMsgStoretimeResponseHeader responseHeader = - (GetEarliestMsgStoretimeResponseHeader)response.decodeCommandCustomHeader(GetEarliestMsgStoretimeResponseHeader.class); + (GetEarliestMsgStoretimeResponseHeader) response.decodeCommandCustomHeader(GetEarliestMsgStoretimeResponseHeader.class); return responseHeader.getTimestamp(); } @@ -786,7 +786,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { QueryConsumerOffsetResponseHeader responseHeader = - (QueryConsumerOffsetResponseHeader)response.decodeCommandCustomHeader(QueryConsumerOffsetResponseHeader.class); + (QueryConsumerOffsetResponseHeader) response.decodeCommandCustomHeader(QueryConsumerOffsetResponseHeader.class); return responseHeader.getOffset(); } @@ -1249,7 +1249,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { WipeWritePermOfBrokerResponseHeader responseHeader = - (WipeWritePermOfBrokerResponseHeader)response.decodeCommandCustomHeader(WipeWritePermOfBrokerResponseHeader.class); + (WipeWritePermOfBrokerResponseHeader) response.decodeCommandCustomHeader(WipeWritePermOfBrokerResponseHeader.class); return responseHeader.getWipeTopicCount(); } default: @@ -1331,7 +1331,7 @@ public class MQClientAPIImpl { switch (response.getCode()) { case ResponseCode.SUCCESS: { GetKVConfigResponseHeader responseHeader = - (GetKVConfigResponseHeader)response.decodeCommandCustomHeader(GetKVConfigResponseHeader.class); + (GetKVConfigResponseHeader) response.decodeCommandCustomHeader(GetKVConfigResponseHeader.class); return responseHeader.getValue(); } default: diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java index c22c515a..f036b831 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java @@ -581,11 +581,11 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner { if (this.getMessageListenerInner() instanceof MessageListenerOrderly) { this.consumeOrderly = true; this.consumeMessageService = - new ConsumeMessageOrderlyService(this, (MessageListenerOrderly)this.getMessageListenerInner()); + new ConsumeMessageOrderlyService(this, (MessageListenerOrderly) this.getMessageListenerInner()); } else if (this.getMessageListenerInner() instanceof MessageListenerConcurrently) { this.consumeOrderly = false; this.consumeMessageService = - new ConsumeMessageConcurrentlyService(this, (MessageListenerConcurrently)this.getMessageListenerInner()); + new ConsumeMessageConcurrentlyService(this, (MessageListenerConcurrently) this.getMessageListenerInner()); } this.consumeMessageService.start(); @@ -1024,9 +1024,9 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner { long computeAccTotal = this.computeAccumulationTotal(); long adjustThreadPoolNumsThreshold = this.defaultMQPushConsumer.getAdjustThreadPoolNumsThreshold(); - long incThreshold = (long)(adjustThreadPoolNumsThreshold * 1.0); + long incThreshold = (long) (adjustThreadPoolNumsThreshold * 1.0); - long decThreshold = (long)(adjustThreadPoolNumsThreshold * 0.8); + long decThreshold = (long) (adjustThreadPoolNumsThreshold * 0.8); if (computeAccTotal >= incThreshold) { this.consumeMessageService.incCorePoolSize(); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MQConsumerInner.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MQConsumerInner.java index ce4f2b96..76784bee 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MQConsumerInner.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MQConsumerInner.java @@ -26,7 +26,6 @@ import org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData; /** * Consumer inner interface - * */ public interface MQConsumerInner { String groupName(); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MessageQueueLock.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MessageQueueLock.java index 47ae2b0d..9b3ab9fd 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MessageQueueLock.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/MessageQueueLock.java @@ -21,7 +21,6 @@ import org.apache.rocketmq.common.message.MessageQueue; /** * Message lock,strictly ensure the single queue only one thread at a time consuming - * */ public class MessageQueueLock { private ConcurrentHashMap mqLockTable = diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java index 2d177038..641b6c6e 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java @@ -35,7 +35,6 @@ import org.slf4j.Logger; /** * Queue consumption snapshot - * */ public class ProcessQueue { public final static long REBALANCE_LOCK_MAX_LIVE_TIME = @@ -69,8 +68,6 @@ public class ProcessQueue { } /** - - * * @param pushConsumer */ public void cleanExpiredMsg(DefaultMQPushConsumer pushConsumer) { diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullAPIWrapper.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullAPIWrapper.java index d3581753..9cea5db1 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullAPIWrapper.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullAPIWrapper.java @@ -66,7 +66,7 @@ public class PullAPIWrapper { public PullResult processPullResult(final MessageQueue mq, final PullResult pullResult, final SubscriptionData subscriptionData) { - PullResultExt pullResultExt = (PullResultExt)pullResult; + PullResultExt pullResultExt = (PullResultExt) pullResult; this.updatePullFromWhichNode(mq, pullResultExt.getSuggestWhichBrokerId()); if (PullStatus.FOUND == pullResult.getPullStatus()) { diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullMessageService.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullMessageService.java index 55e3d59e..5cc052a7 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullMessageService.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullMessageService.java @@ -71,7 +71,7 @@ public class PullMessageService extends ServiceThread { private void pullMessage(final PullRequest pullRequest) { final MQConsumerInner consumer = this.mQClientFactory.selectConsumer(pullRequest.getConsumerGroup()); if (consumer != null) { - DefaultMQPushConsumerImpl impl = (DefaultMQPushConsumerImpl)consumer; + DefaultMQPushConsumerImpl impl = (DefaultMQPushConsumerImpl) consumer; impl.pullMessage(pullRequest); } else { log.warn("No matched consumer for the PullRequest {}, drop it", pullRequest); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullRequest.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullRequest.java index 4850313d..7a11d5f8 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullRequest.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/PullRequest.java @@ -74,7 +74,7 @@ public class PullRequest { return false; if (getClass() != obj.getClass()) return false; - PullRequest other = (PullRequest)obj; + PullRequest other = (PullRequest) obj; if (consumerGroup == null) { if (other.consumerGroup != null) return false; diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceService.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceService.java index 985129e5..7c2d3af2 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceService.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/RebalanceService.java @@ -23,7 +23,6 @@ import org.slf4j.Logger; /** * Rebalance Service - * */ public class RebalanceService extends ServiceThread { private static long waitInterval = diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java index 42b7a828..271199af 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java @@ -436,7 +436,7 @@ public class MQClientInstance { if (impl != null) { try { if (impl instanceof DefaultMQPushConsumerImpl) { - DefaultMQPushConsumerImpl dmq = (DefaultMQPushConsumerImpl)impl; + DefaultMQPushConsumerImpl dmq = (DefaultMQPushConsumerImpl) impl; dmq.adjustThreadPool(); } } catch (Exception e) { @@ -1026,7 +1026,7 @@ public class MQClientInstance { try { MQConsumerInner impl = this.consumerTable.get(group); if (impl != null && impl instanceof DefaultMQPushConsumerImpl) { - consumer = (DefaultMQPushConsumerImpl)impl; + consumer = (DefaultMQPushConsumerImpl) impl; } else { log.info("[reset-offset] consumer dose not exist. group={}", group); return; @@ -1071,10 +1071,10 @@ public class MQClientInstance { public Map getConsumerStatus(String topic, String group) { MQConsumerInner impl = this.consumerTable.get(group); if (impl != null && impl instanceof DefaultMQPushConsumerImpl) { - DefaultMQPushConsumerImpl consumer = (DefaultMQPushConsumerImpl)impl; + DefaultMQPushConsumerImpl consumer = (DefaultMQPushConsumerImpl) impl; return consumer.getOffsetStore().cloneOffsetTable(topic); } else if (impl != null && impl instanceof DefaultMQPullConsumerImpl) { - DefaultMQPullConsumerImpl consumer = (DefaultMQPullConsumerImpl)impl; + DefaultMQPullConsumerImpl consumer = (DefaultMQPullConsumerImpl) impl; return consumer.getOffsetStore().cloneOffsetTable(topic); } else { return Collections.EMPTY_MAP; @@ -1118,7 +1118,7 @@ public class MQClientInstance { final String brokerName) { MQConsumerInner mqConsumerInner = this.consumerTable.get(consumerGroup); if (null != mqConsumerInner) { - DefaultMQPushConsumerImpl consumer = (DefaultMQPushConsumerImpl)mqConsumerInner; + DefaultMQPushConsumerImpl consumer = (DefaultMQPushConsumerImpl) mqConsumerInner; ConsumeMessageDirectlyResult result = consumer.getConsumeMessageService().consumeMessageDirectly(msg, brokerName); return result; diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java index 42bf360b..e5882789 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java @@ -112,7 +112,7 @@ public class DefaultMQProducerImpl implements MQProducerInner { } public void initTransactionEnv() { - TransactionMQProducer producer = (TransactionMQProducer)this.defaultMQProducer; + TransactionMQProducer producer = (TransactionMQProducer) this.defaultMQProducer; this.checkRequestQueue = new LinkedBlockingQueue(producer.getCheckRequestHoldMax()); this.checkExecutor = new ThreadPoolExecutor(// producer.getCheckThreadPoolMinSize(), // @@ -238,7 +238,7 @@ public class DefaultMQProducerImpl implements MQProducerInner { @Override public TransactionCheckListener checkListener() { if (this.defaultMQProducer instanceof TransactionMQProducer) { - TransactionMQProducer producer = (TransactionMQProducer)defaultMQProducer; + TransactionMQProducer producer = (TransactionMQProducer) defaultMQProducer; return producer.getTransactionCheckListener(); } @@ -538,7 +538,7 @@ public class DefaultMQProducerImpl implements MQProducerInner { MQClientException mqClientException = new MQClientException(info, exception); if (exception instanceof MQBrokerException) { - mqClientException.setResponseCode(((MQBrokerException)exception).getResponseCode()); + mqClientException.setResponseCode(((MQBrokerException) exception).getResponseCode()); } else if (exception instanceof RemotingConnectException) { mqClientException.setResponseCode(ClientErrorCode.CONNECT_BROKER_EXCEPTION); } else if (exception instanceof RemotingTimeoutException) { diff --git a/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java b/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java index b61d855e..7df4b24d 100644 --- a/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java @@ -137,8 +137,8 @@ public class LatencyFaultToleranceImpl implements LatencyFaultTolerance @Override public int hashCode() { int result = getName() != null ? getName().hashCode() : 0; - result = 31 * result + (int)(getCurrentLatency() ^ (getCurrentLatency() >>> 32)); - result = 31 * result + (int)(getStartTimestamp() ^ (getStartTimestamp() >>> 32)); + result = 31 * result + (int) (getCurrentLatency() ^ (getCurrentLatency() >>> 32)); + result = 31 * result + (int) (getStartTimestamp() ^ (getStartTimestamp() >>> 32)); return result; } @@ -149,7 +149,7 @@ public class LatencyFaultToleranceImpl implements LatencyFaultTolerance if (!(o instanceof FaultItem)) return false; - final FaultItem faultItem = (FaultItem)o; + final FaultItem faultItem = (FaultItem) o; if (getCurrentLatency() != faultItem.getCurrentLatency()) return false; diff --git a/client/src/main/java/org/apache/rocketmq/client/stat/ConsumerStatsManager.java b/client/src/main/java/org/apache/rocketmq/client/stat/ConsumerStatsManager.java index c723951f..6b8b76e7 100644 --- a/client/src/main/java/org/apache/rocketmq/client/stat/ConsumerStatsManager.java +++ b/client/src/main/java/org/apache/rocketmq/client/stat/ConsumerStatsManager.java @@ -62,23 +62,23 @@ public class ConsumerStatsManager { } public void incPullRT(final String group, final String topic, final long rt) { - this.topicAndGroupPullRT.addValue(topic + "@" + group, (int)rt, 1); + this.topicAndGroupPullRT.addValue(topic + "@" + group, (int) rt, 1); } public void incPullTPS(final String group, final String topic, final long msgs) { - this.topicAndGroupPullTPS.addValue(topic + "@" + group, (int)msgs, 1); + this.topicAndGroupPullTPS.addValue(topic + "@" + group, (int) msgs, 1); } public void incConsumeRT(final String group, final String topic, final long rt) { - this.topicAndGroupConsumeRT.addValue(topic + "@" + group, (int)rt, 1); + this.topicAndGroupConsumeRT.addValue(topic + "@" + group, (int) rt, 1); } public void incConsumeOKTPS(final String group, final String topic, final long msgs) { - this.topicAndGroupConsumeOKTPS.addValue(topic + "@" + group, (int)msgs, 1); + this.topicAndGroupConsumeOKTPS.addValue(topic + "@" + group, (int) msgs, 1); } public void incConsumeFailedTPS(final String group, final String topic, final long msgs) { - this.topicAndGroupConsumeFailedTPS.addValue(topic + "@" + group, (int)msgs, 1); + this.topicAndGroupConsumeFailedTPS.addValue(topic + "@" + group, (int) msgs, 1); } public ConsumeStatus consumeStatus(final String group, final String topic) { diff --git a/common/src/main/java/org/apache/rocketmq/common/Configuration.java b/common/src/main/java/org/apache/rocketmq/common/Configuration.java index 54020573..187e42b2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/Configuration.java +++ b/common/src/main/java/org/apache/rocketmq/common/Configuration.java @@ -119,7 +119,6 @@ public class Configuration { * * @param object * @param fieldName - * * @throws java.lang.RuntimeException if the field of object is not exist. */ public void setStorePathFromConfig(Object object, String fieldName) { @@ -156,7 +155,7 @@ public class Configuration { if (this.storePathFromConfig) { try { - realStorePath = (String)storePathField.get(this.storePathObject); + realStorePath = (String) storePathField.get(this.storePathObject); } catch (IllegalAccessException e) { log.error("getStorePath error, ", e); } diff --git a/common/src/main/java/org/apache/rocketmq/common/CountDownLatch2.java b/common/src/main/java/org/apache/rocketmq/common/CountDownLatch2.java index c3e3372b..8c416e69 100644 --- a/common/src/main/java/org/apache/rocketmq/common/CountDownLatch2.java +++ b/common/src/main/java/org/apache/rocketmq/common/CountDownLatch2.java @@ -176,7 +176,7 @@ public class CountDownLatch2 { protected boolean tryReleaseShared(int releases) { // Decrement count; signal when transition to zero - for (; ; ) { + for (;;) { int c = getState(); if (c == 0) return false; diff --git a/common/src/main/java/org/apache/rocketmq/common/DataVersion.java b/common/src/main/java/org/apache/rocketmq/common/DataVersion.java index f3e46158..2c3d349e 100644 --- a/common/src/main/java/org/apache/rocketmq/common/DataVersion.java +++ b/common/src/main/java/org/apache/rocketmq/common/DataVersion.java @@ -56,7 +56,7 @@ public class DataVersion extends RemotingSerializable { if (o == null || getClass() != o.getClass()) return false; - final DataVersion that = (DataVersion)o; + final DataVersion that = (DataVersion) o; if (timestatmp != that.timestatmp) return false; @@ -66,7 +66,7 @@ public class DataVersion extends RemotingSerializable { @Override public int hashCode() { - int result = (int)(timestatmp ^ (timestatmp >>> 32)); + int result = (int) (timestatmp ^ (timestatmp >>> 32)); result = 31 * result + (counter != null ? counter.hashCode() : 0); return result; } diff --git a/common/src/main/java/org/apache/rocketmq/common/MixAll.java b/common/src/main/java/org/apache/rocketmq/common/MixAll.java index 8307dd58..b235859f 100644 --- a/common/src/main/java/org/apache/rocketmq/common/MixAll.java +++ b/common/src/main/java/org/apache/rocketmq/common/MixAll.java @@ -186,7 +186,7 @@ public class MixAll { public static final String file2String(final File file) { if (file.exists()) { - char[] data = new char[(int)file.length()]; + char[] data = new char[(int) file.length()]; boolean result = false; FileReader fileReader = null; @@ -442,7 +442,7 @@ public class MixAll { int unit = si ? 1000 : 1024; if (bytes < unit) return bytes + " B"; - int exp = (int)(Math.log(bytes) / Math.log(unit)); + int exp = (int) (Math.log(bytes) / Math.log(unit)); String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp - 1) + (si ? "" : "i"); return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); } diff --git a/common/src/main/java/org/apache/rocketmq/common/TopicConfig.java b/common/src/main/java/org/apache/rocketmq/common/TopicConfig.java index 2582b9f2..4a1f6b24 100644 --- a/common/src/main/java/org/apache/rocketmq/common/TopicConfig.java +++ b/common/src/main/java/org/apache/rocketmq/common/TopicConfig.java @@ -151,7 +151,7 @@ public class TopicConfig { if (o == null || getClass() != o.getClass()) return false; - final TopicConfig that = (TopicConfig)o; + final TopicConfig that = (TopicConfig) o; if (readQueueNums != that.readQueueNums) return false; diff --git a/common/src/main/java/org/apache/rocketmq/common/UtilAll.java b/common/src/main/java/org/apache/rocketmq/common/UtilAll.java index 54bcdef8..e9267075 100644 --- a/common/src/main/java/org/apache/rocketmq/common/UtilAll.java +++ b/common/src/main/java/org/apache/rocketmq/common/UtilAll.java @@ -193,7 +193,7 @@ public class UtilAll { long freeSpace = file.getFreeSpace(); long usedSpace = totalSpace - freeSpace; if (totalSpace > 0) { - return usedSpace / (double)totalSpace; + return usedSpace / (double) totalSpace; } } catch (Exception e) { return -1; @@ -213,7 +213,7 @@ public class UtilAll { public static final int crc32(byte[] array, int offset, int length) { CRC32 crc32 = new CRC32(); crc32.update(array, offset, length); - return (int)(crc32.getValue() & 0x7FFFFFFF); + return (int) (crc32.getValue() & 0x7FFFFFFF); } public static String bytes2string(byte[] src) { @@ -236,13 +236,13 @@ public class UtilAll { byte[] d = new byte[length]; for (int i = 0; i < length; i++) { int pos = i * 2; - d[i] = (byte)(charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); + d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); } return d; } private static byte charToByte(char c) { - return (byte)"0123456789ABCDEF".indexOf(c); + return (byte) "0123456789ABCDEF".indexOf(c); } public static byte[] uncompress(final byte[] src) throws IOException { @@ -400,15 +400,15 @@ public class UtilAll { //10.0.0.0~10.255.255.255 //172.16.0.0~172.31.255.255 //192.168.0.0~192.168.255.255 - if (ip[0] == (byte)10) { + if (ip[0] == (byte) 10) { return true; - } else if (ip[0] == (byte)172) { - if (ip[1] >= (byte)16 && ip[1] <= (byte)31) { + } else if (ip[0] == (byte) 172) { + if (ip[1] >= (byte) 16 && ip[1] <= (byte) 31) { return true; } - } else if (ip[0] == (byte)192) { - if (ip[1] == (byte)168) { + } else if (ip[0] == (byte) 192) { + if (ip[1] == (byte) 168) { return true; } } @@ -423,27 +423,27 @@ public class UtilAll { // if (ip[0] == (byte)30 && ip[1] == (byte)10 && ip[2] == (byte)163 && ip[3] == (byte)120) { // } - if (ip[0] >= (byte)1 && ip[0] <= (byte)126) { - if (ip[1] == (byte)1 && ip[2] == (byte)1 && ip[3] == (byte)1) { + if (ip[0] >= (byte) 1 && ip[0] <= (byte) 126) { + if (ip[1] == (byte) 1 && ip[2] == (byte) 1 && ip[3] == (byte) 1) { return false; } - if (ip[1] == (byte)0 && ip[2] == (byte)0 && ip[3] == (byte)0) { + if (ip[1] == (byte) 0 && ip[2] == (byte) 0 && ip[3] == (byte) 0) { return false; } return true; - } else if (ip[0] >= (byte)128 && ip[0] <= (byte)191) { - if (ip[2] == (byte)1 && ip[3] == (byte)1) { + } else if (ip[0] >= (byte) 128 && ip[0] <= (byte) 191) { + if (ip[2] == (byte) 1 && ip[3] == (byte) 1) { return false; } - if (ip[2] == (byte)0 && ip[3] == (byte)0) { + if (ip[2] == (byte) 0 && ip[3] == (byte) 0) { return false; } return true; - } else if (ip[0] >= (byte)192 && ip[0] <= (byte)223) { - if (ip[3] == (byte)1) { + } else if (ip[0] >= (byte) 192 && ip[0] <= (byte) 223) { + if (ip[3] == (byte) 1) { return false; } - if (ip[3] == (byte)0) { + if (ip[3] == (byte) 0) { return false; } return true; @@ -466,10 +466,10 @@ public class UtilAll { InetAddress ip = null; byte[] internalIP = null; while (allNetInterfaces.hasMoreElements()) { - NetworkInterface netInterface = (NetworkInterface)allNetInterfaces.nextElement(); + NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement(); Enumeration addresses = netInterface.getInetAddresses(); while (addresses.hasMoreElements()) { - ip = (InetAddress)addresses.nextElement(); + ip = (InetAddress) addresses.nextElement(); if (ip != null && ip instanceof Inet4Address) { byte[] ipByte = ip.getAddress(); if (ipByte.length == 4) { diff --git a/common/src/main/java/org/apache/rocketmq/common/filter/impl/PolishExpr.java b/common/src/main/java/org/apache/rocketmq/common/filter/impl/PolishExpr.java index 2b89944d..733eb6d0 100644 --- a/common/src/main/java/org/apache/rocketmq/common/filter/impl/PolishExpr.java +++ b/common/src/main/java/org/apache/rocketmq/common/filter/impl/PolishExpr.java @@ -49,7 +49,7 @@ public class PolishExpr { segments.add(token); } else if (isLeftParenthesis(token)) { - operatorStack.push((Operator)token); + operatorStack.push((Operator) token); } else if (isRightParenthesis(token)) { Operator opNew = null; @@ -60,7 +60,7 @@ public class PolishExpr { throw new IllegalArgumentException("mismatched parentheses"); } else if (isOperator(token)) { - Operator opNew = (Operator)token; + Operator opNew = (Operator) token; if (!operatorStack.empty()) { Operator opOld = operatorStack.peek(); if (opOld.isCompareable() && opNew.compare(opOld) != 1) { @@ -83,11 +83,8 @@ public class PolishExpr { } /** - * * @param expression - * * @return - * * @throws Exception */ private static List participle(String expression) { @@ -99,7 +96,7 @@ public class PolishExpr { Type preType = Type.NULL; for (int i = 0; i < size; i++) { - int chValue = (int)expression.charAt(i); + int chValue = (int) expression.charAt(i); if ((97 <= chValue && chValue <= 122) || (65 <= chValue && chValue <= 90) || (49 <= chValue && chValue <= 57) || 95 == chValue) { @@ -129,7 +126,7 @@ public class PolishExpr { } preType = Type.PARENTHESIS; - segments.add(createOperator((char)chValue + "")); + segments.add(createOperator((char) chValue + "")); } else if (38 == chValue || 124 == chValue) { if (Type.OPERAND == preType || Type.SEPAERATOR == preType || Type.PARENTHESIS == preType) { @@ -157,7 +154,7 @@ public class PolishExpr { preType = Type.SEPAERATOR; } else { - throw new IllegalArgumentException("illegal expression, at index " + i + " " + (char)chValue); + throw new IllegalArgumentException("illegal expression, at index " + i + " " + (char) chValue); } } @@ -173,11 +170,11 @@ public class PolishExpr { } public static boolean isLeftParenthesis(Op token) { - return token instanceof Operator && LEFTPARENTHESIS == (Operator)token; + return token instanceof Operator && LEFTPARENTHESIS == (Operator) token; } public static boolean isRightParenthesis(Op token) { - return token instanceof Operator && RIGHTPARENTHESIS == (Operator)token; + return token instanceof Operator && RIGHTPARENTHESIS == (Operator) token; } public static boolean isOperator(Op token) { diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java index 1c279200..6e7b490c 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java @@ -64,10 +64,10 @@ public class MessageClientIDSetter { public static Date getNearlyTimeFromID(String msgID) { ByteBuffer buf = ByteBuffer.allocate(8); byte[] bytes = UtilAll.string2bytes(msgID); - buf.put((byte)0); - buf.put((byte)0); - buf.put((byte)0); - buf.put((byte)0); + buf.put((byte) 0); + buf.put((byte) 0); + buf.put((byte) 0); + buf.put((byte) 0); buf.put(bytes, 10, 4); buf.position(0); long spanMS = buf.getLong(); @@ -113,8 +113,8 @@ public class MessageClientIDSetter { setStartTime(current); } buffer.position(0); - buffer.putInt((int)(System.currentTimeMillis() - startTime)); - buffer.putShort((short)COUNTER.getAndIncrement()); + buffer.putInt((int) (System.currentTimeMillis() - startTime)); + buffer.putShort((short) COUNTER.getAndIncrement()); return buffer.array(); } diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java index 6ae1d2a7..22600781 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java @@ -54,7 +54,7 @@ public class MessageDecoder { public static String createMessageId(SocketAddress socketAddress, long transactionIdhashCode) { ByteBuffer byteBuffer = ByteBuffer.allocate(MessageDecoder.MSG_ID_LENGTH); - InetSocketAddress inetSocketAddress = (InetSocketAddress)socketAddress; + InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress; byteBuffer.put(inetSocketAddress.getAddress().getAddress()); byteBuffer.putInt(inetSocketAddress.getPort()); byteBuffer.putLong(transactionIdhashCode); @@ -95,10 +95,10 @@ public class MessageDecoder { public static byte[] encode(MessageExt messageExt, boolean needCompress) throws Exception { byte[] body = messageExt.getBody(); byte[] topics = messageExt.getTopic().getBytes(CHARSET_UTF8); - byte topicLen = (byte)topics.length; + byte topicLen = (byte) topics.length; String properties = messageProperties2String(messageExt.getProperties()); byte[] propertiesBytes = properties.getBytes(CHARSET_UTF8); - short propertiesLength = (short)propertiesBytes.length; + short propertiesLength = (short) propertiesBytes.length; int sysFlag = messageExt.getSysFlag(); byte[] newBody = messageExt.getBody(); if (needCompress && (sysFlag & MessageSysFlag.COMPRESSED_FLAG) == MessageSysFlag.COMPRESSED_FLAG) { @@ -164,7 +164,7 @@ public class MessageDecoder { byteBuffer.putLong(bornTimeStamp); // 10 BORNHOST - InetSocketAddress bornHost = (InetSocketAddress)messageExt.getBornHost(); + InetSocketAddress bornHost = (InetSocketAddress) messageExt.getBornHost(); byteBuffer.put(bornHost.getAddress().getAddress()); byteBuffer.putInt(bornHost.getPort()); @@ -173,7 +173,7 @@ public class MessageDecoder { byteBuffer.putLong(storeTimestamp); // 12 STOREHOST - InetSocketAddress serverHost = (InetSocketAddress)messageExt.getStoreHost(); + InetSocketAddress serverHost = (InetSocketAddress) messageExt.getStoreHost(); byteBuffer.put(serverHost.getAddress().getAddress()); byteBuffer.putInt(serverHost.getPort()); @@ -295,7 +295,7 @@ public class MessageDecoder { // 16 TOPIC byte topicLen = byteBuffer.get(); - byte[] topic = new byte[(int)topicLen]; + byte[] topic = new byte[(int) topicLen]; byteBuffer.get(topic); msgExt.setTopic(new String(topic, CHARSET_UTF8)); @@ -314,7 +314,7 @@ public class MessageDecoder { msgExt.setMsgId(msgId); if (isClient) { - ((MessageClientExt)msgExt).setOffsetMsgId(msgId); + ((MessageClientExt) msgExt).setOffsetMsgId(msgId); } return msgExt; diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageExt.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageExt.java index 9fec0ca2..8a4ea897 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageExt.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageExt.java @@ -65,7 +65,7 @@ public class MessageExt extends Message { } private static ByteBuffer socketAddress2ByteBuffer(final SocketAddress socketAddress, final ByteBuffer byteBuffer) { - InetSocketAddress inetSocketAddress = (InetSocketAddress)socketAddress; + InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress; byteBuffer.put(inetSocketAddress.getAddress().getAddress(), 0, 4); byteBuffer.putInt(inetSocketAddress.getPort()); byteBuffer.flip(); @@ -119,7 +119,7 @@ public class MessageExt extends Message { public String getBornHostString() { if (this.bornHost != null) { - InetSocketAddress inetSocketAddress = (InetSocketAddress)this.bornHost; + InetSocketAddress inetSocketAddress = (InetSocketAddress) this.bornHost; return inetSocketAddress.getAddress().getHostAddress(); } @@ -128,7 +128,7 @@ public class MessageExt extends Message { public String getBornHostNameString() { if (this.bornHost != null) { - InetSocketAddress inetSocketAddress = (InetSocketAddress)this.bornHost; + InetSocketAddress inetSocketAddress = (InetSocketAddress) this.bornHost; return inetSocketAddress.getAddress().getHostName(); } 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 fa2745d4..fc162fa4 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 @@ -76,7 +76,7 @@ public class MessageQueue implements Comparable, 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; 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 f5c43c9e..1e36dd14 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 @@ -75,7 +75,7 @@ public class MessageQueueForC implements Comparable, 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; 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 d58ccf25..d024e802 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 @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: NamesrvConfig.java 1839 2013-05-16 02:12:02Z vintagewang@apache.org $ + * + * $Id: NamesrvConfig.java 1839 2013-05-16 02:12:02Z vintagewang@apache.org $ */ /** 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 4f0dfce6..e2a7282b 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 @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: TopAddressing.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: TopAddressing.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** 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 9836b8d3..aea95f19 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 @@ -53,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; } @@ -109,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; } diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateRequestHeader.java index eb08c19d..2eed1f2e 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: EndTransactionRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: EndTransactionRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateResponseHeader.java index 7ad665f2..fed5ced2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CheckTransactionStateResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: EndTransactionResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: EndTransactionResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CloneGroupOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CloneGroupOffsetRequestHeader.java index 46c183ec..88fea2df 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CloneGroupOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CloneGroupOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: DeleteTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: DeleteTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CreateTopicRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CreateTopicRequestHeader.java index 609d46db..6f98f226 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/CreateTopicRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/CreateTopicRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: CreateTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: CreateTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/DeleteTopicRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/DeleteTopicRequestHeader.java index 73d65562..412279c2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/DeleteTopicRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/DeleteTopicRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: DeleteTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: DeleteTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionRequestHeader.java index e21016a7..c5d0ac5f 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: EndTransactionRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: EndTransactionRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionResponseHeader.java index 377a73cf..1dd9ac7b 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/EndTransactionResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: EndTransactionResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: EndTransactionResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetAllTopicConfigResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetAllTopicConfigResponseHeader.java index c8de6417..fac18545 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetAllTopicConfigResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetAllTopicConfigResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetAllTopicConfigResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetAllTopicConfigResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetBrokerConfigResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetBrokerConfigResponseHeader.java index a6b6bc0b..88e8921c 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetBrokerConfigResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetBrokerConfigResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetBrokerConfigResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetBrokerConfigResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeRequestHeader.java index a99bbc61..5f5dbe00 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetEarliestMsgStoretimeRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetEarliestMsgStoretimeRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeResponseHeader.java index d074a91b..f8c4af4f 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetEarliestMsgStoretimeResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetEarliestMsgStoretimeResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetEarliestMsgStoretimeResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetRequestHeader.java index 714d1b56..3b8f99c4 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetMaxOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetMaxOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetResponseHeader.java index e89ef213..e5ffd8d3 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMaxOffsetResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetMaxOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetMaxOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetRequestHeader.java index eef99e27..50e4e152 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetMinOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetMinOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetResponseHeader.java index 67b7a018..a9392f4b 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/GetMinOffsetResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetMinOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetMinOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageRequestHeader.java index b0e65adf..109b97b6 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: PullMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: PullMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageResponseHeader.java index 6907068f..0871b8c8 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/PullMessageResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: PullMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: PullMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetRequestHeader.java index 9cbfaa2f..3b90af29 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueryConsumerOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueryConsumerOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetResponseHeader.java index 51b50ea0..f010624b 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryConsumerOffsetResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueryConsumerOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueryConsumerOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryCorrectionOffsetHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryCorrectionOffsetHeader.java index 04926fad..db5b3065 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryCorrectionOffsetHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryCorrectionOffsetHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetMinOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetMinOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageRequestHeader.java index 5aed5f3d..ffc83e65 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueryMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueryMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageResponseHeader.java index 14d4d54f..a34522e0 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryMessageResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueryMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueryMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryTopicConsumeByWhoRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryTopicConsumeByWhoRequestHeader.java index a58de58d..bd8061d9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryTopicConsumeByWhoRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/QueryTopicConsumeByWhoRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueryMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueryMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetRequestHeader.java index e686f902..93e30513 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SearchOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: SearchOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetResponseHeader.java index bbac8442..72e0efa9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SearchOffsetResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SearchOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: SearchOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageRequestHeader.java index 937a86e9..592651b6 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SendMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: SendMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java index b6a8fa59..510c5fc1 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SendMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: SendMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetRequestHeader.java index 5822d8e9..270c293a 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: UpdateConsumerOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: UpdateConsumerOffsetRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetResponseHeader.java index c8b60838..cd250802 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/UpdateConsumerOffsetResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: UpdateConsumerOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: UpdateConsumerOffsetResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageRequestHeader.java index f1c76227..5d3cdea7 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ViewMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: ViewMessageRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageResponseHeader.java index b2d97d42..a03d6403 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/ViewMessageResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ViewMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: ViewMessageResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoRequestHeader.java index 62abaecf..21cefba7 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetRouteInfoRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetRouteInfoRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoResponseHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoResponseHeader.java index a122ceab..131b6641 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoResponseHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/GetRouteInfoResponseHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: GetRouteInfoResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: GetRouteInfoResponseHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterBrokerRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterBrokerRequestHeader.java index dbfecb1d..1e421ea4 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterBrokerRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterBrokerRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: RegisterBrokerRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: RegisterBrokerRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterOrderTopicRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterOrderTopicRequestHeader.java index 0e04c790..a0bad3e7 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterOrderTopicRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/RegisterOrderTopicRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: RegisterOrderTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: RegisterOrderTopicRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/UnRegisterBrokerRequestHeader.java b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/UnRegisterBrokerRequestHeader.java index 9f6fd27c..070874f9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/UnRegisterBrokerRequestHeader.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/header/namesrv/UnRegisterBrokerRequestHeader.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: UnRegisterBrokerRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: UnRegisterBrokerRequestHeader.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumeType.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumeType.java index 49fe045e..248b7156 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumeType.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumeType.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ConsumeType.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: ConsumeType.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumerData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumerData.java index c2a0107e..75e2f9e6 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumerData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ConsumerData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ConsumerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: ConsumerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/HeartbeatData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/HeartbeatData.java index 52571743..35202b91 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/HeartbeatData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/HeartbeatData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: HeartbeatData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: HeartbeatData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/MessageModel.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/MessageModel.java index d710502d..bf27e93e 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/MessageModel.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/MessageModel.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: MessageModel.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: MessageModel.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ProducerData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ProducerData.java index b7d4c95a..f30e154e 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ProducerData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/ProducerData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ProducerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: ProducerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/SubscriptionData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/SubscriptionData.java index 8c4292af..a03bdc4f 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/SubscriptionData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/heartbeat/SubscriptionData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: SubscriptionData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: SubscriptionData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** @@ -124,7 +126,7 @@ public class SubscriptionData implements Comparable { return false; if (getClass() != obj.getClass()) return false; - SubscriptionData other = (SubscriptionData)obj; + SubscriptionData other = (SubscriptionData) obj; if (classFilterMode != other.classFilterMode) return false; if (codeSet == null) { diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/route/BrokerData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/route/BrokerData.java index f79bdb56..1382b243 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/route/BrokerData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/route/BrokerData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: BrokerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: BrokerData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** @@ -78,7 +80,7 @@ public class BrokerData implements Comparable { return false; if (getClass() != obj.getClass()) return false; - BrokerData other = (BrokerData)obj; + BrokerData other = (BrokerData) obj; if (brokerAddrs == null) { if (other.brokerAddrs != null) return false; diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java index 3fe3e2c0..94328ae1 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: QueueData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: QueueData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** @@ -81,7 +83,7 @@ public class QueueData implements Comparable { return false; if (getClass() != obj.getClass()) return false; - QueueData other = (QueueData)obj; + QueueData other = (QueueData) obj; if (brokerName == null) { if (other.brokerName != null) return false; diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/route/TopicRouteData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/route/TopicRouteData.java index 64d97264..b4fd25ab 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/route/TopicRouteData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/route/TopicRouteData.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: TopicRouteData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ + * + * $Id: TopicRouteData.java 1835 2013-05-16 02:00:50Z vintagewang@apache.org $ */ /** @@ -106,7 +108,7 @@ public class TopicRouteData extends RemotingSerializable { return false; if (getClass() != obj.getClass()) return false; - TopicRouteData other = (TopicRouteData)obj; + TopicRouteData other = (TopicRouteData) obj; if (brokerDatas == null) { if (other.brokerDatas != null) return false; diff --git a/common/src/main/java/org/apache/rocketmq/common/queue/ConcurrentTreeMap.java b/common/src/main/java/org/apache/rocketmq/common/queue/ConcurrentTreeMap.java index 021ba834..106384cf 100644 --- a/common/src/main/java/org/apache/rocketmq/common/queue/ConcurrentTreeMap.java +++ b/common/src/main/java/org/apache/rocketmq/common/queue/ConcurrentTreeMap.java @@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory; /** * thread safe - * */ public class ConcurrentTreeMap { private static final Logger log = LoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME); diff --git a/common/src/main/java/org/apache/rocketmq/common/queue/RoundQueue.java b/common/src/main/java/org/apache/rocketmq/common/queue/RoundQueue.java index e9f2177b..7d6d47fe 100644 --- a/common/src/main/java/org/apache/rocketmq/common/queue/RoundQueue.java +++ b/common/src/main/java/org/apache/rocketmq/common/queue/RoundQueue.java @@ -22,7 +22,6 @@ import java.util.Queue; /** * not thread safe - * */ public class RoundQueue { diff --git a/common/src/main/java/org/apache/rocketmq/common/subscription/SubscriptionGroupConfig.java b/common/src/main/java/org/apache/rocketmq/common/subscription/SubscriptionGroupConfig.java index 9bf97fbf..315c18d2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/subscription/SubscriptionGroupConfig.java +++ b/common/src/main/java/org/apache/rocketmq/common/subscription/SubscriptionGroupConfig.java @@ -114,7 +114,7 @@ public class SubscriptionGroupConfig { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (int)(brokerId ^ (brokerId >>> 32)); + result = prime * result + (int) (brokerId ^ (brokerId >>> 32)); result = prime * result + (consumeBroadcastEnable ? 1231 : 1237); result = prime * result + (consumeEnable ? 1231 : 1237); result = prime * result + (consumeFromMinEnable ? 1231 : 1237); @@ -123,7 +123,7 @@ public class SubscriptionGroupConfig { result = prime * result + retryMaxTimes; result = prime * result + retryQueueNums; result = - prime * result + (int)(whichBrokerWhenConsumeSlowly ^ (whichBrokerWhenConsumeSlowly >>> 32)); + prime * result + (int) (whichBrokerWhenConsumeSlowly ^ (whichBrokerWhenConsumeSlowly >>> 32)); return result; } @@ -135,7 +135,7 @@ public class SubscriptionGroupConfig { return false; if (getClass() != obj.getClass()) return false; - SubscriptionGroupConfig other = (SubscriptionGroupConfig)obj; + SubscriptionGroupConfig other = (SubscriptionGroupConfig) obj; if (brokerId != other.brokerId) return false; if (consumeBroadcastEnable != other.consumeBroadcastEnable) diff --git a/common/src/main/java/org/apache/rocketmq/common/utils/ChannelUtil.java b/common/src/main/java/org/apache/rocketmq/common/utils/ChannelUtil.java index dcb9187c..52c3e488 100644 --- a/common/src/main/java/org/apache/rocketmq/common/utils/ChannelUtil.java +++ b/common/src/main/java/org/apache/rocketmq/common/utils/ChannelUtil.java @@ -23,7 +23,7 @@ import java.net.InetSocketAddress; public class ChannelUtil { public static String getRemoteIp(Channel channel) { - InetSocketAddress inetSocketAddress = (InetSocketAddress)channel.remoteAddress(); + InetSocketAddress inetSocketAddress = (InetSocketAddress) channel.remoteAddress(); if (inetSocketAddress == null) { return ""; } diff --git a/common/src/main/java/org/apache/rocketmq/common/utils/HttpTinyClient.java b/common/src/main/java/org/apache/rocketmq/common/utils/HttpTinyClient.java index 0cc34635..7cc94461 100755 --- a/common/src/main/java/org/apache/rocketmq/common/utils/HttpTinyClient.java +++ b/common/src/main/java/org/apache/rocketmq/common/utils/HttpTinyClient.java @@ -36,10 +36,10 @@ public class HttpTinyClient { HttpURLConnection conn = null; try { - conn = (HttpURLConnection)new URL(url).openConnection(); + conn = (HttpURLConnection) new URL(url).openConnection(); conn.setRequestMethod("GET"); - conn.setConnectTimeout((int)readTimeoutMs); - conn.setReadTimeout((int)readTimeoutMs); + conn.setConnectTimeout((int) readTimeoutMs); + conn.setReadTimeout((int) readTimeoutMs); setHeaders(conn, headers, encoding); conn.connect(); @@ -90,20 +90,12 @@ public class HttpTinyClient { } /** - - * * @param url * @param headers - * @param paramValues - * @param encoding - * @param readTimeoutMs - - * * @return the http response of given http post request - * * @throws java.io.IOException */ static public HttpResult httpPost(String url, List headers, List paramValues, @@ -112,10 +104,10 @@ public class HttpTinyClient { HttpURLConnection conn = null; try { - conn = (HttpURLConnection)new URL(url).openConnection(); + conn = (HttpURLConnection) new URL(url).openConnection(); conn.setRequestMethod("POST"); conn.setConnectTimeout(3000); - conn.setReadTimeout((int)readTimeoutMs); + conn.setReadTimeout((int) readTimeoutMs); conn.setDoOutput(true); conn.setDoInput(true); setHeaders(conn, headers, encoding); diff --git a/common/src/main/java/org/apache/rocketmq/common/utils/IOTinyUtils.java b/common/src/main/java/org/apache/rocketmq/common/utils/IOTinyUtils.java index b569c24b..e2e7cba7 100644 --- a/common/src/main/java/org/apache/rocketmq/common/utils/IOTinyUtils.java +++ b/common/src/main/java/org/apache/rocketmq/common/utils/IOTinyUtils.java @@ -56,14 +56,11 @@ public class IOTinyUtils { return count; } - /** - - */ static public List readLines(Reader input) throws IOException { BufferedReader reader = toBufferedReader(input); List list = new ArrayList(); - String line = null; - for (; ; ) { + String line; + for (;;) { line = reader.readLine(); if (null != line) { list.add(line); @@ -75,7 +72,7 @@ public class IOTinyUtils { } static private BufferedReader toBufferedReader(Reader reader) { - return reader instanceof BufferedReader ? (BufferedReader)reader : new BufferedReader(reader); + return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); } static public void copyFile(String source, String target) throws IOException { diff --git a/example/src/main/java/org/apache/rocketmq/example/benchmark/Consumer.java b/example/src/main/java/org/apache/rocketmq/example/benchmark/Consumer.java index f810f5a8..a3e06aa6 100644 --- a/example/src/main/java/org/apache/rocketmq/example/benchmark/Consumer.java +++ b/example/src/main/java/org/apache/rocketmq/example/benchmark/Consumer.java @@ -76,9 +76,9 @@ public class Consumer { Long[] end = snapshotList.getLast(); final long consumeTps = - (long)(((end[1] - begin[1]) / (double)(end[0] - begin[0])) * 1000L); - final double averageB2CRT = (end[2] - begin[2]) / (double)(end[1] - begin[1]); - final double averageS2CRT = (end[3] - begin[3]) / (double)(end[1] - begin[1]); + (long) (((end[1] - begin[1]) / (double) (end[0] - begin[0])) * 1000L); + final double averageB2CRT = (end[2] - begin[2]) / (double) (end[1] - begin[1]); + final double averageS2CRT = (end[3] - begin[3]) / (double) (end[1] - begin[1]); System.out.printf("Consume TPS: %d Average(B2C) RT: %7.3f Average(S2C) RT: %7.3f MAX(B2C) RT: %d MAX(S2C) RT: %d%n", consumeTps, averageB2CRT, averageS2CRT, end[4], end[5] diff --git a/example/src/main/java/org/apache/rocketmq/example/benchmark/Producer.java b/example/src/main/java/org/apache/rocketmq/example/benchmark/Producer.java index 88e9a4fa..8a1dd314 100644 --- a/example/src/main/java/org/apache/rocketmq/example/benchmark/Producer.java +++ b/example/src/main/java/org/apache/rocketmq/example/benchmark/Producer.java @@ -81,8 +81,8 @@ public class Producer { Long[] begin = snapshotList.getFirst(); Long[] end = snapshotList.getLast(); - final long sendTps = (long)(((end[3] - begin[3]) / (double)(end[0] - begin[0])) * 1000L); - final double averageRT = (end[5] - begin[5]) / (double)(end[3] - begin[3]); + final long sendTps = (long) (((end[3] - begin[3]) / (double) (end[0] - begin[0])) * 1000L); + final double averageRT = (end[5] - begin[5]) / (double) (end[3] - begin[3]); System.out.printf("Send TPS: %d Max RT: %d Average RT: %7.3f Send Failed: %d Response Failed: %d%n", sendTps, statsBenchmark.getSendMessageMaxRT().get(), averageRT, end[2], end[4]); diff --git a/example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java b/example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java index ce4b1ab7..2a62b10f 100644 --- a/example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java +++ b/example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java @@ -73,8 +73,8 @@ public class TransactionProducer { Long[] end = snapshotList.getLast(); final long sendTps = - (long)(((end[3] - begin[3]) / (double)(end[0] - begin[0])) * 1000L); - final double averageRT = (end[5] - begin[5]) / (double)(end[3] - begin[3]); + (long) (((end[3] - begin[3]) / (double) (end[0] - begin[0])) * 1000L); + final double averageRT = (end[5] - begin[5]) / (double) (end[3] - begin[3]); System.out.printf( "Send TPS: %d Max RT: %d Average RT: %7.3f Send Failed: %d Response Failed: %d transaction checkCount: %d %n", diff --git a/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java b/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java index 7abbb5ae..96807802 100644 --- a/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java +++ b/example/src/main/java/org/apache/rocketmq/example/ordermessage/Producer.java @@ -44,7 +44,7 @@ public class Producer { SendResult sendResult = producer.send(msg, new MessageQueueSelector() { @Override public MessageQueue select(List mqs, Message msg, Object arg) { - Integer id = (Integer)arg; + Integer id = (Integer) arg; int index = id % mqs.size(); return mqs.get(index); } diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FilterServerOuterAPI.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FilterServerOuterAPI.java index 32b8bad4..c01aadc2 100644 --- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FilterServerOuterAPI.java +++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FilterServerOuterAPI.java @@ -60,7 +60,7 @@ public class FilterServerOuterAPI { switch (response.getCode()) { case ResponseCode.SUCCESS: { RegisterFilterServerResponseHeader responseHeader = - (RegisterFilterServerResponseHeader)response + (RegisterFilterServerResponseHeader) response .decodeCommandCustomHeader(RegisterFilterServerResponseHeader.class); return responseHeader; diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java index f239caf1..7df4748e 100644 --- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java +++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/FiltersrvStartup.java @@ -120,7 +120,7 @@ public class FiltersrvStartup { System.exit(-2); } - LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(lc); lc.reset(); diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java index 11102d08..e3b34410 100644 --- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java +++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/DynaCode.java @@ -95,7 +95,7 @@ public class DynaCode { StringBuffer buf = new StringBuffer(); while (cl != null) { if (cl instanceof URLClassLoader) { - URL urls[] = ((URLClassLoader)cl).getURLs(); + URL urls[] = ((URLClassLoader) cl).getURLs(); for (int i = 0; i < urls.length; i++) { if (buf.length() > 0) { buf.append(File.pathSeparatorChar); diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/FilterClassManager.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/FilterClassManager.java index 66389e0f..e4e6deb5 100644 --- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/FilterClassManager.java +++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/filter/FilterClassManager.java @@ -84,7 +84,7 @@ public class FilterClassManager { Class newClass = DynaCode.compileAndLoadClass(filterClassInfo.getClassName(), javaSource); Object newInstance = newClass.newInstance(); - filterClassInfo.setMessageFilter((MessageFilter)newInstance); + filterClassInfo.setMessageFilter((MessageFilter) newInstance); filterClassInfo.setClassCRC(classCRC); log.info("fetch Remote class File OK, {} {}", next.getKey(), @@ -134,7 +134,7 @@ public class FilterClassManager { String javaSource = new String(filterSourceBinary, MixAll.DEFAULT_CHARSET); Class newClass = DynaCode.compileAndLoadClass(className, javaSource); Object newInstance = newClass.newInstance(); - filterClassInfoNew.setMessageFilter((MessageFilter)newInstance); + filterClassInfoNew.setMessageFilter((MessageFilter) newInstance); filterClassInfoNew.setClassCRC(classCRC); } diff --git a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/processor/DefaultRequestProcessor.java b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/processor/DefaultRequestProcessor.java index 1d56ac17..2740b21c 100644 --- a/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/processor/DefaultRequestProcessor.java +++ b/filtersrv/src/main/java/org/apache/rocketmq/filtersrv/processor/DefaultRequestProcessor.java @@ -85,7 +85,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand registerMessageFilterClass(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final RegisterMessageFilterClassRequestHeader requestHeader = - (RegisterMessageFilterClassRequestHeader)request.decodeCommandCustomHeader(RegisterMessageFilterClassRequestHeader.class); + (RegisterMessageFilterClassRequestHeader) request.decodeCommandCustomHeader(RegisterMessageFilterClassRequestHeader.class); try { boolean ok = this.filtersrvController.getFilterClassManager().registerFilterClass(requestHeader.getConsumerGroup(), @@ -109,9 +109,9 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand pullMessageForward(final ChannelHandlerContext ctx, final RemotingCommand request) throws Exception { final RemotingCommand response = RemotingCommand.createResponseCommand(PullMessageResponseHeader.class); - final PullMessageResponseHeader responseHeader = (PullMessageResponseHeader)response.readCustomHeader(); + final PullMessageResponseHeader responseHeader = (PullMessageResponseHeader) response.readCustomHeader(); final PullMessageRequestHeader requestHeader = - (PullMessageRequestHeader)request.decodeCommandCustomHeader(PullMessageRequestHeader.class); + (PullMessageRequestHeader) request.decodeCommandCustomHeader(PullMessageRequestHeader.class); final FilterContext filterContext = new FilterContext(); filterContext.setConsumerGroup(requestHeader.getConsumerGroup()); @@ -331,10 +331,10 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { if (bodyLength > 0) msgStoreItemMemory.put(msgInner.getBody()); // 16 TOPIC - msgStoreItemMemory.put((byte)topicLength); + msgStoreItemMemory.put((byte) topicLength); msgStoreItemMemory.put(topicData); // 17 PROPERTIES - msgStoreItemMemory.putShort((short)propertiesLength); + msgStoreItemMemory.putShort((short) propertiesLength); if (propertiesLength > 0) msgStoreItemMemory.put(propertiesData); diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java index 0eb9a52e..eb1afc85 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java @@ -102,7 +102,7 @@ public class NamesrvStartup { System.exit(-2); } - LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(lc); lc.reset(); diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/ClusterTestRequestProcessor.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/ClusterTestRequestProcessor.java index 95410fa1..d66b3e86 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/ClusterTestRequestProcessor.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/ClusterTestRequestProcessor.java @@ -53,7 +53,7 @@ public class ClusterTestRequestProcessor extends DefaultRequestProcessor { public RemotingCommand getRouteInfoByTopic(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetRouteInfoRequestHeader requestHeader = - (GetRouteInfoRequestHeader)request.decodeCommandCustomHeader(GetRouteInfoRequestHeader.class); + (GetRouteInfoRequestHeader) request.decodeCommandCustomHeader(GetRouteInfoRequestHeader.class); TopicRouteData topicRouteData = this.namesrvController.getRouteInfoManager().pickupTopicRouteData(requestHeader.getTopic()); if (topicRouteData != null) { diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java index 0135274b..213b096d 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/processor/DefaultRequestProcessor.java @@ -127,7 +127,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand putKVConfig(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final PutKVConfigRequestHeader requestHeader = - (PutKVConfigRequestHeader)request.decodeCommandCustomHeader(PutKVConfigRequestHeader.class); + (PutKVConfigRequestHeader) request.decodeCommandCustomHeader(PutKVConfigRequestHeader.class); this.namesrvController.getKvConfigManager().putKVConfig( requestHeader.getNamespace(), @@ -142,9 +142,9 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand getKVConfig(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(GetKVConfigResponseHeader.class); - final GetKVConfigResponseHeader responseHeader = (GetKVConfigResponseHeader)response.readCustomHeader(); + final GetKVConfigResponseHeader responseHeader = (GetKVConfigResponseHeader) response.readCustomHeader(); final GetKVConfigRequestHeader requestHeader = - (GetKVConfigRequestHeader)request.decodeCommandCustomHeader(GetKVConfigRequestHeader.class); + (GetKVConfigRequestHeader) request.decodeCommandCustomHeader(GetKVConfigRequestHeader.class); String value = this.namesrvController.getKvConfigManager().getKVConfig( requestHeader.getNamespace(), @@ -166,7 +166,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand deleteKVConfig(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final DeleteKVConfigRequestHeader requestHeader = - (DeleteKVConfigRequestHeader)request.decodeCommandCustomHeader(DeleteKVConfigRequestHeader.class); + (DeleteKVConfigRequestHeader) request.decodeCommandCustomHeader(DeleteKVConfigRequestHeader.class); this.namesrvController.getKvConfigManager().deleteKVConfig( requestHeader.getNamespace(), @@ -181,9 +181,9 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand registerBrokerWithFilterServer(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(RegisterBrokerResponseHeader.class); - final RegisterBrokerResponseHeader responseHeader = (RegisterBrokerResponseHeader)response.readCustomHeader(); + final RegisterBrokerResponseHeader responseHeader = (RegisterBrokerResponseHeader) response.readCustomHeader(); final RegisterBrokerRequestHeader requestHeader = - (RegisterBrokerRequestHeader)request.decodeCommandCustomHeader(RegisterBrokerRequestHeader.class); + (RegisterBrokerRequestHeader) request.decodeCommandCustomHeader(RegisterBrokerRequestHeader.class); RegisterBrokerBody registerBrokerBody = new RegisterBrokerBody(); @@ -217,9 +217,9 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand registerBroker(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(RegisterBrokerResponseHeader.class); - final RegisterBrokerResponseHeader responseHeader = (RegisterBrokerResponseHeader)response.readCustomHeader(); + final RegisterBrokerResponseHeader responseHeader = (RegisterBrokerResponseHeader) response.readCustomHeader(); final RegisterBrokerRequestHeader requestHeader = - (RegisterBrokerRequestHeader)request.decodeCommandCustomHeader(RegisterBrokerRequestHeader.class); + (RegisterBrokerRequestHeader) request.decodeCommandCustomHeader(RegisterBrokerRequestHeader.class); TopicConfigSerializeWrapper topicConfigWrapper; if (request.getBody() != null) { @@ -254,7 +254,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand unregisterBroker(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final UnRegisterBrokerRequestHeader requestHeader = - (UnRegisterBrokerRequestHeader)request.decodeCommandCustomHeader(UnRegisterBrokerRequestHeader.class); + (UnRegisterBrokerRequestHeader) request.decodeCommandCustomHeader(UnRegisterBrokerRequestHeader.class); this.namesrvController.getRouteInfoManager().unregisterBroker( requestHeader.getClusterName(), @@ -270,7 +270,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { public RemotingCommand getRouteInfoByTopic(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetRouteInfoRequestHeader requestHeader = - (GetRouteInfoRequestHeader)request.decodeCommandCustomHeader(GetRouteInfoRequestHeader.class); + (GetRouteInfoRequestHeader) request.decodeCommandCustomHeader(GetRouteInfoRequestHeader.class); TopicRouteData topicRouteData = this.namesrvController.getRouteInfoManager().pickupTopicRouteData(requestHeader.getTopic()); @@ -308,9 +308,9 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand wipeWritePermOfBroker(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(WipeWritePermOfBrokerResponseHeader.class); - final WipeWritePermOfBrokerResponseHeader responseHeader = (WipeWritePermOfBrokerResponseHeader)response.readCustomHeader(); + final WipeWritePermOfBrokerResponseHeader responseHeader = (WipeWritePermOfBrokerResponseHeader) response.readCustomHeader(); final WipeWritePermOfBrokerRequestHeader requestHeader = - (WipeWritePermOfBrokerRequestHeader)request.decodeCommandCustomHeader(WipeWritePermOfBrokerRequestHeader.class); + (WipeWritePermOfBrokerRequestHeader) request.decodeCommandCustomHeader(WipeWritePermOfBrokerRequestHeader.class); int wipeTopicCnt = this.namesrvController.getRouteInfoManager().wipeWritePermOfBrokerByLock(requestHeader.getBrokerName()); @@ -339,7 +339,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand deleteTopicInNamesrv(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final DeleteTopicInNamesrvRequestHeader requestHeader = - (DeleteTopicInNamesrvRequestHeader)request.decodeCommandCustomHeader(DeleteTopicInNamesrvRequestHeader.class); + (DeleteTopicInNamesrvRequestHeader) request.decodeCommandCustomHeader(DeleteTopicInNamesrvRequestHeader.class); this.namesrvController.getRouteInfoManager().deleteTopic(requestHeader.getTopic()); @@ -351,7 +351,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand getKVListByNamespace(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetKVListByNamespaceRequestHeader requestHeader = - (GetKVListByNamespaceRequestHeader)request.decodeCommandCustomHeader(GetKVListByNamespaceRequestHeader.class); + (GetKVListByNamespaceRequestHeader) request.decodeCommandCustomHeader(GetKVListByNamespaceRequestHeader.class); byte[] jsonValue = this.namesrvController.getKvConfigManager().getKVListByNamespace( requestHeader.getNamespace()); @@ -370,7 +370,7 @@ public class DefaultRequestProcessor implements NettyRequestProcessor { private RemotingCommand getTopicsByCluster(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetTopicsByClusterRequestHeader requestHeader = - (GetTopicsByClusterRequestHeader)request.decodeCommandCustomHeader(GetTopicsByClusterRequestHeader.class); + (GetTopicsByClusterRequestHeader) request.decodeCommandCustomHeader(GetTopicsByClusterRequestHeader.class); byte[] body = this.namesrvController.getRouteInfoManager().getTopicsByCluster(requestHeader.getCluster()); diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java index e440e615..95dca3a1 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java @@ -385,7 +385,7 @@ public class RouteInfoManager { if (null != brokerData) { BrokerData brokerDataClone = new BrokerData(); brokerDataClone.setBrokerName(brokerData.getBrokerName()); - brokerDataClone.setBrokerAddrs((HashMap)brokerData + brokerDataClone.setBrokerAddrs((HashMap) brokerData .getBrokerAddrs().clone()); brokerDataList.add(brokerDataClone); foundBrokerData = true; diff --git a/pom.xml b/pom.xml index f74b5e24..76acc200 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ limitations under the License. --> - @@ -309,7 +309,7 @@ verify verify - checkstyle/checkstyle.xml + style/rmq_checkstyle.xml UTF-8 true true diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingHelper.java b/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingHelper.java index 8d189e72..4fb4ed65 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingHelper.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingHelper.java @@ -67,7 +67,7 @@ public class RemotingHelper { socketChannel.configureBlocking(true); //bugfix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4614802 - socketChannel.socket().setSoTimeout((int)timeoutMillis); + socketChannel.socket().setSoTimeout((int) timeoutMillis); ByteBuffer byteBufferRequest = request.encode(); while (byteBufferRequest.hasRemaining()) { @@ -168,7 +168,7 @@ public class RemotingHelper { if (null == channel) { return ""; } - final InetSocketAddress remote = (InetSocketAddress)channel.remoteAddress(); + final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress(); if (remote != null) { return remote.getAddress().getHostName(); } @@ -188,7 +188,7 @@ public class RemotingHelper { public static String parseSocketAddressName(SocketAddress socketAddress) { - final InetSocketAddress addrs = (InetSocketAddress)socketAddress; + final InetSocketAddress addrs = (InetSocketAddress) socketAddress; if (addrs != null) { return addrs.getAddress().getHostName(); } diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingUtil.java b/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingUtil.java index bcc22327..5589c04f 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingUtil.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingUtil.java @@ -67,7 +67,7 @@ public class RemotingUtil { try { final Method method = providerClazz.getMethod("provider"); if (method != null) { - final SelectorProvider selectorProvider = (SelectorProvider)method.invoke(null); + final SelectorProvider selectorProvider = (SelectorProvider) method.invoke(null); if (selectorProvider != null) { result = selectorProvider.openSelector(); } @@ -155,7 +155,7 @@ public class RemotingUtil { public static String socketAddress2String(final SocketAddress addr) { StringBuilder sb = new StringBuilder(); - InetSocketAddress inetSocketAddress = (InetSocketAddress)addr; + InetSocketAddress inetSocketAddress = (InetSocketAddress) addr; sb.append(inetSocketAddress.getAddress().getHostAddress()); sb.append(":"); sb.append(inetSocketAddress.getPort()); diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java b/remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java index 9cccaaf8..62b26ba3 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java @@ -21,8 +21,6 @@ import org.slf4j.LoggerFactory; /** * Base class for background thread - * - * */ public abstract class ServiceThread implements Runnable { private static final Logger STLOG = LoggerFactory.getLogger(RemotingHelper.ROCKETMQ_REMOTING); diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java index 73d7f2bd..106e55cd 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java @@ -42,7 +42,7 @@ public class NettyDecoder extends LengthFieldBasedFrameDecoder { public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception { ByteBuf frame = null; try { - frame = (ByteBuf)super.decode(ctx, in); + frame = (ByteBuf) super.decode(ctx, in); if (null == frame) { return null; } diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java index db7815a8..cd8ef973 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java @@ -637,7 +637,7 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof IdleStateEvent) { - IdleStateEvent evnet = (IdleStateEvent)evt; + IdleStateEvent evnet = (IdleStateEvent) evt; if (evnet.state().equals(IdleState.ALL_IDLE)) { final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel()); log.warn("NETTY CLIENT PIPELINE: IDLE exception [{}]", remoteAddress); diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java index f109086e..58ba6171 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java @@ -171,7 +171,7 @@ public class NettyRemotingServer extends NettyRemotingAbstract implements Remoti try { ChannelFuture sync = this.serverBootstrap.bind().sync(); - InetSocketAddress addr = (InetSocketAddress)sync.channel().localAddress(); + InetSocketAddress addr = (InetSocketAddress) sync.channel().localAddress(); this.port = addr.getPort(); } catch (InterruptedException e1) { throw new RuntimeException("this.serverBootstrap.bind().sync() InterruptedException", e1); @@ -337,7 +337,7 @@ public class NettyRemotingServer extends NettyRemotingAbstract implements Remoti @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof IdleStateEvent) { - IdleStateEvent evnet = (IdleStateEvent)evt; + IdleStateEvent evnet = (IdleStateEvent) evt; if (evnet.state().equals(IdleState.ALL_IDLE)) { final String remoteAddress = RemotingHelper.parseChannelRemoteAddr(ctx.channel()); log.warn("NETTY SERVER PIPELINE: IDLE exception [{}]", remoteAddress); diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRequestProcessor.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRequestProcessor.java index c6251e92..020124b7 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRequestProcessor.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRequestProcessor.java @@ -21,8 +21,6 @@ import org.apache.rocketmq.remoting.protocol.RemotingCommand; /** * Common remoting command processor - * - * */ public interface NettyRequestProcessor { RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyServerConfig.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyServerConfig.java index f69fded6..8424da6e 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyServerConfig.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyServerConfig.java @@ -133,6 +133,6 @@ public class NettyServerConfig implements Cloneable { @Override public Object clone() throws CloneNotSupportedException { - return (NettyServerConfig)super.clone(); + return (NettyServerConfig) super.clone(); } } diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/RequestTask.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/RequestTask.java index 0443b435..d1fbbfea 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/RequestTask.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/RequestTask.java @@ -36,7 +36,7 @@ public class RequestTask implements Runnable { @Override public int hashCode() { int result = runnable != null ? runnable.hashCode() : 0; - result = 31 * result + (int)(getCreateTimestamp() ^ (getCreateTimestamp() >>> 32)); + result = 31 * result + (int) (getCreateTimestamp() ^ (getCreateTimestamp() >>> 32)); result = 31 * result + (channel != null ? channel.hashCode() : 0); result = 31 * result + (request != null ? request.hashCode() : 0); result = 31 * result + (isStopRun() ? 1 : 0); @@ -50,7 +50,7 @@ public class RequestTask implements Runnable { if (!(o instanceof RequestTask)) return false; - final RequestTask that = (RequestTask)o; + final RequestTask that = (RequestTask) o; if (getCreateTimestamp() != that.getCreateTimestamp()) return false; diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/LanguageCode.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/LanguageCode.java index bdb02c60..cc5e8ec0 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/LanguageCode.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/LanguageCode.java @@ -18,15 +18,15 @@ package org.apache.rocketmq.remoting.protocol; public enum LanguageCode { - JAVA((byte)0), - CPP((byte)1), - DOTNET((byte)2), - PYTHON((byte)3), - DELPHI((byte)4), - ERLANG((byte)5), - RUBY((byte)6), - OTHER((byte)7), - HTTP((byte)8); + JAVA((byte) 0), + CPP((byte) 1), + DOTNET((byte) 2), + PYTHON((byte) 3), + DELPHI((byte) 4), + ERLANG((byte) 5), + RUBY((byte) 6), + OTHER((byte) 7), + HTTP((byte) 8); private byte code; diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java index 6b253dc6..cffa072d 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RemotingCommand.java @@ -195,7 +195,7 @@ public class RemotingCommand { } public static SerializeType getProtocolType(int source) { - return SerializeType.valueOf((byte)((source >> 24) & 0xFF)); + return SerializeType.valueOf((byte) ((source >> 24) & 0xFF)); } public static int createNewRequestId() { @@ -223,9 +223,9 @@ public class RemotingCommand { byte[] result = new byte[4]; result[0] = type.getCode(); - result[1] = (byte)((source >> 16) & 0xFF); - result[2] = (byte)((source >> 8) & 0xFF); - result[3] = (byte)(source & 0xFF); + result[1] = (byte) ((source >> 16) & 0xFF); + result[2] = (byte) ((source >> 8) & 0xFF); + result[3] = (byte) (source & 0xFF); return result; } diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializable.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializable.java index 64b37db8..b773c1d6 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializable.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializable.java @@ -51,11 +51,11 @@ public class RocketMQSerializable { // ################### content ByteBuffer headerBuffer = ByteBuffer.allocate(totalLen); // int code(~32767) - headerBuffer.putShort((short)cmd.getCode()); + headerBuffer.putShort((short) cmd.getCode()); // LanguageCode language headerBuffer.put(cmd.getLanguage().getCode()); // int version(~32767) - headerBuffer.putShort((short)cmd.getVersion()); + headerBuffer.putShort((short) cmd.getVersion()); // int opaque headerBuffer.putInt(cmd.getOpaque()); // int flag @@ -109,7 +109,7 @@ public class RocketMQSerializable { key = entry.getKey().getBytes(RemotingSerializable.CHARSET_UTF8); val = entry.getValue().getBytes(RemotingSerializable.CHARSET_UTF8); - content.putShort((short)key.length); + content.putShort((short) key.length); content.put(key); content.putInt(val.length); diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/SerializeType.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/SerializeType.java index 6bfd42c2..4ca6357d 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/SerializeType.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/SerializeType.java @@ -18,8 +18,8 @@ package org.apache.rocketmq.remoting.protocol; public enum SerializeType { - JSON((byte)0), - ROCKETMQ((byte)1); + JSON((byte) 0), + ROCKETMQ((byte) 1); private byte code; diff --git a/remoting/src/test/java/org/apache/rocketmq/remoting/MixTest.java b/remoting/src/test/java/org/apache/rocketmq/remoting/MixTest.java index 984ecd1b..db165c24 100644 --- a/remoting/src/test/java/org/apache/rocketmq/remoting/MixTest.java +++ b/remoting/src/test/java/org/apache/rocketmq/remoting/MixTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: MixTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: MixTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/remoting/src/test/java/org/apache/rocketmq/remoting/NettyRPCTest.java b/remoting/src/test/java/org/apache/rocketmq/remoting/NettyRPCTest.java index 15a9aa31..1cfb8bca 100644 --- a/remoting/src/test/java/org/apache/rocketmq/remoting/NettyRPCTest.java +++ b/remoting/src/test/java/org/apache/rocketmq/remoting/NettyRPCTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: NettyRPCTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: NettyRPCTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** @@ -37,11 +39,16 @@ import org.apache.rocketmq.remoting.netty.NettyRequestProcessor; import org.apache.rocketmq.remoting.netty.NettyServerConfig; import org.apache.rocketmq.remoting.netty.ResponseFuture; import org.apache.rocketmq.remoting.protocol.RemotingCommand; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.assertTrue; public class NettyRPCTest { + private static RemotingServer remotingServer; + private static RemotingClient remotingClient; + public static RemotingServer createRemotingServer() throws InterruptedException { NettyServerConfig config = new NettyServerConfig(); RemotingServer remotingServer = new NettyRemotingServer(config); @@ -71,84 +78,70 @@ public class NettyRPCTest { return client; } + @BeforeClass + public static void initialize() throws InterruptedException { + remotingServer = createRemotingServer(); + remotingClient = createRemotingClient(); + } + + @AfterClass + public static void destroy() { + remotingClient.shutdown(); + remotingServer.shutdown(); + } + @Test public void test_RPC_Sync() throws InterruptedException, RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException { - RemotingServer server = createRemotingServer(); - RemotingClient client = createRemotingClient(); for (int i = 0; i < 100; i++) { TestRequestHeader requestHeader = new TestRequestHeader(); requestHeader.setCount(i); requestHeader.setMessageTitle("HelloMessageTitle"); RemotingCommand request = RemotingCommand.createRequestCommand(0, requestHeader); - RemotingCommand response = client.invokeSync("localhost:8888", request, 1000 * 3000); + RemotingCommand response = remotingClient.invokeSync("localhost:8888", request, 1000 * 3000); System.out.println("invoke result = " + response); assertTrue(response != null); } - - client.shutdown(); - server.shutdown(); - System.out.println("-----------------------------------------------------------------"); } @Test public void test_RPC_Oneway() throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingTooMuchRequestException, RemotingSendRequestException { - RemotingServer server = createRemotingServer(); - RemotingClient client = createRemotingClient(); for (int i = 0; i < 100; i++) { RemotingCommand request = RemotingCommand.createRequestCommand(0, null); request.setRemark(String.valueOf(i)); - client.invokeOneway("localhost:8888", request, 1000 * 3); + remotingClient.invokeOneway("localhost:8888", request, 1000 * 3); } - - client.shutdown(); - server.shutdown(); - System.out.println("-----------------------------------------------------------------"); } @Test public void test_RPC_Async() throws InterruptedException, RemotingConnectException, RemotingTimeoutException, RemotingTooMuchRequestException, RemotingSendRequestException { - RemotingServer server = createRemotingServer(); - RemotingClient client = createRemotingClient(); for (int i = 0; i < 100; i++) { RemotingCommand request = RemotingCommand.createRequestCommand(0, null); request.setRemark(String.valueOf(i)); - client.invokeAsync("localhost:8888", request, 1000 * 3, new InvokeCallback() { + remotingClient.invokeAsync("localhost:8888", request, 1000 * 3, new InvokeCallback() { @Override public void operationComplete(ResponseFuture responseFuture) { System.out.println(responseFuture.getResponseCommand()); } }); } - - Thread.sleep(1000 * 3); - - client.shutdown(); - server.shutdown(); - System.out.println("-----------------------------------------------------------------"); } @Test public void test_server_call_client() throws InterruptedException, RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException { - final RemotingServer server = createRemotingServer(); - final RemotingClient client = createRemotingClient(); - server.registerProcessor(0, new NettyRequestProcessor() { + remotingServer.registerProcessor(0, new NettyRequestProcessor() { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) { try { - return server.invokeSync(ctx.channel(), request, 1000 * 10); - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (RemotingSendRequestException e) { - e.printStackTrace(); - } catch (RemotingTimeoutException e) { + return remotingServer.invokeSync(ctx.channel(), request, 1000 * 10); + } catch (InterruptedException | RemotingSendRequestException | RemotingTimeoutException e) { e.printStackTrace(); } @@ -161,7 +154,7 @@ public class NettyRPCTest { } }, Executors.newCachedThreadPool()); - client.registerProcessor(0, new NettyRequestProcessor() { + remotingClient.registerProcessor(0, new NettyRequestProcessor() { @Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) { System.out.println("client receive server request = " + request); @@ -177,14 +170,10 @@ public class NettyRPCTest { for (int i = 0; i < 3; i++) { RemotingCommand request = RemotingCommand.createRequestCommand(0, null); - RemotingCommand response = client.invokeSync("localhost:8888", request, 1000 * 3); + RemotingCommand response = remotingClient.invokeSync("localhost:8888", request, 1000 * 3); System.out.println("invoke result = " + response); assertTrue(response != null); } - - client.shutdown(); - server.shutdown(); - System.out.println("-----------------------------------------------------------------"); } } diff --git a/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java b/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java index 27b957f1..f33af761 100644 --- a/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java +++ b/store/src/main/java/org/apache/rocketmq/store/AllocateMappedFileService.java @@ -306,7 +306,7 @@ public class AllocateMappedFileService extends ServiceThread { return false; if (getClass() != obj.getClass()) return false; - AllocateRequest other = (AllocateRequest)obj; + AllocateRequest other = (AllocateRequest) obj; if (filePath == null) { if (other.filePath != null) return false; diff --git a/store/src/main/java/org/apache/rocketmq/store/AppendMessageCallback.java b/store/src/main/java/org/apache/rocketmq/store/AppendMessageCallback.java index 6d158d33..59c9a385 100644 --- a/store/src/main/java/org/apache/rocketmq/store/AppendMessageCallback.java +++ b/store/src/main/java/org/apache/rocketmq/store/AppendMessageCallback.java @@ -20,8 +20,6 @@ import java.nio.ByteBuffer; /** * Write messages callback interface - * - * */ public interface AppendMessageCallback { @@ -31,7 +29,6 @@ public interface AppendMessageCallback { * @param byteBuffer * @param maxBlank * @param msg - * * @return How many bytes to write */ AppendMessageResult doAppend(final long fileFromOffset, final ByteBuffer byteBuffer, diff --git a/store/src/main/java/org/apache/rocketmq/store/AppendMessageResult.java b/store/src/main/java/org/apache/rocketmq/store/AppendMessageResult.java index 965097f1..1fda351e 100644 --- a/store/src/main/java/org/apache/rocketmq/store/AppendMessageResult.java +++ b/store/src/main/java/org/apache/rocketmq/store/AppendMessageResult.java @@ -18,7 +18,6 @@ package org.apache.rocketmq.store; /** * When write a message to the commit log, returns results - * */ public class AppendMessageResult { // Return code diff --git a/store/src/main/java/org/apache/rocketmq/store/AppendMessageStatus.java b/store/src/main/java/org/apache/rocketmq/store/AppendMessageStatus.java index 39cf9fa6..30725f3d 100644 --- a/store/src/main/java/org/apache/rocketmq/store/AppendMessageStatus.java +++ b/store/src/main/java/org/apache/rocketmq/store/AppendMessageStatus.java @@ -18,8 +18,6 @@ package org.apache.rocketmq.store; /** * When write a message to the commit log, returns code - * - * */ public enum AppendMessageStatus { PUT_OK, diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java index 17625f49..06df2876 100644 --- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java +++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java @@ -143,7 +143,7 @@ public class CommitLog { int mappedFileSize = this.defaultMessageStore.getMessageStoreConfig().getMapedFileSizeCommitLog(); MappedFile mappedFile = this.mappedFileQueue.findMappedFileByOffset(offset, returnFirstOnNotFound); if (mappedFile != null) { - int pos = (int)(offset % mappedFileSize); + int pos = (int) (offset % mappedFileSize); SelectMappedBufferResult result = mappedFile.selectMappedBuffer(pos); return result; } @@ -637,7 +637,7 @@ public class CommitLog { // Synchronization flush if (FlushDiskType.SYNC_FLUSH == this.defaultMessageStore.getMessageStoreConfig().getFlushDiskType()) { - final GroupCommitService service = (GroupCommitService)this.flushCommitLogService; + final GroupCommitService service = (GroupCommitService) this.flushCommitLogService; if (msg.isWaitStoreMsgOK()) { request = new GroupCommitRequest(result.getWroteOffset() + result.getWroteBytes()); service.putRequest(request); @@ -729,7 +729,7 @@ public class CommitLog { int mappedFileSize = this.defaultMessageStore.getMessageStoreConfig().getMapedFileSizeCommitLog(); MappedFile mappedFile = this.mappedFileQueue.findMappedFileByOffset(offset, offset == 0); if (mappedFile != null) { - int pos = (int)(offset % mappedFileSize); + int pos = (int) (offset % mappedFileSize); return mappedFile.selectMappedBuffer(pos, size); } return null; @@ -1150,7 +1150,7 @@ public class CommitLog { final byte[] propertiesData = msgInner.getPropertiesString() == null ? null : msgInner.getPropertiesString().getBytes(MessageDecoder.CHARSET_UTF8); - final short propertiesLength = propertiesData == null ? 0 : (short)propertiesData.length; + final short propertiesLength = propertiesData == null ? 0 : (short) propertiesData.length; if (propertiesLength > Short.MAX_VALUE) { log.warn("putMessage message properties length too long. length={}", propertiesData.length); @@ -1226,7 +1226,7 @@ public class CommitLog { if (bodyLength > 0) this.msgStoreItemMemory.put(msgInner.getBody()); // 16 TOPIC - this.msgStoreItemMemory.put((byte)topicLength); + this.msgStoreItemMemory.put((byte) topicLength); this.msgStoreItemMemory.put(topicData); // 17 PROPERTIES this.msgStoreItemMemory.putShort(propertiesLength); diff --git a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java index d9e2f031..a0606382 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java +++ b/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java @@ -131,7 +131,7 @@ public class ConsumeQueue { if (mappedFile != null) { long offset = 0; int low = - minLogicOffset > mappedFile.getFileFromOffset() ? (int)(minLogicOffset - mappedFile + minLogicOffset > mappedFile.getFileFromOffset() ? (int) (minLogicOffset - mappedFile .getFileFromOffset()) : 0; int high = 0; int midOffset = -1, targetOffset = -1, leftOffset = -1, rightOffset = -1; @@ -407,7 +407,7 @@ public class ConsumeQueue { byteBuffer.putInt(Integer.MAX_VALUE); byteBuffer.putLong(0L); - int until = (int)(untilWhere % this.mappedFileQueue.getMappedFileSize()); + int until = (int) (untilWhere % this.mappedFileQueue.getMappedFileSize()); for (int i = 0; i < until; i += CQ_STORE_UNIT_SIZE) { mappedFile.appendMessage(byteBuffer.array()); } @@ -419,7 +419,7 @@ public class ConsumeQueue { if (offset >= this.getMinLogicOffset()) { MappedFile mappedFile = this.mappedFileQueue.findMappedFileByOffset(offset); if (mappedFile != null) { - SelectMappedBufferResult result = mappedFile.selectMappedBuffer((int)(offset % mappedFileSize)); + SelectMappedBufferResult result = mappedFile.selectMappedBuffer((int) (offset % mappedFileSize)); return result; } } diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java index 7e3af19e..6d182e66 100644 --- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java +++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java @@ -459,7 +459,7 @@ public class DefaultMessageStore implements MessageStore { nextBeginOffset = offset + (i / ConsumeQueue.CQ_STORE_UNIT_SIZE); long diff = maxOffsetPy - maxPhyOffsetPulling; - long memory = (long)(StoreUtil.TOTAL_PHYSICAL_MEMORY_SIZE + long memory = (long) (StoreUtil.TOTAL_PHYSICAL_MEMORY_SIZE * (this.messageStoreConfig.getAccessMessageInMemoryMaxRatio() / 100.0)); getResult.setSuggestPullingFromSlave(diff > memory); } finally { @@ -1016,7 +1016,7 @@ public class DefaultMessageStore implements MessageStore { } private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) { - long memory = (long)(StoreUtil.TOTAL_PHYSICAL_MEMORY_SIZE * (this.messageStoreConfig.getAccessMessageInMemoryMaxRatio() / 100.0)); + long memory = (long) (StoreUtil.TOTAL_PHYSICAL_MEMORY_SIZE * (this.messageStoreConfig.getAccessMessageInMemoryMaxRatio() / 100.0)); return (maxOffsetPy - offsetPy) > memory; } @@ -1288,6 +1288,24 @@ public class DefaultMessageStore implements MessageStore { return brokerStatsManager; } + public int remainTransientStoreBufferNumbs() { + return this.transientStorePool.remainBufferNumbs(); + } + + @Override + public boolean isTransientStorePoolDeficient() { + return remainTransientStoreBufferNumbs() == 0; + } + + public void unlockMappedFile(final MappedFile mappedFile) { + this.scheduledExecutorService.schedule(new Runnable() { + @Override + public void run() { + mappedFile.munlock(); + } + }, 6, TimeUnit.SECONDS); + } + class CleanCommitLogService { private final static int MAX_MANUAL_DELETE_FILE_TIMES = 20; @@ -1565,6 +1583,10 @@ public class DefaultMessageStore implements MessageStore { return reputFromOffset; } + public void setReputFromOffset(long reputFromOffset) { + this.reputFromOffset = reputFromOffset; + } + @Override public void shutdown() { for (int i = 0; i < 50 && this.isCommitLogAvailable(); i++) { @@ -1582,10 +1604,6 @@ public class DefaultMessageStore implements MessageStore { super.shutdown(); } - public void setReputFromOffset(long reputFromOffset) { - this.reputFromOffset = reputFromOffset; - } - public long behind() { return DefaultMessageStore.this.commitLog.getMaxOffset() - this.reputFromOffset; } @@ -1683,22 +1701,4 @@ public class DefaultMessageStore implements MessageStore { } } - - public int remainTransientStoreBufferNumbs() { - return this.transientStorePool.remainBufferNumbs(); - } - - @Override - public boolean isTransientStorePoolDeficient() { - return remainTransientStoreBufferNumbs() == 0; - } - - public void unlockMappedFile(final MappedFile mappedFile) { - this.scheduledExecutorService.schedule(new Runnable() { - @Override - public void run() { - mappedFile.munlock(); - } - }, 6, TimeUnit.SECONDS); - } } diff --git a/store/src/main/java/org/apache/rocketmq/store/GetMessageResult.java b/store/src/main/java/org/apache/rocketmq/store/GetMessageResult.java index b7d33f3a..3c7e0071 100644 --- a/store/src/main/java/org/apache/rocketmq/store/GetMessageResult.java +++ b/store/src/main/java/org/apache/rocketmq/store/GetMessageResult.java @@ -86,7 +86,7 @@ public class GetMessageResult { this.messageMapedList.add(mapedBuffer); this.messageBufferList.add(mapedBuffer.getByteBuffer()); this.bufferTotalSize += mapedBuffer.getSize(); - this.msgCount4Commercial += (int)Math.ceil( + this.msgCount4Commercial += (int) Math.ceil( mapedBuffer.getSize() / BrokerStatsManager.SIZE_PER_COUNT); } diff --git a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java index 6803ec9f..7c2d703f 100644 --- a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java +++ b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java @@ -125,7 +125,7 @@ public class MappedFile extends ReferenceResource { } } - ByteBuffer viewedBuffer = (ByteBuffer)invoke(buffer, methodName); + ByteBuffer viewedBuffer = (ByteBuffer) invoke(buffer, methodName); if (viewedBuffer == null) return buffer; else @@ -463,7 +463,7 @@ public class MappedFile extends ReferenceResource { int flush = 0; long time = System.currentTimeMillis(); for (int i = 0, j = 0; i < this.fileSize; i += MappedFile.OS_PAGE_SIZE, j++) { - byteBuffer.put(i, (byte)0); + byteBuffer.put(i, (byte) 0); // force flush when flush disk type is sync if (type == FlushDiskType.SYNC_FLUSH) { if ((i / OS_PAGE_SIZE) - (flush / OS_PAGE_SIZE) >= pages) { @@ -522,7 +522,7 @@ public class MappedFile extends ReferenceResource { public void mlock() { final long beginTime = System.currentTimeMillis(); - final long address = ((DirectBuffer)(this.mappedByteBuffer)).address(); + final long address = ((DirectBuffer) (this.mappedByteBuffer)).address(); Pointer pointer = new Pointer(address); { int ret = LibC.INSTANCE.mlock(pointer, new NativeLong(this.fileSize)); @@ -537,7 +537,7 @@ public class MappedFile extends ReferenceResource { public void munlock() { final long beginTime = System.currentTimeMillis(); - final long address = ((DirectBuffer)(this.mappedByteBuffer)).address(); + final long address = ((DirectBuffer) (this.mappedByteBuffer)).address(); Pointer pointer = new Pointer(address); int ret = LibC.INSTANCE.munlock(pointer, new NativeLong(this.fileSize)); log.info("munlock {} {} {} ret = {} time consuming = {}", address, this.fileName, this.fileSize, ret, System.currentTimeMillis() - beginTime); diff --git a/store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java b/store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java index 49455c6b..f4e976d6 100644 --- a/store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java +++ b/store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java @@ -81,13 +81,13 @@ public class MappedFileQueue { return null; for (int i = 0; i < mfs.length; i++) { - MappedFile mappedFile = (MappedFile)mfs[i]; + MappedFile mappedFile = (MappedFile) mfs[i]; if (mappedFile.getLastModifiedTimestamp() >= timestamp) { return mappedFile; } } - return (MappedFile)mfs[mfs.length - 1]; + return (MappedFile) mfs[mfs.length - 1]; } private Object[] copyMappedFiles(final int reservedMappedFiles) { @@ -108,9 +108,9 @@ public class MappedFileQueue { long fileTailOffset = file.getFileFromOffset() + this.mappedFileSize; if (fileTailOffset > offset) { if (offset >= file.getFileFromOffset()) { - file.setWrotePosition((int)(offset % this.mappedFileSize)); - file.setCommittedPosition((int)(offset % this.mappedFileSize)); - file.setFlushedPosition((int)(offset % this.mappedFileSize)); + file.setWrotePosition((int) (offset % this.mappedFileSize)); + file.setCommittedPosition((int) (offset % this.mappedFileSize)); + file.setFlushedPosition((int) (offset % this.mappedFileSize)); } else { file.destroy(1000); willRemoveFiles.add(file); @@ -273,7 +273,7 @@ public class MappedFileQueue { while (iterator.hasPrevious()) { mappedFileLast = iterator.previous(); if (offset >= mappedFileLast.getFileFromOffset()) { - int where = (int)(offset % mappedFileLast.getFileSize()); + int where = (int) (offset % mappedFileLast.getFileSize()); mappedFileLast.setFlushedPosition(where); mappedFileLast.setWrotePosition(where); mappedFileLast.setCommittedPosition(where); @@ -347,7 +347,7 @@ public class MappedFileQueue { List files = new ArrayList(); if (null != mfs) { for (int i = 0; i < mfsLength; i++) { - MappedFile mappedFile = (MappedFile)mfs[i]; + MappedFile mappedFile = (MappedFile) mfs[i]; long liveMaxTimestamp = mappedFile.getLastModifiedTimestamp() + expiredTime; if (System.currentTimeMillis() >= liveMaxTimestamp || cleanImmediately) { if (mappedFile.destroy(intervalForcibly)) { @@ -387,7 +387,7 @@ public class MappedFileQueue { for (int i = 0; i < mfsLength; i++) { boolean destroy; - MappedFile mappedFile = (MappedFile)mfs[i]; + MappedFile mappedFile = (MappedFile) mfs[i]; SelectMappedBufferResult result = mappedFile.selectMappedBuffer(this.mappedFileSize - unitSize); if (result != null) { long maxOffsetInLogicQueue = result.getByteBuffer().getLong(); @@ -457,7 +457,7 @@ public class MappedFileQueue { try { MappedFile mappedFile = this.getFirstMappedFile(); if (mappedFile != null) { - int index = (int)((offset / this.mappedFileSize) - (mappedFile.getFileFromOffset() / this.mappedFileSize)); + int index = (int) ((offset / this.mappedFileSize) - (mappedFile.getFileFromOffset() / this.mappedFileSize)); if (index < 0 || index >= this.mappedFiles.size()) { LOG_ERROR.warn("Offset for {} not matched. Request offset: {}, index: {}, " + "mappedFileSize: {}, mappedFiles count: {}", @@ -510,7 +510,7 @@ public class MappedFileQueue { Object[] mfs = this.copyMappedFiles(0); if (mfs != null) { for (Object mf : mfs) { - if (((ReferenceResource)mf).isAvailable()) { + if (((ReferenceResource) mf).isAvailable()) { size += this.mappedFileSize; } } diff --git a/store/src/main/java/org/apache/rocketmq/store/StoreUtil.java b/store/src/main/java/org/apache/rocketmq/store/StoreUtil.java index 9cd71454..e97052f2 100644 --- a/store/src/main/java/org/apache/rocketmq/store/StoreUtil.java +++ b/store/src/main/java/org/apache/rocketmq/store/StoreUtil.java @@ -30,7 +30,7 @@ public class StoreUtil { long physicalTotal = 1024 * 1024 * 1024 * 24; OperatingSystemMXBean osmxb = ManagementFactory.getOperatingSystemMXBean(); if (osmxb instanceof com.sun.management.OperatingSystemMXBean) { - physicalTotal = ((com.sun.management.OperatingSystemMXBean)osmxb).getTotalPhysicalMemorySize(); + physicalTotal = ((com.sun.management.OperatingSystemMXBean) osmxb).getTotalPhysicalMemorySize(); } return physicalTotal; diff --git a/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java b/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java index 3e332baf..ffbc313f 100644 --- a/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java +++ b/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java @@ -50,7 +50,7 @@ public class TransientStorePool { for (int i = 0; i < poolSize; i++) { ByteBuffer byteBuffer = ByteBuffer.allocateDirect(fileSize); - final long address = ((DirectBuffer)byteBuffer).address(); + final long address = ((DirectBuffer) byteBuffer).address(); Pointer pointer = new Pointer(address); LibC.INSTANCE.mlock(pointer, new NativeLong(fileSize)); @@ -60,7 +60,7 @@ public class TransientStorePool { public void destroy() { for (ByteBuffer byteBuffer : availableBuffers) { - final long address = ((DirectBuffer)byteBuffer).address(); + final long address = ((DirectBuffer) byteBuffer).address(); Pointer pointer = new Pointer(address); LibC.INSTANCE.munlock(pointer, new NativeLong(fileSize)); } diff --git a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java index d1e2bfec..741a7127 100644 --- a/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java +++ b/store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java @@ -182,8 +182,8 @@ public class MessageStoreConfig { public int getMapedFileSizeConsumeQueue() { - int factor = (int)Math.ceil(this.mapedFileSizeConsumeQueue / (ConsumeQueue.CQ_STORE_UNIT_SIZE * 1.0)); - return (int)(factor * ConsumeQueue.CQ_STORE_UNIT_SIZE); + int factor = (int) Math.ceil(this.mapedFileSizeConsumeQueue / (ConsumeQueue.CQ_STORE_UNIT_SIZE * 1.0)); + return (int) (factor * ConsumeQueue.CQ_STORE_UNIT_SIZE); } public void setMapedFileSizeConsumeQueue(int mapedFileSizeConsumeQueue) { @@ -444,14 +444,14 @@ public class MessageStoreConfig { return brokerRole; } - public void setBrokerRole(String brokerRole) { - this.brokerRole = BrokerRole.valueOf(brokerRole); - } - public void setBrokerRole(BrokerRole brokerRole) { this.brokerRole = brokerRole; } + public void setBrokerRole(String brokerRole) { + this.brokerRole = BrokerRole.valueOf(brokerRole); + } + public int getHaTransferBatchSize() { return haTransferBatchSize; } @@ -472,14 +472,14 @@ public class MessageStoreConfig { return flushDiskType; } - public void setFlushDiskType(String type) { - this.flushDiskType = FlushDiskType.valueOf(type); - } - public void setFlushDiskType(FlushDiskType flushDiskType) { this.flushDiskType = flushDiskType; } + public void setFlushDiskType(String type) { + this.flushDiskType = FlushDiskType.valueOf(type); + } + public int getSyncFlushTimeout() { return syncFlushTimeout; } @@ -570,6 +570,7 @@ public class MessageStoreConfig { /** * Enable transient commitLog store poll only if transientStorePoolEnable is true and the FlushDiskType is ASYNC_FLUSH + * * @return true or false */ public boolean isTransientStorePoolEnable() { diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java b/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java index 82fe8f4f..bab3d1ec 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java +++ b/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java @@ -207,7 +207,7 @@ public class HAService { if (selected != null) { for (SelectionKey k : selected) { if ((k.readyOps() & SelectionKey.OP_ACCEPT) != 0) { - SocketChannel sc = ((ServerSocketChannel)k.channel()).accept(); + SocketChannel sc = ((ServerSocketChannel) k.channel()).accept(); if (sc != null) { HAService.log.info("HAService receive new connection, " diff --git a/store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java b/store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java index de1a31de..97f39200 100644 --- a/store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java +++ b/store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java @@ -124,7 +124,7 @@ public class IndexFile { this.mappedByteBuffer.putInt(absIndexPos, keyHash); this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset); - this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int)timeDiff); + this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff); this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue); this.mappedByteBuffer.putInt(absSlotPos, this.indexHeader.getIndexCount()); @@ -183,15 +183,8 @@ public class IndexFile { boolean result = begin < this.indexHeader.getBeginTimestamp() && end > this.indexHeader.getEndTimestamp(); - result = - result - || (begin >= this.indexHeader.getBeginTimestamp() && begin <= this.indexHeader - .getEndTimestamp()); - - result = - result - || (end >= this.indexHeader.getBeginTimestamp() && end <= this.indexHeader - .getEndTimestamp()); + result = result || (begin >= this.indexHeader.getBeginTimestamp() && begin <= this.indexHeader.getEndTimestamp()); + result = result || (end >= this.indexHeader.getBeginTimestamp() && end <= this.indexHeader.getEndTimestamp()); return result; } @@ -219,7 +212,7 @@ public class IndexFile { || this.indexHeader.getIndexCount() <= 1) { // TODO NOTFOUND } else { - for (int nextIndexToRead = slotValue; ; ) { + for (int nextIndexToRead = slotValue;;) { if (phyOffsets.size() >= maxNum) { break; } @@ -231,7 +224,7 @@ public class IndexFile { int keyHashRead = this.mappedByteBuffer.getInt(absIndexPos); long phyOffsetRead = this.mappedByteBuffer.getLong(absIndexPos + 4); - long timeDiff = (long)this.mappedByteBuffer.getInt(absIndexPos + 4 + 8); + long timeDiff = (long) this.mappedByteBuffer.getInt(absIndexPos + 4 + 8); int prevIndexRead = this.mappedByteBuffer.getInt(absIndexPos + 4 + 8 + 4); if (timeDiff < 0) { diff --git a/store/src/main/java/org/apache/rocketmq/store/index/IndexService.java b/store/src/main/java/org/apache/rocketmq/store/index/IndexService.java index b72ffe90..4d07e837 100644 --- a/store/src/main/java/org/apache/rocketmq/store/index/IndexService.java +++ b/store/src/main/java/org/apache/rocketmq/store/index/IndexService.java @@ -106,7 +106,7 @@ public class IndexService { if (files != null) { List fileList = new ArrayList(); for (int i = 0; i < (files.length - 1); i++) { - IndexFile f = (IndexFile)files[i]; + IndexFile f = (IndexFile) files[i]; if (f.getEndPhyOffset() < offset) { fileList.add(f); } else { diff --git a/store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java b/store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java index 3df48064..259eb3b6 100644 --- a/store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java +++ b/store/src/main/java/org/apache/rocketmq/store/schedule/ScheduleMessageService.java @@ -224,8 +224,6 @@ public class ScheduleMessageService extends ConfigManager { } /** - - * * @return */ private long correctDeliverTimestamp(final long now, final long deliverTimestamp) { diff --git a/store/src/main/java/org/apache/rocketmq/store/util/LibC.java b/store/src/main/java/org/apache/rocketmq/store/util/LibC.java index dc5d6a94..ae70efdc 100644 --- a/store/src/main/java/org/apache/rocketmq/store/util/LibC.java +++ b/store/src/main/java/org/apache/rocketmq/store/util/LibC.java @@ -23,7 +23,7 @@ import com.sun.jna.Platform; import com.sun.jna.Pointer; public interface LibC extends Library { - LibC INSTANCE = (LibC)Native.loadLibrary(Platform.isWindows() ? "msvcrt" : "c", LibC.class); + LibC INSTANCE = (LibC) Native.loadLibrary(Platform.isWindows() ? "msvcrt" : "c", LibC.class); int MADV_WILLNEED = 3; int MADV_DONTNEED = 4; diff --git a/store/src/test/java/org/apache/rocketmq/store/MappedFileQueueTest.java b/store/src/test/java/org/apache/rocketmq/store/MappedFileQueueTest.java index 018cf990..1948fc7a 100644 --- a/store/src/test/java/org/apache/rocketmq/store/MappedFileQueueTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/MappedFileQueueTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: MappedFileQueueTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: MappedFileQueueTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/store/src/test/java/org/apache/rocketmq/store/MappedFileTest.java b/store/src/test/java/org/apache/rocketmq/store/MappedFileTest.java index a10f4eb5..2aa9000b 100644 --- a/store/src/test/java/org/apache/rocketmq/store/MappedFileTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/MappedFileTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: MappedFileTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: MappedFileTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/store/src/test/java/org/apache/rocketmq/store/StoreCheckpointTest.java b/store/src/test/java/org/apache/rocketmq/store/StoreCheckpointTest.java index 2fe4d469..0f7ce391 100644 --- a/store/src/test/java/org/apache/rocketmq/store/StoreCheckpointTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/StoreCheckpointTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: StoreCheckpointTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: StoreCheckpointTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/store/src/test/java/org/apache/rocketmq/store/index/IndexFileTest.java b/store/src/test/java/org/apache/rocketmq/store/index/IndexFileTest.java index cdecb20e..c9c10714 100644 --- a/store/src/test/java/org/apache/rocketmq/store/index/IndexFileTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/index/IndexFileTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: IndexFileTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: IndexFileTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/store/src/test/java/org/apache/rocketmq/store/schedule/ScheduleMessageTest.java b/store/src/test/java/org/apache/rocketmq/store/schedule/ScheduleMessageTest.java index c5d97566..e3b09bda 100644 --- a/store/src/test/java/org/apache/rocketmq/store/schedule/ScheduleMessageTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/schedule/ScheduleMessageTest.java @@ -15,6 +15,8 @@ * limitations under the License. * * $Id: ScheduleMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ + * + * $Id: ScheduleMessageTest.java 1831 2013-05-16 01:39:51Z vintagewang@apache.org $ */ /** diff --git a/checkstyle/checkstyle.xml b/style/rmq_checkstyle.xml similarity index 98% rename from checkstyle/checkstyle.xml rename to style/rmq_checkstyle.xml index 0d22d7d3..e2049b6d 100644 --- a/checkstyle/checkstyle.xml +++ b/style/rmq_checkstyle.xml @@ -58,7 +58,7 @@ - + @@ -107,9 +107,7 @@ - diff --git a/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java b/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java index 847a2c0b..f133c43e 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java @@ -708,7 +708,7 @@ public class DefaultMQAdminExtImpl implements MQAdminExt, MQAdminExtInner { return this.mqClientInstance.getMQClientAPIImpl().consumeMessageDirectly(RemotingUtil.socketAddress2String(msg.getStoreHost()), consumerGroup, clientId, msgId, timeoutMillis * 3); } else { - MessageClientExt msgClient = (MessageClientExt)msg; + MessageClientExt msgClient = (MessageClientExt) msg; return this.mqClientInstance.getMQClientAPIImpl().consumeMessageDirectly(RemotingUtil.socketAddress2String(msg.getStoreHost()), consumerGroup, clientId, msgClient.getOffsetMsgId(), timeoutMillis * 3); } diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java b/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java index a1753c11..38089c34 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java @@ -194,7 +194,7 @@ public class MQAdminStartup { private static void initLogback() throws JoranException { String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); - LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(lc); lc.reset(); diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/cluster/CLusterSendMsgRTCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/cluster/CLusterSendMsgRTCommand.java index 1ae6d526..a6e592a5 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/cluster/CLusterSendMsgRTCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/cluster/CLusterSendMsgRTCommand.java @@ -161,7 +161,7 @@ public class CLusterSendMsgRTCommand implements SubCommand { } } - double rt = (double)elapsed / (amount - 1); + double rt = (double) elapsed / (amount - 1); if (!printAsTlog) { System.out.printf("%-24s %-24s %-8s %-16s %-16s%n", clusterName, diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java index 3e706143..692d060d 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/consumer/ConsumerProgressSubCommand.java @@ -141,7 +141,7 @@ public class ConsumerProgressSubCommand implements SubCommand { groupConsumeInfo.setGroup(consumerGroup); if (consumeStats != null) { - groupConsumeInfo.setConsumeTps((int)consumeStats.getConsumeTps()); + groupConsumeInfo.setConsumeTps((int) consumeStats.getConsumeTps()); groupConsumeInfo.setDiffTotal(consumeStats.computeTotalDiff()); } @@ -251,7 +251,7 @@ class GroupConsumeInfo implements Comparable { return o.count - this.count; } - return (int)(o.diffTotal - diffTotal); + return (int) (o.diffTotal - diffTotal); } public int getConsumeTps() { diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/message/CheckMsgSendRTCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/message/CheckMsgSendRTCommand.java index cade0e01..22d351fa 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/message/CheckMsgSendRTCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/message/CheckMsgSendRTCommand.java @@ -88,7 +88,7 @@ public class CheckMsgSendRTCommand implements SubCommand { producer.send(msg, new MessageQueueSelector() { @Override public MessageQueue select(List mqs, Message msg, Object arg) { - int queueIndex = (Integer)arg % mqs.size(); + int queueIndex = (Integer) arg % mqs.size(); MessageQueue queue = mqs.get(queueIndex); brokerName = queue.getBrokerName(); queueId = queue.getQueueId(); @@ -114,7 +114,7 @@ public class CheckMsgSendRTCommand implements SubCommand { ); } - double rt = (double)timeElapsed / (amount - 1); + double rt = (double) timeElapsed / (amount - 1); System.out.printf("Avg RT: %s%n", String.format("%.2f", rt)); } catch (Exception e) { e.printStackTrace(); diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/message/PrintMessageByQueueCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/message/PrintMessageByQueueCommand.java index aad16441..e810e86a 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/message/PrintMessageByQueueCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/message/PrintMessageByQueueCommand.java @@ -246,7 +246,7 @@ public class PrintMessageByQueueCommand implements SubCommand { @Override public int compareTo(final TagCountBean o) { - return (int)(o.getCount().get() - this.count.get()); + return (int) (o.getCount().get() - this.count.get()); } } } diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgByIdSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgByIdSubCommand.java index 38f9a72f..4211780c 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgByIdSubCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/message/QueryMsgByIdSubCommand.java @@ -57,7 +57,7 @@ public class QueryMsgByIdSubCommand implements SubCommand { String bodyTmpFilePath = createBodyFile(msg); String msgId = msg.getMsgId(); if (msg instanceof MessageClientExt) { - msgId = ((MessageClientExt)msg).getOffsetMsgId(); + msgId = ((MessageClientExt) msg).getOffsetMsgId(); } System.out.printf("%-20s %s%n", -- GitLab