[ 
https://issues.apache.org/jira/browse/PHOENIX-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13913955#comment-13913955
 ] 

James Taylor edited comment on PHOENIX-78 at 2/27/14 2:31 AM:
--------------------------------------------------------------

Very minor, but can you use ByteUtil.copyKeyBytesIfNecessary(ptr) in place of 
this in MetaDataUtil:
{code}
   public static byte[] getMutationKVByteValue(Mutation headerRow, byte[] key,
        KeyValueBuilder builder, ImmutableBytesWritable ptr) {
        if (getMutationKeyValue(headerRow, key, builder, ptr)) {
            return ByteUtil.copyKeyBytesIfNecessary(ptr);
        }
       return ByteUtil.EMPTY_BYTE_ARRAY;
  }
{code}
If unit test pass (or a good sampling of them :-) ), then +1

Thanks!



was (Author: jamestaylor):
Very minor, but can you use ByteUtil.copyKeyBytesIfNecessary(ptr) in place of 
this in MetaDataUtil:

   public static byte[] getMutationKVByteValue(Mutation headerRow, byte[] key,
        KeyValueBuilder builder, ImmutableBytesWritable ptr) {
        if (getMutationKeyValue(headerRow, key, builder, ptr)) {
            return ByteUtil.copyKeyBytesIfNecessary(ptr);
        }
       return ByteUtil.EMPTY_BYTE_ARRAY;
  }

If unit test pass (or a good sampling of them :-) ), then +1

Thanks!


> MetaDataUtil must respect ClientKeyValue usage
> ----------------------------------------------
>
>                 Key: PHOENIX-78
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-78
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Jesse Yates
>            Assignee: Jesse Yates
>             Fix For: 3.0.0
>
>         Attachments: phoenix-78-v0.patch, phoenix-78-v1.patch
>
>
> We can get into cases where the ClientKeyValue is being generated for 
> metadata operations, but being operated on as a regular KeyValue, for 
> instance:
> {quote}
> java.lang.UnsupportedOperationException: ClientKeyValue does not support a 
> single backing buffer. 
> at 
> org.apache.phoenix.client.ClientKeyValue.getBuffer(ClientKeyValue.java:500) 
> at 
> org.apache.phoenix.util.MetaDataUtil.getMutationKeyValue(MetaDataUtil.java:202)
>  
> at 
> org.apache.phoenix.util.MetaDataUtil.getMutationKVByteValue(MetaDataUtil.java:193)
>  
> at org.apache.phoenix.util.MetaDataUtil.isMultiTenant(MetaDataUtil.java:245) 
> at 
> org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:887)
>  
> at 
> org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1107)
>  
> at 
> org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:409) 
> at 
> org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:174)
>  
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:224)
>  
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:185) 
> at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:137)
>  
> at 
> org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:142)
>  
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to