Skip to content

Commit

Permalink
Corrected spellings.
Browse files Browse the repository at this point in the history
  • Loading branch information
shroman authored and dongeforever committed Jun 6, 2017
1 parent e9a0d62 commit eaba61f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static BrokerController createBrokerController(String[] args) {
properties = new Properties();
properties.load(in);

parsePropertie2SystemEnv(properties);
properties2SystemEnv(properties);
MixAll.properties2Object(properties, brokerConfig);
MixAll.properties2Object(properties, nettyServerConfig);
MixAll.properties2Object(properties, nettyClientConfig);
Expand Down Expand Up @@ -212,9 +212,9 @@ public void run() {
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);
}
}
Expand All @@ -230,10 +230,12 @@ public void run() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
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;
Expand All @@ -46,7 +48,7 @@ public long position() {

@Override
public long transfered() {
return transfered;
return transferred;
}

@Override
Expand All @@ -57,14 +59,14 @@ public long count() {
@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<ByteBuffer> messageBufferList = this.getMessageResult.getMessageBufferList();
for (ByteBuffer bb : messageBufferList) {
if (bb.hasRemaining()) {
transfered += target.write(bb);
return transfered;
transferred += target.write(bb);
return transferred;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
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;
Expand All @@ -40,7 +42,7 @@ public long position() {

@Override
public long transfered() {
return transfered;
return transferred;
}

@Override
Expand All @@ -51,11 +53,11 @@ public long count() {
@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
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;
Expand All @@ -46,7 +48,7 @@ public long position() {

@Override
public long transfered() {
return transfered;
return transferred;
}

@Override
Expand All @@ -57,14 +59,14 @@ public long count() {
@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<ByteBuffer> messageBufferList = this.queryMessageResult.getMessageBufferList();
for (ByteBuffer bb : messageBufferList) {
if (bb.hasRemaining()) {
transfered += target.write(bb);
return transfered;
transferred += target.write(bb);
return transferred;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected RemotingCommand msgCheck(final ChannelHandlerContext ctx,
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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand
// 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private RemotingCommand processRequest(final Channel channel, RemotingCommand re
}

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean open() {

return true;
} catch (SQLException e) {
log.info("Create JDBC Connection Exeption", e);
log.info("Create JDBC Connection Exception", e);
}
}

Expand Down

0 comments on commit eaba61f

Please sign in to comment.