Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A5F54200BA8 for ; Sun, 9 Oct 2016 17:12:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A492F160AFA; Sun, 9 Oct 2016 15:12:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3F75C160AF6 for ; Sun, 9 Oct 2016 17:12:44 +0200 (CEST) Received: (qmail 88975 invoked by uid 500); 9 Oct 2016 15:12:41 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 88560 invoked by uid 99); 9 Oct 2016 15:12:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2016 15:12:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 467C8E0BDB; Sun, 9 Oct 2016 15:12:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Date: Sun, 09 Oct 2016 15:12:57 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [19/52] [partial] hbase-site git commit: Published site at e06c3676f1273f033e3e185ee9c1ec52c1c7cb31. archived-at: Sun, 09 Oct 2016 15:12:45 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c7e84622/apidocs/src-html/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.html b/apidocs/src-html/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.html index 7b2aec8..1ecaccd 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/filter/SingleColumnValueExcludeFilter.html @@ -38,157 +38,156 @@ 030import org.apache.hadoop.hbase.classification.InterfaceStability; 031import org.apache.hadoop.hbase.exceptions.DeserializationException; 032import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; -033import org.apache.hadoop.hbase.protobuf.ProtobufUtil; -034import org.apache.hadoop.hbase.protobuf.generated.FilterProtos; -035 -036import com.google.protobuf.InvalidProtocolBufferException; -037 -038/** -039 * A {@link Filter} that checks a single column value, but does not emit the -040 * tested column. This will enable a performance boost over -041 * {@link SingleColumnValueFilter}, if the tested column value is not actually -042 * needed as input (besides for the filtering itself). -043 */ -044@InterfaceAudience.Public -045@InterfaceStability.Stable -046public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter { -047 -048 /** -049 * Constructor for binary compare of the value of a single column. If the -050 * column is found and the condition passes, all columns of the row will be -051 * emitted; except for the tested column value. If the column is not found or -052 * the condition fails, the row will not be emitted. -053 * -054 * @param family name of column family -055 * @param qualifier name of column qualifier -056 * @param compareOp operator -057 * @param value value to compare column values against -058 */ -059 public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier, -060 CompareOp compareOp, byte[] value) { -061 super(family, qualifier, compareOp, value); -062 } -063 -064 /** -065 * Constructor for binary compare of the value of a single column. If the -066 * column is found and the condition passes, all columns of the row will be -067 * emitted; except for the tested column value. If the condition fails, the -068 * row will not be emitted. -069 * <p> -070 * Use the filterIfColumnMissing flag to set whether the rest of the columns -071 * in a row will be emitted if the specified column to check is not found in -072 * the row. -073 * -074 * @param family name of column family -075 * @param qualifier name of column qualifier -076 * @param compareOp operator -077 * @param comparator Comparator to use. -078 */ -079 public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier, -080 CompareOp compareOp, ByteArrayComparable comparator) { -081 super(family, qualifier, compareOp, comparator); -082 } -083 -084 /** -085 * Constructor for protobuf deserialization only. -086 * @param family -087 * @param qualifier -088 * @param compareOp -089 * @param comparator -090 * @param filterIfMissing -091 * @param latestVersionOnly -092 */ -093 protected SingleColumnValueExcludeFilter(final byte[] family, final byte[] qualifier, -094 final CompareOp compareOp, ByteArrayComparable comparator, final boolean filterIfMissing, -095 final boolean latestVersionOnly) { -096 super(family, qualifier, compareOp, comparator, filterIfMissing, latestVersionOnly); -097 } -098 -099 // We cleaned result row in FilterRow to be consistent with scanning process. -100 public boolean hasFilterRow() { -101 return true; -102 } -103 -104 // Here we remove from row all key values from testing column -105 @Override -106 public void filterRowCells(List<Cell> kvs) { -107 Iterator<? extends Cell> it = kvs.iterator(); -108 while (it.hasNext()) { -109 // If the current column is actually the tested column, -110 // we will skip it instead. -111 if (CellUtil.matchingColumn(it.next(), this.columnFamily, this.columnQualifier)) { -112 it.remove(); -113 } -114 } -115 } -116 -117 public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) { -118 SingleColumnValueFilter tempFilter = (SingleColumnValueFilter) -119 SingleColumnValueFilter.createFilterFromArguments(filterArguments); -120 SingleColumnValueExcludeFilter filter = new SingleColumnValueExcludeFilter ( -121 tempFilter.getFamily(), tempFilter.getQualifier(), -122 tempFilter.getOperator(), tempFilter.getComparator()); -123 -124 if (filterArguments.size() == 6) { -125 filter.setFilterIfMissing(tempFilter.getFilterIfMissing()); -126 filter.setLatestVersionOnly(tempFilter.getLatestVersionOnly()); -127 } -128 return filter; -129 } -130 -131 /** -132 * @return The filter serialized using pb -133 */ -134 public byte [] toByteArray() { -135 FilterProtos.SingleColumnValueExcludeFilter.Builder builder = -136 FilterProtos.SingleColumnValueExcludeFilter.newBuilder(); -137 builder.setSingleColumnValueFilter(super.convert()); -138 return builder.build().toByteArray(); -139 } -140 -141 /** -142 * @param pbBytes A pb serialized {@link SingleColumnValueExcludeFilter} instance -143 * @return An instance of {@link SingleColumnValueExcludeFilter} made from <code>bytes</code> -144 * @throws DeserializationException -145 * @see #toByteArray -146 */ -147 public static SingleColumnValueExcludeFilter parseFrom(final byte [] pbBytes) -148 throws DeserializationException { -149 FilterProtos.SingleColumnValueExcludeFilter proto; -150 try { -151 proto = FilterProtos.SingleColumnValueExcludeFilter.parseFrom(pbBytes); -152 } catch (InvalidProtocolBufferException e) { -153 throw new DeserializationException(e); -154 } -155 -156 FilterProtos.SingleColumnValueFilter parentProto = proto.getSingleColumnValueFilter(); -157 final CompareOp compareOp = -158 CompareOp.valueOf(parentProto.getCompareOp().name()); -159 final ByteArrayComparable comparator; -160 try { -161 comparator = ProtobufUtil.toComparator(parentProto.getComparator()); -162 } catch (IOException ioe) { -163 throw new DeserializationException(ioe); -164 } -165 -166 return new SingleColumnValueExcludeFilter(parentProto.hasColumnFamily() ? parentProto -167 .getColumnFamily().toByteArray() : null, parentProto.hasColumnQualifier() ? parentProto -168 .getColumnQualifier().toByteArray() : null, compareOp, comparator, parentProto -169 .getFilterIfMissing(), parentProto.getLatestVersionOnly()); -170 } -171 -172 /** -173 * @param other -174 * @return true if and only if the fields of the filter that are serialized -175 * are equal to the corresponding fields in other. Used for testing. -176 */ -177 boolean areSerializedFieldsEqual(Filter o) { -178 if (o == this) return true; -179 if (!(o instanceof SingleColumnValueExcludeFilter)) return false; -180 -181 return super.areSerializedFieldsEqual(o); -182 } -183} +033import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; +034import org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos; +035import org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException; +036 +037/** +038 * A {@link Filter} that checks a single column value, but does not emit the +039 * tested column. This will enable a performance boost over +040 * {@link SingleColumnValueFilter}, if the tested column value is not actually +041 * needed as input (besides for the filtering itself). +042 */ +043@InterfaceAudience.Public +044@InterfaceStability.Stable +045public class SingleColumnValueExcludeFilter extends SingleColumnValueFilter { +046 +047 /** +048 * Constructor for binary compare of the value of a single column. If the +049 * column is found and the condition passes, all columns of the row will be +050 * emitted; except for the tested column value. If the column is not found or +051 * the condition fails, the row will not be emitted. +052 * +053 * @param family name of column family +054 * @param qualifier name of column qualifier +055 * @param compareOp operator +056 * @param value value to compare column values against +057 */ +058 public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier, +059 CompareOp compareOp, byte[] value) { +060 super(family, qualifier, compareOp, value); +061 } +062 +063 /** +064 * Constructor for binary compare of the value of a single column. If the +065 * column is found and the condition passes, all columns of the row will be +066 * emitted; except for the tested column value. If the condition fails, the +067 * row will not be emitted. +068 * <p> +069 * Use the filterIfColumnMissing flag to set whether the rest of the columns +070 * in a row will be emitted if the specified column to check is not found in +071 * the row. +072 * +073 * @param family name of column family +074 * @param qualifier name of column qualifier +075 * @param compareOp operator +076 * @param comparator Comparator to use. +077 */ +078 public SingleColumnValueExcludeFilter(byte[] family, byte[] qualifier, +079 CompareOp compareOp, ByteArrayComparable comparator) { +080 super(family, qualifier, compareOp, comparator); +081 } +082 +083 /** +084 * Constructor for protobuf deserialization only. +085 * @param family +086 * @param qualifier +087 * @param compareOp +088 * @param comparator +089 * @param filterIfMissing +090 * @param latestVersionOnly +091 */ +092 protected SingleColumnValueExcludeFilter(final byte[] family, final byte[] qualifier, +093 final CompareOp compareOp, ByteArrayComparable comparator, final boolean filterIfMissing, +094 final boolean latestVersionOnly) { +095 super(family, qualifier, compareOp, comparator, filterIfMissing, latestVersionOnly); +096 } +097 +098 // We cleaned result row in FilterRow to be consistent with scanning process. +099 public boolean hasFilterRow() { +100 return true; +101 } +102 +103 // Here we remove from row all key values from testing column +104 @Override +105 public void filterRowCells(List<Cell> kvs) { +106 Iterator<? extends Cell> it = kvs.iterator(); +107 while (it.hasNext()) { +108 // If the current column is actually the tested column, +109 // we will skip it instead. +110 if (CellUtil.matchingColumn(it.next(), this.columnFamily, this.columnQualifier)) { +111 it.remove(); +112 } +113 } +114 } +115 +116 public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) { +117 SingleColumnValueFilter tempFilter = (SingleColumnValueFilter) +118 SingleColumnValueFilter.createFilterFromArguments(filterArguments); +119 SingleColumnValueExcludeFilter filter = new SingleColumnValueExcludeFilter ( +120 tempFilter.getFamily(), tempFilter.getQualifier(), +121 tempFilter.getOperator(), tempFilter.getComparator()); +122 +123 if (filterArguments.size() == 6) { +124 filter.setFilterIfMissing(tempFilter.getFilterIfMissing()); +125 filter.setLatestVersionOnly(tempFilter.getLatestVersionOnly()); +126 } +127 return filter; +128 } +129 +130 /** +131 * @return The filter serialized using pb +132 */ +133 public byte [] toByteArray() { +134 FilterProtos.SingleColumnValueExcludeFilter.Builder builder = +135 FilterProtos.SingleColumnValueExcludeFilter.newBuilder(); +136 builder.setSingleColumnValueFilter(super.convert()); +137 return builder.build().toByteArray(); +138 } +139 +140 /** +141 * @param pbBytes A pb serialized {@link SingleColumnValueExcludeFilter} instance +142 * @return An instance of {@link SingleColumnValueExcludeFilter} made from <code>bytes</code> +143 * @throws DeserializationException +144 * @see #toByteArray +145 */ +146 public static SingleColumnValueExcludeFilter parseFrom(final byte [] pbBytes) +147 throws DeserializationException { +148 FilterProtos.SingleColumnValueExcludeFilter proto; +149 try { +150 proto = FilterProtos.SingleColumnValueExcludeFilter.parseFrom(pbBytes); +151 } catch (InvalidProtocolBufferException e) { +152 throw new DeserializationException(e); +153 } +154 +155 FilterProtos.SingleColumnValueFilter parentProto = proto.getSingleColumnValueFilter(); +156 final CompareOp compareOp = +157 CompareOp.valueOf(parentProto.getCompareOp().name()); +158 final ByteArrayComparable comparator; +159 try { +160 comparator = ProtobufUtil.toComparator(parentProto.getComparator()); +161 } catch (IOException ioe) { +162 throw new DeserializationException(ioe); +163 } +164 +165 return new SingleColumnValueExcludeFilter(parentProto.hasColumnFamily() ? parentProto +166 .getColumnFamily().toByteArray() : null, parentProto.hasColumnQualifier() ? parentProto +167 .getColumnQualifier().toByteArray() : null, compareOp, comparator, parentProto +168 .getFilterIfMissing(), parentProto.getLatestVersionOnly()); +169 } +170 +171 /** +172 * @param other +173 * @return true if and only if the fields of the filter that are serialized +174 * are equal to the corresponding fields in other. Used for testing. +175 */ +176 boolean areSerializedFieldsEqual(Filter o) { +177 if (o == this) return true; +178 if (!(o instanceof SingleColumnValueExcludeFilter)) return false; +179 +180 return super.areSerializedFieldsEqual(o); +181 } +182}