gokceni commented on a change in pull request #705: PHOENIX-5723
PhoenixIndexImportDirectReducer cleanup method updates i…
URL: https://github.com/apache/phoenix/pull/705#discussion_r378530118
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/PhoenixIndexImportDirectReducer.java
##########
@@ -100,55 +100,20 @@ private void updateCounters(IndexTool.IndexVerifyType
verifyType,
@Override
protected void reduce(ImmutableBytesWritable arg0, Iterable<IntWritable>
arg1,
- Reducer<ImmutableBytesWritable, IntWritable,
NullWritable, NullWritable>.Context context)
- throws IOException, InterruptedException
-
- {
+ Reducer<ImmutableBytesWritable, IntWritable, NullWritable,
NullWritable>.Context context)
+ throws IOException, InterruptedException {
if (!calledOnce.compareAndSet(false, true)) {
return;
}
- IndexTool.IndexVerifyType verifyType =
getIndexVerifyType(context.getConfiguration());
- if (verifyType != IndexTool.IndexVerifyType.NONE) {
- updateCounters(verifyType, context);
- }
- }
-
- @Override
- protected void cleanup(Context context) throws IOException,
InterruptedException{
try {
- IndexToolUtil.updateIndexState(context.getConfiguration(),
PIndexState.ACTIVE);
-
- updateTasksTable(context);
+ IndexTool.IndexVerifyType verifyType =
getIndexVerifyType(configuration);
+ if (verifyType != IndexTool.IndexVerifyType.NONE) {
+ updateCounters(verifyType, context);
+ }
+ IndexToolUtil.updateIndexState(configuration, PIndexState.ACTIVE);
} catch (SQLException e) {
LOGGER.error(" Failed to update the status to Active");
throw new RuntimeException(e.getMessage());
}
}
-
- private void updateTasksTable(Context context) throws SQLException,
IOException {
Review comment:
Please don't remove this method. Removing will cause IndexRebuildTaskIT to
fail.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services