org.rocksdb.Options.setMaxWriteBufferNumber()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(160)

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

Options.setMaxWriteBufferNumber介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

public RocksDbCacheOperator(TopologyContext context, String cacheDir) {
  this.stormConf = context.getStormConf();
  this.maxFlushSize = ConfigExtension.getTransactionCacheBatchFlushSize(stormConf);
  Options rocksDbOpt = new Options();
  rocksDbOpt.setCreateMissingColumnFamilies(true).setCreateIfMissing(true);
  long bufferSize =
      ConfigExtension.getTransactionCacheBlockSize(stormConf) != null ? ConfigExtension.getTransactionCacheBlockSize(stormConf) : (1 * SizeUnit.GB);
  rocksDbOpt.setWriteBufferSize(bufferSize);
  int maxBufferNum = ConfigExtension.getTransactionMaxCacheBlockNum(stormConf) != null ? ConfigExtension.getTransactionMaxCacheBlockNum(stormConf) : 3;
  rocksDbOpt.setMaxWriteBufferNumber(maxBufferNum);
  // Config for log of RocksDb
  rocksDbOpt.setMaxLogFileSize(1073741824); // 1G
  rocksDbOpt.setKeepLogFileNum(1);
  rocksDbOpt.setInfoLogLevel(InfoLogLevel.WARN_LEVEL);
  
  try {
    Map<Object, Object> conf = new HashMap<Object, Object>();
    conf.put(ROCKSDB_ROOT_DIR, cacheDir);
    conf.put(ROCKSDB_RESET, true);
    initDir(conf);
    initDb(null, rocksDbOpt);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  kryo = new Kryo();
  output = new Output(200, 2000000000);
  input = new Input(1);
  LOG.info("Finished rocksDb cache init: maxFlushSize={}, bufferSize={}, maxBufferNum={}", maxFlushSize, bufferSize, maxBufferNum);
}

代码示例来源:origin: apache/kylin

public RocksDBLookupBuilder(TableDesc tableDesc, String[] keyColumns, String dbPath) {
  this.tableDesc = tableDesc;
  this.encoder = new RocksDBLookupRowEncoder(tableDesc, keyColumns);
  this.dbPath = dbPath;
  this.writeBatchSize = 500;
  this.options = new Options();
  options.setCreateIfMissing(true).setWriteBufferSize(8 * SizeUnit.KB).setMaxWriteBufferNumber(3)
      .setMaxBackgroundCompactions(5).setCompressionType(CompressionType.SNAPPY_COMPRESSION)
      .setCompactionStyle(CompactionStyle.UNIVERSAL);
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
protected void init() throws FailStoreException {
  try {
    options = new Options();
    options.setCreateIfMissing(true)
        .setWriteBufferSize(8 * SizeUnit.KB)
        .setMaxWriteBufferNumber(3)
        .setMaxBackgroundCompactions(10)
        .setCompressionType(CompressionType.SNAPPY_COMPRESSION)
        .setCompactionStyle(CompactionStyle.UNIVERSAL);
    Filter bloomFilter = new BloomFilter(10);
    BlockBasedTableConfig tableConfig = new BlockBasedTableConfig();
    tableConfig.setBlockCacheSize(64 * SizeUnit.KB)
        .setFilter(bloomFilter)
        .setCacheNumShardBits(6)
        .setBlockSizeDeviation(5)
        .setBlockRestartInterval(10)
        .setCacheIndexAndFilterBlocks(true)
        .setHashIndexAllowCollision(false)
        .setBlockCacheCompressedSize(64 * SizeUnit.KB)
        .setBlockCacheCompressedNumShardBits(10);
    options.setTableFormatConfig(tableConfig);
  } catch (Exception e) {
    throw new FailStoreException(e);
  }
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
protected void init() throws FailStoreException {
  try {
    options = new Options();
    options.setCreateIfMissing(true)
        .setWriteBufferSize(8 * SizeUnit.KB)
        .setMaxWriteBufferNumber(3)
        .setMaxBackgroundCompactions(10)
        .setCompressionType(CompressionType.SNAPPY_COMPRESSION)
        .setCompactionStyle(CompactionStyle.UNIVERSAL);
    Filter bloomFilter = new BloomFilter(10);
    BlockBasedTableConfig tableConfig = new BlockBasedTableConfig();
    tableConfig.setBlockCacheSize(64 * SizeUnit.KB)
        .setFilter(bloomFilter)
        .setCacheNumShardBits(6)
        .setBlockSizeDeviation(5)
        .setBlockRestartInterval(10)
        .setCacheIndexAndFilterBlocks(true)
        .setHashIndexAllowCollision(false)
        .setBlockCacheCompressedSize(64 * SizeUnit.KB)
        .setBlockCacheCompressedNumShardBits(10);
    options.setTableFormatConfig(tableConfig);
  } catch (Exception e) {
    throw new FailStoreException(e);
  }
}

代码示例来源:origin: alibaba/jstorm

currentOptions.setMaxWriteBufferNumber(4);
currentOptions.setWriteBufferSize(64 * SizeUnit.MB);

代码示例来源:origin: org.rocksdb/rocksdbjni

@Override
public Options setMaxWriteBufferNumber(final int maxWriteBufferNumber) {
 assert(isOwningHandle());
 setMaxWriteBufferNumber(nativeHandle_, maxWriteBufferNumber);
 return this;
}

代码示例来源:origin: org.locationtech.geogig/geogig-core

.setMaxWriteBufferNumber(8)//
.setMaxBackgroundCompactions(2)//
.setMinWriteBufferNumberToMerge(4)//

代码示例来源:origin: jwplayer/southpaw

.setMaxBackgroundCompactions(maxBackgroundCompactions)
.setMaxBackgroundFlushes(maxBackgroundFlushes)
.setMaxWriteBufferNumber(maxWriteBufferNumber)
.setWalSizeLimitMB(0L)
.setWalTtlSeconds(0L);

代码示例来源:origin: homeaway/stream-registry

@Override
  public void setConfig(final String storeName, final Options options, final Map<String, Object> configs) {
    BlockBasedTableConfig tableConfig = new org.rocksdb.BlockBasedTableConfig();
    tableConfig.setBlockCacheSize(2 * 1024 * 1024L);
    tableConfig.setBlockSize(2 * 1024L);
    tableConfig.setCacheIndexAndFilterBlocks(true);
    options.setTableFormatConfig(tableConfig);
    options.setMaxWriteBufferNumber(2);
    options.optimizeFiltersForHits();
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

int maxBufferNum = ConfigExtension.getTransactionMaxCacheBlockNum(stormConf) != null ?
    ConfigExtension.getTransactionMaxCacheBlockNum(stormConf) : 3;
rocksDbOpt.setMaxWriteBufferNumber(maxBufferNum);

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

private Options createDatabaseOptions() {
  BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig()
      .setBlockSize(cacheBlockSizeKB * 1024L)
      .setBlockCacheSize(readCacheSizeMB * 1024L * 1024L)
      .setCacheIndexAndFilterBlocks(true);
  return new Options()
      .setCreateIfMissing(true)
      .setDbLogDir(Paths.get(this.dbDir, DB_LOG_DIR).toString())
      .setWalDir(Paths.get(this.dbDir, DB_WRITE_AHEAD_LOG_DIR).toString())
      .setWalTtlSeconds(0)
      .setWalSizeLimitMB(MAX_WRITE_AHEAD_LOG_SIZE_MB)
      .setWriteBufferSize(writeBufferSizeMB * 1024L * 1024L)
      .setMaxWriteBufferNumber(MAX_WRITE_BUFFER_NUMBER)
      .setMinWriteBufferNumberToMerge(MIN_WRITE_BUFFER_NUMBER_TO_MERGE)
      .setTableFormatConfig(tableFormatConfig)
      .setOptimizeFiltersForHits(true)
      .setUseDirectReads(true);
}

代码示例来源:origin: org.apache.kylin/kylin-core-dictionary

public RocksDBLookupBuilder(TableDesc tableDesc, String[] keyColumns, String dbPath) {
  this.tableDesc = tableDesc;
  this.encoder = new RocksDBLookupRowEncoder(tableDesc, keyColumns);
  this.dbPath = dbPath;
  this.writeBatchSize = 500;
  this.options = new Options();
  options.setCreateIfMissing(true).setWriteBufferSize(8 * SizeUnit.KB).setMaxWriteBufferNumber(3)
      .setMaxBackgroundCompactions(5).setCompressionType(CompressionType.SNAPPY_COMPRESSION)
      .setCompactionStyle(CompactionStyle.UNIVERSAL);
}

代码示例来源:origin: org.apache.kafka/kafka-streams

options.setCompressionType(COMPRESSION_TYPE);
options.setCompactionStyle(COMPACTION_STYLE);
options.setMaxWriteBufferNumber(MAX_WRITE_BUFFERS);
options.setCreateIfMissing(true);
options.setErrorIfExists(false);

代码示例来源:origin: apache/samza

options.setMaxWriteBufferNumber(storeConfig.getInt(ROCKSDB_NUM_WRITE_BUFFERS, 3));
options.setCreateIfMissing(true);
options.setErrorIfExists(false);

代码示例来源:origin: org.apache.samza/samza-kv-rocksdb

options.setMaxWriteBufferNumber(storeConfig.getInt(ROCKSDB_NUM_WRITE_BUFFERS, 3));
options.setCreateIfMissing(true);
options.setErrorIfExists(false);

代码示例来源:origin: org.apache.samza/samza-kv-rocksdb_2.11

options.setMaxWriteBufferNumber(storeConfig.getInt(ROCKSDB_NUM_WRITE_BUFFERS, 3));
options.setCreateIfMissing(true);
options.setErrorIfExists(false);

代码示例来源:origin: com.github.ltsopensource/lts-core

@Override
protected void init() throws FailStoreException {
  try {
    options = new Options();
    options.setCreateIfMissing(true)
        .setWriteBufferSize(8 * SizeUnit.KB)
        .setMaxWriteBufferNumber(3)
        .setMaxBackgroundCompactions(10)
        .setCompressionType(CompressionType.SNAPPY_COMPRESSION)
        .setCompactionStyle(CompactionStyle.UNIVERSAL);
    Filter bloomFilter = new BloomFilter(10);
    BlockBasedTableConfig tableConfig = new BlockBasedTableConfig();
    tableConfig.setBlockCacheSize(64 * SizeUnit.KB)
        .setFilter(bloomFilter)
        .setCacheNumShardBits(6)
        .setBlockSizeDeviation(5)
        .setBlockRestartInterval(10)
        .setCacheIndexAndFilterBlocks(true)
        .setHashIndexAllowCollision(false)
        .setBlockCacheCompressedSize(64 * SizeUnit.KB)
        .setBlockCacheCompressedNumShardBits(10);
    options.setTableFormatConfig(tableConfig);
  } catch (Exception e) {
    throw new FailStoreException(e);
  }
}

代码示例来源:origin: org.apache.bookkeeper/bookkeeper-server

options.setMaxWriteBufferNumber(4);
if (numLevels > 0) {
  options.setNumLevels(numLevels);

相关文章

Options类方法