Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/14#discussion_r10315916
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/client/ClientKeyValueBuilder.java 
---
    @@ -1,78 +1,332 @@
     /*
    - * Licensed to the Apache Software Foundation (ASF) under one
    - * or more contributor license agreements.  See the NOTICE file
    - * distributed with this work for additional information
    - * regarding copyright ownership.  The ASF licenses this file
    - * to you under the Apache License, Version 2.0 (the
    - * "License"); you may not use this file except in compliance
    - * with the License.  You may obtain a copy of the License at
    - *
    - * http://www.apache.org/licenses/LICENSE-2.0
    - *
    - * Unless required by applicable law or agreed to in writing, software
    - * distributed under the License is distributed on an "AS IS" BASIS,
    - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    - * See the License for the specific language governing permissions and
    - * limitations under the License.
    + * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE
    + * file distributed with this work for additional information regarding 
copyright ownership. The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the
    + * License. You may obtain a copy of the License at 
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
    + * applicable law or agreed to in writing, software distributed under the 
License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied. See the License for the specific language
    + * governing permissions and limitations under the License.
      */
     package org.apache.phoenix.client;
     
     import org.apache.hadoop.hbase.KeyValue;
    +import org.apache.hadoop.hbase.KeyValue.KVComparator;
     import org.apache.hadoop.hbase.KeyValue.Type;
     import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
     import org.apache.hadoop.hbase.util.Bytes;
     import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
     
    +import com.google.common.primitives.Longs;
    +
     /**
    - * A {@link KeyValueBuilder} that builds {@link ClientKeyValue}, 
eliminating the extra byte copies
    - * inherent in the standard {@link KeyValue} implementation.
    + * A {@link KeyValueBuilder} that builds {@link ClientKeyValue}, 
eliminating the extra byte copies inherent in the
    + * standard {@link KeyValue} implementation.
      * <p>
      * This {@link KeyValueBuilder} is only supported in HBase 0.94.14+ (
    - * {@link PhoenixDatabaseMetaData#CLIENT_KEY_VALUE_BUILDER_THRESHOLD}), 
with the addition of
    - * HBASE-9834.
    + * {@link PhoenixDatabaseMetaData#CLIENT_KEY_VALUE_BUILDER_THRESHOLD}), 
with the addition of HBASE-9834.
      */
     public class ClientKeyValueBuilder extends KeyValueBuilder {
     
         public static final KeyValueBuilder INSTANCE = new 
ClientKeyValueBuilder();
     
    -  private ClientKeyValueBuilder() {
    -    // private ctor for singleton
    -  }
    +    private ClientKeyValueBuilder() {
    +        // private ctor for singleton
    +    }
     
    -  @Override
    -  public KeyValue buildPut(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
    -      ImmutableBytesWritable qualifier, long ts, ImmutableBytesWritable 
value) {
    -    return new ClientKeyValue(row, family, qualifier, ts, Type.Put, value);
    -  }
    +    @Override
    +    public KeyValue buildPut(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
    +            ImmutableBytesWritable qualifier, long ts, 
ImmutableBytesWritable value) {
    +        return new ClientKeyValue(row, family, qualifier, ts, Type.Put, 
value);
    +    }
     
    -  @Override
    -  public KeyValue buildDeleteFamily(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
    +    @Override
    +    public KeyValue buildDeleteFamily(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
                 ImmutableBytesWritable qualifier, long ts) {
             return new ClientKeyValue(row, family, qualifier, ts, 
Type.DeleteFamily, null);
    -  }
    +    }
     
    -  @Override
    -  public KeyValue buildDeleteColumns(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
    +    @Override
    +    public KeyValue buildDeleteColumns(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
                 ImmutableBytesWritable qualifier, long ts) {
             return new ClientKeyValue(row, family, qualifier, ts, 
Type.DeleteColumn, null);
    -  }
    +    }
     
    -  @Override
    -  public KeyValue buildDeleteColumn(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
    +    @Override
    +    public KeyValue buildDeleteColumn(ImmutableBytesWritable row, 
ImmutableBytesWritable family,
                 ImmutableBytesWritable qualifier, long ts) {
             return new ClientKeyValue(row, family, qualifier, ts, Type.Delete, 
null);
    -  }
    +    }
     
    -  @Override
    -  public int compareQualifier(KeyValue kv, byte[] key, int offset, int 
length) {
    +    @Override
    +    public int compareQualifier(KeyValue kv, byte[] key, int offset, int 
length) {
             byte[] qual = kv.getQualifier();
             return Bytes.compareTo(qual, 0, qual.length, key, offset, length);
    -  }
    +    }
     
    -  @Override
    -  public void getValueAsPtr(KeyValue kv, ImmutableBytesWritable ptr) {
    -        ClientKeyValue ckv = (ClientKeyValue) kv;
    +    @Override
    +    public void getValueAsPtr(KeyValue kv, ImmutableBytesWritable ptr) {
    +        ClientKeyValue ckv = (ClientKeyValue)kv;
             ImmutableBytesWritable value = ckv.getRawValue();
             ptr.set(value.get(), value.getOffset(), value.getLength());
    -  }
    +    }
    --- End diff --
    
    Above here, are whitespace only changes. Please ignore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to