Skip to content

Commit

Permalink
[ROCKETMQ-9] Clean up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
WillemJiang committed Dec 27, 2016
1 parent d1fa869 commit e5892e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -484,10 +484,10 @@ public MappedFile findMappedFileByOffset(final long offset, final boolean return
try {
return this.mappedFiles.get(index);
} catch (Exception e) {
if (returnFirstOnNotFound)
if (returnFirstOnNotFound) {
return mappedFile;

LOG_ERROR.warn("findMappedFileByOffset failure. {}", UtilAll.currentStackTrace());
}
LOG_ERROR.warn("findMappedFileByOffset failure. ", e);
}
}
} catch (Exception e) {
Expand Down
Expand Up @@ -279,7 +279,7 @@ private IndexFile putKey(IndexFile indexFile, DispatchRequest msg, String idxKey
*
* @return {@link IndexFile} or null on failure.
*/
private IndexFile retryGetAndCreateIndexFile() {
public IndexFile retryGetAndCreateIndexFile() {
IndexFile indexFile = null;

for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) {
Expand All @@ -288,7 +288,7 @@ private IndexFile retryGetAndCreateIndexFile() {
break;

try {
log.error("Tried to create index file " + times + " times");
log.info("Tried to create index file " + times + " times");
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions rocketmq-store/src/test/resources/logback-test.xml
Expand Up @@ -20,6 +20,7 @@
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
<charset class="java.nio.charset.Charset">UTF-8</charset>
</encoder>
</appender>

Expand Down

0 comments on commit e5892e1

Please sign in to comment.