本文整理了Java中com.sleepycat.je.Cursor.setCacheMode()
方法的一些代码示例,展示了Cursor.setCacheMode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cursor.setCacheMode()
方法的具体详情如下:
包路径:com.sleepycat.je.Cursor
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!