提交 9b0d037d 编写于 作者: V vongosling

Merge branch 'develop' of github.com:apache/rocketmq into develop

...@@ -319,7 +319,7 @@ public class BrokerController { ...@@ -319,7 +319,7 @@ public class BrokerController {
this.registerProcessor(); this.registerProcessor();
final long initialDelay = UtilAll.computNextMorningTimeMillis() - System.currentTimeMillis(); final long initialDelay = UtilAll.computeNextMorningTimeMillis() - System.currentTimeMillis();
final long period = 1000 * 60 * 60 * 24; final long period = 1000 * 60 * 60 * 24;
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package org.apache.rocketmq.broker.filter; package org.apache.rocketmq.broker.filter;
import org.apache.rocketmq.common.BrokerConfig; import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.UtilAll;
import org.apache.rocketmq.common.constant.LoggerName; import org.apache.rocketmq.common.constant.LoggerName;
import org.apache.rocketmq.logging.InternalLogger; import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory; import org.apache.rocketmq.logging.InternalLoggerFactory;
...@@ -98,10 +99,10 @@ public class CommitLogDispatcherCalcBitMap implements CommitLogDispatcher { ...@@ -98,10 +99,10 @@ public class CommitLogDispatcherCalcBitMap implements CommitLogDispatcher {
request.setBitMap(filterBitMap.bytes()); request.setBitMap(filterBitMap.bytes());
long eclipseTime = System.currentTimeMillis() - startTime; long elapsedTime = UtilAll.computeElapsedTimeMilliseconds(startTime);
// 1ms // 1ms
if (eclipseTime >= 1) { if (elapsedTime >= 1) {
log.warn("Spend {} ms to calc bit map, consumerNum={}, topic={}", eclipseTime, filterDatas.size(), request.getTopic()); log.warn("Spend {} ms to calc bit map, consumerNum={}, topic={}", elapsedTime, filterDatas.size(), request.getTopic());
} }
} catch (Throwable e) { } catch (Throwable e) {
log.error("Calc bit map error! topic={}, offset={}, queueId={}, {}", request.getTopic(), request.getCommitLogOffset(), request.getQueueId(), e); log.error("Calc bit map error! topic={}, offset={}, queueId={}, {}", request.getTopic(), request.getCommitLogOffset(), request.getQueueId(), e);
......
...@@ -78,8 +78,8 @@ public abstract class ServiceThread implements Runnable { ...@@ -78,8 +78,8 @@ public abstract class ServiceThread implements Runnable {
if (!this.thread.isDaemon()) { if (!this.thread.isDaemon()) {
this.thread.join(this.getJointime()); this.thread.join(this.getJointime());
} }
long eclipseTime = System.currentTimeMillis() - beginTime; long elapsedTime = System.currentTimeMillis() - beginTime;
log.info("join thread " + this.getServiceName() + " eclipse time(ms) " + eclipseTime + " " log.info("join thread " + this.getServiceName() + " elapsed time(ms) " + elapsedTime + " "
+ this.getJointime()); + this.getJointime());
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error("Interrupted", e); log.error("Interrupted", e);
......
...@@ -93,7 +93,7 @@ public class UtilAll { ...@@ -93,7 +93,7 @@ public class UtilAll {
return nf.format(offset); return nf.format(offset);
} }
public static long computeEclipseTimeMilliseconds(final long beginTime) { public static long computeElapsedTimeMilliseconds(final long beginTime) {
return System.currentTimeMillis() - beginTime; return System.currentTimeMillis() - beginTime;
} }
...@@ -124,7 +124,7 @@ public class UtilAll { ...@@ -124,7 +124,7 @@ public class UtilAll {
cal.get(Calendar.MILLISECOND)); cal.get(Calendar.MILLISECOND));
} }
public static long computNextMorningTimeMillis() { public static long computeNextMorningTimeMillis() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis()); cal.setTimeInMillis(System.currentTimeMillis());
cal.add(Calendar.DAY_OF_MONTH, 1); cal.add(Calendar.DAY_OF_MONTH, 1);
...@@ -136,7 +136,7 @@ public class UtilAll { ...@@ -136,7 +136,7 @@ public class UtilAll {
return cal.getTimeInMillis(); return cal.getTimeInMillis();
} }
public static long computNextMinutesTimeMillis() { public static long computeNextMinutesTimeMillis() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis()); cal.setTimeInMillis(System.currentTimeMillis());
cal.add(Calendar.DAY_OF_MONTH, 0); cal.add(Calendar.DAY_OF_MONTH, 0);
...@@ -148,7 +148,7 @@ public class UtilAll { ...@@ -148,7 +148,7 @@ public class UtilAll {
return cal.getTimeInMillis(); return cal.getTimeInMillis();
} }
public static long computNextHourTimeMillis() { public static long computeNextHourTimeMillis() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis()); cal.setTimeInMillis(System.currentTimeMillis());
cal.add(Calendar.DAY_OF_MONTH, 0); cal.add(Calendar.DAY_OF_MONTH, 0);
...@@ -160,7 +160,7 @@ public class UtilAll { ...@@ -160,7 +160,7 @@ public class UtilAll {
return cal.getTimeInMillis(); return cal.getTimeInMillis();
} }
public static long computNextHalfHourTimeMillis() { public static long computeNextHalfHourTimeMillis() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis()); cal.setTimeInMillis(System.currentTimeMillis());
cal.add(Calendar.DAY_OF_MONTH, 0); cal.add(Calendar.DAY_OF_MONTH, 0);
......
...@@ -51,7 +51,7 @@ public class MomentStatsItem { ...@@ -51,7 +51,7 @@ public class MomentStatsItem {
} catch (Throwable e) { } catch (Throwable e) {
} }
} }
}, Math.abs(UtilAll.computNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 5, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 5, TimeUnit.MILLISECONDS);
} }
public void printAtMinutes() { public void printAtMinutes() {
......
...@@ -58,7 +58,7 @@ public class MomentStatsItemSet { ...@@ -58,7 +58,7 @@ public class MomentStatsItemSet {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 5, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 5, TimeUnit.MILLISECONDS);
} }
private void printAtMinutes() { private void printAtMinutes() {
......
...@@ -127,7 +127,7 @@ public class StatsItem { ...@@ -127,7 +127,7 @@ public class StatsItem {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60, TimeUnit.MILLISECONDS);
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
...@@ -137,7 +137,7 @@ public class StatsItem { ...@@ -137,7 +137,7 @@ public class StatsItem {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextHourTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextHourTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60, TimeUnit.MILLISECONDS);
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
...@@ -147,7 +147,7 @@ public class StatsItem { ...@@ -147,7 +147,7 @@ public class StatsItem {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextMorningTimeMillis() - System.currentTimeMillis()) - 2000, 1000 * 60 * 60 * 24, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMorningTimeMillis() - System.currentTimeMillis()) - 2000, 1000 * 60 * 60 * 24, TimeUnit.MILLISECONDS);
} }
public void samplingInSeconds() { public void samplingInSeconds() {
......
...@@ -81,7 +81,7 @@ public class StatsItemSet { ...@@ -81,7 +81,7 @@ public class StatsItemSet {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMinutesTimeMillis() - System.currentTimeMillis()), 1000 * 60, TimeUnit.MILLISECONDS);
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
...@@ -91,7 +91,7 @@ public class StatsItemSet { ...@@ -91,7 +91,7 @@ public class StatsItemSet {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextHourTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextHourTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60, TimeUnit.MILLISECONDS);
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() { this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
...@@ -101,7 +101,7 @@ public class StatsItemSet { ...@@ -101,7 +101,7 @@ public class StatsItemSet {
} catch (Throwable ignored) { } catch (Throwable ignored) {
} }
} }
}, Math.abs(UtilAll.computNextMorningTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60 * 24, TimeUnit.MILLISECONDS); }, Math.abs(UtilAll.computeNextMorningTimeMillis() - System.currentTimeMillis()), 1000 * 60 * 60 * 24, TimeUnit.MILLISECONDS);
} }
private void samplingInSeconds() { private void samplingInSeconds() {
......
...@@ -103,8 +103,8 @@ public class QueryConsumeTimeSpanBodyTest { ...@@ -103,8 +103,8 @@ public class QueryConsumeTimeSpanBodyTest {
List<QueueTimeSpan> queueTimeSpans = new ArrayList<QueueTimeSpan>(); List<QueueTimeSpan> queueTimeSpans = new ArrayList<QueueTimeSpan>();
QueueTimeSpan queueTimeSpan = new QueueTimeSpan(); QueueTimeSpan queueTimeSpan = new QueueTimeSpan();
queueTimeSpan.setMinTimeStamp(System.currentTimeMillis()); queueTimeSpan.setMinTimeStamp(System.currentTimeMillis());
queueTimeSpan.setMaxTimeStamp(UtilAll.computNextHourTimeMillis()); queueTimeSpan.setMaxTimeStamp(UtilAll.computeNextHourTimeMillis());
queueTimeSpan.setConsumeTimeStamp(UtilAll.computNextMinutesTimeMillis()); queueTimeSpan.setConsumeTimeStamp(UtilAll.computeNextMinutesTimeMillis());
queueTimeSpan.setDelayTime(5000l); queueTimeSpan.setDelayTime(5000l);
MessageQueue messageQueue = new MessageQueue(UUID.randomUUID().toString(), UUID.randomUUID().toString(), new Random().nextInt()); MessageQueue messageQueue = new MessageQueue(UUID.randomUUID().toString(), UUID.randomUUID().toString(), new Random().nextInt());
queueTimeSpan.setMessageQueue(messageQueue); queueTimeSpan.setMessageQueue(messageQueue);
......
...@@ -62,8 +62,8 @@ public abstract class ServiceThread implements Runnable { ...@@ -62,8 +62,8 @@ public abstract class ServiceThread implements Runnable {
long beginTime = System.currentTimeMillis(); long beginTime = System.currentTimeMillis();
this.thread.join(this.getJointime()); this.thread.join(this.getJointime());
long eclipseTime = System.currentTimeMillis() - beginTime; long elapsedTime = System.currentTimeMillis() - beginTime;
log.info("join thread " + this.getServiceName() + " eclipse time(ms) " + eclipseTime + " " log.info("join thread " + this.getServiceName() + " elapsed time(ms) " + elapsedTime + " "
+ this.getJointime()); + this.getJointime());
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error("Interrupted", e); log.error("Interrupted", e);
......
...@@ -176,10 +176,10 @@ public class AllocateMappedFileService extends ServiceThread { ...@@ -176,10 +176,10 @@ public class AllocateMappedFileService extends ServiceThread {
mappedFile = new MappedFile(req.getFilePath(), req.getFileSize()); mappedFile = new MappedFile(req.getFilePath(), req.getFileSize());
} }
long eclipseTime = UtilAll.computeEclipseTimeMilliseconds(beginTime); long elapsedTime = UtilAll.computeElapsedTimeMilliseconds(beginTime);
if (eclipseTime > 10) { if (elapsedTime > 10) {
int queueSize = this.requestQueue.size(); int queueSize = this.requestQueue.size();
log.warn("create mappedFile spent time(ms) " + eclipseTime + " queue size " + queueSize log.warn("create mappedFile spent time(ms) " + elapsedTime + " queue size " + queueSize
+ " " + req.getFilePath() + " " + req.getFileSize()); + " " + req.getFilePath() + " " + req.getFileSize());
} }
......
...@@ -569,7 +569,7 @@ public class CommitLog { ...@@ -569,7 +569,7 @@ public class CommitLog {
} }
} }
long eclipseTimeInLock = 0; long elapsedTimeInLock = 0;
MappedFile unlockMappedFile = null; MappedFile unlockMappedFile = null;
MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile(); MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();
...@@ -619,14 +619,14 @@ public class CommitLog { ...@@ -619,14 +619,14 @@ public class CommitLog {
return new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result); return new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result);
} }
eclipseTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp; elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;
beginTimeInLock = 0; beginTimeInLock = 0;
} finally { } finally {
putMessageLock.unlock(); putMessageLock.unlock();
} }
if (eclipseTimeInLock > 500) { if (elapsedTimeInLock > 500) {
log.warn("[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", eclipseTimeInLock, msg.getBody().length, result); log.warn("[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", elapsedTimeInLock, msg.getBody().length, result);
} }
if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) { if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) {
...@@ -714,7 +714,7 @@ public class CommitLog { ...@@ -714,7 +714,7 @@ public class CommitLog {
return new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, null); return new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, null);
} }
long eclipseTimeInLock = 0; long elapsedTimeInLock = 0;
MappedFile unlockMappedFile = null; MappedFile unlockMappedFile = null;
MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile(); MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();
...@@ -769,14 +769,14 @@ public class CommitLog { ...@@ -769,14 +769,14 @@ public class CommitLog {
return new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result); return new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result);
} }
eclipseTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp; elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;
beginTimeInLock = 0; beginTimeInLock = 0;
} finally { } finally {
putMessageLock.unlock(); putMessageLock.unlock();
} }
if (eclipseTimeInLock > 500) { if (elapsedTimeInLock > 500) {
log.warn("[NOTIFYME]putMessages in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", eclipseTimeInLock, messageExtBatch.getBody().length, result); log.warn("[NOTIFYME]putMessages in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", elapsedTimeInLock, messageExtBatch.getBody().length, result);
} }
if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) { if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) {
......
...@@ -394,11 +394,11 @@ public class DefaultMessageStore implements MessageStore { ...@@ -394,11 +394,11 @@ public class DefaultMessageStore implements MessageStore {
long beginTime = this.getSystemClock().now(); long beginTime = this.getSystemClock().now();
PutMessageResult result = this.commitLog.putMessage(msg); PutMessageResult result = this.commitLog.putMessage(msg);
long eclipseTime = this.getSystemClock().now() - beginTime; long elapsedTime = this.getSystemClock().now() - beginTime;
if (eclipseTime > 500) { if (elapsedTime > 500) {
log.warn("putMessage not in lock eclipse time(ms)={}, bodyLength={}", eclipseTime, msg.getBody().length); log.warn("putMessage not in lock elapsed time(ms)={}, bodyLength={}", elapsedTime, msg.getBody().length);
} }
this.storeStatsService.setPutMessageEntireTimeMax(eclipseTime); this.storeStatsService.setPutMessageEntireTimeMax(elapsedTime);
if (null == result || !result.isOk()) { if (null == result || !result.isOk()) {
this.storeStatsService.getPutMessageFailedTimes().incrementAndGet(); this.storeStatsService.getPutMessageFailedTimes().incrementAndGet();
...@@ -450,11 +450,11 @@ public class DefaultMessageStore implements MessageStore { ...@@ -450,11 +450,11 @@ public class DefaultMessageStore implements MessageStore {
long beginTime = this.getSystemClock().now(); long beginTime = this.getSystemClock().now();
PutMessageResult result = this.commitLog.putMessages(messageExtBatch); PutMessageResult result = this.commitLog.putMessages(messageExtBatch);
long eclipseTime = this.getSystemClock().now() - beginTime; long elapsedTime = this.getSystemClock().now() - beginTime;
if (eclipseTime > 500) { if (elapsedTime > 500) {
log.warn("not in lock eclipse time(ms)={}, bodyLength={}", eclipseTime, messageExtBatch.getBody().length); log.warn("not in lock elapsed time(ms)={}, bodyLength={}", elapsedTime, messageExtBatch.getBody().length);
} }
this.storeStatsService.setPutMessageEntireTimeMax(eclipseTime); this.storeStatsService.setPutMessageEntireTimeMax(elapsedTime);
if (null == result || !result.isOk()) { if (null == result || !result.isOk()) {
this.storeStatsService.getPutMessageFailedTimes().incrementAndGet(); this.storeStatsService.getPutMessageFailedTimes().incrementAndGet();
...@@ -642,8 +642,8 @@ public class DefaultMessageStore implements MessageStore { ...@@ -642,8 +642,8 @@ public class DefaultMessageStore implements MessageStore {
} else { } else {
this.storeStatsService.getGetMessageTimesTotalMiss().incrementAndGet(); this.storeStatsService.getGetMessageTimesTotalMiss().incrementAndGet();
} }
long eclipseTime = this.getSystemClock().now() - beginTime; long elapsedTime = this.getSystemClock().now() - beginTime;
this.storeStatsService.setGetMessageEntireTimeMax(eclipseTime); this.storeStatsService.setGetMessageEntireTimeMax(elapsedTime);
getResult.setStatus(status); getResult.setStatus(status);
getResult.setNextBeginOffset(nextBeginOffset); getResult.setNextBeginOffset(nextBeginOffset);
......
...@@ -448,7 +448,7 @@ public class MappedFile extends ReferenceResource { ...@@ -448,7 +448,7 @@ public class MappedFile extends ReferenceResource {
log.info("delete file[REF:" + this.getRefCount() + "] " + this.fileName log.info("delete file[REF:" + this.getRefCount() + "] " + this.fileName
+ (result ? " OK, " : " Failed, ") + "W:" + this.getWrotePosition() + " M:" + (result ? " OK, " : " Failed, ") + "W:" + this.getWrotePosition() + " M:"
+ this.getFlushedPosition() + ", " + this.getFlushedPosition() + ", "
+ UtilAll.computeEclipseTimeMilliseconds(beginTime)); + UtilAll.computeElapsedTimeMilliseconds(beginTime));
} catch (Exception e) { } catch (Exception e) {
log.warn("close file channel " + this.fileName + " Failed. ", e); log.warn("close file channel " + this.fileName + " Failed. ", e);
} }
......
...@@ -411,7 +411,7 @@ public class DLedgerCommitLog extends CommitLog { ...@@ -411,7 +411,7 @@ public class DLedgerCommitLog extends CommitLog {
EncodeResult encodeResult; EncodeResult encodeResult;
putMessageLock.lock(); //spin or ReentrantLock ,depending on store config putMessageLock.lock(); //spin or ReentrantLock ,depending on store config
long eclipseTimeInLock; long elapsedTimeInLock;
long queueOffset; long queueOffset;
try { try {
beginTimeInDledgerLock = this.defaultMessageStore.getSystemClock().now(); beginTimeInDledgerLock = this.defaultMessageStore.getSystemClock().now();
...@@ -431,8 +431,8 @@ public class DLedgerCommitLog extends CommitLog { ...@@ -431,8 +431,8 @@ public class DLedgerCommitLog extends CommitLog {
long wroteOffset = dledgerFuture.getPos() + DLedgerEntry.BODY_OFFSET; long wroteOffset = dledgerFuture.getPos() + DLedgerEntry.BODY_OFFSET;
ByteBuffer buffer = ByteBuffer.allocate(MessageDecoder.MSG_ID_LENGTH); ByteBuffer buffer = ByteBuffer.allocate(MessageDecoder.MSG_ID_LENGTH);
String msgId = MessageDecoder.createMessageId(buffer, msg.getStoreHostBytes(), wroteOffset); String msgId = MessageDecoder.createMessageId(buffer, msg.getStoreHostBytes(), wroteOffset);
eclipseTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginTimeInDledgerLock; elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginTimeInDledgerLock;
appendResult = new AppendMessageResult(AppendMessageStatus.PUT_OK, wroteOffset, encodeResult.data.length, msgId, System.currentTimeMillis(), queueOffset, eclipseTimeInLock); appendResult = new AppendMessageResult(AppendMessageStatus.PUT_OK, wroteOffset, encodeResult.data.length, msgId, System.currentTimeMillis(), queueOffset, elapsedTimeInLock);
switch (tranType) { switch (tranType) {
case MessageSysFlag.TRANSACTION_PREPARED_TYPE: case MessageSysFlag.TRANSACTION_PREPARED_TYPE:
case MessageSysFlag.TRANSACTION_ROLLBACK_TYPE: case MessageSysFlag.TRANSACTION_ROLLBACK_TYPE:
...@@ -453,8 +453,8 @@ public class DLedgerCommitLog extends CommitLog { ...@@ -453,8 +453,8 @@ public class DLedgerCommitLog extends CommitLog {
putMessageLock.unlock(); putMessageLock.unlock();
} }
if (eclipseTimeInLock > 500) { if (elapsedTimeInLock > 500) {
log.warn("[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", eclipseTimeInLock, msg.getBody().length, appendResult); log.warn("[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}", elapsedTimeInLock, msg.getBody().length, appendResult);
} }
PutMessageStatus putMessageStatus = PutMessageStatus.UNKNOWN_ERROR; PutMessageStatus putMessageStatus = PutMessageStatus.UNKNOWN_ERROR;
......
...@@ -77,7 +77,7 @@ public class IndexFile { ...@@ -77,7 +77,7 @@ public class IndexFile {
this.indexHeader.updateByteBuffer(); this.indexHeader.updateByteBuffer();
this.mappedByteBuffer.force(); this.mappedByteBuffer.force();
this.mappedFile.release(); this.mappedFile.release();
log.info("flush index file eclipse time(ms) " + (System.currentTimeMillis() - beginTime)); log.info("flush index file elapsed time(ms) " + (System.currentTimeMillis() - beginTime));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册