Java Code Examples for org.apache.hadoop.hbase.filter.CompareFilter.CompareOp#values()

The following examples show how to use org.apache.hadoop.hbase.filter.CompareFilter.CompareOp#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SortOrderTest.java    From phoenix with Apache License 2.0 5 votes vote down vote up
@Test
public void descSortOrderTransformsOp() {
    for (CompareOp op : CompareOp.values()) {
    	CompareOp oppositeOp = SortOrder.DESC.transform(op);
    	switch (op) {
		case EQUAL:
			assertSame(CompareOp.EQUAL, oppositeOp);
			break;
		case GREATER:
			assertSame(CompareOp.LESS, oppositeOp);
			break;
		case GREATER_OR_EQUAL:
			assertSame(CompareOp.LESS_OR_EQUAL, oppositeOp);
			break;
		case LESS:
			assertSame(CompareOp.GREATER, oppositeOp);
			break;
		case LESS_OR_EQUAL:
			assertSame(CompareOp.GREATER_OR_EQUAL, oppositeOp);
			break;
		case NOT_EQUAL:
			assertSame(CompareOp.NOT_EQUAL, oppositeOp);
			break;
		case NO_OP:
			assertSame(CompareOp.NO_OP, oppositeOp);
			break;
    	}
    }		
}
 
Example 2
Source File: SortOrderTest.java    From phoenix with Apache License 2.0 5 votes vote down vote up
@Test
public void descSortOrderTransformsOp() {
    for (CompareOp op : CompareOp.values()) {
    	CompareOp oppositeOp = SortOrder.DESC.transform(op);
    	switch (op) {
		case EQUAL:
			assertSame(CompareOp.EQUAL, oppositeOp);
			break;
		case GREATER:
			assertSame(CompareOp.LESS, oppositeOp);
			break;
		case GREATER_OR_EQUAL:
			assertSame(CompareOp.LESS_OR_EQUAL, oppositeOp);
			break;
		case LESS:
			assertSame(CompareOp.GREATER, oppositeOp);
			break;
		case LESS_OR_EQUAL:
			assertSame(CompareOp.GREATER_OR_EQUAL, oppositeOp);
			break;
		case NOT_EQUAL:
			assertSame(CompareOp.NOT_EQUAL, oppositeOp);
			break;
		case NO_OP:
			assertSame(CompareOp.NO_OP, oppositeOp);
			break;
    	}
    }		
}
 
Example 3
Source File: ComparisonExpression.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Override
public void readFields(DataInput input) throws IOException {
    op = CompareOp.values()[WritableUtils.readVInt(input)];
    super.readFields(input);
}
 
Example 4
Source File: SortOrderTest.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Test
public void ascSortOrderDoesNotTransformOp() {
    for (CompareOp op : CompareOp.values()) {
    	assertSame(op, SortOrder.ASC.transform(op));
    }
}
 
Example 5
Source File: ComparisonExpression.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Override
public void readFields(DataInput input) throws IOException {
    op = CompareOp.values()[WritableUtils.readVInt(input)];
    super.readFields(input);
}
 
Example 6
Source File: SortOrderTest.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Test
public void ascSortOrderDoesNotTransformOp() {
    for (CompareOp op : CompareOp.values()) {
    	assertSame(op, SortOrder.ASC.transform(op));
    }
}
 
Example 7
Source File: ComparisonExpression.java    From phoenix with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void readFields(DataInput input) throws IOException {
    op = CompareOp.values()[WritableUtils.readVInt(input)];
    super.readFields(input);
}