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


Java Connection.getConfiguration方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.Connection.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.getConfiguration方法的具体用法?Java Connection.getConfiguration怎么用?Java Connection.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.client.Connection的用法示例。


在下文中一共展示了Connection.getConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RegionMonitor

import org.apache.hadoop.hbase.client.Connection; //导入方法依赖的package包/类
public RegionMonitor(Connection connection, String[] monitorTargets, boolean useRegExp,
    Sink sink, ExecutorService executor, boolean writeSniffing, TableName writeTableName,
    boolean treatFailureAsError) {
  super(connection, monitorTargets, useRegExp, sink, executor, treatFailureAsError);
  Configuration conf = connection.getConfiguration();
  this.writeSniffing = writeSniffing;
  this.writeTableName = writeTableName;
  this.writeDataTTL =
      conf.getInt(HConstants.HBASE_CANARY_WRITE_DATA_TTL_KEY, DEFAULT_WRITE_DATA_TTL);
  this.regionsLowerLimit =
      conf.getFloat(HConstants.HBASE_CANARY_WRITE_PERSERVER_REGIONS_LOWERLIMIT_KEY, 1.0f);
  this.regionsUpperLimit =
      conf.getFloat(HConstants.HBASE_CANARY_WRITE_PERSERVER_REGIONS_UPPERLIMIT_KEY, 1.5f);
  this.checkPeriod =
      conf.getInt(HConstants.HBASE_CANARY_WRITE_TABLE_CHECK_PERIOD_KEY,
        DEFAULT_WRITE_TABLE_CHECK_PERIOD);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:Canary.java

示例2: HBaseConnection

import org.apache.hadoop.hbase.client.Connection; //导入方法依赖的package包/类
/**
 * Alternative constructor for when you already have an hbase connection
 * object you want to use
 */
public HBaseConnection(final Connection connection) {
    this.sharedClusterConnection = connection;
    this.configuration = connection.getConfiguration();
    this.quorum = connection.getConfiguration().get(PROP_KEY_HBASE_ZOOKEEPER_QUORUM);
    this.clientPort = connection.getConfiguration().get(PROP_KEY_HBASE_ZOOKEEPER_CLIENT_PORT);
    this.znodeParent = connection.getConfiguration().get(PROP_KEY_HBASE_ZOOKEEPER_ZNODE_PARENT);
    autoCreateTables = true;
}
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:13,代码来源:HBaseConnection.java

示例3: IndexTable

import org.apache.hadoop.hbase.client.Connection; //导入方法依赖的package包/类
/**
 * Construct with given configuration.
 *
 * @param conf
 * @param tableName
 * @throws IOException
 */
public IndexTable(final Connection conn, final TableName tableName) throws IOException {
  this.conn = conn;
  this.conf = conn.getConfiguration();
  this.tableName = tableName;
  this.writeBufferSize = conf.getLong("hbase.client.write.buffer", 2097152);
  this.autoFlush = true;
  this.scannerCaching = conf.getInt("hbase.client.scanner.caching", 1000);
  this.mainTable = conn.getTable(tableName);
  this.mainCCTTable =
      conn.getTable(TableName.valueOf(Bytes.add(tableName.getName(), IndexConstants.CCT_FIX)));
  this.indexDesc = new IndexTableDescriptor(mainTable.getTableDescriptor());
  this.indexTableMaps = new TreeMap<byte[], Table>(Bytes.BYTES_COMPARATOR);
  this.cctTableMaps = new TreeMap<byte[], Table>(Bytes.BYTES_COMPARATOR);

  indexTableMaps.put(IndexConstants.KEY, mainTable);
  cctTableMaps.put(Bytes.add(IndexConstants.KEY, IndexConstants.CCT_FIX), mainCCTTable);
  if (indexDesc.getIndexedColumns() != null && indexDesc.getIndexedColumns().length != 0) {
    for (IndexSpecification spec : indexDesc.getIndexSpecifications()) {
      indexTableMaps.put(spec.getIndexColumn(), new HTable(conf, spec.getIndexTableName()));
      cctTableMaps.put(Bytes.add(spec.getIndexColumn(), IndexConstants.CCT_FIX), new HTable(conf,
          Bytes.add(spec.getIndexTableName().getName(), IndexConstants.CCT_FIX)));
    }
  }
  String tempInfo = mainTable.getTableDescriptor().getValue("DATA_FORMAT");
  if (tempInfo != null) {
    this.columnTypeMap = new TreeMap<byte[], DataType>(Bytes.BYTES_COMPARATOR);
    String[] temp = tempInfo.split(",");
    for (int i = 0; i < temp.length; i++) {
      int loc = temp[i].lastIndexOf(':');
      if (loc != -1) {
        this.columnTypeMap.put(Bytes.toBytes(temp[i].substring(0, loc)),
            DataType.valueOf(temp[i].substring(loc + 1)));
      } else {
        LOG.warn("Failed to read column type!" + temp[i]);
      }
    }
  }
  this.resultBufferSize = DEFAULT_RESULT_BUFFER_SIZE;
  this.loadFactor = DEFAULT_LOAD_FACTOR;
  this.maxScanners = DEFAULT_MAX_SCANNERS;
  this.maxGetsPerScanner = DEFAULT_MAX_GETS_PER_SCANNER;
  this.chooser = new SimpleIndexChooser(this);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:51,代码来源:IndexTable.java


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