提交 320543a6 authored 作者: Thomas Mueller's avatar Thomas Mueller

Don't create a *.h2.db file when using the MVStore

上级 6e74c6eb
......@@ -469,9 +469,8 @@ This is work in progress. To try it out, append
to the database URL. In general, functionality and performance should be
similar than the current default storage engine (the page store).
There are a few features that have not been implemented yet or are not complete,
for example there is still a file named <code>.h2.db</code>,
and the <code>.lock.db</code> file is still used to lock a database
(long term, the plan is to no longer use those files).
for example the <code>.lock.db</code> file is still used to lock a database
(the plan is to no longer use this file by default).
</p>
<h2 id="differences">Similar Projects and Differences to Other Storage Engines</h2>
......
......@@ -72,7 +72,7 @@ public class BackupCommand extends Prepared {
backupPageStore(out, fn, db.getPageStore());
// synchronize on the database, to avoid concurrent temp file
// creation / deletion / backup
String base = FileUtils.getParent(fn);
String base = FileUtils.getParent(db.getName());
synchronized (db.getLobSyncObject()) {
String prefix = db.getDatabasePath();
String dir = FileUtils.getParent(prefix);
......@@ -103,6 +103,9 @@ public class BackupCommand extends Prepared {
}
private void backupPageStore(ZipOutputStream out, String fileName, PageStore store) throws IOException {
if (store == null) {
return;
}
Database db = session.getDatabase();
fileName = FileUtils.getName(fileName);
out.putNextEntry(new ZipEntry(fileName));
......
......@@ -64,6 +64,8 @@ public class Explain extends Prepared {
if (maxrows >= 0) {
String plan;
if (executeCommand) {
;
// TODO to the same for the MVStore
PageStore store = db.isPersistent() ? db.getPageStore() : null;
if (store != null) {
store.statisticsStart();
......
......@@ -467,7 +467,10 @@ public class Database implements DataHandler {
* @return true if one exists
*/
static boolean exists(String name) {
return FileUtils.exists(name + Constants.SUFFIX_PAGE_FILE);
if (FileUtils.exists(name + Constants.SUFFIX_PAGE_FILE)) {
return true;
}
return FileUtils.exists(name + Constants.SUFFIX_MV_FILE);
}
/**
......@@ -531,14 +534,19 @@ public class Database implements DataHandler {
String dataFileName = databaseName + ".data.db";
boolean existsData = FileUtils.exists(dataFileName);
String pageFileName = databaseName + Constants.SUFFIX_PAGE_FILE;
String mvFileName = databaseName + Constants.SUFFIX_MV_FILE;
boolean existsPage = FileUtils.exists(pageFileName);
if (existsData && !existsPage) {
boolean existsMv = FileUtils.exists(mvFileName);
if (existsData && (!existsPage && !existsMv)) {
throw DbException.get(ErrorCode.FILE_VERSION_ERROR_1,
"Old database: " + dataFileName + " - please convert the database to a SQL script and re-create it.");
}
if (existsPage && !FileUtils.canWrite(pageFileName)) {
readOnly = true;
}
if (existsMv && !FileUtils.canWrite(mvFileName)) {
readOnly = true;
}
if (readOnly) {
if (traceLevelFile >= TraceSystem.DEBUG) {
String traceFile = Utils.getProperty("java.io.tmpdir", ".") + "/" + "h2_" + System.currentTimeMillis();
......@@ -1837,9 +1845,11 @@ public class Database implements DataHandler {
mvStore.prepareCommit(session, transaction);
return;
}
if (pageStore != null) {
pageStore.flushLog();
pageStore.prepareCommit(session, transaction);
}
}
/**
* Commit the current transaction of the given session.
......@@ -2262,9 +2272,12 @@ public class Database implements DataHandler {
}
public PageStore getPageStore() {
if (dbSettings.mvStore && mvStore == null) {
if (dbSettings.mvStore) {
if (mvStore == null) {
mvStore = MVTableEngine.init(this);
}
return null;
}
if (pageStore == null) {
pageStore = new PageStore(this, databaseName + Constants.SUFFIX_PAGE_FILE, accessModeData, cacheSize);
if (pageSize != Constants.DEFAULT_PAGE_SIZE) {
......@@ -2520,12 +2533,18 @@ public class Database implements DataHandler {
this.logMode = log;
pageStore.setLogMode(log);
}
if (mvStore != null) {
this.logMode = log;
}
}
public int getLogMode() {
if (pageStore != null) {
return pageStore.getLogMode();
}
if (mvStore != null) {
return logMode;
}
return PageStore.LOG_MODE_OFF;
}
......
......@@ -20,6 +20,7 @@ import org.h2.engine.ConnectionInfo;
import org.h2.engine.Constants;
import org.h2.engine.Database;
import org.h2.engine.Session;
import org.h2.store.PageStore;
import org.h2.table.Table;
import org.h2.util.New;
......@@ -139,40 +140,83 @@ public class DatabaseInfo implements DatabaseInfoMBean {
@Override
public long getFileWriteCountTotal() {
return database.isPersistent() ? database.getPageStore().getWriteCountTotal() : 0L;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getWriteCountTotal();
}
// TODO remove this method when removing the page store
// (the MVStore doesn't support it)
return 0;
}
@Override
public long getFileWriteCount() {
return database.isPersistent() ? database.getPageStore().getWriteCount() : 0L;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getWriteCount();
}
return database.getMvStore().getStore().getFileStore().getReadCount();
}
@Override
public long getFileReadCount() {
return database.isPersistent() ? database.getPageStore().getReadCount() : 0L;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getReadCount();
}
return database.getMvStore().getStore().getFileStore().getReadCount();
}
@Override
public long getFileSize() {
return database.isPersistent() ?
(database.getPageStore().getPageCount() * database.getPageStore().getPageSize() / 1024) : 0;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getPageCount() * p.getPageSize() / 1024;
}
return database.getMvStore().getStore().getFileStore().size();
}
@Override
public int getCacheSizeMax() {
return database.isPersistent() ? database.getPageStore().getCache().getMaxMemory() : 0;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getCache().getMaxMemory();
}
return database.getMvStore().getStore().getCacheSize() * 1024;
}
@Override
public void setCacheSizeMax(int kb) {
if (database.isPersistent()) {
database.getPageStore().getCache().setMaxMemory(kb);
database.setCacheSize(kb);
}
}
@Override
public int getCacheSize() {
return database.isPersistent() ? database.getPageStore().getCache().getMemory() : 0;
if (!database.isPersistent()) {
return 0;
}
PageStore p = database.getPageStore();
if (p != null) {
return p.getCache().getMemory();
}
return database.getMvStore().getStore().getCacheSizeUsed() * 1024;
}
@Override
......
......@@ -1432,9 +1432,7 @@ public class MVStore {
"Negative position {0}", filePos);
}
p = Page.read(fileStore, map, pos, filePos, fileStore.size());
if (cache != null) {
cache.put(pos, p, p.getMemory());
}
cachePage(pos, p, p.getMemory());
}
return p;
}
......@@ -2013,6 +2011,43 @@ public class MVStore {
return unsavedPageCount;
}
/**
* Put the page in the cache.
*
* @param pos the page position
* @param page the page
* @param memory the memory used
*/
void cachePage(long pos, Page page, int memory) {
if (cache != null) {
cache.put(pos, page, memory);
}
}
/**
* Get the amount of memory used for caching, in MB.
*
* @return the amount of memory used for caching
*/
public int getCacheSizeUsed() {
if (cache == null) {
return 0;
}
return (int) (cache.getUsedMemory() / 1024 / 1024);
}
/**
* Get the maximum cache size, in MB.
*
* @return the cache size
*/
public int getCacheSize() {
if (cache == null) {
return 0;
}
return (int) (cache.getMaxMemory() / 1024 / 1024);
}
/**
* A background writer thread to automatically store changes from time to time.
*/
......
......@@ -819,7 +819,8 @@ public class Page {
valueType.write(buff, values[i]);
}
}
if (map.getStore().getCompress()) {
MVStore store = map.getStore();
if (store.getCompress()) {
Compressor compressor = map.getStore().getCompressor();
int expLen = buff.position() - compressStart;
byte[] exp = new byte[expLen];
......@@ -846,6 +847,7 @@ public class Page {
DataUtils.ERROR_INTERNAL, "Page already stored");
}
pos = DataUtils.getPagePos(chunkId, start, pageLength, type);
store.cachePage(pos, this, getMemory());
long max = DataUtils.getPageMaxLength(pos);
chunk.maxLength += max;
chunk.maxLengthLive += max;
......
......@@ -625,6 +625,7 @@ public class MVTable extends TableBase {
database.getLobStorage().removeAllForTable(getId());
database.lockMeta(session);
}
database.getMvStore().removeTable(this);
super.removeChildrenAndResources(session);
// go backwards because database.removeIndex will call table.removeIndex
while (indexes.size() > 1) {
......@@ -643,7 +644,6 @@ public class MVTable extends TableBase {
}
primaryIndex.remove(session);
database.removeMeta(session, getId());
database.getMvStore().removeTable(this);
primaryIndex = null;
close(session);
invalidate();
......
......@@ -570,7 +570,7 @@ public class Schema extends DbObjectBase {
}
data.schema = this;
if (data.tableEngine == null) {
if (database.getSettings().mvStore) {
if (database.getSettings().mvStore && database.isPersistent()) {
data.tableEngine = MVTableEngine.class.getName();
}
}
......
......@@ -135,8 +135,6 @@ public class TcpServerThread implements Runnable {
if (server.getIfExists()) {
ci.setProperty("IFEXISTS", "TRUE");
}
session = Engine.getInstance().createSession(ci);
transfer.setSession(session);
transfer.writeInt(SessionRemote.STATUS_OK);
transfer.writeInt(clientVersion);
transfer.flush();
......@@ -145,6 +143,8 @@ public class TcpServerThread implements Runnable {
ci.setFileEncryptionKey(transfer.readBytes());
}
}
session = Engine.getInstance().createSession(ci);
transfer.setSession(session);
server.addConnection(threadId, originalURL, ci.getUserName());
trace("Connected");
} catch (Throwable e) {
......
......@@ -68,7 +68,8 @@ public class RecoverTester implements Recorder {
if (op != Recorder.WRITE && op != Recorder.TRUNCATE) {
return;
}
if (!fileName.endsWith(Constants.SUFFIX_PAGE_FILE)) {
if (!fileName.endsWith(Constants.SUFFIX_PAGE_FILE) &&
!fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
return;
}
writeCount++;
......
......@@ -40,6 +40,8 @@ import org.h2.index.IndexType;
import org.h2.index.MetaIndex;
import org.h2.index.MultiVersionIndex;
import org.h2.message.DbException;
import org.h2.mvstore.FileStore;
import org.h2.mvstore.db.MVTableEngine.Store;
import org.h2.result.Row;
import org.h2.result.SearchRow;
import org.h2.result.SortOrder;
......@@ -919,6 +921,7 @@ public class MetaTable extends Table {
}
if (database.isPersistent()) {
PageStore store = database.getPageStore();
if (store != null) {
add(rows, "info.FILE_WRITE_TOTAL", "" + store.getWriteCountTotal());
add(rows, "info.FILE_WRITE", "" + store.getWriteCount());
add(rows, "info.FILE_READ", "" + store.getReadCount());
......@@ -927,6 +930,15 @@ public class MetaTable extends Table {
add(rows, "info.CACHE_MAX_SIZE", "" + store.getCache().getMaxMemory());
add(rows, "info.CACHE_SIZE", "" + store.getCache().getMemory());
}
Store mvStore = database.getMvStore();
if (mvStore != null) {
FileStore fs = mvStore.getStore().getFileStore();
add(rows, "info.FILE_WRITE", "" + fs.getWriteCount());
add(rows, "info.FILE_READ", "" + fs.getReadCount());
add(rows, "info.CACHE_MAX_SIZE", "" + mvStore.getStore().getCacheSize());
add(rows, "info.CACHE_SIZE", "" + mvStore.getStore().getCacheSizeUsed());
}
}
break;
}
case TYPE_INFO: {
......
......@@ -130,7 +130,9 @@ public class Backup extends Tool {
ZipOutputStream zipOut = new ZipOutputStream(fileOut);
String base = "";
for (String fileName : list) {
if (fileName.endsWith(Constants.SUFFIX_PAGE_FILE) || allFiles) {
if (allFiles ||
fileName.endsWith(Constants.SUFFIX_PAGE_FILE) ||
fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
base = FileUtils.getParent(fileName);
break;
}
......
......@@ -91,7 +91,6 @@ public class Recover extends Tool implements DataHandler {
private int pageSize;
private FileStore store;
private int[] parents;
private String mvFile;
private Stats stat;
......@@ -250,16 +249,15 @@ public class Recover extends Tool implements DataHandler {
}
for (String fileName : list) {
if (fileName.endsWith(Constants.SUFFIX_PAGE_FILE)) {
String mvFile = fileName.substring(0, fileName.length() -
Constants.SUFFIX_PAGE_FILE.length()) + Constants.SUFFIX_MV_FILE;
if (list.contains(mvFile)) {
this.mvFile = mvFile;
}
dumpPageStore(fileName);
} else if (fileName.endsWith(Constants.SUFFIX_LOB_FILE)) {
dumpLob(fileName, false);
} else if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
PrintWriter writer = getWriter(fileName, ".txt");
String f = fileName.substring(0, fileName.length() - Constants.SUFFIX_PAGE_FILE.length());
PrintWriter writer = getWriter(f + ".h2.db", ".sql");
dumpMVStoreFile(writer, fileName);
writer.close();
writer = getWriter(fileName, ".txt");
MVStoreTool.dump(fileName, writer);
writer.close();
}
......@@ -455,9 +453,6 @@ public class Recover extends Tool implements DataHandler {
schema.clear();
objectIdSet = New.hashSet();
dumpPageStore(writer, pageCount);
if (mvFile != null) {
dumpMVStoreFile(writer, mvFile);
}
writeSchema(writer);
try {
dumpPageLogStream(writer, logKey, logFirstTrunkPage, logFirstDataPage, pageCount);
......@@ -488,6 +483,11 @@ public class Recover extends Tool implements DataHandler {
private void dumpMVStoreFile(PrintWriter writer, String fileName) {
writer.println("-- mvstore");
writer.println("CREATE ALIAS IF NOT EXISTS READ_BLOB FOR \"" + this.getClass().getName() + ".readBlob\";");
writer.println("CREATE ALIAS IF NOT EXISTS READ_CLOB FOR \"" + this.getClass().getName() + ".readClob\";");
writer.println("CREATE ALIAS IF NOT EXISTS READ_BLOB_DB FOR \"" + this.getClass().getName() + ".readBlobDb\";");
writer.println("CREATE ALIAS IF NOT EXISTS READ_CLOB_DB FOR \"" + this.getClass().getName() + ".readClobDb\";");
resetSchema();
setDatabaseName(fileName.substring(0, fileName.length() - Constants.SUFFIX_MV_FILE.length()));
MVStore mv = new MVStore.Builder().fileName(fileName).readOnly().open();
TransactionStore store = new TransactionStore(mv);
......@@ -551,6 +551,7 @@ public class Recover extends Tool implements DataHandler {
}
}
}
writeSchema(writer);
} catch (Throwable e) {
writeError(writer, e);
} finally {
......
......@@ -124,6 +124,9 @@ public class Restore extends Tool {
if (fileName.endsWith(Constants.SUFFIX_PAGE_FILE)) {
return fileName.substring(0, fileName.length() - Constants.SUFFIX_PAGE_FILE.length());
}
if (fileName.endsWith(Constants.SUFFIX_MV_FILE)) {
return fileName.substring(0, fileName.length() - Constants.SUFFIX_MV_FILE.length());
}
return null;
}
......
......@@ -730,7 +730,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
// synth
new TestBtreeIndex().runTest(this);
new TestDiskFull().runTest(this);
new TestCrashAPI().runTest(this);
new TestFuzzOptimizations().runTest(this);
......
......@@ -15,6 +15,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import org.h2.api.DatabaseEventListener;
import org.h2.constant.ErrorCode;
import org.h2.engine.Constants;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.tools.Restore;
......@@ -63,17 +64,29 @@ public class TestOpenClose extends TestBase {
if (config.memory || config.reopen) {
return;
}
FileUtils.delete("split:" + getBaseDir() + "/openClose2.h2.db");
String fn = getBaseDir() + "/openClose2";
if (config.mvStore) {
fn += Constants.SUFFIX_MV_FILE;
} else {
fn += Constants.SUFFIX_PAGE_FILE;
}
FileUtils.delete("split:" + fn);
Connection conn;
conn = DriverManager.getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
String url = "jdbc:h2:split:18:" + getBaseDir() + "/openClose2";
url = getURL(url, true);
conn = DriverManager.getConnection(url);
conn.createStatement().execute("create table test(id int, name varchar) as select 1, space(1000000)");
conn.close();
FileChannel c = FileUtils.open(getBaseDir() + "/openClose2.h2.db.1.part", "rw");
FileChannel c = FileUtils.open(fn+".1.part", "rw");
c.position(c.size() * 2 - 1);
c.write(ByteBuffer.wrap(new byte[1]));
c.close();
assertThrows(ErrorCode.IO_EXCEPTION_2, this).getConnection("jdbc:h2:split:18:" + getBaseDir() + "/openClose2");
FileUtils.delete("split:" + getBaseDir() + "/openClose2.h2.db");
if (config.mvStore) {
assertThrows(ErrorCode.FILE_CORRUPTED_1, this).getConnection(url);
} else {
assertThrows(ErrorCode.IO_EXCEPTION_2, this).getConnection(url);
}
FileUtils.delete("split:" + fn);
}
private void testCloseDelay() throws Exception {
......
......@@ -160,6 +160,9 @@ public class TestTempTables extends TestBase {
if (config.memory) {
return;
}
if (config.mvStore) {
return;
}
deleteDb("tempTables");
Connection conn = getConnection("tempTables");
Statement stat = conn.createStatement();
......
......@@ -37,6 +37,7 @@ import javax.servlet.ServletContext;
import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties;
import org.h2.engine.Constants;
import org.h2.server.web.WebServlet;
import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
......@@ -178,10 +179,16 @@ public class TestWeb extends TestBase {
assertTrue(FileUtils.exists(getBaseDir() + "/backup.zip"));
result = client.get(url, "tools.do?tool=DeleteDbFiles&args=-dir," +
getBaseDir() + ",-db,web");
assertFalse(FileUtils.exists(getBaseDir() + "/web.h2.db"));
String fn = getBaseDir() + "/web";
if (config.mvStore) {
fn += Constants.SUFFIX_MV_FILE;
} else {
fn += Constants.SUFFIX_PAGE_FILE;
}
assertFalse(FileUtils.exists(fn));
result = client.get(url, "tools.do?tool=Restore&args=-dir," +
getBaseDir() + ",-db,web,-file," + getBaseDir() + "/backup.zip");
assertTrue(FileUtils.exists(getBaseDir() + "/web.h2.db"));
assertTrue(FileUtils.exists(fn));
FileUtils.delete(getBaseDir() + "/web.h2.sql");
FileUtils.delete(getBaseDir() + "/backup.zip");
result = client.get(url, "tools.do?tool=Recover&args=-dir," +
......@@ -192,7 +199,7 @@ public class TestWeb extends TestBase {
getBaseDir() + "/web.h2.sql,-url," + getURL("web", true) +
",-user," + getUser() + ",-password," + getPassword());
FileUtils.delete(getBaseDir() + "/web.h2.sql");
assertTrue(FileUtils.exists(getBaseDir() + "/web.h2.db"));
assertTrue(FileUtils.exists(fn));
deleteDb("web");
} finally {
server.shutdown();
......
......@@ -48,6 +48,7 @@ public class TestMVStore extends TestBase {
public void test() throws Exception {
FileUtils.deleteRecursive(getBaseDir(), true);
FileUtils.createDirectories(getBaseDir());
testCacheInfo();
testRollback();
testVersionsToKeep();
testRemoveMap();
......@@ -99,6 +100,29 @@ public class TestMVStore extends TestBase {
testLargerThan2G();
}
private void testCacheInfo() {
String fileName = getBaseDir() + "/testCloseMap.h3";
MVStore s = new MVStore.Builder().fileName(fileName).cacheSize(2).open();
assertEquals(2, s.getCacheSize());
MVMap<Integer, byte[]> map;
map = s.openMap("data");
byte[] data = new byte[100 * 1024];
for (int i = 0; i < 30; i++) {
map.put(i, data);
s.commit();
if (i < 10) {
assertEquals(0, s.getCacheSizeUsed());
} else if (i > 20) {
assertEquals(1, s.getCacheSizeUsed());
}
}
s.close();
s = new MVStore.Builder().open();
assertEquals(0, s.getCacheSize());
assertEquals(0, s.getCacheSizeUsed());
s.close();
}
private void testVersionsToKeep() throws Exception {
MVStore s = new MVStore.Builder().open();
MVMap<Integer, Integer> map;
......@@ -576,9 +600,11 @@ public class TestMVStore extends TestBase {
3406, 2590, 1924, 1440, 1102, 956, 918
};
for (int cacheSize = 0; cacheSize <= 6; cacheSize += 4) {
int cacheMB = 1 + 3 * cacheSize;
s = new MVStore.Builder().
fileName(fileName).
cacheSize(1 + 3 * cacheSize).open();
cacheSize(cacheMB).open();
assertEquals(cacheMB, s.getCacheSize());
map = s.openMap("test");
for (int i = 0; i < 1024; i += 128) {
for (int j = 0; j < i; j++) {
......
......@@ -534,7 +534,7 @@ public class TestMVTableEngine extends TestBase {
stat = conn.createStatement();
stat.execute("create table test(id int)");
conn.close();
FileUtils.setReadOnly(getBaseDir() + "/mvstore.h2.db");
FileUtils.setReadOnly(getBaseDir() + "/mvstore" + Constants.SUFFIX_MV_FILE);
conn = getConnection(dbName);
Database db = (Database) ((JdbcConnection) conn).getSession().getDataHandler();
assertTrue(db.getMvStore().getStore().getFileStore().isReadOnly());
......
......@@ -105,6 +105,9 @@ public class TestClearReferences extends TestBase {
if (!name.endsWith(".class")) {
return;
}
if (name.indexOf('$') >= 0) {
return;
}
String className = file.getAbsolutePath().replace('\\', '/');
className = className.substring(className.lastIndexOf("org/h2"));
String packageName = className.substring(0, className.lastIndexOf('/'));
......
......@@ -101,6 +101,8 @@ public class TestJmx extends TestBase {
conn.close();
conn = getConnection("jmx;jmx=true");
conn.close();
conn = getConnection("jmx;jmx=true");
name = new ObjectName("org.h2:name=JMX,*");
......@@ -110,12 +112,20 @@ public class TestJmx extends TestBase {
assertEquals("16384", mbeanServer.getAttribute(name, "CacheSizeMax").toString());
mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1));
if (config.mvStore) {
assertEquals("1024", mbeanServer.getAttribute(name, "CacheSizeMax").toString());
assertEquals("0", mbeanServer.getAttribute(name, "CacheSize").toString());
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileReadCount"));
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileWriteCount"));
assertEquals("0", mbeanServer.getAttribute(name, "FileWriteCountTotal").toString());
} else {
assertEquals("1", mbeanServer.getAttribute(name, "CacheSizeMax").toString());
assertTrue(0 < (Integer) mbeanServer.getAttribute(name, "CacheSize"));
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileSize"));
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileReadCount"));
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileWriteCount"));
assertTrue(0 < (Long) mbeanServer.getAttribute(name, "FileWriteCountTotal"));
}
mbeanServer.setAttribute(name, new Attribute("LogMode", 0));
assertEquals("0", mbeanServer.getAttribute(name, "LogMode").toString());
......
......@@ -247,8 +247,7 @@ public class H2Database {
* @return the page size
*/
public long getPageSize() {
PageStore store = session.getDatabase().getPageStore();
return store == null ? 0 : store.getPageSize();
return 0;
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论