提交 71429fde authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 23b43e80
......@@ -19,9 +19,9 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul><li>File systems with a maximum file size (for example FAT) are now supported using
the file prefix 'split:'. In this case the files are split in parts of 1 GB.
Example URL: jdbc:h2:split:~/db/test. If you want to split into parts of 1 MB, use
jdbc:h2:split:20:~/db/test (the part size is 1 << x, the default is 30 meaning 1 GB).
the file prefix 'split:'. In this case the files are split in parts of 1 GB.
Example URL: jdbc:h2:split:~/db/test. If you want to split into parts of 1 MB, use
jdbc:h2:split:20:~/db/test (the part size is 1 &lt;&lt; x, the default is 30 meaning 1 GB).
</li><li>The database now tries to detect if the classloader or virtual machine has
almost shut down by checking if static final variables are set to null.
This should help reduce exceptions when stopping the web application.
......
......@@ -540,7 +540,7 @@ public class SysProperties {
/**
* System property <code>h2.splitFileSizeShift</code> (default: 30).<br />
* The maximum file size of a split file is 1L << x.
* The maximum file size of a split file is 1L &lt;&lt; x.
*/
public static final long SPLIT_FILE_SIZE_SHIFT = getIntSetting("h2.splitFileSizeShift", 20);
......
......@@ -473,7 +473,14 @@ public class FullText implements Trigger, CloseListener {
return "'" + ByteUtils.convertBytesToString(data) + "'";
}
static String asString(Object data, int type) throws SQLException {
/**
* Convert the object to a string.
*
* @param data the object
* @param type the SQL type
* @return the string
*/
protected static String asString(Object data, int type) throws SQLException {
if (data == null) {
return "NULL";
}
......
......@@ -120,11 +120,19 @@ class FullTextSettings {
this.prepSelectRowById = prepSelectRowById;
}
/**
* Remove all indexes from the settings.
*/
void removeAllIndexes() {
indexes.clear();
}
public void removeIndexInfo(IndexInfo index) {
/**
* Remove an index from the settings.
*
* @param index the index to remove
*/
void removeIndexInfo(IndexInfo index) {
indexes.remove(ObjectUtils.getLong(index.id));
}
......
......@@ -21,10 +21,9 @@ import org.h2.message.Message;
*/
public class FileSystemSplit extends FileSystem {
static final String PART_SUFFIX = ".part";
private static final String PART_SUFFIX = ".part";
private static final FileSystemSplit INSTANCE = new FileSystemSplit();
long defaultMaxSize = 1L << SysProperties.SPLIT_FILE_SIZE_SHIFT;
private long defaultMaxSize = 1L << SysProperties.SPLIT_FILE_SIZE_SHIFT;
public static FileSystemSplit getInstance() {
return INSTANCE;
......@@ -288,6 +287,13 @@ public class FileSystemSplit extends FileSystem {
return fileName;
}
/**
* Get the file name of a part file.
*
* @param fileName the file name
* @param id the part id
* @return the file name including the part id
*/
static String getFileName(String fileName, int id) {
if (id > 0) {
fileName += "." + id + PART_SUFFIX;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论