Search in sources :

Example 6 with HivePartitionDataset

use of org.apache.gobblin.compliance.HivePartitionDataset in project incubator-gobblin by apache.

the class RestorableHivePartitionDatasetFinder method findDatasets.

/**
 * Will return a Singleton list of HivePartitionDataset to be restored.
 */
public List<HivePartitionDataset> findDatasets() throws IOException {
    Preconditions.checkArgument(this.state.contains(ComplianceConfigurationKeys.RESTORE_DATASET), "Missing required property " + ComplianceConfigurationKeys.RESTORE_DATASET);
    HivePartitionDataset hivePartitionDataset = HivePartitionFinder.findDataset(this.state.getProp(ComplianceConfigurationKeys.RESTORE_DATASET), this.state);
    Preconditions.checkNotNull(hivePartitionDataset, "No dataset to restore");
    return Collections.singletonList(hivePartitionDataset);
}
Also used : HivePartitionDataset(org.apache.gobblin.compliance.HivePartitionDataset)

Example 7 with HivePartitionDataset

use of org.apache.gobblin.compliance.HivePartitionDataset in project incubator-gobblin by apache.

the class CleanableHivePartitionDatasetFinder method findDatasets.

/**
 * Will find all datasets according to whitelist, except the backup and staging tables.
 */
public List<HivePartitionDataset> findDatasets() throws IOException {
    List<HivePartitionDataset> list = new ArrayList<>();
    for (HivePartitionDataset hivePartitionDataset : super.findDatasets()) {
        CleanableHivePartitionDataset dataset = new CleanableHivePartitionDataset(hivePartitionDataset, this.fs, this.state);
        list.add(dataset);
    }
    return list;
}
Also used : HivePartitionDataset(org.apache.gobblin.compliance.HivePartitionDataset) ArrayList(java.util.ArrayList)

Aggregations

HivePartitionDataset (org.apache.gobblin.compliance.HivePartitionDataset)7 State (org.apache.gobblin.configuration.State)3 ArrayList (java.util.ArrayList)2 WorkUnit (org.apache.gobblin.source.workunit.WorkUnit)2 Splitter (com.google.common.base.Splitter)1 HashMap (java.util.HashMap)1 HivePartitionVersion (org.apache.gobblin.compliance.HivePartitionVersion)1 HivePartitionVersionFinder (org.apache.gobblin.compliance.HivePartitionVersionFinder)1 WorkUnitState (org.apache.gobblin.configuration.WorkUnitState)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Partition (org.apache.hadoop.hive.ql.metadata.Partition)1 Table (org.apache.hadoop.hive.ql.metadata.Table)1 TException (org.apache.thrift.TException)1