phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3208) MutationState.toMutations method would throw a exception if multiple tables are upserted
Date Wed, 02 Nov 2016 11:44:58 GMT

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

Hadoop QA commented on PHOENIX-3208:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12836543/PHOENIX-3208_v3.patch
  against master branch at commit effb095230f9f0a3e9b00e1925c6ed797ff5666c.
  ATTACHMENT ID: 12836543

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:green}+1 tests included{color}.  The patch appears to include 3 new or modified
tests.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of
javac compiler warnings.

    {color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 43 warning messages.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number
of release audit warnings.

    {color:red}-1 lineLengths{color}.  The patch introduces the following lines longer than
100:
    +        return PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR
+ PhoenixRuntime.CONNECTIONLESS;
+            conn.createStatement().execute("upsert into MUTATION_TEST1(id1,appId1) values(111,'app1')");
+            conn.createStatement().execute("upsert into MUTATION_TEST2(id2,appId2) values(222,'app2')");
+    private void assertTable(String tableName1,List<KeyValue> keyValues1,String tableName2,List<KeyValue>
keyValues2) {
+        assertTrue(Bytes.equals(PUnsignedInt.INSTANCE.toBytes(111),CellUtil.cloneRow(keyValues1.get(0))));
+        assertTrue("app1".equals(PVarchar.INSTANCE.toObject(CellUtil.cloneValue(keyValues1.get(0)))));
+        assertTrue(Bytes.equals(PUnsignedInt.INSTANCE.toBytes(222),CellUtil.cloneRow(keyValues2.get(0))));
+        assertTrue("app2".equals(PVarchar.INSTANCE.toObject(CellUtil.cloneValue(keyValues2.get(0)))));

     {color:red}-1 core tests{color}.  The patch failed these unit tests:
     

Test results: https://builds.apache.org/job/PreCommit-PHOENIX-Build/666//testReport/
Javadoc warnings: https://builds.apache.org/job/PreCommit-PHOENIX-Build/666//artifact/patchprocess/patchJavadocWarnings.txt
Console output: https://builds.apache.org/job/PreCommit-PHOENIX-Build/666//console

This message is automatically generated.

> MutationState.toMutations method would throw a exception if multiple tables are upserted

> -----------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-3208
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3208
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.8.0
>            Reporter: chenglei
>         Attachments: PHOENIX-3208_v3.patch
>
>
>         MutationState.toMutations method is to return the current uncommitted tables
mutations , but if multiple tables have been upserted , the toMutations method would throw
a exception:
>         {code:borderStyle=solid}
>      java.util.NoSuchElementException
> 	at com.google.common.collect.Iterators$1.next(Iterators.java:77)
> 	at org.apache.phoenix.execute.MutationState$1.next(MutationState.java:584)
> 	at org.apache.phoenix.execute.MutationState$1.next(MutationState.java:1)
> 	at org.apache.phoenix.execute.MutationState$2$1.next(MutationState.java:710)
> 	at org.apache.phoenix.execute.MutationState$2$1.next(MutationState.java:1)
> 	at org.apache.phoenix.execute.MutationState$2.next(MutationState.java:732)
> 	at org.apache.phoenix.execute.MutationState$2.next(MutationState.java:1)
> 	at org.apache.phoenix.util.PhoenixRuntime$1.next(PhoenixRuntime.java:354)
> 	at org.apache.phoenix.util.PhoenixRuntime$1.next(PhoenixRuntime.java:1)
>         {code}
>      
>         I write a simple unit test to reproduce this problem in my patch,the PhoenixRuntime.getUncommittedDataIterator
method internally uses the  MutationState.toMutations method:
> {code:borderStyle=solid} 
>     @Test
>     public void testToMutationsError() throws Exception {
>         Connection conn = null;
>         try {
>             conn=DriverManager.getConnection(getUrl());
>             conn.createStatement().execute(
>                     "create table MUTATION_TEST1"+
>                     "( id1 UNSIGNED_INT not null primary key,"+
>                       "appId1 VARCHAR)");
>             conn.createStatement().execute(
>                     "create table MUTATION_TEST2"+
>                     "( id2 UNSIGNED_INT not null primary key,"+
>                       "appId2 VARCHAR)");
>             conn.createStatement().execute("upsert into MUTATION_TEST1(id1,appId1) values(111,'app1')");
>             conn.createStatement().execute("upsert into MUTATION_TEST2(id2,appId2) values(222,'app2')");
>             Iterator<Pair<byte[],List<KeyValue>>> dataTableNameAndMutationKeyValuesIter
=
>                     PhoenixRuntime.getUncommittedDataIterator(conn);
>             assertTrue(dataTableNameAndMutationKeyValuesIter.hasNext());
>             Pair<byte[],List<KeyValue>> pair=dataTableNameAndMutationKeyValuesIter.next();
>             String tableName1=Bytes.toString(pair.getFirst());
>             List<KeyValue> keyValues1=pair.getSecond();
>             assertTrue(dataTableNameAndMutationKeyValuesIter.hasNext());
>             pair=dataTableNameAndMutationKeyValuesIter.next();
>             String tableName2=Bytes.toString(pair.getFirst());
>             List<KeyValue> keyValues2=pair.getSecond();
>             if("MUTATION_TEST1".equals(tableName1)) {
>                 assertTable(tableName1, keyValues1, tableName2, keyValues2);
>             }
>             else {
>                 assertTable(tableName2, keyValues2, tableName1, keyValues1);
>             }
>             assertTrue(!dataTableNameAndMutationKeyValuesIter.hasNext());
>         }
>         finally {
>             if(conn!=null) {
>                 conn.close();
>             }
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message