提交 e5892e16 编写于 作者: W Willem Jiang

[ROCKETMQ-9] Clean up the code

上级 d1fa8694
...@@ -484,10 +484,10 @@ public class MappedFileQueue { ...@@ -484,10 +484,10 @@ public class MappedFileQueue {
try { try {
return this.mappedFiles.get(index); return this.mappedFiles.get(index);
} catch (Exception e) { } catch (Exception e) {
if (returnFirstOnNotFound) if (returnFirstOnNotFound) {
return mappedFile; return mappedFile;
}
LOG_ERROR.warn("findMappedFileByOffset failure. {}", UtilAll.currentStackTrace()); LOG_ERROR.warn("findMappedFileByOffset failure. ", e);
} }
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -279,7 +279,7 @@ public class IndexService { ...@@ -279,7 +279,7 @@ public class IndexService {
* *
* @return {@link IndexFile} or null on failure. * @return {@link IndexFile} or null on failure.
*/ */
private IndexFile retryGetAndCreateIndexFile() { public IndexFile retryGetAndCreateIndexFile() {
IndexFile indexFile = null; IndexFile indexFile = null;
for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) { for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) {
...@@ -288,7 +288,7 @@ public class IndexService { ...@@ -288,7 +288,7 @@ public class IndexService {
break; break;
try { try {
log.error("Tried to create index file " + times + " times"); log.info("Tried to create index file " + times + " times");
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
<charset class="java.nio.charset.Charset">UTF-8</charset>
</encoder> </encoder>
</appender> </appender>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册