本文整理汇总了Java中org.iq80.leveldb.Options.maxOpenFiles方法的典型用法代码示例。如果您正苦于以下问题:Java Options.maxOpenFiles方法的具体用法?Java Options.maxOpenFiles怎么用?Java Options.maxOpenFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.iq80.leveldb.Options
的用法示例。
在下文中一共展示了Options.maxOpenFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOK
import org.iq80.leveldb.Options; //导入方法依赖的package包/类
private void onOK() {
Options options = new Options();
options.createIfMissing(this.createBox.isSelected());
options.compressionType((CompressionType) this.compressType.getSelectedItem());
try{
options.maxOpenFiles(Integer.parseInt(this.maxOpenFiles.getValue().toString()));
}catch (NumberFormatException e){
options.maxOpenFiles(1000);
}
options.verifyChecksums(this.verifyChecksumsCheckBox.isSelected());
options.paranoidChecks(this.paranoidChecksCheckBox.isSelected());
this.viewer.setOptions(options);
dispose();
}
示例2: initRollingLevelDB
import org.iq80.leveldb.Options; //导入方法依赖的package包/类
private void initRollingLevelDB(Long dbStartTime,
Path rollingInstanceDBPath) {
if (rollingdbs.containsKey(dbStartTime)) {
return;
}
Options options = new Options();
options.createIfMissing(true);
options.cacheSize(conf.getLong(
YarnConfiguration.TIMELINE_SERVICE_LEVELDB_READ_CACHE_SIZE,
YarnConfiguration.DEFAULT_TIMELINE_SERVICE_LEVELDB_READ_CACHE_SIZE));
options.maxOpenFiles(conf.getInt(
YarnConfiguration.TIMELINE_SERVICE_LEVELDB_MAX_OPEN_FILES,
YarnConfiguration.DEFAULT_TIMELINE_SERVICE_LEVELDB_MAX_OPEN_FILES));
options.writeBufferSize(conf.getInt(
YarnConfiguration.TIMELINE_SERVICE_LEVELDB_WRITE_BUFFER_SIZE,
YarnConfiguration.DEFAULT_TIMELINE_SERVICE_LEVELDB_WRITE_BUFFER_SIZE));
LOG.info("Initializing rolling leveldb instance :" + rollingInstanceDBPath
+ " for start time: " + dbStartTime);
DB db = null;
try {
db = factory.open(
new File(rollingInstanceDBPath.toUri().getPath()), options);
rollingdbs.put(dbStartTime, db);
String dbName = fdf.format(dbStartTime);
LOG.info("Added rolling leveldb instance " + dbName + " to " + getName());
} catch (IOException ioe) {
LOG.warn("Failed to open rolling leveldb instance :"
+ new File(rollingInstanceDBPath.toUri().getPath()), ioe);
}
}
示例3: main
import org.iq80.leveldb.Options; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
String path = args[0];
Options options = new Options();
options.createIfMissing(false);
options.maxOpenFiles(200);
options.verifyChecksums(true);
options.paranoidChecks(true);
try {
JniDBFactory.factory.repair(new File(path), options);
} catch (UnsatisfiedLinkError ule) {
Iq80DBFactory.factory.repair(new File(path), options);
}
}
示例4: activateService
import org.iq80.leveldb.Options; //导入方法依赖的package包/类
@Override
public void activateService()
throws Exception
{
charset = Charset.forName( "UTF-8" );
configuration.refresh();
LevelDBEntityStoreConfiguration config = configuration.get();
// Choose flavour
String flavour = config.flavour().get();
DBFactory factory;
if( "jni".equalsIgnoreCase( flavour ) )
{
factory = newJniDBFactory();
}
else if( "java".equalsIgnoreCase( flavour ) )
{
factory = newJavaDBFactory();
}
else
{
factory = newDBFactory();
}
// Apply configuration
Options options = new Options();
options.createIfMissing( true );
if( config.blockRestartInterval().get() != null )
{
options.blockRestartInterval( config.blockRestartInterval().get() );
}
if( config.blockSize().get() != null )
{
options.blockSize( config.blockSize().get() );
}
if( config.cacheSize().get() != null )
{
options.cacheSize( config.cacheSize().get() );
}
if( config.compression().get() != null )
{
options.compressionType( config.compression().get()
? CompressionType.SNAPPY
: CompressionType.NONE );
}
if( config.maxOpenFiles().get() != null )
{
options.maxOpenFiles( config.maxOpenFiles().get() );
}
if( config.paranoidChecks().get() != null )
{
options.paranoidChecks( config.paranoidChecks().get() );
}
if( config.verifyChecksums().get() != null )
{
options.verifyChecksums( config.verifyChecksums().get() );
}
if( config.writeBufferSize().get() != null )
{
options.writeBufferSize( config.writeBufferSize().get() );
}
if( config.errorIfExists().get() != null )
{
options.errorIfExists( config.errorIfExists().get() );
}
// Open/Create the database
File dbFile = new File( fileConfig.dataDirectory(), descriptor.identity().toString() );
db = factory.open( dbFile, options );
}