Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

yanxinyi
Copy link
Contributor

…EW_TTL has expired

@yanxinyi yanxinyi changed the title Phoenix 5592 MapReduce job to asynchronously delete rows where the VIEW_TTL has expired PHOENIX-5592 MapReduce job to asynchronously delete rows where the VIEW_TTL has expired Apr 16, 2020
initMultiViewJobStatusTracker(config);
}

LOGGER.debug(String.format("Deleting from view %s, TenantID %s, and TTL value: %d",
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -24,6 +24,25 @@
import java.io.IOException;

public interface ViewInfoWritable extends Writable {
public enum ViewInfoJobState {
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

@jpisaac jpisaac left a 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.

@jpisaac
Copy link
Contributor

jpisaac commented Apr 30, 2020

@xinyi Another suggestion I have is whether u want to split this into 2 PRs?

  1. A general framework to use multiple input views in a MR jobs.
  2. MR job using the above framework to delete VIEW TTL expired rows.

Copy link
Contributor

@ChinmaySKulkarni ChinmaySKulkarni left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

this.multiViewJobStatusTracker = (MultiViewJobStatusTracker) defaultViewDeletionTrackerClass.newInstance();
} catch (Exception e) {
LOGGER.info("exception " + e.getMessage());
LOGGER.info("stack trace" + e.getStackTrace().toString());
Copy link
Contributor

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.

@stoty
Copy link
Contributor

stoty commented Aug 1, 2023

Already merged.

@stoty stoty closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants