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

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

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

Cursor.getNextDup介绍

[英]If the next key/data pair of the database is a duplicate data record for the current key/data pair, moves the cursor to the next key/data pair of the database and returns that pair.

Calling this method is equivalent to calling #get(DatabaseEntry,DatabaseEntry,Get,ReadOptions) with Get#NEXT_DUP.
[中]如果数据库的下一个密钥/数据对是当前密钥/数据对的重复数据记录,则将光标移动到数据库的下一个密钥/数据对并返回该对。
调用此方法相当于使用get#NEXT_DUP调用#get(DatabaseEntry、DatabaseEntry、get、ReadOptions)。

代码示例

代码示例来源:origin: opensourceBIM/BIMserver

@Override
public List<byte[]> getDuplicates(String tableName, byte[] keyBytes, DatabaseSession databaseSession) throws BimserverDatabaseException {
  DatabaseEntry key = new DatabaseEntry(keyBytes);
  DatabaseEntry value = new DatabaseEntry();
  try {
    TableWrapper tableWrapper = getTableWrapper(tableName);
    Cursor cursor = tableWrapper.getDatabase().openCursor(getTransaction(databaseSession, tableWrapper), getCursorConfig(tableWrapper));
    try {
      OperationStatus operationStatus = cursor.getSearchKey(key, value, LockMode.DEFAULT);
      List<byte[]> result = new ArrayList<byte[]>();
      while (operationStatus == OperationStatus.SUCCESS) {
        result.add(value.getData());
        operationStatus = cursor.getNextDup(key, value, LockMode.DEFAULT);
      }
      return result;
    } finally {
      cursor.close();
    }
  } catch (DatabaseException e) {
    LOGGER.error("", e);
  }
  return null;
}

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

@Override
protected boolean cursor_getNextDup() throws Exception {
  return cursor().getNextDup(mSearchKey, mData, mLockMode) == SUCCESS;
}

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

@Override
public int size() {
  Cursor c = berkeley.openSecondaryCursor(proxyObject, null, clazz, cc);
  DatabaseEntry theData = new DatabaseEntry();
  // TODO: this is a very slow but robust way to get the size
  int size = 0;
  OperationStatus retVal = c.getSearchKey(theKey, theData,
      LockMode.DEFAULT);
  if (retVal == OperationStatus.SUCCESS && c.count() > 0) {
    while (retVal == OperationStatus.SUCCESS) {
      retVal = c.getNextDup(theKey, theData, LockMode.DEFAULT);
      size++;
    }
  }
  berkeley.releaseCursor(proxyObject);
  return size;
}

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

retVal = cursor.getNextDup(theKey, theData,
    LockMode.DEFAULT);
if (retVal != OperationStatus.SUCCESS) {

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

retVal = cursor.getNextDup(theKey, theData,
    LockMode.DEFAULT);
if (retVal != OperationStatus.SUCCESS) {

代码示例来源:origin: HuygensING/timbuctoo

if (valueCheck == null) {
 if (direction == Iterate.FORWARDS) {
  iterator = dbCursor -> dbCursor.getNextDup(keyEntry, valueEntry, LockMode.DEFAULT);
 } else {
  iterator = dbCursor -> dbCursor.getPrevDup(keyEntry, valueEntry, LockMode.DEFAULT);
 if (direction == Iterate.FORWARDS) {
  iterator = dbCursor -> {
   final OperationStatus result = dbCursor.getNextDup(keyEntry, valueEntry, LockMode.DEFAULT);
   return result == OperationStatus.SUCCESS ? check.get() : result;
  };

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

set.set(o.getId());
if (cursor.count() > 1) {
  while (cursor.getNextDup(theKey, theData,
      LockMode.DEFAULT) == OperationStatus.SUCCESS) {
    o = BerkeleyConcept.deserialise(berkeley,

代码示例来源:origin: itisaid/Doris

status = cursor.getNextDup(keyEntry, valueEntry, LockMode.READ_UNCOMMITTED);
isDeleteSuccess = true;

相关文章