summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/Database.java
diff options
context:
space:
mode:
Diffstat (limited to 'lang/java/src/com/sleepycat/db/Database.java')
-rw-r--r--lang/java/src/com/sleepycat/db/Database.java54
1 files changed, 52 insertions, 2 deletions
diff --git a/lang/java/src/com/sleepycat/db/Database.java b/lang/java/src/com/sleepycat/db/Database.java
index c0060300..059b9cb2 100644
--- a/lang/java/src/com/sleepycat/db/Database.java
+++ b/lang/java/src/com/sleepycat/db/Database.java
@@ -1,7 +1,7 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 2002, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
@@ -365,6 +365,14 @@ it will be closed when the environment handle that owns the database handle is c
DbConstants.DB_TXN_NOSYNC : 0) : 0);
}
+ private java.io.File getBlobSubDir()
+ throws DatabaseException {
+ String blobDirStr = db.get_blob_sub_dir();
+ if (blobDirStr != null)
+ return (new java.io.File(blobDirStr));
+ return null;
+ }
+
/**
Return the database's underlying file name.
<p>
@@ -1311,6 +1319,28 @@ from the {@link com.sleepycat.db.Environment#beginCDSGroup Environment.beginCDSG
}
/**
+ Print database statistics to a specified output channel (see the
+ setMsgfile() method for more information), or passed to an application
+ callback function (see the setMsgcall() method for more information).
+ <p>
+ @param config
+ The statistics returned; if null, default statistics are returned.
+ <p>
+ @return
+ A non-zero error value on failure and 0 on success.
+ <p>
+ @throws DeadlockException if the operation was selected to resolve a
+ deadlock.
+ <p>
+ @throws DatabaseException if a failure occurs.
+ */
+ public int printStats(StatsConfig config)
+ throws DatabaseException {
+
+ return db.stat_print(StatsConfig.checkNull(config).getFlags());
+ }
+
+ /**
<p>
Remove the database specified by the file and database parameters.
<p>
@@ -1360,7 +1390,8 @@ The database to be removed.
DatabaseConfig config)
throws DatabaseException, java.io.FileNotFoundException {
- final Db db = DatabaseConfig.checkNull(config).createDatabase(null);
+ final Db db = DatabaseConfig.DEFAULT.createDatabase(null);
+ DatabaseConfig.checkNull(config).configureDatabase(db, DatabaseConfig.DEFAULT);
db.remove(fileName, databaseName, 0);
}
@@ -1637,7 +1668,26 @@ or failure.
throws DatabaseException, java.io.FileNotFoundException {
final Db db = DatabaseConfig.checkNull(dbConfig).createDatabase(null);
+ /* Configure db with dbConfig */
+ dbConfig.configureDatabase(db, DatabaseConfig.DEFAULT);
return db.verify(fileName, databaseName, dumpStream,
VerifyConfig.checkNull(verifyConfig).getFlags());
}
+
+ /**
+ Sets the path of a file to store statistical information.
+ <p>
+ @param file
+ The path of a file to store statistical information.
+ <p>
+ @throws DatabaseException if a failure occurs.
+ */
+ public void setMsgfile(java.io.File file) throws DatabaseException {
+ if (file != null) {
+ db.set_msgfile(file.toString());
+ }
+ else {
+ db.set_msgfile(null);
+ }
+ }
}