/** * @param other * @return true if and only if the fields of the comparator that are serialized * are equal to the corresponding fields in other. Used for testing. */ boolean areSerializedFieldsEqual(ByteArrayComparable other) { if (other == this) return true; return Bytes.equals(this.getValue(), other.getValue()); }
@Override public String toString() { return String.format("%s (%s, %s)", this.getClass().getSimpleName(), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); }
public ByteArrayComparableModel( ByteArrayComparable comparator) { String typeName = comparator.getClass().getSimpleName(); ComparatorType type = ComparatorType.valueOf(typeName); this.type = typeName; switch (type) { case BinaryComparator: case BinaryPrefixComparator: this.value = Bytes.toString(Base64.getEncoder().encode(comparator.getValue())); break; case BitComparator: this.value = Bytes.toString(Base64.getEncoder().encode(comparator.getValue())); this.op = ((BitComparator)comparator).getOperator().toString(); break; case NullComparator: break; case RegexStringComparator: case SubstringComparator: this.value = Bytes.toString(comparator.getValue()); break; default: throw new RuntimeException("unhandled filter type: " + type); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", getClass().getSimpleName(), Bytes.toStringBinary(this.family), Bytes.toStringBinary(this.qualifier), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.dropDependentColumn, this.op.name(), this.comparator != null ? Bytes.toStringBinary(this.comparator.getValue()) : "null"); }
@Test public void testColumnValueFilter() throws IOException { String filterString = "ColumnValueFilter ('family', 'qualifier', <, 'binaryprefix:value')"; ColumnValueFilter cvf = doTestFilter(filterString, ColumnValueFilter.class); assertEquals("family", new String(cvf.getFamily(), StandardCharsets.UTF_8)); assertEquals("qualifier", new String(cvf.getQualifier(), StandardCharsets.UTF_8)); assertEquals(CompareOperator.LESS, cvf.getCompareOperator()); assertTrue(cvf.getComparator() instanceof BinaryPrefixComparator); assertEquals("value", new String(cvf.getComparator().getValue(), StandardCharsets.UTF_8)); } }
assertEquals("qualifier", new String(singleColumnValueExcludeFilter.getQualifier(), StandardCharsets.UTF_8)); assertEquals("a", new String(singleColumnValueExcludeFilter.getComparator().getValue(), StandardCharsets.UTF_8)); assertFalse(singleColumnValueExcludeFilter.getFilterIfMissing());
@Override public String toString() { return String.format("%s (%s, %s)", this.getClass().getSimpleName(), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", getClass().getSimpleName(), Bytes.toStringBinary(this.family), Bytes.toStringBinary(this.qualifier), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.dropDependentColumn, this.op.name(), this.comparator != null ? Bytes.toStringBinary(this.comparator.getValue()) : "null"); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
/** * @param other * @return true if and only if the fields of the comparator that are serialized * are equal to the corresponding fields in other. Used for testing. */ boolean areSerializedFieldsEqual(ByteArrayComparable other) { if (other == this) return true; return Bytes.equals(this.getValue(), other.getValue()); }
/** * @param other * @return true if and only if the fields of the comparator that are serialized * are equal to the corresponding fields in other. Used for testing. */ boolean areSerializedFieldsEqual(ByteArrayComparable other) { if (other == this) return true; return Bytes.equals(this.getValue(), other.getValue()); }
@Override public String toString() { return String.format("%s (%s, %s)", this.getClass().getSimpleName(), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", getClass().getSimpleName(), Bytes.toStringBinary(this.family), Bytes.toStringBinary(this.qualifier), this.op.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.compareOp.name(), Bytes.toStringBinary(this.comparator.getValue())); } }
@Override public String toString() { return String.format("%s (%s, %s, %s, %s, %s)", this.getClass().getSimpleName(), Bytes.toStringBinary(this.columnFamily), Bytes.toStringBinary(this.columnQualifier), this.dropDependentColumn, this.op.name(), this.comparator != null ? Bytes.toStringBinary(this.comparator.getValue()) : "null"); } }
@Test public void testColumnValueFilter() throws IOException { String filterString = "ColumnValueFilter ('family', 'qualifier', <, 'binaryprefix:value')"; ColumnValueFilter cvf = doTestFilter(filterString, ColumnValueFilter.class); assertEquals("family", new String(cvf.getFamily(), StandardCharsets.UTF_8)); assertEquals("qualifier", new String(cvf.getQualifier(), StandardCharsets.UTF_8)); assertEquals(CompareOperator.LESS, cvf.getCompareOperator()); assertTrue(cvf.getComparator() instanceof BinaryPrefixComparator); assertEquals("value", new String(cvf.getComparator().getValue(), StandardCharsets.UTF_8)); } }