You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/09/02 04:15:05 UTC

[GitHub] [incubator-druid] sekingme commented on a change in pull request #8281: Add realization for updating version of derived segments in Materiali…

sekingme commented on a change in pull request #8281: Add realization for updating version of derived segments in Materiali…
URL: https://github.com/apache/incubator-druid/pull/8281#discussion_r319801887
 
 

 ##########
 File path: extensions-contrib/materialized-view-maintenance/src/main/java/org/apache/druid/indexing/materializedview/MaterializedViewSupervisor.java
 ##########
 @@ -369,6 +369,19 @@ void checkSegmentsAndSubmitTasks()
     MapDifference<Interval, String> difference = Maps.difference(maxCreatedDate, derivativeVersion);
     Map<Interval, String> toBuildInterval = new HashMap<>(difference.entriesOnlyOnLeft());
     Map<Interval, String> toDropInterval = new HashMap<>(difference.entriesOnlyOnRight());
+    // update version of derived segments if isn't the max (created_date) of all base segments
+    // prevent user supplied segments list did not match with segments list obtained from db
+    Map<Interval, MapDifference.ValueDifference<String>> checkIfNewestVersion =
+            new HashMap<>(difference.entriesDiffering());
+    for (Map.Entry<Interval, MapDifference.ValueDifference<String>> entry : checkIfNewestVersion.entrySet()) {
+      String versionOfBase = maxCreatedDate.get(entry.getKey());
+      String versionOfDerivative = derivativeVersion.get(entry.getKey());
+      if (versionOfBase.compareTo(versionOfDerivative) > 0 &&
 
 Review comment:
   Sure, already change the code and add some unit tests.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org