提交 2645a401 编写于 作者: J jt

fix format

上级 1f5251a7
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......@@ -30,14 +30,14 @@ import org.slf4j.LoggerFactory;
*/
public class FlushPartialPolicy implements Policy {
private static final Logger logger = LoggerFactory.getLogger(FlushPartialPolicy.class);
private static final Logger LOGGER = LoggerFactory.getLogger(FlushPartialPolicy.class);
private Thread workerThread;
private long sleepInterval = IoTDBDescriptor.getInstance().getConfig().smallFlushInterval;
@Override
public void execute() {
if (logger.isDebugEnabled()) {
logger.debug("Memory reaches {}, current memory size is {}, JVM memory is {}, flushing.",
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Memory reaches {}, current memory size is {}, JVM memory is {}, flushing.",
BasicMemController.getInstance().getCurrLevel(),
MemUtils.bytesCntToStr(BasicMemController.getInstance().getTotalUsage()),
MemUtils.bytesCntToStr(Runtime.getRuntime().totalMemory()
......@@ -50,7 +50,7 @@ public class FlushPartialPolicy implements Policy {
workerThread.start();
} else {
if (workerThread.isAlive()) {
logger.debug("Last flush is ongoing...");
LOGGER.debug("Last flush is ongoing...");
} else {
workerThread = createWorkerThread();
workerThread.start();
......@@ -64,7 +64,7 @@ public class FlushPartialPolicy implements Policy {
try {
Thread.sleep(sleepInterval);
} catch (InterruptedException e) {
logger.warn("Flush worker interrupted!", e);
LOGGER.warn("Flush worker interrupted!", e);
Thread.currentThread().interrupt();
}
}, ThreadName.FLUSH_PARTIAL_POLICY.getName());
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
public class JVMMemController extends BasicMemController {
private static Logger logger = LoggerFactory.getLogger(JVMMemController.class);
private static Logger LOGGER = LoggerFactory.getLogger(JVMMemController.class);
private JVMMemController(IoTDBConfig config) {
super(config);
......@@ -66,16 +66,16 @@ public class JVMMemController extends BasicMemController {
if (memUsage < warningThreshold) {
return UsageLevel.SAFE;
} else if (memUsage < dangerouseThreshold) {
if (logger.isDebugEnabled()) {
logger.debug("Warning Threshold : {} allocated to {}, total usage {}",
MemUtils.bytesCntToStr(usage),
user.getClass(), MemUtils.bytesCntToStr(memUsage));
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Warning Threshold : {} allocated to {}, total usage {}",
MemUtils.bytesCntToStr(usage),
user.getClass(), MemUtils.bytesCntToStr(memUsage));
}
return UsageLevel.WARNING;
} else {
if (logger.isWarnEnabled()) {
logger.warn("Memory request from {} is denied, memory usage : {}", user.getClass(),
MemUtils.bytesCntToStr(memUsage));
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Memory request from {} is denied, memory usage : {}", user.getClass(),
MemUtils.bytesCntToStr(memUsage));
}
return UsageLevel.DANGEROUS;
}
......@@ -83,9 +83,9 @@ public class JVMMemController extends BasicMemController {
@Override
public void reportFree(Object user, long freeSize) {
if (logger.isInfoEnabled()) {
logger.info("{} freed from {}, total usage {}", MemUtils.bytesCntToStr(freeSize),
user.getClass(), MemUtils.bytesCntToStr(getTotalUsage()));
if (LOGGER.isInfoEnabled()) {
LOGGER.info("{} freed from {}, total usage {}", MemUtils.bytesCntToStr(freeSize),
user.getClass(), MemUtils.bytesCntToStr(getTotalUsage()));
}
}
......@@ -95,6 +95,6 @@ public class JVMMemController extends BasicMemController {
}
private static final JVMMemController INSTANCE = new JVMMemController(
IoTDBDescriptor.getInstance().getConfig());
IoTDBDescriptor.getInstance().getConfig());
}
}
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
*/
public class RecordMemController extends BasicMemController {
private static Logger logger = LoggerFactory.getLogger(RecordMemController.class);
private static Logger LOGGER = LoggerFactory.getLogger(RecordMemController.class);
// the key is the reference of the memory user, while the value is its memory usage in byte
private Map<Object, Long> memMap;
......@@ -115,27 +115,27 @@ public class RecordMemController extends BasicMemController {
}
private void logDangerous(long newTotUsage, Object user) {
if (logger.isWarnEnabled()) {
logger.warn("Memory request from {} is denied, memory usage : {}", user.getClass(),
MemUtils.bytesCntToStr(newTotUsage));
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Memory request from {} is denied, memory usage : {}", user.getClass(),
MemUtils.bytesCntToStr(newTotUsage));
}
}
private void logSafe(long newTotUsage, Object user, long usage, long oldUsage) {
if (logger.isDebugEnabled()) {
logger.debug("Safe Threshold : {} allocated to {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(usage), user.getClass(),
MemUtils.bytesCntToStr(oldUsage + usage),
MemUtils.bytesCntToStr(newTotUsage));
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Safe Threshold : {} allocated to {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(usage), user.getClass(),
MemUtils.bytesCntToStr(oldUsage + usage),
MemUtils.bytesCntToStr(newTotUsage));
}
}
private void logWarn(long newTotUsage, Object user, long usage, long oldUsage) {
if (logger.isDebugEnabled()) {
logger.debug("Warning Threshold : {} allocated to {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(usage), user.getClass(),
MemUtils.bytesCntToStr(oldUsage + usage),
MemUtils.bytesCntToStr(newTotUsage));
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Warning Threshold : {} allocated to {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(usage), user.getClass(),
MemUtils.bytesCntToStr(oldUsage + usage),
MemUtils.bytesCntToStr(newTotUsage));
}
}
......@@ -146,10 +146,10 @@ public class RecordMemController extends BasicMemController {
public void reportFree(Object user, long freeSize) {
Long usage = memMap.get(user);
if (usage == null) {
logger.error("Unregistered memory usage from {}", user.getClass());
LOGGER.error("Unregistered memory usage from {}", user.getClass());
} else if (freeSize > usage) {
logger
.error("Request to free {} bytes while it only registered {} bytes", freeSize, usage);
LOGGER
.error("Request to free {} bytes while it only registered {} bytes", freeSize, usage);
totalMemUsed.addAndGet(-usage);
memMap.remove(user);
} else {
......@@ -159,11 +159,11 @@ public class RecordMemController extends BasicMemController {
} else {
memMap.remove(user);
}
if (logger.isInfoEnabled()) {
logger.info("{} freed from {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(freeSize),
user.getClass(), MemUtils.bytesCntToStr(usage - freeSize),
MemUtils.bytesCntToStr(newTotalMemUsage));
if (LOGGER.isInfoEnabled()) {
LOGGER.info("{} freed from {}, it is using {}, total usage {}",
MemUtils.bytesCntToStr(freeSize),
user.getClass(), MemUtils.bytesCntToStr(usage - freeSize),
MemUtils.bytesCntToStr(newTotalMemUsage));
}
}
}
......@@ -174,6 +174,6 @@ public class RecordMemController extends BasicMemController {
}
private static final RecordMemController INSTANCE = new RecordMemController(
IoTDBDescriptor.getInstance().getConfig());
IoTDBDescriptor.getInstance().getConfig());
}
}
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
public class MemTableFlushUtil {
private static final Logger logger = LoggerFactory.getLogger(MemTableFlushUtil.class);
private static final Logger LOGGER = LoggerFactory.getLogger(MemTableFlushUtil.class);
private static final int PAGE_SIZE_THRESHOLD = TSFileConfig.pageSizeInByte;
private MemTableFlushUtil(){
......@@ -74,7 +74,7 @@ public class MemTableFlushUtil {
.write(timeValuePair.getTimestamp(), timeValuePair.getValue().getBinary());
break;
default:
logger.error("don't support data type: {}", dataType);
LOGGER.error("don't support data type: {}", dataType);
break;
}
}
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......@@ -181,8 +181,8 @@ public class OverflowProcessor extends Processor {
memUage = memSize.addAndGet(memUage);
if (memUage > memThreshold) {
LOGGER.warn("The usage of memory {} in overflow processor {} reaches the threshold {}",
MemUtils.bytesCntToStr(memUage), getProcessorName(),
MemUtils.bytesCntToStr(memThreshold));
MemUtils.bytesCntToStr(memUage), getProcessorName(),
MemUtils.bytesCntToStr(memThreshold));
flush();
}
}
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......@@ -70,8 +70,8 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
/**
* constructor of ExclusiveWriteLogNode.
*
* @param identifier ExclusiveWriteLogNode identifier
* @param restoreFilePath restore file path
* @param identifier ExclusiveWriteLogNode identifier
* @param restoreFilePath restore file path
* @param processorStoreFilePath processor store file path
*/
public ExclusiveWriteLogNode(String identifier, String restoreFilePath,
......@@ -81,7 +81,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
new File(logDirectory).mkdirs();
recoverPerformer = new ExclusiveLogRecoverPerformer(restoreFilePath, processorStoreFilePath,
this);
this);
currentFileWriter = new LogWriter(logDirectory + File.separator + WAL_FILE_NAME);
}
......@@ -155,7 +155,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
logger.error("Log node {} renaming log file failed!", identifier);
} else {
logger.info("Log node {} renamed log file, file size is {}", identifier,
MemUtils.bytesCntToStr(newLogFile.length()));
MemUtils.bytesCntToStr(newLogFile.length()));
}
}
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
......@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册