Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 ea81f4766 -> 4ced25530


PHOENIX-4949 - IndexTool - updateIndexState called too many times unnecessarily


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 4ced255304a99fa9d92132301476c2e8c79b30ab
Parents: ea81f47
Author: Geoffrey <[email protected]>
Authored: Thu Oct 4 11:20:56 2018 -0700
Committer: Geoffrey Jacoby <[email protected]>
Committed: Thu Oct 4 13:24:17 2018 -0700

----------------------------------------------------------------------
 .../index/PhoenixIndexImportDirectReducer.java       | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4ced2553/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
index 51b88c1..0786b9b 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
@@ -36,22 +36,11 @@ public class PhoenixIndexImportDirectReducer extends
         Reducer<ImmutableBytesWritable, IntWritable, NullWritable, 
NullWritable> {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(PhoenixIndexImportDirectReducer.class);
-    private Configuration configuration;
 
-    /**
-     * Called once at the start of the task.
-     */
     @Override
-    protected void setup(Context context) throws IOException, 
InterruptedException {
-        configuration = context.getConfiguration();
-    }
-
-    @Override
-    protected void reduce(ImmutableBytesWritable arg0, Iterable<IntWritable> 
arg1,
-            Reducer<ImmutableBytesWritable, IntWritable, NullWritable, 
NullWritable>.Context arg2)
-            throws IOException, InterruptedException {
+    protected void cleanup(Context context) throws IOException, 
InterruptedException{
         try {
-            IndexToolUtil.updateIndexState(configuration, PIndexState.ACTIVE);
+            IndexToolUtil.updateIndexState(context.getConfiguration(), 
PIndexState.ACTIVE);
         } catch (SQLException e) {
             LOG.error(" Failed to update the status to Active");
             throw new RuntimeException(e.getMessage());

Reply via email to