-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHOENIX-5592 MapReduce job to asynchronously delete rows where the VIEW_TTL has expired #762
Conversation
…EW_TTL has expired
… end users can have customized metrics based on the STATE
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixMultiViewInputFormat.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixMultiViewReader.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/ViewTTLDeleteJobMapper.java
Outdated
Show resolved
Hide resolved
initMultiViewJobStatusTracker(config); | ||
} | ||
|
||
LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log at debug level only if debug level enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the config of debug-level enabled, it will omit the logging for the debug level logging.
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/ViewTTLDeleteJobMapper.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/DefaultMultiViewSplitStrategy.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/MultiViewSplitStrategy.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixViewTtlUtil.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/apache/phoenix/mapreduce/util/DefaultPhoenixMultiViewListProvider.java
Outdated
Show resolved
Hide resolved
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/DefaultMultiViewSplitStrategy.java
Show resolved
Hide resolved
@@ -24,6 +24,25 @@ | |||
import java.io.IOException; | |||
|
|||
public interface ViewInfoWritable extends Writable { | |||
public enum ViewInfoJobState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on reafctoring it out to be more generic.
@@ -24,24 +24,6 @@ | |||
import java.io.IOException; | |||
|
|||
public class ViewInfoTracker implements ViewInfoWritable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Good job on refactoring out it to an interface. Now that you have refactored it out it can be called ViewTTLInfoWritable? Since it contains TTL related info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks LGTM to me, apart from a few nits.
Can you get @ChinmaySKulkarni to also look at it.
@xinyi Another suggestion I have is whether u want to split this into 2 PRs?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good @yanxinyi. Great job! I have provided some comments. Overall, please check that we create Phoenix/HBase connections and Phoenix statements via some sort of try-with-resources to avoid any resource leaks.
|
||
private final int ONE = 1; | ||
private final int ZERO = 0; | ||
private final int NUMBER_OF_UPSERT_ROWS = 202; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, any reason we choose 202?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the default split size is 100, it will have an uneven split in this case.
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/ViewTTLDeleteJobMapper.java
Show resolved
Hide resolved
...ore/src/main/java/org/apache/phoenix/mapreduce/util/DefaultPhoenixMultiViewListProvider.java
Show resolved
Hide resolved
this.multiViewJobStatusTracker = (MultiViewJobStatusTracker) defaultViewDeletionTrackerClass.newInstance(); | ||
} catch (Exception e) { | ||
LOGGER.info("exception " + e.getMessage()); | ||
LOGGER.info("stack trace" + e.getStackTrace().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we swallowing the exception here? Can it be rethrown? Also, in case we DO want to swallow the exception and just log it, this should be error
level.
Already merged. |
…EW_TTL has expired