Search in sources :

Example 1 with Results

use of org.apache.gobblin.compaction.verify.DataCompletenessVerifier.Results in project incubator-gobblin by apache.

the class MRCompactor method verifyDataCompleteness.

private void verifyDataCompleteness() {
    List<Pattern> blacklist = DatasetFilterUtils.getPatternList(this.state, COMPACTION_COMPLETENESS_VERIFICATION_BLACKLIST);
    List<Pattern> whitelist = DatasetFilterUtils.getPatternList(this.state, COMPACTION_COMPLETENESS_VERIFICATION_WHITELIST);
    int numDatasetsVerifiedTogether = getNumDatasetsVerifiedTogether();
    List<Dataset> datasetsToBeVerified = Lists.newArrayList();
    for (Dataset dataset : this.datasets) {
        if (dataset.state() != UNVERIFIED) {
            continue;
        }
        if (shouldVerifyCompletenessForDataset(dataset, blacklist, whitelist)) {
            datasetsToBeVerified.add(dataset);
            if (datasetsToBeVerified.size() >= numDatasetsVerifiedTogether) {
                ListenableFuture<Results> future = this.verifier.get().verify(datasetsToBeVerified);
                addCallback(datasetsToBeVerified, future);
                datasetsToBeVerified = Lists.newArrayList();
            }
        } else {
            dataset.setState(VERIFIED);
        }
    }
    if (!datasetsToBeVerified.isEmpty()) {
        ListenableFuture<Results> future = this.verifier.get().verify(datasetsToBeVerified);
        addCallback(datasetsToBeVerified, future);
    }
}
Also used : Pattern(java.util.regex.Pattern) Results(org.apache.gobblin.compaction.verify.DataCompletenessVerifier.Results) Dataset(org.apache.gobblin.compaction.dataset.Dataset)

Aggregations

Pattern (java.util.regex.Pattern)1 Dataset (org.apache.gobblin.compaction.dataset.Dataset)1 Results (org.apache.gobblin.compaction.verify.DataCompletenessVerifier.Results)1