org.apache.hadoop.hbase.HBaseTestingUtility.createPreSplitLoadTestTable()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(119)

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

HBaseTestingUtility.createPreSplitLoadTestTable介绍

[英]Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.
[中]为负载测试创建预拆分表。如果表已存在,则记录警告并继续。

代码示例

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor hcd) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, hcd, DEFAULT_REGIONS_PER_SERVER);
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor hcd, int numRegionsPerServer) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, new ColumnFamilyDescriptor[] {hcd},
   numRegionsPerServer);
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableName tableName, byte[] columnFamily, Algorithm compression,
  DataBlockEncoding dataBlockEncoding) throws IOException {
 return createPreSplitLoadTestTable(conf, tableName,
  columnFamily, compression, dataBlockEncoding, DEFAULT_REGIONS_PER_SERVER, 1,
  Durability.USE_DEFAULT);
}
/**

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor[] hcds,
  int numRegionsPerServer) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, hcds,
  new RegionSplitter.HexStringSplit(), numRegionsPerServer);
}

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

protected void createPreSplitLoadTestTable(HTableDescriptor htd, HColumnDescriptor hcd)
  throws IOException {
 HBaseTestingUtility.createPreSplitLoadTestTable(conf, htd, hcd);
 TEST_UTIL.waitUntilAllRegionsAssigned(htd.getTableName());
}

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

@Override
protected void initTable() throws IOException {
 // Do the same as the LoadTestTool does, but with different table configuration.
 HTableDescriptor htd = new HTableDescriptor(getTablename());
 htd.setConfiguration(StoreEngine.STORE_ENGINE_CLASS_KEY, StripeStoreEngine.class.getName());
 htd.setConfiguration(HStore.BLOCKING_STOREFILES_KEY, "100");
 HColumnDescriptor hcd = new HColumnDescriptor(HFileTestUtil.DEFAULT_COLUMN_FAMILY);
 HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), htd, hcd);
}

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

private void createTable(TableName tableName) throws Exception {
 long startTime, endTime;
 TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableName);
 TableDescriptor desc = builder.build();
 ColumnFamilyDescriptorBuilder cbuilder =
   ColumnFamilyDescriptorBuilder.newBuilder(COLUMN_NAME.getBytes(Charset.defaultCharset()));
 ColumnFamilyDescriptor[] columns = new ColumnFamilyDescriptor[] { cbuilder.build() };
 LOG.info("Creating table {} with {} splits.", tableName,
  regionsCountPerServer * regionServerCount);
 startTime = System.currentTimeMillis();
 HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), desc, columns,
  regionsCountPerServer);
 util.waitTableAvailable(tableName);
 endTime = System.currentTimeMillis();
 LOG.info("Pre-split table created successfully in {}ms.", (endTime - startTime));
}

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

public void initTestTable() throws IOException {
 Durability durability = Durability.USE_DEFAULT;
 if (deferredLogFlush) {
  durability = Durability.ASYNC_WAL;
 }
 HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableName,
  getColumnFamilies(), compressAlgo, dataBlockEncodingAlgo, numRegionsPerServer,
   regionReplication, durability);
 applyColumnFamilyOptions(tableName, getColumnFamilies());
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableName tableName, byte[] columnFamily, Algorithm compression,
  DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication,
  Durability durability)
    throws IOException {
 HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.setDurability(durability);
 desc.setRegionReplication(regionReplication);
 HColumnDescriptor hcd = new HColumnDescriptor(columnFamily);
 hcd.setDataBlockEncoding(dataBlockEncoding);
 hcd.setCompressionType(compression);
 return createPreSplitLoadTestTable(conf, desc, hcd, numRegionsPerServer);
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableName tableName, byte[][] columnFamilies, Algorithm compression,
  DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication,
  Durability durability)
    throws IOException {
 HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.setDurability(durability);
 desc.setRegionReplication(regionReplication);
 HColumnDescriptor[] hcds = new HColumnDescriptor[columnFamilies.length];
 for (int i = 0; i < columnFamilies.length; i++) {
  HColumnDescriptor hcd = new HColumnDescriptor(columnFamilies[i]);
  hcd.setDataBlockEncoding(dataBlockEncoding);
  hcd.setCompressionType(compression);
  hcds[i] = hcd;
 }
 return createPreSplitLoadTestTable(conf, desc, hcds, numRegionsPerServer);
}

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

HBaseTestingUtility.createPreSplitLoadTestTable(conf, TABLE_NAME,
  HFileTestUtil.DEFAULT_COLUMN_FAMILY, Compression.Algorithm.NONE,
  DataBlockEncoding.NONE);

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor hcd) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, hcd, DEFAULT_REGIONS_PER_SERVER);
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor hcd, int numRegionsPerServer) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, new ColumnFamilyDescriptor[] {hcd},
   numRegionsPerServer);
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableName tableName, byte[] columnFamily, Algorithm compression,
  DataBlockEncoding dataBlockEncoding) throws IOException {
 return createPreSplitLoadTestTable(conf, tableName,
  columnFamily, compression, dataBlockEncoding, DEFAULT_REGIONS_PER_SERVER, 1,
  Durability.USE_DEFAULT);
}
/**

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableDescriptor desc, ColumnFamilyDescriptor[] hcds,
  int numRegionsPerServer) throws IOException {
 return createPreSplitLoadTestTable(conf, desc, hcds,
  new RegionSplitter.HexStringSplit(), numRegionsPerServer);
}

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

protected void createPreSplitLoadTestTable(HTableDescriptor htd, HColumnDescriptor hcd)
  throws IOException {
 HBaseTestingUtility.createPreSplitLoadTestTable(conf, htd, hcd);
 TEST_UTIL.waitUntilAllRegionsAssigned(htd.getTableName());
}

代码示例来源:origin: org.apache.hbase/hbase-it

@Override
protected void initTable() throws IOException {
 // Do the same as the LoadTestTool does, but with different table configuration.
 HTableDescriptor htd = new HTableDescriptor(getTablename());
 htd.setConfiguration(StoreEngine.STORE_ENGINE_CLASS_KEY, StripeStoreEngine.class.getName());
 htd.setConfiguration(HStore.BLOCKING_STOREFILES_KEY, "100");
 HColumnDescriptor hcd = new HColumnDescriptor(HFileTestUtil.DEFAULT_COLUMN_FAMILY);
 HBaseTestingUtility.createPreSplitLoadTestTable(util.getConfiguration(), htd, hcd);
}

代码示例来源:origin: org.apache.hbase/hbase-mapreduce

public void initTestTable() throws IOException {
 Durability durability = Durability.USE_DEFAULT;
 if (deferredLogFlush) {
  durability = Durability.ASYNC_WAL;
 }
 HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableName,
  getColumnFamilies(), compressAlgo, dataBlockEncodingAlgo, numRegionsPerServer,
   regionReplication, durability);
 applyColumnFamilyOptions(tableName, getColumnFamilies());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-mapreduce

public void initTestTable() throws IOException {
 Durability durability = Durability.USE_DEFAULT;
 if (deferredLogFlush) {
  durability = Durability.ASYNC_WAL;
 }
 HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableName,
  getColumnFamilies(), compressAlgo, dataBlockEncodingAlgo, numRegionsPerServer,
   regionReplication, durability);
 applyColumnFamilyOptions(tableName, getColumnFamilies());
}

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

/**
 * Creates a pre-split table for load testing. If the table already exists,
 * logs a warning and continues.
 * @return the number of regions the table was split into
 */
public static int createPreSplitLoadTestTable(Configuration conf,
  TableName tableName, byte[] columnFamily, Algorithm compression,
  DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication,
  Durability durability)
    throws IOException {
 HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.setDurability(durability);
 desc.setRegionReplication(regionReplication);
 HColumnDescriptor hcd = new HColumnDescriptor(columnFamily);
 hcd.setDataBlockEncoding(dataBlockEncoding);
 hcd.setCompressionType(compression);
 return createPreSplitLoadTestTable(conf, desc, hcd, numRegionsPerServer);
}

相关文章

HBaseTestingUtility类方法