org.rocksdb.RocksDB.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(274)

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

RocksDB.getProperty介绍

[英]DB implementations can export properties about their state via this method. If "property" is a valid property understood by this DB implementation, fills "*value" with its current value and returns true. Otherwise returns false.

Valid property names include:

  • "rocksdb.num-files-at-level<N>" - return the number of files at level <N>, where <N> is an ASCII representation of a level number (e.g. "0").
  • "rocksdb.stats" - returns a multi-line string that describes statistics about the internal operation of the DB.
  • "rocksdb.sstables" - returns a multi-line string that describes all of the sstables that make up the db contents.
    [中]DB实现可以通过此方法导出有关其状态的属性。如果“property”是此DB实现可以理解的有效属性,则用其当前值填充“*value”,并返回true。否则返回false。
    有效的财产名称包括:
    *“rocksdb.num级别<N>的文件数”-返回级别<N>的文件数,<N>是级别号的ASCII表示形式(例如“0”)。
    *“rocksdb.stats”-返回一个多行字符串,描述数据库内部操作的统计信息。
    *“rocksdb.sstables”-返回一个多行字符串,该字符串描述构成db内容的所有sstables。

代码示例

代码示例来源:origin: Alluxio/alluxio

  1. @Override
  2. public long estimateSize() {
  3. try {
  4. return Long.parseLong(mDb.getProperty(mInodesColumn, "rocksdb.estimate-num-keys"));
  5. } catch (RocksDBException e) {
  6. throw new RuntimeException(e);
  7. }
  8. }

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

  1. /**
  2. * Get property value by name from specified table
  3. */
  4. @Override
  5. public String property(String table, String property) {
  6. try {
  7. return rocksdb().getProperty(cf(table), property);
  8. } catch (RocksDBException e) {
  9. throw new BackendException(e);
  10. }
  11. }

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

  1. /**
  2. * Get property value
  3. */
  4. @Override
  5. public String property(String property) {
  6. try {
  7. return rocksdb().getProperty(property);
  8. } catch (RocksDBException e) {
  9. throw new BackendException(e);
  10. }
  11. }

代码示例来源:origin: com.baidu.hugegraph/hugegraph-rocksdb

  1. /**
  2. * Get property value by name from specified table
  3. */
  4. @Override
  5. public String property(String table, String property) {
  6. try {
  7. return rocksdb().getProperty(cf(table), property);
  8. } catch (RocksDBException e) {
  9. throw new BackendException(e);
  10. }
  11. }

代码示例来源:origin: com.baidu.hugegraph/hugegraph-rocksdb

  1. /**
  2. * Get property value
  3. */
  4. @Override
  5. public String property(String property) {
  6. try {
  7. return rocksdb().getProperty(property);
  8. } catch (RocksDBException e) {
  9. throw new BackendException(e);
  10. }
  11. }

代码示例来源:origin: com.palantir.atlasdb/atlasdb-rocksdb

  1. @Override
  2. public String getProperty(String tableName, String property) {
  3. try (ColumnFamily cf = cfs.get(tableName)) {
  4. return db.getProperty(cf.getHandle(), property);
  5. } catch (RocksDBException e) {
  6. throw Throwables.propagate(e);
  7. }
  8. }
  9. }

代码示例来源:origin: com.github.ddth/ddth-commons-core

  1. /**
  2. * See {@link RocksDB#getProperty(ColumnFamilyHandle, String)}.
  3. *
  4. * @param cfName
  5. * @param name
  6. * @return
  7. * @throws RocksDbException
  8. */
  9. public String getProperty(String cfName, String name) throws RocksDbException {
  10. ColumnFamilyHandle cfh = getColumnFamilyHandle(cfName);
  11. if (cfh == null) {
  12. throw new RocksDbException.ColumnFamilyNotExists(cfName);
  13. }
  14. try {
  15. return rocksDb.getProperty(cfh, name);
  16. } catch (Exception e) {
  17. throw e instanceof RocksDbException ? (RocksDbException) e : new RocksDbException(e);
  18. }
  19. }

相关文章