sakshamgangwar commented on a change in pull request #1079:
URL: https://github.com/apache/phoenix/pull/1079#discussion_r560522807



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/iterate/TableSnapshotResultIterator.java
##########
@@ -88,19 +90,34 @@ public TableSnapshotResultIterator(Configuration 
configuration, Scan scan, ScanM
   }
 
   private void init() throws IOException {
-    RestoreSnapshotHelper.RestoreMetaChanges meta =
-        RestoreSnapshotHelper.copySnapshotForScanner(this.configuration, 
this.fs,
-            this.rootDir, this.restoreDir, this.snapshotName);
-    List<RegionInfo> restoredRegions = meta.getRegionsToAdd();
-    this.htd = meta.getTableDescriptor();
-    this.regions = new ArrayList<RegionInfo>(restoredRegions.size());
-
-    for (RegionInfo restoredRegion : restoredRegions) {
-      if (isValidRegion(restoredRegion)) {
-        this.regions.add(restoredRegion);
+    if 
(PhoenixConfigurationUtil.getMRSnapshotManagedInternally(configuration)) {

Review comment:
       @bharathv doing the restore per MR job can be handled at one place but I 
was not able to get any spot to delete/cleanup the restore right after the job 
is done on phoenix side. On the caller side, I am able to do the cleanup, so in 
order to handle it in a clean way: I added this configuration to explicitly 
say: whether or not restore needs to be managed internally or externally. If 
internally I am keeping the original flow (with issue) as it is. Externally: 
restore + delete happens on the MR job caller side.  




----------------------------------------------------------------
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]


Reply via email to