本文整理匯總了Java中com.sleepycat.je.Database.getDatabaseName方法的典型用法代碼示例。如果您正苦於以下問題:Java Database.getDatabaseName方法的具體用法?Java Database.getDatabaseName怎麽用?Java Database.getDatabaseName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sleepycat.je.Database
的用法示例。
在下文中一共展示了Database.getDatabaseName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: BdbPersistentQueue
import com.sleepycat.je.Database; //導入方法依賴的package包/類
/**
* 構造函數,傳入BDB數據庫
*
* @param db
* @param valueClass
* @param classCatalog
*/
public BdbPersistentQueue(Database db,Class<E> valueClass,StoredClassCatalog classCatalog){
this.queueDb=db;
this.dbName=db.getDatabaseName();
headIndex=new AtomicLong(0);
tailIndex=new AtomicLong(0);
bindDatabase(queueDb,valueClass,classCatalog);
}
示例2: BdbPendingQueue
import com.sleepycat.je.Database; //導入方法依賴的package包/類
/**
* 構造函數,傳入BDB數據庫
*
* @param db
* @param valueClass
* @param classCatalog
*/
public BdbPendingQueue(Database db,Class<E> valueClass,StoredClassCatalog classCatalog){
this.queueDb=db;
this.dbName=db.getDatabaseName();
bindDatabase(queueDb,valueClass,classCatalog);
if(!queueMap.isEmpty()){
System.out.println("BdbPendingQueue 已有數據,firstKey:"+queueMap.firstKey()+" lastKey:"+queueMap.lastKey());
headIndex=new AtomicLong(queueMap.firstKey());
tailIndex=new AtomicLong(queueMap.lastKey()+1);
}else{
headIndex=new AtomicLong(0);
tailIndex=new AtomicLong(0);
}
}
示例3: diff
import com.sleepycat.je.Database; //導入方法依賴的package包/類
/**
* A mechanism for efficiently comparing two quiescent databases.
*
* @param db1 a valid, open Database handle
* @param db2 a valid, open Database handle
* @return true if the db1 and db2 are identical
* @throws Exception
*/
public boolean diff(Database db1, Database db2)
throws Exception {
BlockBag bag = createBlockBag(db2);
final boolean ret = diff(db1, bag);
if (cfg.getVerbose()) {
final String db1Name = db1.getDatabaseName();
final String db2Name = db2.getDatabaseName();
final boolean namesMatch = db1Name.equals(db2Name);
if (ret) {
if (namesMatch) {
output("No differences in " + db1Name);
} else {
output(db1Name + " matches " + db2Name);
}
} else {
if (namesMatch) {
output("Differences in " + db1Name);
} else {
output(db1Name + " does not match " + db2Name);
}
}
}
/* Do the analysis for these two databases. */
if (cfg.getDiffAnalysis() && tracker.getDiffRegions().size() != 0) {
DiffRecordAnalyzer.doAnalysis(db1, db2, tracker, cfg.getVerbose());
}
return ret;
}