autumnust commented on a change in pull request #2957: [GOBBLIN-1117]Enable
record count verification for ORC format
URL: https://github.com/apache/incubator-gobblin/pull/2957#discussion_r409836707
##########
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:
Will address.
----------------------------------------------------------------
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]
With regards,
Apache Git Services