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

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

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

Cursor.setCacheMode介绍

[英]Sets the CacheMode default used for subsequent operations performed using this cursor. This method may be used to override the defaults specified using DatabaseConfig#setCacheMode and EnvironmentConfig#setCacheMode. Note that the default is always overridden by a non-null cache mode that is specified via ReadOptions or WriteOptions.
[中]设置用于使用此光标执行的后续操作的CacheMode默认值。此方法可用于覆盖使用DatabaseConfig#setCacheMode和EnvironmentConfig#setCacheMode指定的默认值。请注意,默认值始终由通过ReadOptions或WriteOptions指定的非空缓存模式覆盖。

代码示例

代码示例来源:origin: voldemort/voldemort

@Override
public ClosableIterator<ByteArray> keys() {
  try {
    Cursor cursor = getBdbDatabase().openCursor(null, null);
    // evict data brought in by the cursor walk right away
    if(this.minimizeScanImpact)
      cursor.setCacheMode(CacheMode.EVICT_BIN);
    return new BdbKeysIterator(cursor, this);
  } catch(DatabaseException e) {
    this.bdbEnvironmentStats.reportException(e);
    logger.error(e);
    throw new PersistenceFailureException(e);
  }
}

代码示例来源:origin: voldemort/voldemort

@Override
public ClosableIterator<Pair<ByteArray, Versioned<byte[]>>> entries(int partition) {
  try {
    Cursor cursor = getBdbDatabase().openCursor(null, null);
    // evict data brought in by the cursor walk right away
    if(this.minimizeScanImpact)
      cursor.setCacheMode(CacheMode.EVICT_BIN);
    return new BdbPartitionEntriesIterator(cursor, partition, this);
  } catch(DatabaseException e) {
    this.bdbEnvironmentStats.reportException(e);
    logger.error(e);
    throw new PersistenceFailureException(e);
  }
}

代码示例来源:origin: voldemort/voldemort

@Override
public ClosableIterator<Pair<ByteArray, Versioned<byte[]>>> entries() {
  try {
    Cursor cursor = getBdbDatabase().openCursor(null, null);
    // evict data brought in by the cursor walk right away
    if(this.minimizeScanImpact)
      cursor.setCacheMode(CacheMode.EVICT_BIN);
    return new BdbEntriesIterator(cursor, this);
  } catch(DatabaseException e) {
    this.bdbEnvironmentStats.reportException(e);
    logger.error(e);
    throw new PersistenceFailureException(e);
  }
}

代码示例来源:origin: voldemort/voldemort

@Override
public ClosableIterator<ByteArray> keys(int partition) {
  try {
    Cursor cursor = getBdbDatabase().openCursor(null, null);
    // evict data brought in by the cursor walk right away
    if(this.minimizeScanImpact)
      cursor.setCacheMode(CacheMode.EVICT_BIN);
    return new BdbPartitionKeysIterator(cursor, partition, this);
  } catch(DatabaseException e) {
    this.bdbEnvironmentStats.reportException(e);
    logger.error(e);
    throw new PersistenceFailureException(e);
  }
}

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

public void setCacheMode(CacheMode cacheMode) {
  cursor.getCursor().setCacheMode(cacheMode);
}
/* <!-- end JE only --> */

代码示例来源:origin: dnmilne/wikipediaminer

/**
 * Creates an iterator that will cycle through all entries the given WDatabase.
 * 
 * @param database an active (connected) WDatabase.
 */
public WIterator(WDatabase<K,V> database) {
  
  this.db = database ;
  cursor = db.getDatabase(true).openCursor(null, null) ;
  cursor.setCacheMode(CacheMode.UNCHANGED) ;
  queueNext() ;    
}

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

cursor.setCacheMode(CacheMode.UNCHANGED);

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

setCacheMode(null);

相关文章