From eaba61ffe81b65abe689922ce85d596a1808ab11 Mon Sep 17 00:00:00 2001 From: shtykh_roman Date: Thu, 9 Mar 2017 18:07:54 +0900 Subject: [PATCH] Corrected spellings. --- .../org/apache/rocketmq/broker/BrokerStartup.java | 10 ++++++---- .../broker/pagecache/ManyMessageTransfer.java | 14 ++++++++------ .../broker/pagecache/OneMessageTransfer.java | 14 ++++++++------ .../broker/pagecache/QueryMessageTransfer.java | 14 ++++++++------ .../processor/AbstractSendMessageProcessor.java | 2 +- .../broker/processor/EndTransactionProcessor.java | 2 +- .../broker/processor/PullMessageProcessor.java | 2 +- .../transaction/jdbc/JDBCTransactionStore.java | 2 +- 8 files changed, 34 insertions(+), 26 deletions(-) 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 f613894d..39ee8dd2 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerStartup.java @@ -125,7 +125,7 @@ public class BrokerStartup { properties = new Properties(); properties.load(in); - parsePropertie2SystemEnv(properties); + properties2SystemEnv(properties); MixAll.properties2Object(properties, brokerConfig); MixAll.properties2Object(properties, nettyServerConfig); MixAll.properties2Object(properties, nettyClientConfig); @@ -212,9 +212,9 @@ public class BrokerStartup { log.info("Shutdown hook was invoked, {}", this.shutdownTimes.incrementAndGet()); if (!this.hasShutdown) { this.hasShutdown = true; - long begineTime = System.currentTimeMillis(); + long beginTime = System.currentTimeMillis(); controller.shutdown(); - long consumingTimeTotal = System.currentTimeMillis() - begineTime; + long consumingTimeTotal = System.currentTimeMillis() - beginTime; log.info("Shutdown hook over, consuming total time(ms): {}", consumingTimeTotal); } } @@ -230,10 +230,12 @@ public class BrokerStartup { return null; } - private static void parsePropertie2SystemEnv(Properties properties) { + private static void properties2SystemEnv(Properties properties) { if (properties == null) { + log.info("No properties to set system environment"); return; } + String rmqAddressServerDomain = properties.getProperty("rmqAddressServerDomain", MixAll.DEFAULT_NAMESRV_ADDR_LOOKUP); String rmqAddressServerSubGroup = properties.getProperty("rmqAddressServerSubGroup", "nsaddr"); System.setProperty("rocketmq.namesrv.domain", rmqAddressServerDomain); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/ManyMessageTransfer.java b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/ManyMessageTransfer.java index 85a43595..5b9df3e2 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/ManyMessageTransfer.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/ManyMessageTransfer.java @@ -27,7 +27,9 @@ import org.apache.rocketmq.store.GetMessageResult; public class ManyMessageTransfer extends AbstractReferenceCounted implements FileRegion { private final ByteBuffer byteBufferHeader; private final GetMessageResult getMessageResult; - private long transfered; // the bytes which was transfered already + + /** Bytes which were transferred already. */ + private long transferred; public ManyMessageTransfer(ByteBuffer byteBufferHeader, GetMessageResult getMessageResult) { this.byteBufferHeader = byteBufferHeader; @@ -46,7 +48,7 @@ public class ManyMessageTransfer extends AbstractReferenceCounted implements Fil @Override public long transfered() { - return transfered; + return transferred; } @Override @@ -57,14 +59,14 @@ public class ManyMessageTransfer extends AbstractReferenceCounted implements Fil @Override public long transferTo(WritableByteChannel target, long position) throws IOException { if (this.byteBufferHeader.hasRemaining()) { - transfered += target.write(this.byteBufferHeader); - return transfered; + transferred += target.write(this.byteBufferHeader); + return transferred; } else { List messageBufferList = this.getMessageResult.getMessageBufferList(); for (ByteBuffer bb : messageBufferList) { if (bb.hasRemaining()) { - transfered += target.write(bb); - return transfered; + transferred += target.write(bb); + return transferred; } } } diff --git a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/OneMessageTransfer.java b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/OneMessageTransfer.java index e5d2298d..254c2ab8 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/OneMessageTransfer.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/OneMessageTransfer.java @@ -26,7 +26,9 @@ import org.apache.rocketmq.store.SelectMappedBufferResult; public class OneMessageTransfer extends AbstractReferenceCounted implements FileRegion { private final ByteBuffer byteBufferHeader; private final SelectMappedBufferResult selectMappedBufferResult; - private long transfered; // the bytes which was transfered already + + /** Bytes which were transferred already. */ + private long transferred; public OneMessageTransfer(ByteBuffer byteBufferHeader, SelectMappedBufferResult selectMappedBufferResult) { this.byteBufferHeader = byteBufferHeader; @@ -40,7 +42,7 @@ public class OneMessageTransfer extends AbstractReferenceCounted implements File @Override public long transfered() { - return transfered; + return transferred; } @Override @@ -51,11 +53,11 @@ public class OneMessageTransfer extends AbstractReferenceCounted implements File @Override public long transferTo(WritableByteChannel target, long position) throws IOException { if (this.byteBufferHeader.hasRemaining()) { - transfered += target.write(this.byteBufferHeader); - return transfered; + transferred += target.write(this.byteBufferHeader); + return transferred; } else if (this.selectMappedBufferResult.getByteBuffer().hasRemaining()) { - transfered += target.write(this.selectMappedBufferResult.getByteBuffer()); - return transfered; + transferred += target.write(this.selectMappedBufferResult.getByteBuffer()); + return transferred; } return 0; diff --git a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/QueryMessageTransfer.java b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/QueryMessageTransfer.java index 66c36b6d..aaa1304d 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/pagecache/QueryMessageTransfer.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/pagecache/QueryMessageTransfer.java @@ -27,7 +27,9 @@ import org.apache.rocketmq.store.QueryMessageResult; public class QueryMessageTransfer extends AbstractReferenceCounted implements FileRegion { private final ByteBuffer byteBufferHeader; private final QueryMessageResult queryMessageResult; - private long transfered; // the bytes which was transfered already + + /** Bytes which were transferred already. */ + private long transferred; public QueryMessageTransfer(ByteBuffer byteBufferHeader, QueryMessageResult queryMessageResult) { this.byteBufferHeader = byteBufferHeader; @@ -46,7 +48,7 @@ public class QueryMessageTransfer extends AbstractReferenceCounted implements Fi @Override public long transfered() { - return transfered; + return transferred; } @Override @@ -57,14 +59,14 @@ public class QueryMessageTransfer extends AbstractReferenceCounted implements Fi @Override public long transferTo(WritableByteChannel target, long position) throws IOException { if (this.byteBufferHeader.hasRemaining()) { - transfered += target.write(this.byteBufferHeader); - return transfered; + transferred += target.write(this.byteBufferHeader); + return transferred; } else { List messageBufferList = this.queryMessageResult.getMessageBufferList(); for (ByteBuffer bb : messageBufferList) { if (bb.hasRemaining()) { - transfered += target.write(bb); - return transfered; + transferred += target.write(bb); + return transferred; } } } 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 f5dc1f90..9f23bade 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 @@ -214,7 +214,7 @@ public abstract class AbstractSendMessageProcessor implements NettyRequestProces int queueIdInt = requestHeader.getQueueId(); int idValid = Math.max(topicConfig.getWriteQueueNums(), topicConfig.getReadQueueNums()); if (queueIdInt >= idValid) { - String errorInfo = String.format("request queueId[%d] is illagal, %s Producer: %s", + String errorInfo = String.format("request queueId[%d] is illegal, %s Producer: %s", queueIdInt, topicConfig.toString(), RemotingHelper.parseChannelRemoteAddr(ctx.channel())); 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 fc15bbfd..68e41676 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 @@ -157,7 +157,7 @@ public class EndTransactionProcessor implements NettyRequestProcessor { // Failed case CREATE_MAPEDFILE_FAILED: response.setCode(ResponseCode.SYSTEM_ERROR); - response.setRemark("create maped file failed."); + response.setRemark("create mapped file failed."); break; case MESSAGE_ILLEGAL: case PROPERTIES_SIZE_EXCEEDED: 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 7d158943..89967d8f 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 @@ -133,7 +133,7 @@ public class PullMessageProcessor implements NettyRequestProcessor { } if (requestHeader.getQueueId() < 0 || requestHeader.getQueueId() >= topicConfig.getReadQueueNums()) { - String errorInfo = String.format("queueId[%d] is illagal, topic:[%s] topicConfig.readQueueNums:[%d] consumer:[%s]", + String errorInfo = String.format("queueId[%d] is illegal, topic:[%s] topicConfig.readQueueNums:[%d] consumer:[%s]", requestHeader.getQueueId(), requestHeader.getTopic(), topicConfig.getReadQueueNums(), channel.remoteAddress()); LOG.warn(errorInfo); response.setCode(ResponseCode.SYSTEM_ERROR); diff --git a/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java b/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java index ae6400c8..056d9390 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/transaction/jdbc/JDBCTransactionStore.java @@ -63,7 +63,7 @@ public class JDBCTransactionStore implements TransactionStore { return true; } catch (SQLException e) { - log.info("Create JDBC Connection Exeption", e); + log.info("Create JDBC Connection Exception", e); } } -- GitLab