com.sleepycat.je.Cursor.getDatabase()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中com.sleepycat.je.Cursor.getDatabase()方法的一些代码示例,展示了Cursor.getDatabase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cursor.getDatabase()方法的具体详情如下:
包路径:com.sleepycat.je.Cursor
类名称:Cursor
方法名:getDatabase

Cursor.getDatabase介绍

[英]Returns the Database handle associated with this Cursor.
[中]返回与此游标关联的数据库句柄。

代码示例

代码示例来源:origin: com.sleepycat/je

WeakHashMap cdbCursorsMap = (WeakHashMap) localCdbCursors.get();
if (cdbCursorsMap != null) {
  Database db = cursor.getDatabase();
  CdbCursors cdbCursors = (CdbCursors) cdbCursorsMap.get(db);
  if (cdbCursors != null) {

代码示例来源:origin: com.sleepycat/je

WeakHashMap cdbCursorsMap = (WeakHashMap) localCdbCursors.get();
if (cdbCursorsMap != null) {
  Database db = cursor.getDatabase();
  CdbCursors cdbCursors = (CdbCursors) cdbCursorsMap.get(db);
  if (cdbCursors != null) {

代码示例来源:origin: org.jsimpledb/jsimpledb-kv-bdb

@Override
public synchronized void remove() {
  if (BerkeleyKVTransaction.this.closed)
    throw new StaleTransactionException(BerkeleyKVTransaction.this);
  if (this.removeKey == null)
    throw new IllegalStateException();
  try {
    final OperationStatus status = this.canRemoveWithCursor ? this.cursor.delete() :
     this.cursor.getDatabase().delete(BerkeleyKVTransaction.this.tx, new DatabaseEntry(this.removeKey));
    switch (status) {
    case SUCCESS:
    case KEYEMPTY:
      break;
    default:
      throw BerkeleyKVTransaction.this.weirdStatus(status, "delete");
    }
  } catch (DatabaseException e) {
    throw BerkeleyKVTransaction.this.wrapException(e);
  }
  this.removeKey = null;
}

代码示例来源:origin: io.permazen/permazen-kv-bdb

@Override
public synchronized void remove() {
  if (BerkeleyKVTransaction.this.closed)
    throw new StaleTransactionException(BerkeleyKVTransaction.this);
  if (this.removeKey == null)
    throw new IllegalStateException();
  try {
    final OperationStatus status = this.canRemoveWithCursor ? this.cursor.delete() :
     this.cursor.getDatabase().delete(BerkeleyKVTransaction.this.tx, new DatabaseEntry(this.removeKey));
    switch (status) {
    case SUCCESS:
    case KEYEMPTY:
      break;
    default:
      throw BerkeleyKVTransaction.this.weirdStatus(status, "delete");
    }
  } catch (DatabaseException e) {
    throw BerkeleyKVTransaction.this.wrapException(e);
  }
  this.removeKey = null;
}

代码示例来源:origin: com.sleepycat/je

private static HashSet<Record> getDiffArea(Cursor cursor,
                      byte[] beginKey,
                      byte[] beginData,
                      long diffSize)
  throws Exception {
  HashSet<Record> records = new HashSet<Record>();
  LogManager logManager = DbInternal.getNonNullEnvImpl
    (cursor.getDatabase().getEnvironment()).getLogManager();
  DatabaseEntry key = new DatabaseEntry(beginKey);
  DatabaseEntry data = new DatabaseEntry(beginData);
  boolean scanToEnd = (diffSize == DATABASE_END ? true : false);
  long count = 1;
  for (OperationStatus status =
     cursor.getSearchBoth(key, data, LockMode.DEFAULT);
     status == OperationStatus.SUCCESS;
     status = cursor.getNext(key, data, LockMode.DEFAULT)) {
    if (!scanToEnd && count > diffSize) {
      break;
    }
    records.add(new Record(key.getData(), data.getData(),
                getVLSN(cursor, logManager)));
    count++;
  }
  return records;
}

代码示例来源:origin: com.sleepycat/je

false /*verifyPrimary*/,
secCursors[0].getCursorImpl().getLocker(),
secCursors[0].getDatabase(), null)) {

相关文章