当前位置: 首页>>代码示例>>Java>>正文


Java Options.maxOpenFiles方法代码示例

本文整理汇总了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();
}
 
开发者ID:SuperMarcus,项目名称:LevelDBViewer,代码行数:19,代码来源:OpenLevelDBDialog.java

示例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);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:RollingLevelDB.java

示例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);
  }      
}
 
开发者ID:cityzendata,项目名称:warp10-platform,代码行数:15,代码来源:WarpRepair.java

示例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 );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:71,代码来源:LevelDBEntityStoreMixin.java


注:本文中的org.iq80.leveldb.Options.maxOpenFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。