本文整理汇总了Java中org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException类的典型用法代码示例。如果您正苦于以下问题:Java IllegalArgumentIOException类的具体用法?Java IllegalArgumentIOException怎么用?Java IllegalArgumentIOException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IllegalArgumentIOException类属于org.apache.hadoop.hbase.exceptions包,在下文中一共展示了IllegalArgumentIOException类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initiateCompactionStrategy
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
@VisibleForTesting
void initiateCompactionStrategy(MemoryCompactionPolicy compType,
Configuration configuration, String cfName) throws IllegalArgumentIOException {
assert (compType !=MemoryCompactionPolicy.NONE);
switch (compType){
case BASIC: strategy = new BasicMemStoreCompactionStrategy(configuration, cfName);
break;
case EAGER: strategy = new EagerMemStoreCompactionStrategy(configuration, cfName);
break;
case ADAPTIVE: strategy = new AdaptiveMemStoreCompactionStrategy(configuration, cfName);
break;
default:
// sanity check
throw new IllegalArgumentIOException("Unknown memory compaction type " + compType);
}
}
示例2: assertIsIllegalArgumentException
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
public static void assertIsIllegalArgumentException(final ProcedureInfo result) {
assertEquals(true, result.isFailed());
LOG.info(result.getExceptionFullMessage());
Throwable cause = ProcedureTestingUtility.getExceptionCause(result);
assertTrue("expected IllegalArgumentIOException, got " + cause,
cause instanceof IllegalArgumentIOException);
}
示例3: updateMetaState
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
protected void updateMetaState(TableName tableName, TableState.State newState)
throws IOException {
if (tableName.equals(TableName.META_TABLE_NAME)) {
if (TableState.State.DISABLING.equals(newState) ||
TableState.State.DISABLED.equals(newState)) {
throw new IllegalArgumentIOException("Cannot disable the meta table; " + newState);
}
// Otherwise, just return; no need to set ENABLED on meta -- it is always ENABLED.
return;
}
MetaTableAccessor.updateTableState(master.getConnection(), tableName, newState);
}
示例4: MemStoreCompactor
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
public MemStoreCompactor(CompactingMemStore compactingMemStore,
MemoryCompactionPolicy compactionPolicy) throws IllegalArgumentIOException {
this.compactingMemStore = compactingMemStore;
this.compactionKVMax = compactingMemStore.getConfiguration()
.getInt(HConstants.COMPACTION_KV_MAX, HConstants.COMPACTION_KV_MAX_DEFAULT);
initiateCompactionStrategy(compactionPolicy, compactingMemStore.getConfiguration(),
compactingMemStore.getFamilyName());
}
示例5: createMemStoreCompactor
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
@VisibleForTesting
protected MemStoreCompactor createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy)
throws IllegalArgumentIOException {
return new MemStoreCompactor(this, compactionPolicy);
}
示例6: MyMemStoreCompactor
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
public MyMemStoreCompactor(CompactingMemStore compactingMemStore, MemoryCompactionPolicy
compactionPolicy) throws IllegalArgumentIOException {
super(compactingMemStore, compactionPolicy);
}
示例7: createMemStoreCompactor
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
@Override
protected MemStoreCompactor createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy)
throws IllegalArgumentIOException {
return new MyMemStoreCompactor(this, compactionPolicy);
}
示例8: initiateType
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
void initiateType(MemoryCompactionPolicy compactionType, Configuration conf)
throws IllegalArgumentIOException {
compactor.initiateCompactionStrategy(compactionType, conf, "CF_TEST");
}
示例9: assertIsIllegalArgumentException
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
public static void assertIsIllegalArgumentException(final Procedure<?> result) {
Throwable cause = assertProcFailed(result);
assertTrue("expected IllegalArgumentIOException, got " + cause,
cause instanceof IllegalArgumentIOException);
}
示例10: createNInputSplitsUniform
import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException; //导入依赖的package包/类
/**
* Create n splits for one InputSplit, For now only support uniform distribution
* @param split A TableSplit corresponding to a range of rowkeys
* @param n Number of ranges after splitting. Pass 1 means no split for the range
* Pass 2 if you want to split the range in two;
* @return A list of TableSplit, the size of the list is n
* @throws IllegalArgumentIOException
*/
protected List<InputSplit> createNInputSplitsUniform(InputSplit split, int n)
throws IllegalArgumentIOException {
if (split == null || !(split instanceof TableSplit)) {
throw new IllegalArgumentIOException(
"InputSplit for CreateNSplitsPerRegion can not be null + "
+ "and should be instance of TableSplit");
}
//if n < 1, then still continue using n = 1
n = n < 1 ? 1 : n;
List<InputSplit> res = new ArrayList<>(n);
if (n == 1) {
res.add(split);
return res;
}
// Collect Region related information
TableSplit ts = (TableSplit) split;
TableName tableName = ts.getTable();
String regionLocation = ts.getRegionLocation();
String encodedRegionName = ts.getEncodedRegionName();
long regionSize = ts.getLength();
byte[] startRow = ts.getStartRow();
byte[] endRow = ts.getEndRow();
// For special case: startRow or endRow is empty
if (startRow.length == 0 && endRow.length == 0){
startRow = new byte[1];
endRow = new byte[1];
startRow[0] = 0;
endRow[0] = -1;
}
if (startRow.length == 0 && endRow.length != 0){
startRow = new byte[1];
startRow[0] = 0;
}
if (startRow.length != 0 && endRow.length == 0){
endRow =new byte[startRow.length];
for (int k = 0; k < startRow.length; k++){
endRow[k] = -1;
}
}
// Split Region into n chunks evenly
byte[][] splitKeys = Bytes.split(startRow, endRow, true, n-1);
for (int i = 0; i < splitKeys.length - 1; i++) {
//notice that the regionSize parameter may be not very accurate
TableSplit tsplit =
new TableSplit(tableName, scan, splitKeys[i], splitKeys[i + 1], regionLocation,
encodedRegionName, regionSize / n);
res.add(tsplit);
}
return res;
}