[ 
https://issues.apache.org/jira/browse/GOBBLIN-1117?focusedWorklogId=423663&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-423663
 ]

ASF GitHub Bot logged work on GOBBLIN-1117:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Apr/20 19:11
            Start Date: 16/Apr/20 19:11
    Worklog Time Spent: 10m 
      Work Description: zxcware commented on pull request #2957: 
[GOBBLIN-1117]Enable record count verification for ORC format
URL: https://github.com/apache/incubator-gobblin/pull/2957#discussion_r409785019
 
 

 ##########
 File path: 
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionThresholdVerifier.java
 ##########
 @@ -62,34 +62,41 @@ public CompactionThresholdVerifier(State state) {
    *
    * @return true iff the difference exceeds the threshold or this is the 
first time compaction
    */
-  public Result verify (FileSystemDataset dataset) {
+  public Result verify(FileSystemDataset dataset) {
 
     Map<String, Double> thresholdMap = RecompactionConditionBasedOnRatio.
-            getDatasetRegexAndRecompactThreshold 
(state.getProp(MRCompactor.COMPACTION_LATEDATA_THRESHOLD_FOR_RECOMPACT_PER_DATASET,
-                    StringUtils.EMPTY));
+        getDatasetRegexAndRecompactThreshold(
+            
state.getProp(MRCompactor.COMPACTION_LATEDATA_THRESHOLD_FOR_RECOMPACT_PER_DATASET,
 StringUtils.EMPTY));
 
     CompactionPathParser.CompactionParserResult result = new 
CompactionPathParser(state).parse(dataset);
 
-    double threshold = 
RecompactionConditionBasedOnRatio.getRatioThresholdByDatasetName(result.getDatasetName(),
 thresholdMap);
-    log.debug ("Threshold is {} for dataset {}", threshold, 
result.getDatasetName());
+    double threshold =
+        
RecompactionConditionBasedOnRatio.getRatioThresholdByDatasetName(result.getDatasetName(),
 thresholdMap);
+    log.debug("Threshold is {} for dataset {}", threshold, 
result.getDatasetName());
 
     InputRecordCountHelper helper = new InputRecordCountHelper(state);
     try {
       double newRecords = 0;
       if (!dataset.isVirtual()) {
-        newRecords = helper.calculateRecordCount (Lists.newArrayList(new 
Path(dataset.datasetURN())));
+        newRecords = helper.calculateRecordCount(Lists.newArrayList(new 
Path(dataset.datasetURN())));
       }
-      double oldRecords = helper.readRecordCount (new 
Path(result.getDstAbsoluteDir()));
+      double oldRecords = helper.readRecordCount(new 
Path(result.getDstAbsoluteDir()));
 
       if (oldRecords == 0) {
         return new Result(true, "");
       }
       if ((newRecords - oldRecords) / oldRecords > threshold) {
-        log.debug ("Dataset {} records exceeded the threshold {}", 
dataset.datasetURN(), threshold);
+        if (newRecords < oldRecords) {
 
 Review comment:
   put outside? otherwise, `(newRecords - oldRecords) / oldRecords` is a 
negative value and will be always smaller than a positive threshold.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 423663)
    Time Spent: 40m  (was: 0.5h)

> Fix hard-code avro suffix in record-count verification process for 
> re-compaction
> --------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1117
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1117
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Lei Sun
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to