/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof InclusiveStopFilter)) return false; InclusiveStopFilter other = (InclusiveStopFilter)o; return Bytes.equals(this.getStopRowKey(), other.getStopRowKey()); }
@Test public void testInclusiveStopFilter() throws IOException { String filterString = "InclusiveStopFilter ('row 3')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row 3", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testUnescapedQuote3() throws IOException { String filterString = " InclusiveStopFilter ('''')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("'", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testUnescapedQuote1() throws IOException { String filterString = "InclusiveStopFilter ('row''3')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row'3", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testUnescapedQuote2() throws IOException { String filterString = "InclusiveStopFilter ('row''3''')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row'3'", new String(stopRowKey, StandardCharsets.UTF_8)); }
case InclusiveStopFilter: this.value = Bytes.toString(Base64.getEncoder().encode( ((InclusiveStopFilter)filter).getStopRowKey())); break; case MultipleColumnPrefixFilter:
/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof InclusiveStopFilter)) return false; InclusiveStopFilter other = (InclusiveStopFilter)o; return Bytes.equals(this.getStopRowKey(), other.getStopRowKey()); }
/** * @param o the other filter to compare with * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ @Override boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof InclusiveStopFilter)) return false; InclusiveStopFilter other = (InclusiveStopFilter)o; return Bytes.equals(this.getStopRowKey(), other.getStopRowKey()); }
/** * @param other * @return true if and only if the fields of the filter that are serialized * are equal to the corresponding fields in other. Used for testing. */ boolean areSerializedFieldsEqual(Filter o) { if (o == this) return true; if (!(o instanceof InclusiveStopFilter)) return false; InclusiveStopFilter other = (InclusiveStopFilter)o; return Bytes.equals(this.getStopRowKey(), other.getStopRowKey()); }
@Test public void testUnescapedQuote1() throws IOException { String filterString = "InclusiveStopFilter ('row''3')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row'3", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testInclusiveStopFilter() throws IOException { String filterString = "InclusiveStopFilter ('row 3')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row 3", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testUnescapedQuote2() throws IOException { String filterString = "InclusiveStopFilter ('row''3''')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("row'3'", new String(stopRowKey, StandardCharsets.UTF_8)); }
@Test public void testUnescapedQuote3() throws IOException { String filterString = " InclusiveStopFilter ('''')"; InclusiveStopFilter inclusiveStopFilter = doTestFilter(filterString, InclusiveStopFilter.class); byte [] stopRowKey = inclusiveStopFilter.getStopRowKey(); assertEquals("'", new String(stopRowKey, StandardCharsets.UTF_8)); }
case InclusiveStopFilter: this.value = Bytes.toString(Base64.getEncoder().encode( ((InclusiveStopFilter)filter).getStopRowKey())); break; case MultipleColumnPrefixFilter:
case InclusiveStopFilter: this.value = Base64.encodeBytes(((InclusiveStopFilter)filter).getStopRowKey()); break; case MultipleColumnPrefixFilter:
case InclusiveStopFilter: this.value = Base64.encodeBytes(((InclusiveStopFilter)filter).getStopRowKey()); break; case MultipleColumnPrefixFilter: