phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [24/24] phoenix git commit: Catch up omid2 branch with latest from 4.x-HBase-1.3
Date Tue, 12 Jun 2018 06:09:07 GMT
Catch up omid2 branch with latest from 4.x-HBase-1.3


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ec7a6607
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ec7a6607
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ec7a6607

Branch: refs/heads/omid2
Commit: ec7a66072d616f740bfd669b8da56d0ac995f4a1
Parents: d1977ff 6f4a48f
Author: James Taylor <jamestaylor@apache.org>
Authored: Mon Jun 11 23:08:31 2018 -0700
Committer: James Taylor <jamestaylor@apache.org>
Committed: Mon Jun 11 23:08:31 2018 -0700

----------------------------------------------------------------------
 bin/hbase-site.xml                              |   4 -
 dev/make_rc.sh                                  |   2 -
 phoenix-client/pom.xml                          |   1 +
 phoenix-core/pom.xml                            |  28 -
 .../StatisticsCollectionRunTrackerIT.java       |  32 +-
 .../phoenix/end2end/ArrayAppendFunctionIT.java  |  38 +
 .../org/apache/phoenix/end2end/IndexToolIT.java | 106 ++-
 .../org/apache/phoenix/end2end/OrderByIT.java   |  45 +-
 .../org/apache/phoenix/end2end/SequenceIT.java  |  57 +-
 .../phoenix/end2end/SequencePointInTimeIT.java  | 112 +++
 .../apache/phoenix/end2end/SkipScanQueryIT.java |  21 +
 .../apache/phoenix/end2end/SystemCatalogIT.java |  23 +-
 .../apache/phoenix/cache/ServerCacheClient.java |  21 +-
 .../apache/phoenix/compile/UpsertCompiler.java  |   2 +-
 .../apache/phoenix/compile/WhereCompiler.java   |  12 +-
 .../GroupedAggregateRegionObserver.java         |   4 +-
 .../coprocessor/MetaDataEndpointImpl.java       |   6 +-
 .../phoenix/coprocessor/MetaDataProtocol.java   |  16 +-
 .../UngroupedAggregateRegionObserver.java       |   4 +-
 .../phoenix/exception/SQLExceptionCode.java     |   6 +-
 .../apache/phoenix/execute/BaseQueryPlan.java   |   2 +-
 .../apache/phoenix/execute/HashJoinPlan.java    |  12 +-
 .../apache/phoenix/execute/MutationState.java   | 757 ++++++++-----------
 .../PhoenixTxIndexMutationGenerator.java        |  44 +-
 .../phoenix/filter/DistinctPrefixFilter.java    |  31 +-
 .../apache/phoenix/filter/SkipScanFilter.java   |   4 +-
 .../write/ParallelWriterIndexCommitter.java     |   4 +-
 .../TrackingParallelWriterIndexCommitter.java   |   4 +-
 .../phoenix/index/IndexMetaDataCacheClient.java |  67 +-
 .../index/PhoenixTransactionalIndexer.java      |   4 +-
 .../phoenix/jdbc/PhoenixDatabaseMetaData.java   |  17 +-
 .../apache/phoenix/join/HashCacheClient.java    |   5 +-
 .../phoenix/mapreduce/index/IndexTool.java      | 142 +++-
 .../query/ConnectionQueryServicesImpl.java      |  17 +-
 .../query/ConnectionlessQueryServicesImpl.java  |   7 +-
 .../apache/phoenix/query/QueryConstants.java    |   2 +
 .../phoenix/query/QueryServicesOptions.java     |   5 +-
 .../apache/phoenix/schema/MetaDataClient.java   |  14 +-
 .../org/apache/phoenix/schema/RowKeySchema.java |  20 +-
 .../org/apache/phoenix/schema/Sequence.java     |   6 +-
 .../stats/StatisticsCollectionRunTracker.java   |  45 +-
 .../transaction/OmidTransactionContext.java     |   4 +
 .../transaction/PhoenixTransactionContext.java  |   9 +-
 .../transaction/TephraTransactionContext.java   | 101 +++
 .../java/org/apache/phoenix/util/ByteUtil.java  |  16 +-
 .../phoenix/util/EquiDepthStreamHistogram.java  | 453 +++++++++++
 .../java/org/apache/phoenix/util/IndexUtil.java |  40 +-
 .../java/org/apache/phoenix/util/ScanUtil.java  |   3 +-
 .../util/EquiDepthStreamHistogramTest.java      | 303 ++++++++
 .../apache/phoenix/hive/HiveMapReduceIT.java    |   8 +
 .../phoenix/queryserver/server/QueryServer.java |  90 ++-
 .../server/QueryServerConfigurationTest.java    |  72 ++
 phoenix-server/pom.xml                          |   1 +
 pom.xml                                         |  16 +-
 54 files changed, 2093 insertions(+), 772 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
----------------------------------------------------------------------
diff --cc phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
index c435c48,c29d6b5..3642adf
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
@@@ -46,8 -45,8 +45,6 @@@ import org.apache.hadoop.hbase.util.Byt
  import org.apache.hadoop.hbase.util.Pair;
  import org.apache.htrace.Span;
  import org.apache.htrace.TraceScope;
--import org.apache.phoenix.cache.IndexMetaDataCache;
--import org.apache.phoenix.cache.ServerCacheClient;
  import org.apache.phoenix.cache.ServerCacheClient.ServerCache;
  import org.apache.phoenix.compile.MutationPlan;
  import org.apache.phoenix.coprocessor.BaseScannerRegionObserver;
@@@ -572,9 -556,10 +555,9 @@@ public class MutationState implements S
                      if (!sendAll) {
                          TableRef key = new TableRef(index);
                          MultiRowMutationState multiRowMutationState = mutations.remove(key);
-                         if (multiRowMutationState!=null) {
+                         if (multiRowMutationState != null) {
                              final List<Mutation> deleteMutations = Lists.newArrayList();
 -                            generateMutations(tableRef, mutationTimestamp, serverTimestamp,
multiRowMutationState,
 -                                    deleteMutations, null);
 +                            generateMutations(key, mutationTimestamp, serverTimestamp, multiRowMutationState,
deleteMutations, null);
                              if (indexMutations == null) {
                                  indexMutations = deleteMutations;
                              } else {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/execute/PhoenixTxIndexMutationGenerator.java
----------------------------------------------------------------------
diff --cc phoenix-core/src/main/java/org/apache/phoenix/execute/PhoenixTxIndexMutationGenerator.java
index 0a01603,a7b5687..6ef6f3b
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/PhoenixTxIndexMutationGenerator.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/PhoenixTxIndexMutationGenerator.java
@@@ -60,8 -61,9 +62,10 @@@ import org.apache.phoenix.hbase.index.u
  import org.apache.phoenix.index.IndexMaintainer;
  import org.apache.phoenix.index.PhoenixIndexCodec;
  import org.apache.phoenix.index.PhoenixIndexMetaData;
+ import org.apache.phoenix.jdbc.PhoenixConnection;
 +import org.apache.phoenix.query.ConnectionQueryServices;
  import org.apache.phoenix.query.KeyRange;
+ import org.apache.phoenix.schema.PTable;
  import org.apache.phoenix.schema.types.PVarbinary;
  import org.apache.phoenix.transaction.PhoenixTransactionContext;
  import org.apache.phoenix.transaction.PhoenixTransactionContext.PhoenixVisibilityLevel;
@@@ -476,4 -444,42 +480,42 @@@ public class PhoenixTxIndexMutationGene
              return pair;
          }
      }
+     
+     public static PhoenixTxIndexMutationGenerator newGenerator(final PhoenixConnection connection,
PTable table, List<PTable> indexes,
+             Map<String, byte[]> attributes) {
+         final List<IndexMaintainer> indexMaintainers = Lists.newArrayListWithExpectedSize(indexes.size());
+         for (PTable index : indexes) {
+             IndexMaintainer maintainer = index.getIndexMaintainer(table, connection);
+             indexMaintainers.add(maintainer);
+         }
+         IndexMetaDataCache indexMetaDataCache = new IndexMetaDataCache() {
+ 
+             @Override
+             public void close() throws IOException {}
+ 
+             @Override
+             public List<IndexMaintainer> getIndexMaintainers() {
+                 return indexMaintainers;
+             }
+ 
+             @Override
+             public PhoenixTransactionContext getTransactionContext() {
+                 PhoenixTransactionContext context = connection.getMutationState().getPhoenixTransactionContext();
+                 return context.newTransactionContext(context, true);
+             }
+ 
+             @Override
+             public int getClientVersion() {
+                 return MetaDataProtocol.PHOENIX_VERSION;
+             }
+ 
+         };
+         try {
+             PhoenixIndexMetaData indexMetaData = new PhoenixIndexMetaData(indexMetaDataCache,
attributes);
 -            return new PhoenixTxIndexMutationGenerator(connection.getQueryServices().getConfiguration(),
indexMetaData,
 -                    table.getPhysicalName().getBytes());
++            return new PhoenixTxIndexMutationGenerator(connection.getQueryServices(),connection.getQueryServices().getConfiguration(),
indexMetaData,
++                    table.getPhysicalName().getBytes(), null, null);
+         } catch (IOException e) {
+             throw new RuntimeException(e); // Impossible
+         }
+     }
  }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixTransactionalIndexer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/transaction/OmidTransactionContext.java
----------------------------------------------------------------------
diff --cc phoenix-core/src/main/java/org/apache/phoenix/transaction/OmidTransactionContext.java
index 28d6276,d235d4b..cae6a84
--- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/OmidTransactionContext.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/transaction/OmidTransactionContext.java
@@@ -303,18 -126,15 +303,22 @@@ public class OmidTransactionContext imp
          
      }
  
 +    /**
 +    *  OmidTransactionContext specific functions
 +    */
 +
 +    public HBaseTransaction getTransaction() {
 +        return tx;
 +    }
 +
 +
      @Override
 -    public HTableInterface getTransactionalTable(HTableInterface htable, boolean isImmutable)
{
 -        // TODO Auto-generated method stub
 -        return null;
 +    public HTableInterface getTransactionalTable(HTableInterface htable, boolean isConflictFree)
throws SQLException {
 +        return new OmidTransactionTable(this, htable, isConflictFree);
      }
  
+     @Override
 -    public HTableInterface getTransactionalTableWriter(PhoenixConnection connection, PTable
table, HTableInterface htable, boolean isIndex) {
 -        // TODO Auto-generated method stub
 -        return null;
++    public HTableInterface getTransactionalTableWriter(PhoenixConnection connection, PTable
table, HTableInterface htable, boolean isIndex) throws SQLException {
++        return new OmidTransactionTable(this, htable, table.isImmutableRows() || isIndex);
+     }
  }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/transaction/PhoenixTransactionContext.java
----------------------------------------------------------------------
diff --cc phoenix-core/src/main/java/org/apache/phoenix/transaction/PhoenixTransactionContext.java
index 5cb9154,dfa35be..9141f89
--- a/phoenix-core/src/main/java/org/apache/phoenix/transaction/PhoenixTransactionContext.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/transaction/PhoenixTransactionContext.java
@@@ -105,9 -106,14 +106,14 @@@ public interface PhoenixTransactionCont
          }
  
          @Override
 -        public HTableInterface getTransactionalTable(HTableInterface htable, boolean isImmutable)
{
 +        public HTableInterface getTransactionalTable(HTableInterface htable, boolean isConflictFree)
{
              return null;
          }
+ 
+         @Override
+         public HTableInterface getTransactionalTableWriter(PhoenixConnection connection,
PTable table, HTableInterface htable, boolean isIndex) {
+             return null;
+         }
      };
      /**
       * 
@@@ -224,5 -230,6 +230,6 @@@
      public Provider getProvider();
      public PhoenixTransactionContext newTransactionContext(PhoenixTransactionContext contex,
boolean subTask);
  
 -    public HTableInterface getTransactionalTable(HTableInterface htable, boolean isImmutable);
 +    public HTableInterface getTransactionalTable(HTableInterface htable, boolean isConflictFree)
throws SQLException;
- }
+     public HTableInterface getTransactionalTableWriter(PhoenixConnection connection, PTable
table, HTableInterface htable, boolean isIndex) throws SQLException;
+ }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/transaction/TephraTransactionContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
----------------------------------------------------------------------
diff --cc phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
index 7e280f4,3fe5438..22bac58
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
@@@ -116,7 -116,6 +116,7 @@@ import org.apache.phoenix.schema.types.
  import org.apache.phoenix.schema.types.PLong;
  import org.apache.phoenix.schema.types.PVarbinary;
  import org.apache.phoenix.schema.types.PVarchar;
- import org.apache.phoenix.transaction.PhoenixTransactionContext;
++import org.apache.phoenix.transaction.PhoenixTransactionProvider.Feature;
  
  import com.google.common.collect.Lists;
  
@@@ -844,5 -817,12 +818,15 @@@ public class IndexUtil 
      				.setTableName(indexName).build().buildException();
      	}
      }
+ 
+     public static List<PTable> getClientMaintainedIndexes(PTable table) {
+         Iterator<PTable> indexIterator = // Only maintain tables with immutable rows
through this client-side mechanism
 -        (table.isImmutableRows() || table.isTransactional()) ? IndexMaintainer.maintainedGlobalIndexes(table
 -                .getIndexes().iterator()) : Collections.<PTable> emptyIterator();
++                (table.isTransactional() && table.getTransactionProvider().getTransactionProvider().isUnsupported(Feature.MAINTAIN_LOCAL_INDEX_ON_SERVER))
?
++                         IndexMaintainer.maintainedIndexes(table.getIndexes().iterator())
:
++                             (table.isImmutableRows() || table.isTransactional()) ?
++                                IndexMaintainer.maintainedGlobalIndexes(table.getIndexes().iterator())
:
++                                    Collections.<PTable>emptyIterator();
+         return Lists.newArrayList(indexIterator);
+     }
      
  }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/ec7a6607/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 7b2f7b0,859157d..3e3511a
--- a/pom.xml
+++ b/pom.xml
@@@ -100,9 -100,7 +100,8 @@@
      <joni.version>2.1.2</joni.version>
      <avatica.version>1.10.0</avatica.version>
      <jettyVersion>8.1.7.v20120910</jettyVersion>
-     <tephra.version>0.13.0-incubating</tephra.version>
-     <!-- <tephra.version>0.12.0-incubating</tephra.version> -->
+     <tephra.version>0.14.0-incubating</tephra.version>
 +    <omid.version>0.8.2.11-SNAPSHOT</omid.version>
      <spark.version>2.0.2</spark.version>
      <scala.version>2.11.8</scala.version>
      <scala.binary.version>2.11</scala.binary.version>


Mime
View raw message