phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject git commit: Remove unused imports, cleanup unnecessary member variable in InListExpression
Date Sun, 20 Jul 2014 00:22:54 GMT
Repository: phoenix
Updated Branches:
  refs/heads/3.0 866d43266 -> 1483998e5


Remove unused imports, cleanup unnecessary member variable in InListExpression


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

Branch: refs/heads/3.0
Commit: 1483998e5f1e33ea022bd3a0ee54fe99c70403ee
Parents: 866d432
Author: James Taylor <jtaylor@salesforce.com>
Authored: Sat Jul 19 17:25:47 2014 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Sat Jul 19 17:25:47 2014 -0700

----------------------------------------------------------------------
 .../phoenix/end2end/FirstValueFunctionIT.java   | 11 ++++--
 .../phoenix/end2end/LastValueFunctionIT.java    | 11 ++++--
 .../phoenix/end2end/NthValueFunctionIT.java     | 11 ++++--
 .../phoenix/mapreduce/CsvBulkLoadToolIT.java    |  1 -
 .../phoenix/compile/CreateSequenceCompiler.java |  4 +--
 .../phoenix/expression/InListExpression.java    |  9 +++--
 .../phoenix/expression/ModulusExpression.java   |  4 ---
 .../FirstLastValueBaseClientAggregator.java     |  1 +
 .../expression/function/SubstrFunction.java     |  1 -
 .../phoenix/iterate/ParallelIterators.java      | 38 +++++++++++++++-----
 .../phoenix/mapreduce/CsvBulkLoadTool.java      |  6 ----
 .../apache/phoenix/parse/ParseNodeVisitor.java  |  1 -
 .../query/ConnectionQueryServicesImpl.java      |  1 -
 13 files changed, 62 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/it/java/org/apache/phoenix/end2end/FirstValueFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FirstValueFunctionIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FirstValueFunctionIT.java
index de19cec..6c080d3 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/FirstValueFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/FirstValueFunctionIT.java
@@ -17,9 +17,14 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.junit.Assert.*;
-import java.sql.*;
-import static org.apache.hadoop.hbase.util.VersionInfo.getUrl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+
 import org.junit.Test;
 
 public class FirstValueFunctionIT extends BaseHBaseManagedTimeIT {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java
index 4886b4d..fd7fa73 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/LastValueFunctionIT.java
@@ -17,9 +17,14 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.junit.Assert.*;
-import java.sql.*;
-import static org.apache.hadoop.hbase.util.VersionInfo.getUrl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+
 import org.junit.Test;
 
 public class LastValueFunctionIT extends BaseHBaseManagedTimeIT {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/it/java/org/apache/phoenix/end2end/NthValueFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NthValueFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NthValueFunctionIT.java
index 94067f9..8a62da9 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NthValueFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NthValueFunctionIT.java
@@ -17,9 +17,14 @@
  */
 package org.apache.phoenix.end2end;
 
-import static org.junit.Assert.*;
-import java.sql.*;
-import static org.apache.hadoop.hbase.util.VersionInfo.getUrl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+
 import org.junit.Test;
 
 public class NthValueFunctionIT extends BaseHBaseManagedTimeIT {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
index d4a80a2..c6d9b61 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertTrue;
 import java.io.PrintWriter;
 import java.sql.Connection;
 import java.sql.DriverManager;
-import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.Statement;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateSequenceCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateSequenceCompiler.java
b/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateSequenceCompiler.java
index d31a8f1..6a92ecd 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateSequenceCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateSequenceCompiler.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.exception.SQLExceptionCode;
-import org.apache.phoenix.exception.SQLExceptionInfo;
 import org.apache.phoenix.execute.MutationState;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -31,14 +30,13 @@ import org.apache.phoenix.jdbc.PhoenixStatement;
 import org.apache.phoenix.parse.BindParseNode;
 import org.apache.phoenix.parse.CreateSequenceStatement;
 import org.apache.phoenix.parse.ParseNode;
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.parse.TableName;
+import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.MetaDataClient;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.PDatum;
 import org.apache.phoenix.schema.SortOrder;
-
 import org.apache.phoenix.util.SequenceUtil;
 
 public class CreateSequenceCompiler {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
index 979af0c..011da55 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/InListExpression.java
@@ -22,6 +22,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.sql.SQLException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
@@ -48,8 +49,7 @@ import com.google.common.collect.Sets;
  *
  */
 public class InListExpression extends BaseSingleExpression {
-    public final LinkedHashSet<ImmutableBytesPtr> EMPTY_SET = new LinkedHashSet<ImmutableBytesPtr>();
-    private LinkedHashSet<ImmutableBytesPtr> values;
+    private Set<ImmutableBytesPtr> values;
     private ImmutableBytesPtr minValue;
     private ImmutableBytesPtr maxValue;
     private int valuesByteLength;
@@ -135,10 +135,12 @@ public class InListExpression extends BaseSingleExpression {
         if (values.isEmpty()) {
             this.minValue = ByteUtil.EMPTY_BYTE_ARRAY_PTR;
             this.maxValue = ByteUtil.EMPTY_BYTE_ARRAY_PTR;
-            this.values = EMPTY_SET;
+            this.values = Collections.emptySet();
         } else {
             this.minValue = valuesArray[0];
             this.maxValue = valuesArray[valuesArray.length-1];
+            // Use LinkedHashSet on client-side so that we don't need to serialize the
+            // minValue and maxValue but can infer them based on the first and last position.
             this.values = new LinkedHashSet<ImmutableBytesPtr>(Arrays.asList(valuesArray));
         }
     }
@@ -205,6 +207,7 @@ public class InListExpression extends BaseSingleExpression {
         byte[] valuesBytes = Bytes.readByteArray(input);
         valuesByteLength = valuesBytes.length;
         int len = fixedWidth == -1 ? WritableUtils.readVInt(input) : valuesByteLength / fixedWidth;
+        // TODO: consider using a regular HashSet as we never serialize from the server-side
         values = Sets.newLinkedHashSetWithExpectedSize(len);
         int offset = 0;
         int i  = 0;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/expression/ModulusExpression.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/ModulusExpression.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/ModulusExpression.java
index c8dfe93..5ca2140 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/ModulusExpression.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/ModulusExpression.java
@@ -21,10 +21,6 @@ import java.sql.SQLException;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
-import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.expression.function.ScalarFunction;
-import org.apache.phoenix.parse.FunctionParseNode.Argument;
-import org.apache.phoenix.parse.FunctionParseNode.BuiltInFunction;
 import org.apache.phoenix.schema.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstLastValueBaseClientAggregator.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstLastValueBaseClientAggregator.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstLastValueBaseClientAggregator.java
index fde79ba..e0b7113 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstLastValueBaseClientAggregator.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/FirstLastValueBaseClientAggregator.java
@@ -90,6 +90,7 @@ public class FirstLastValueBaseClientAggregator extends BaseAggregator {
         return true;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void aggregate(Tuple tuple, ImmutableBytesWritable ptr) {
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/expression/function/SubstrFunction.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/SubstrFunction.java
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/SubstrFunction.java
index a7f15ac..f2ad764 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/SubstrFunction.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/SubstrFunction.java
@@ -19,7 +19,6 @@ package org.apache.phoenix.expression.function;
 
 import java.io.DataInput;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.util.List;
 
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIterators.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIterators.java
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIterators.java
index 34373bd..61767ee 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIterators.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIterators.java
@@ -18,9 +18,20 @@
 package org.apache.phoenix.iterate;
 
 import java.sql.SQLException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
-import java.util.concurrent.*;
+import java.util.NavigableSet;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.client.Scan;
@@ -29,17 +40,28 @@ import org.apache.hadoop.hbase.filter.PageFilter;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.phoenix.compile.GroupByCompiler.GroupBy;
-import org.apache.phoenix.compile.*;
-import org.apache.phoenix.coprocessor.BaseScannerRegionObserver;
+import org.apache.phoenix.compile.RowProjector;
+import org.apache.phoenix.compile.StatementContext;
 import org.apache.phoenix.filter.ColumnProjectionFilter;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.job.JobManager.JobCallable;
-import org.apache.phoenix.parse.*;
+import org.apache.phoenix.parse.FilterableStatement;
+import org.apache.phoenix.parse.HintNode;
 import org.apache.phoenix.parse.HintNode.Hint;
-import org.apache.phoenix.query.*;
-import org.apache.phoenix.schema.*;
+import org.apache.phoenix.query.ConnectionQueryServices;
+import org.apache.phoenix.query.KeyRange;
+import org.apache.phoenix.query.QueryConstants;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.schema.PColumnFamily;
+import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.PTable.ViewType;
-import org.apache.phoenix.util.*;
+import org.apache.phoenix.schema.SaltingUtil;
+import org.apache.phoenix.schema.TableRef;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SQLCloseables;
+import org.apache.phoenix.util.ScanUtil;
+import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.ServerUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java
index 84fc5d5..6e2b0c7 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java
@@ -17,7 +17,6 @@
  */
 package org.apache.phoenix.mapreduce;
 
-import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
@@ -48,21 +47,16 @@ import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.mapreduce.HFileOutputFormat;
 import org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles;
-import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
 import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
-import org.apache.phoenix.coprocessor.MetaDataProtocol.MetaDataMutationResult;
-import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 import org.apache.phoenix.job.JobManager;
 import org.apache.phoenix.query.QueryConstants;
-import org.apache.phoenix.schema.MetaDataClient;
 import org.apache.phoenix.schema.PTable;
-import org.apache.phoenix.schema.TableNotFoundException;
 import org.apache.phoenix.util.CSVCommonsLoader;
 import org.apache.phoenix.util.ColumnInfo;
 import org.apache.phoenix.util.PhoenixRuntime;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeVisitor.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeVisitor.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeVisitor.java
index 5308677..40354fe 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeVisitor.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/ParseNodeVisitor.java
@@ -18,7 +18,6 @@
 package org.apache.phoenix.parse;
 
 import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
 import java.util.List;
 
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/1483998e/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index d02859b..4d21bdd 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -1773,7 +1773,6 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices
implement
 
     // Take no locks, as this only gets run when there are no open connections
     // so there's no danger of contention.
-    @SuppressWarnings("deprecation")
     private void returnAllSequences(ConcurrentMap<SequenceKey,Sequence> sequenceMap)
throws SQLException {
         List<Append> mutations = Lists.newArrayListWithExpectedSize(sequenceMap.size());
         for (Sequence sequence : sequenceMap.values()) {


Mime
View raw message