本文整理汇总了Java中org.apache.hadoop.hbase.util.test.LoadTestDataGenerator类的典型用法代码示例。如果您正苦于以下问题:Java LoadTestDataGenerator类的具体用法?Java LoadTestDataGenerator怎么用?Java LoadTestDataGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoadTestDataGenerator类属于org.apache.hadoop.hbase.util.test包,在下文中一共展示了LoadTestDataGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepareForLoadTest
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
protected void prepareForLoadTest() throws IOException {
LOG.info("Starting load test: dataBlockEncoding=" + dataBlockEncoding +
", isMultiPut=" + isMultiPut);
numKeys = numKeys();
Admin admin = new HBaseAdmin(conf);
while (admin.getClusterStatus().getServers().size() < NUM_RS) {
LOG.info("Sleeping until " + NUM_RS + " RSs are online");
Threads.sleepWithoutInterrupt(1000);
}
admin.close();
HTableDescriptor htd = new HTableDescriptor(TABLE);
HColumnDescriptor hcd = new HColumnDescriptor(CF)
.setCompressionType(compression)
.setDataBlockEncoding(dataBlockEncoding);
createPreSplitLoadTestTable(htd, hcd);
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(CF);
writerThreads = prepareWriterThreads(dataGen, conf, TABLE);
readerThreads = prepareReaderThreads(dataGen, conf, TABLE, 100);
}
示例2: prepareForLoadTest
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
protected void prepareForLoadTest() throws IOException {
LOG.info("Starting load test: dataBlockEncoding=" + dataBlockEncoding +
", isMultiPut=" + isMultiPut);
numKeys = numKeys();
HBaseAdmin admin = new HBaseAdmin(conf);
while (admin.getClusterStatus().getServers().size() < NUM_RS) {
LOG.info("Sleeping until " + NUM_RS + " RSs are online");
Threads.sleepWithoutInterrupt(1000);
}
admin.close();
HTableDescriptor htd = new HTableDescriptor(TABLE);
HColumnDescriptor hcd = new HColumnDescriptor(CF)
.setCompressionType(compression)
.setDataBlockEncoding(dataBlockEncoding);
createPreSplitLoadTestTable(htd, hcd);
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(CF);
writerThreads = prepareWriterThreads(dataGen, conf, TABLE);
readerThreads = prepareReaderThreads(dataGen, conf, TABLE, 100);
}
示例3: prepareForLoadTest
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
protected void prepareForLoadTest() throws IOException {
LOG.info("Starting load test: dataBlockEncoding=" + dataBlockEncoding +
", isMultiPut=" + isMultiPut);
numKeys = numKeys();
Admin admin = TEST_UTIL.getAdmin();
while (admin.getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS))
.getLiveServerMetrics().size() < NUM_RS) {
LOG.info("Sleeping until " + NUM_RS + " RSs are online");
Threads.sleepWithoutInterrupt(1000);
}
admin.close();
HTableDescriptor htd = new HTableDescriptor(TABLE);
HColumnDescriptor hcd = new HColumnDescriptor(CF)
.setCompressionType(compression)
.setDataBlockEncoding(dataBlockEncoding);
createPreSplitLoadTestTable(htd, hcd);
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(CF);
writerThreads = prepareWriterThreads(dataGen, conf, TABLE);
readerThreads = prepareReaderThreads(dataGen, conf, TABLE, 100);
}
示例4: prepareForLoadTest
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
protected void prepareForLoadTest() throws IOException {
LOG.info("Starting load test: dataBlockEncoding=" + dataBlockEncoding +
", isMultiPut=" + isMultiPut);
numKeys = numKeys();
HBaseAdmin admin = new HBaseAdmin(conf);
while (admin.getClusterStatus().getServers().size() < NUM_RS) {
LOG.info("Sleeping until " + NUM_RS + " RSs are online");
Threads.sleepWithoutInterrupt(1000);
}
admin.close();
int numRegions = HBaseTestingUtility.createPreSplitLoadTestTable(conf,
TABLE, CF, compression, dataBlockEncoding);
TEST_UTIL.waitUntilAllRegionsAssigned(numRegions);
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(CF);
writerThreads = new MultiThreadedWriter(dataGen, conf, TABLE);
writerThreads.setMultiPut(isMultiPut);
readerThreads = new MultiThreadedReader(dataGen, conf, TABLE, 100);
}
示例5: MultiThreadedAction
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
public MultiThreadedAction(LoadTestDataGenerator dataGen, Configuration conf,
TableName tableName,
String actionLetter) throws IOException {
this.conf = conf;
this.dataGenerator = dataGen;
this.tableName = tableName;
this.actionLetter = actionLetter;
this.connection = HConnectionManager.createConnection(conf);
}
示例6: getLoadGeneratorInstance
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
private LoadTestDataGenerator getLoadGeneratorInstance(String clazzName) throws IOException {
try {
Class<?> clazz = Class.forName(clazzName);
Constructor<?> constructor = clazz.getConstructor(int.class, int.class, int.class, int.class,
byte[][].class);
return (LoadTestDataGenerator) constructor.newInstance(minColDataSize, maxColDataSize,
minColsPerKey, maxColsPerKey, families);
} catch (Exception e) {
throw new IOException(e);
}
}
示例7: getMultiThreadedWriterInstance
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
private MultiThreadedWriter getMultiThreadedWriterInstance(String clazzName
, LoadTestDataGenerator dataGen) throws IOException {
try {
Class<?> clazz = Class.forName(clazzName);
Constructor<?> constructor = clazz.getConstructor(
LoadTestDataGenerator.class, Configuration.class, TableName.class);
return (MultiThreadedWriter) constructor.newInstance(dataGen, conf, tableName);
} catch (Exception e) {
throw new IOException(e);
}
}
示例8: getMultiThreadedUpdaterInstance
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
private MultiThreadedUpdater getMultiThreadedUpdaterInstance(String clazzName
, LoadTestDataGenerator dataGen) throws IOException {
try {
Class<?> clazz = Class.forName(clazzName);
Constructor<?> constructor = clazz.getConstructor(
LoadTestDataGenerator.class, Configuration.class, TableName.class, double.class);
return (MultiThreadedUpdater) constructor.newInstance(
dataGen, conf, tableName, updatePercent);
} catch (Exception e) {
throw new IOException(e);
}
}
示例9: getMultiThreadedReaderInstance
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
private MultiThreadedReader getMultiThreadedReaderInstance(String clazzName
, LoadTestDataGenerator dataGen) throws IOException {
try {
Class<?> clazz = Class.forName(clazzName);
Constructor<?> constructor = clazz.getConstructor(
LoadTestDataGenerator.class, Configuration.class, TableName.class, double.class);
return (MultiThreadedReader) constructor.newInstance(dataGen, conf, tableName, verifyPercent);
} catch (Exception e) {
throw new IOException(e);
}
}
示例10: MultiThreadedUpdaterWithACL
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
public MultiThreadedUpdaterWithACL(LoadTestDataGenerator dataGen, Configuration conf,
TableName tableName, double updatePercent, User userOwner, String userNames)
throws IOException {
super(dataGen, conf, tableName, updatePercent);
this.userOwner = userOwner;
this.userNames = userNames.split(COMMA);
}
示例11: loadData
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
/** Loads data into the table using the multi-threaded writer. */
private void loadData() throws IOException {
long startKey = 0;
long endKey = 100000;
int minColsPerKey = 5;
int maxColsPerKey = 15;
int minColDataSize = 256;
int maxColDataSize = 256 * 3;
int numThreads = 10;
// print out the arguments
System.out.printf("Key range %d .. %d\n", startKey, endKey);
System.out.printf("Number of Columns/Key: %d..%d\n", minColsPerKey,
maxColsPerKey);
System.out.printf("Data Size/Column: %d..%d bytes\n", minColDataSize,
maxColDataSize);
System.out.printf("Client Threads: %d\n", numThreads);
// start the writers
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(
minColDataSize, maxColDataSize, minColsPerKey, maxColsPerKey,
LoadTestTool.DEFAULT_COLUMN_FAMILY);
MultiThreadedWriter writer = new MultiThreadedWriter(dataGen, conf, TABLE_NAME);
writer.setMultiPut(true);
writer.start(startKey, endKey, numThreads);
System.out.printf("Started loading data...");
writer.waitForFinish();
System.out.printf("Finished loading data...");
}
示例12: TimeBoundedMultiThreadedReader
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
public TimeBoundedMultiThreadedReader(LoadTestDataGenerator dataGen, Configuration conf,
TableName tableName, double verifyPercent) throws IOException {
super(dataGen, conf, tableName, verifyPercent);
long timeoutMs = conf.getLong(
String.format("%s.%s", TEST_NAME, GET_TIMEOUT_KEY), DEFAULT_GET_TIMEOUT);
timeoutNano = timeoutMs * 1000000;
LOG.info("Timeout for gets: " + timeoutMs);
String runTimeKey = String.format(RUN_TIME_KEY, this.getClass().getSimpleName());
this.runTime = conf.getLong(runTimeKey, -1);
if (this.runTime <= 0) {
throw new IllegalArgumentException("Please configure " + runTimeKey);
}
}
示例13: getLoadGeneratorInstance
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
private LoadTestDataGenerator getLoadGeneratorInstance(String clazzName) throws IOException {
try {
Class<?> clazz = Class.forName(clazzName);
Constructor<?> constructor = clazz.getConstructor(int.class, int.class, int.class, int.class,
byte[][].class);
return (LoadTestDataGenerator) constructor.newInstance(minColDataSize, maxColDataSize,
minColsPerKey, maxColsPerKey, COLUMN_FAMILIES);
} catch (Exception e) {
throw new IOException(e);
}
}
示例14: loadData
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
/** Loads data into the table using the multi-threaded writer. */
private void loadData() throws IOException {
long startKey = 0;
long endKey = 100000;
int minColsPerKey = 5;
int maxColsPerKey = 15;
int minColDataSize = 256;
int maxColDataSize = 256 * 3;
int numThreads = 10;
// print out the arguments
System.out.printf("Key range %d .. %d\n", startKey, endKey);
System.out.printf("Number of Columns/Key: %d..%d\n", minColsPerKey,
maxColsPerKey);
System.out.printf("Data Size/Column: %d..%d bytes\n", minColDataSize,
maxColDataSize);
System.out.printf("Client Threads: %d\n", numThreads);
// start the writers
LoadTestDataGenerator dataGen = new MultiThreadedAction.DefaultDataGenerator(
minColDataSize, maxColDataSize, minColsPerKey, maxColsPerKey, LoadTestTool.COLUMN_FAMILY);
MultiThreadedWriter writer = new MultiThreadedWriter(dataGen, conf, TABLE_NAME);
writer.setMultiPut(true);
writer.start(startKey, endKey, numThreads);
System.out.printf("Started loading data...");
writer.waitForFinish();
System.out.printf("Finished loading data...");
}
示例15: MultiThreadedAction
import org.apache.hadoop.hbase.util.test.LoadTestDataGenerator; //导入依赖的package包/类
public MultiThreadedAction(LoadTestDataGenerator dataGen, Configuration conf,
TableName tableName,
String actionLetter) {
this.conf = conf;
this.dataGenerator = dataGen;
this.tableName = tableName;
this.actionLetter = actionLetter;
}