本文整理匯總了Java中org.apache.hadoop.hbase.filter.CompareFilter.CompareOp.GREATER_OR_EQUAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java CompareOp.GREATER_OR_EQUAL屬性的具體用法?Java CompareOp.GREATER_OR_EQUAL怎麽用?Java CompareOp.GREATER_OR_EQUAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.hadoop.hbase.filter.CompareFilter.CompareOp
的用法示例。
在下文中一共展示了CompareOp.GREATER_OR_EQUAL屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCompareOp
/**
* Takes a compareOperator symbol as a byte array and returns the corresponding CompareOperator
* <p>
* @param compareOpAsByteArray the comparatorOperator symbol as a byte array
* @return the Compare Operator
*/
public static CompareFilter.CompareOp createCompareOp (byte [] compareOpAsByteArray) {
ByteBuffer compareOp = ByteBuffer.wrap(compareOpAsByteArray);
if (compareOp.equals(ParseConstants.LESS_THAN_BUFFER))
return CompareOp.LESS;
else if (compareOp.equals(ParseConstants.LESS_THAN_OR_EQUAL_TO_BUFFER))
return CompareOp.LESS_OR_EQUAL;
else if (compareOp.equals(ParseConstants.GREATER_THAN_BUFFER))
return CompareOp.GREATER;
else if (compareOp.equals(ParseConstants.GREATER_THAN_OR_EQUAL_TO_BUFFER))
return CompareOp.GREATER_OR_EQUAL;
else if (compareOp.equals(ParseConstants.NOT_EQUAL_TO_BUFFER))
return CompareOp.NOT_EQUAL;
else if (compareOp.equals(ParseConstants.EQUAL_TO_BUFFER))
return CompareOp.EQUAL;
else
throw new IllegalArgumentException("Invalid compare operator");
}
示例2: testDependentColumnFilter
@Test
public void testDependentColumnFilter() throws Exception {
// null column qualifier/family
DependentColumnFilter dependentColumnFilter = new DependentColumnFilter(null, null);
assertTrue(dependentColumnFilter.areSerializedFieldsEqual(
ProtobufUtil.toFilter(ProtobufUtil.toFilter(dependentColumnFilter))));
// non-null column qualifier/family
dependentColumnFilter = new DependentColumnFilter(Bytes.toBytes("family"),
Bytes.toBytes("qual"), true, CompareOp.GREATER_OR_EQUAL,
new BitComparator(Bytes.toBytes("bitComparator"), BitComparator.BitwiseOp.OR));
assertTrue(dependentColumnFilter.areSerializedFieldsEqual(
ProtobufUtil.toFilter(ProtobufUtil.toFilter(dependentColumnFilter))));
}
示例3: setStopType
/**
* Set end type for end value.
* @param stopType - can only be LESS , LESS_OR_EQUAL or NO_OP
*/
public void setStopType(CompareOp stopType) {
if (stopType == CompareOp.EQUAL || stopType == CompareOp.GREATER
|| stopType == CompareOp.GREATER_OR_EQUAL || stopType == CompareOp.NOT_EQUAL) {
throw new IllegalArgumentException("Illegal end type: " + stopType.toString());
}
this.stopType = stopType;
}
示例4: Range
/**
* Construct a Range whose start value and end value are null.
*
* @param column
*/
public Range(byte[] baseTable, byte[] column) {
this.baseTable = baseTable;
setColumn(column);
this.startValue = null;
this.endValue = null;
this.startType = CompareOp.GREATER_OR_EQUAL;
this.endType = CompareOp.LESS_OR_EQUAL;
}
示例5: setStartType
/**
* Set start type for start value.
*
* @param startType - can only be EQUAL, GREATER or GREATER_OR_EQUAL
*/
public void setStartType(CompareOp startType) {
if (startType == CompareOp.EQUAL || startType == CompareOp.GREATER
|| startType == CompareOp.GREATER_OR_EQUAL) {
this.startType = startType;
} else {
this.startType = startType;
// throw new IllegalArgumentException("Illegal start type: "
// + startType.toString());
}
}
示例6: basicFilterNew
private Filter basicFilterNew() {
return new SingleColumnValueFilter(COLUMN_FAMILY, COLUMN_QUALIFIER,
CompareOp.GREATER_OR_EQUAL, VAL_2);
}
示例7: getOpsite
public Range getOpsite() {
Range ran = new Range();
ran.column = this.column;
ran.valueType = this.valueType;
ran.startValue = this.endValue;
ran.endValue = this.startValue;
ran.setStartTs(startTs);
ran.setEndTs(endTs);
ran.setLatestVersionOnly(latestVersionOnly);
ran.setFilterIfMissing(filterIfMissing);
if (ran.valueType == DataType.BOOLEAN) {
if (Bytes.toString(this.startValue).equals("true")) {
ran.startValue = Bytes.toBytes("false");
} else if (Bytes.toString(this.startValue).equals("false")) {
ran.startValue = Bytes.toBytes("true");
}
ran.startType = CompareOp.EQUAL;
return ran;
}
if (this.startValue != null && this.startValue.length != 0) {
switch (this.startType) {
case EQUAL:
ran.startType = CompareOp.GREATER;
ran.startValue = this.startValue;
ran.endValue = this.startValue;
ran.endType = CompareOp.LESS;
break;
case GREATER_OR_EQUAL:
ran.endType = CompareOp.LESS;
break;
case GREATER:
ran.endType = CompareOp.LESS_OR_EQUAL;
break;
default:
break;
}
}
if (this.endValue != null && this.endValue.length != 0) {
switch (this.endType) {
case LESS:
ran.startType = CompareOp.GREATER_OR_EQUAL;
break;
case LESS_OR_EQUAL:
ran.startType = CompareOp.GREATER;
break;
default:
break;
}
}
return ran;
}