本文整理汇总了Java中org.apache.hadoop.hbase.exceptions.FailedSanityCheckException类的典型用法代码示例。如果您正苦于以下问题:Java FailedSanityCheckException类的具体用法?Java FailedSanityCheckException怎么用?Java FailedSanityCheckException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FailedSanityCheckException类属于org.apache.hadoop.hbase.exceptions包,在下文中一共展示了FailedSanityCheckException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkTimestamps
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override public void checkTimestamps(final Map<byte[], List<Cell>> familyMap, long now)
throws FailedSanityCheckException {
if (timestampSlop == HConstants.LATEST_TIMESTAMP) {
return;
}
long maxTs = now + timestampSlop;
for (List<Cell> kvs : familyMap.values()) {
assert kvs instanceof RandomAccess;
int listSize = kvs.size();
for (int i = 0; i < listSize; i++) {
Cell cell = kvs.get(i);
// see if the user-side TS is out of range. latest = server-side
long ts = cell.getTimestamp();
if (ts != HConstants.LATEST_TIMESTAMP && ts > maxTs) {
throw new FailedSanityCheckException(
"Timestamp for KV out of range " + cell + " (too.new=" + timestampSlop + ")");
}
}
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:21,代码来源:HRegion.java
示例2: checkTimestamps
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
void checkTimestamps(final Map<byte[], List<Cell>> familyMap,
long now) throws FailedSanityCheckException {
if (timestampSlop == HConstants.LATEST_TIMESTAMP) {
return;
}
long maxTs = now + timestampSlop;
for (List<Cell> kvs : familyMap.values()) {
assert kvs instanceof RandomAccess;
int listSize = kvs.size();
for (int i = 0; i < listSize; i++) {
Cell cell = kvs.get(i);
// see if the user-side TS is out of range. latest = server-side
long ts = cell.getTimestamp();
if (ts != HConstants.LATEST_TIMESTAMP && ts > maxTs) {
throw new FailedSanityCheckException("Timestamp for KV out of range "
+ cell + " (too.new=" + timestampSlop + ")");
}
}
}
}
开发者ID:grokcoder,项目名称:pbase,代码行数:21,代码来源:HRegion.java
示例3: checkTimestamps
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
void checkTimestamps(final Map<byte[], List<Cell>> familyMap,
long now) throws FailedSanityCheckException {
if (timestampSlop == HConstants.LATEST_TIMESTAMP) {
return;
}
long maxTs = now + timestampSlop;
for (List<Cell> kvs : familyMap.values()) {
for (Cell cell : kvs) {
// see if the user-side TS is out of range. latest = server-side
KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
if (!kv.isLatestTimestamp() && kv.getTimestamp() > maxTs) {
throw new FailedSanityCheckException("Timestamp for KV out of range "
+ cell + " (too.new=" + timestampSlop + ")");
}
}
}
}
开发者ID:tenggyut,项目名称:HIndex,代码行数:18,代码来源:HRegion.java
示例4: checkTimestamps
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
/**
* Check the collection of families for valid timestamps
* @param familyMap
* @param now current timestamp
* @throws FailedSanityCheckException
*/
public void checkTimestamps(final Map<byte[], List<Cell>> familyMap, long now)
throws FailedSanityCheckException {
if (timestampSlop == HConstants.LATEST_TIMESTAMP) {
return;
}
long maxTs = now + timestampSlop;
for (List<Cell> kvs : familyMap.values()) {
// Optimization: 'foreach' loop is not used. See:
// HBASE-12023 HRegion.applyFamilyMapToMemstore creates too many iterator objects
assert kvs instanceof RandomAccess;
int listSize = kvs.size();
for (int i=0; i < listSize; i++) {
Cell cell = kvs.get(i);
// see if the user-side TS is out of range. latest = server-side
long ts = cell.getTimestamp();
if (ts != HConstants.LATEST_TIMESTAMP && ts > maxTs) {
throw new FailedSanityCheckException("Timestamp for KV out of range "
+ cell + " (too.new=" + timestampSlop + ")");
}
}
}
}
开发者ID:apache,项目名称:hbase,代码行数:29,代码来源:HRegion.java
示例5: preAppend
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override
public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> e, Append append)
throws IOException {
// If authorization is not enabled, we don't care about reserved tags
if (!authorizationEnabled) {
return null;
}
for (CellScanner cellScanner = append.cellScanner(); cellScanner.advance();) {
if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
throw new FailedSanityCheckException("Append contains cell with reserved type tag");
}
}
return null;
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:VisibilityController.java
示例6: preIncrement
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment)
throws IOException {
// If authorization is not enabled, we don't care about reserved tags
if (!authorizationEnabled) {
return null;
}
for (CellScanner cellScanner = increment.cellScanner(); cellScanner.advance();) {
if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
throw new FailedSanityCheckException("Increment contains cell with reserved type tag");
}
}
return null;
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:VisibilityController.java
示例7: doBatchMutate
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
private void doBatchMutate(Mutation mutation) throws IOException {
// Currently this is only called for puts and deletes, so no nonces.
OperationStatus[] batchMutate = this.batchMutate(new Mutation[] { mutation });
if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) {
throw new FailedSanityCheckException(batchMutate[0].getExceptionMsg());
} else if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.BAD_FAMILY)) {
throw new NoSuchColumnFamilyException(batchMutate[0].getExceptionMsg());
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:HRegion.java
示例8: exception
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
public void exception(Throwable throwable) {
source.exception();
/**
* Keep some metrics for commonly seen exceptions
*
* Try and put the most common types first.
* Place child types before the parent type that they extend.
*
* If this gets much larger we might have to go to a hashmap
*/
if (throwable != null) {
if (throwable instanceof OutOfOrderScannerNextException) {
source.outOfOrderException();
} else if (throwable instanceof RegionTooBusyException) {
source.tooBusyException();
} else if (throwable instanceof UnknownScannerException) {
source.unknownScannerException();
} else if (throwable instanceof RegionMovedException) {
source.movedRegionException();
} else if (throwable instanceof NotServingRegionException) {
source.notServingRegionException();
} else if (throwable instanceof FailedSanityCheckException) {
source.failedSanityException();
} else if (throwable instanceof MultiActionResultTooLarge) {
source.multiActionTooLargeException();
}
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:30,代码来源:MetricsHBaseServer.java
示例9: testPutWithTsSlop
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
/**
* Tests that there is server-side filtering for invalid timestamp upper
* bound. Note that the timestamp lower bound is automatically handled for us
* by the TTL field.
*/
@Test
public void testPutWithTsSlop() throws IOException {
byte[] fam = Bytes.toBytes("info");
byte[][] families = { fam };
String method = this.getName();
// add data with a timestamp that is too recent for range. Ensure assert
CONF.setInt("hbase.hregion.keyvalue.timestamp.slop.millisecs", 1000);
this.region = initHRegion(tableName, method, CONF, families);
boolean caughtExcep = false;
try {
try {
// no TS specified == use latest. should not error
region.put(new Put(row).add(fam, Bytes.toBytes("qual"), Bytes.toBytes("value")));
// TS out of range. should error
region.put(new Put(row).add(fam, Bytes.toBytes("qual"), System.currentTimeMillis() + 2000,
Bytes.toBytes("value")));
fail("Expected IOE for TS out of configured timerange");
} catch (FailedSanityCheckException ioe) {
LOG.debug("Received expected exception", ioe);
caughtExcep = true;
}
assertTrue("Should catch FailedSanityCheckException", caughtExcep);
} finally {
HRegion.closeHRegion(this.region);
this.region = null;
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:34,代码来源:TestHRegion.java
示例10: preAppend
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override
public Result preAppend(ObserverContext<RegionCoprocessorEnvironment> e, Append append)
throws IOException {
for (CellScanner cellScanner = append.cellScanner(); cellScanner.advance();) {
if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
throw new FailedSanityCheckException("Append contains cell with reserved type tag");
}
}
return null;
}
开发者ID:grokcoder,项目名称:pbase,代码行数:11,代码来源:VisibilityController.java
示例11: preIncrement
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override
public Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> e, Increment increment)
throws IOException {
for (CellScanner cellScanner = increment.cellScanner(); cellScanner.advance();) {
if (!checkForReservedVisibilityTagPresence(cellScanner.current())) {
throw new FailedSanityCheckException("Increment contains cell with reserved type tag");
}
}
return null;
}
开发者ID:grokcoder,项目名称:pbase,代码行数:11,代码来源:VisibilityController.java
示例12: doBatchMutate
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
private void doBatchMutate(Mutation mutation) throws IOException, DoNotRetryIOException {
// Currently this is only called for puts and deletes, so no nonces.
OperationStatus[] batchMutate = this.batchMutate(new Mutation[]{mutation},
HConstants.NO_NONCE, HConstants.NO_NONCE);
if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) {
throw new FailedSanityCheckException(batchMutate[0].getExceptionMsg());
} else if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.BAD_FAMILY)) {
throw new NoSuchColumnFamilyException(batchMutate[0].getExceptionMsg());
}
}
开发者ID:grokcoder,项目名称:pbase,代码行数:12,代码来源:HRegion.java
示例13: doBatchMutate
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
private void doBatchMutate(Mutation mutation) throws IOException, DoNotRetryIOException {
// Currently this is only called for puts and deletes, so no nonces.
OperationStatus[] batchMutate = this.batchMutate(new Mutation[] { mutation },
HConstants.NO_NONCE, HConstants.NO_NONCE);
if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) {
throw new FailedSanityCheckException(batchMutate[0].getExceptionMsg());
} else if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.BAD_FAMILY)) {
throw new NoSuchColumnFamilyException(batchMutate[0].getExceptionMsg());
}
}
开发者ID:tenggyut,项目名称:HIndex,代码行数:11,代码来源:HRegion.java
示例14: exception
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
/**
* Increment the count for a specific exception type. This is called for each exception type
* that is returned to the thrift handler.
* @param rawThrowable type of exception
*/
public void exception(Throwable rawThrowable) {
source.exception();
Throwable throwable = unwrap(rawThrowable);
/**
* Keep some metrics for commonly seen exceptions
*
* Try and put the most common types first.
* Place child types before the parent type that they extend.
*
* If this gets much larger we might have to go to a hashmap
*/
if (throwable != null) {
if (throwable instanceof OutOfOrderScannerNextException) {
source.outOfOrderException();
} else if (throwable instanceof RegionTooBusyException) {
source.tooBusyException();
} else if (throwable instanceof UnknownScannerException) {
source.unknownScannerException();
} else if (throwable instanceof ScannerResetException) {
source.scannerResetException();
} else if (throwable instanceof RegionMovedException) {
source.movedRegionException();
} else if (throwable instanceof NotServingRegionException) {
source.notServingRegionException();
} else if (throwable instanceof FailedSanityCheckException) {
source.failedSanityException();
} else if (throwable instanceof MultiActionResultTooLarge) {
source.multiActionTooLargeException();
} else if (throwable instanceof CallQueueTooBigException) {
source.callQueueTooBigException();
}
}
}
开发者ID:apache,项目名称:hbase,代码行数:40,代码来源:ThriftMetrics.java
示例15: preGetOp
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
@Override
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
Get get, List<Cell> results) throws IOException {
byte[] errorType = get.getAttribute(SHOULD_ERROR_ATTRIBUTE);
if (errorType != null) {
ErrorType type = ErrorType.valueOf(Bytes.toString(errorType));
switch (type) {
case CALL_QUEUE_TOO_BIG:
throw new CallQueueTooBigException("Failing for test");
case MULTI_ACTION_RESULT_TOO_LARGE:
throw new MultiActionResultTooLarge("Failing for test");
case FAILED_SANITY_CHECK:
throw new FailedSanityCheckException("Failing for test");
case NOT_SERVING_REGION:
throw new NotServingRegionException("Failing for test");
case REGION_MOVED:
throw new RegionMovedException(e.getEnvironment().getServerName(), 1);
case SCANNER_RESET:
throw new ScannerResetException("Failing for test");
case UNKNOWN_SCANNER:
throw new UnknownScannerException("Failing for test");
case REGION_TOO_BUSY:
throw new RegionTooBusyException("Failing for test");
case OUT_OF_ORDER_SCANNER_NEXT:
throw new OutOfOrderScannerNextException("Failing for test");
default:
throw new DoNotRetryIOException("Failing for test");
}
}
}
开发者ID:apache,项目名称:hbase,代码行数:31,代码来源:ErrorThrowingGetObserver.java
示例16: doBatchMutate
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
private void doBatchMutate(Mutation mutation) throws IOException {
// Currently this is only called for puts and deletes, so no nonces.
OperationStatus[] batchMutate = this.batchMutate(new Mutation[]{mutation});
if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) {
throw new FailedSanityCheckException(batchMutate[0].getExceptionMsg());
} else if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.BAD_FAMILY)) {
throw new NoSuchColumnFamilyException(batchMutate[0].getExceptionMsg());
}
}
开发者ID:apache,项目名称:hbase,代码行数:10,代码来源:HRegion.java
示例17: exception
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
public void exception(Throwable throwable) {
source.exception();
/**
* Keep some metrics for commonly seen exceptions
*
* Try and put the most common types first.
* Place child types before the parent type that they extend.
*
* If this gets much larger we might have to go to a hashmap
*/
if (throwable != null) {
if (throwable instanceof OutOfOrderScannerNextException) {
source.outOfOrderException();
} else if (throwable instanceof RegionTooBusyException) {
source.tooBusyException();
} else if (throwable instanceof UnknownScannerException) {
source.unknownScannerException();
} else if (throwable instanceof ScannerResetException) {
source.scannerResetException();
} else if (throwable instanceof RegionMovedException) {
source.movedRegionException();
} else if (throwable instanceof NotServingRegionException) {
source.notServingRegionException();
} else if (throwable instanceof FailedSanityCheckException) {
source.failedSanityException();
} else if (throwable instanceof MultiActionResultTooLarge) {
source.multiActionTooLargeException();
} else if (throwable instanceof CallQueueTooBigException) {
source.callQueueTooBigException();
}
}
}
开发者ID:apache,项目名称:hbase,代码行数:34,代码来源:MetricsHBaseServer.java
示例18: testPutWithTsSlop
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
/**
* Tests that there is server-side filtering for invalid timestamp upper
* bound. Note that the timestamp lower bound is automatically handled for us
* by the TTL field.
*/
@Test
public void testPutWithTsSlop() throws IOException {
byte[] fam = Bytes.toBytes("info");
byte[][] families = { fam };
// add data with a timestamp that is too recent for range. Ensure assert
CONF.setInt("hbase.hregion.keyvalue.timestamp.slop.millisecs", 1000);
this.region = initHRegion(tableName, method, CONF, families);
boolean caughtExcep = false;
try {
try {
// no TS specified == use latest. should not error
region.put(new Put(row).addColumn(fam, Bytes.toBytes("qual"), Bytes.toBytes("value")));
// TS out of range. should error
region.put(new Put(row).addColumn(fam, Bytes.toBytes("qual"),
System.currentTimeMillis() + 2000, Bytes.toBytes("value")));
fail("Expected IOE for TS out of configured timerange");
} catch (FailedSanityCheckException ioe) {
LOG.debug("Received expected exception", ioe);
caughtExcep = true;
}
assertTrue("Should catch FailedSanityCheckException", caughtExcep);
} finally {
HBaseTestingUtility.closeRegionAndWAL(this.region);
this.region = null;
}
}
开发者ID:apache,项目名称:hbase,代码行数:33,代码来源:TestHRegion.java
示例19: doBatchMutate
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
private void doBatchMutate(Mutation mutation) throws IOException,
org.apache.hadoop.hbase.DoNotRetryIOException {
OperationStatus[] batchMutate = this.batchMutate(new Mutation[] { mutation });
if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.SANITY_CHECK_FAILURE)) {
throw new FailedSanityCheckException(batchMutate[0].getExceptionMsg());
} else if (batchMutate[0].getOperationStatusCode().equals(OperationStatusCode.BAD_FAMILY)) {
throw new NoSuchColumnFamilyException(batchMutate[0].getExceptionMsg());
}
}
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:10,代码来源:HRegion.java
示例20: testPutWithTsSlop
import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; //导入依赖的package包/类
/**
* Tests that there is server-side filtering for invalid timestamp upper
* bound. Note that the timestamp lower bound is automatically handled for us
* by the TTL field.
*/
@Test
public void testPutWithTsSlop() throws IOException {
byte[] fam = Bytes.toBytes("info");
byte[][] families = { fam };
String method = this.getName();
// add data with a timestamp that is too recent for range. Ensure assert
conf.setInt("hbase.hregion.keyvalue.timestamp.slop.millisecs", 1000);
this.region = initHRegion(tableName, method, conf, families);
boolean caughtExcep = false;
try {
try {
// no TS specified == use latest. should not error
region.put(new Put(row).add(fam, Bytes.toBytes("qual"), Bytes.toBytes("value")));
// TS out of range. should error
region.put(new Put(row).add(fam, Bytes.toBytes("qual"), System.currentTimeMillis() + 2000,
Bytes.toBytes("value")));
fail("Expected IOE for TS out of configured timerange");
} catch (FailedSanityCheckException ioe) {
LOG.debug("Received expected exception", ioe);
caughtExcep = true;
}
assertTrue("Should catch FailedSanityCheckException", caughtExcep);
} finally {
HRegion.closeHRegion(this.region);
this.region = null;
}
}
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:34,代码来源:TestHRegion.java
注:本文中的org.apache.hadoop.hbase.exceptions.FailedSanityCheckException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论