提交 1f7ed15f authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting.

上级 9abf5e1d
......@@ -250,7 +250,8 @@ public class SysProperties {
Utils.getProperty("h2.maxReconnect", 3);
/**
* System property <code>h2.maxMemoryRows</code> (default: 40000 per GB of available RAM).<br />
* System property <code>h2.maxMemoryRows</code>
* (default: 40000 per GB of available RAM).<br />
* The default maximum number of rows to be kept in memory in a result set.
*/
public static final int MAX_MEMORY_ROWS =
......@@ -536,8 +537,10 @@ public class SysProperties {
}
/**
* This method attempts to auto-scale some of our properties to take advantage of more powerful machines out of the box.
* We assume that our default properties are set correctly for approx. 1G of memory, and scale them up if we have more.
* This method attempts to auto-scale some of our properties to take
* advantage of more powerful machines out of the box. We assume that our
* default properties are set correctly for approx. 1G of memory, and scale
* them up if we have more.
*/
private static int getAutoScaledForMemoryProperty(String key, int defaultValue) {
String s = Utils.getProperty(key, null);
......
......@@ -1371,7 +1371,8 @@ public class MVStore {
* Chunks are overwritten irrespective of the current retention time. Before
* overwriting chunks and before resizing the file, syncFile() is called.
*
* @param targetFillRate do nothing if the file store fill rate is higher than this
* @param targetFillRate do nothing if the file store fill rate is higher
* than this
* @param moveSize the number of bytes to move
* @return if anything was written
*/
......
......@@ -363,6 +363,7 @@ public class MVStoreTool {
*
* @param sourceFileName the name of the source store
* @param targetFileName the name of the target store
* @param compress whether to compress the data
*/
public static void compact(String sourceFileName, String targetFileName, boolean compress) {
MVStore source = new MVStore.Builder().
......
......@@ -124,8 +124,8 @@ public abstract class FilePath {
* Rename a file if this is allowed.
*
* @param newName the new fully qualified file name
* @param atomicReplace whether the move should be atomic, and the target file
* should be replaced if it exists and replacing is possible
* @param atomicReplace whether the move should be atomic, and the target
* file should be replaced if it exists and replacing is possible
*/
public abstract void moveTo(FilePath newName, boolean atomicReplace);
......
......@@ -90,7 +90,8 @@ public class FilePathDisk extends FilePath {
name + " (not found)",
newName.name);
}
// Java 7: use java.nio.file.Files.move(Path source, Path target, CopyOption... options)
// Java 7: use java.nio.file.Files.move(Path source, Path target,
// CopyOption... options)
// with CopyOptions "REPLACE_EXISTING" and "ATOMIC_MOVE".
if (atomicReplace) {
boolean ok = oldFile.renameTo(newFile);
......
......@@ -739,7 +739,8 @@ public class Utils {
/**
* Scale the value with the available memory. If 1 GB of RAM is available,
* the value is returned, if 2 GB are available, then twice the value, and so on.
* the value is returned, if 2 GB are available, then twice the value, and
* so on.
*
* @param value the value to scale
* @return the scaled value
......@@ -753,8 +754,10 @@ public class Utils {
try {
OperatingSystemMXBean mxBean = ManagementFactory
.getOperatingSystemMXBean();
// this method is only available on the class com.sun.management.OperatingSystemMXBean, which mxBean
// is an instance of under the Oracle JDK, but it is not present on Android and other JDK's
// this method is only available on the class
// com.sun.management.OperatingSystemMXBean, which mxBean
// is an instance of under the Oracle JDK, but it is not present on
// Android and other JDK's
Method method = Class.forName(
"com.sun.management.OperatingSystemMXBean").
getMethod("getTotalPhysicalMemorySize");
......
......@@ -92,7 +92,8 @@ public class TestMVStoreTool extends TestBase {
long size1 = FileUtils.size(fileName);
long size2 = FileUtils.size(fileName + ".new");
long size3 = FileUtils.size(fileName + ".new.compress");
assertTrue("size1: " + size1 + " size2: " + size2 + " size3: " + size3, size2 < size1 && size3 < size2);
assertTrue("size1: " + size1 + " size2: " + size2 + " size3: " + size3,
size2 < size1 && size3 < size2);
MVStoreTool.compact(fileName, false);
assertEquals(size2, FileUtils.size(fileName));
MVStoreTool.compact(fileName, true);
......
......@@ -761,3 +761,4 @@ reinstated uninteresting dead defendant doctrines beat factual fair suspended
exploit noise ongoing disclaimers shrinks remedy party desirable timely construe
deque synchronizers affero kevent nikolaj hohmuth grajcar jens fogh hostnames
operate resized jni yjp ownable starvation reaper biased introduce epoll hangs
compaction aggressive powerful
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论