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

Formatting.

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