public HiveDatasetVersionCleaner(DatasetVersion datasetVersion, CleanableDataset cleanableDataset) { super(datasetVersion, cleanableDataset); Preconditions.checkArgument(cleanableDataset instanceof CleanableHiveDataset, String.format("%s only supports %s, " + "found: %s", this.getClass(), CleanableHiveDataset.class, cleanableDataset.getClass())); Preconditions.checkArgument(datasetVersion instanceof HiveDatasetVersion, String.format("%s only supports %s, " + "found: %s", this.getClass(), HiveDatasetVersionCleaner.class, datasetVersion.getClass())); this.cleanableHiveDataset = (CleanableHiveDataset) cleanableDataset; this.hiveDatasetVersion = (HiveDatasetVersion) datasetVersion; // For post cleanup activity: // Get db / table name from which partition has to be replaced-in for the target partition being deleted. this.replacementDbName = Optional.fromNullable(ConfigUtils.getString(cleanableHiveDataset.getDatasetConfig(), REPLACEMENT_HIVE_DB_NAME_KEY, null)); this.replacementTableName = Optional.fromNullable(ConfigUtils.getString(cleanableHiveDataset.getDatasetConfig(), REPLACEMENT_HIVE_TABLE_NAME_KEY, null)); }
boolean shouldReplacePartition = shouldReplacePartition(cleanableHiveDataset.getDatasetConfig(), hiveDatasetVersion.getPartition().getTable().getDbName(), hiveDatasetVersion.getPartition().getTable().getTableName(), this.replacementDbName, this.replacementTableName);
public HiveDatasetVersionCleaner(DatasetVersion datasetVersion, CleanableDataset cleanableDataset) { super(datasetVersion, cleanableDataset); Preconditions.checkArgument(cleanableDataset instanceof CleanableHiveDataset, String.format("%s only supports %s, " + "found: %s", this.getClass(), CleanableHiveDataset.class, cleanableDataset.getClass())); Preconditions.checkArgument(datasetVersion instanceof HiveDatasetVersion, String.format("%s only supports %s, " + "found: %s", this.getClass(), HiveDatasetVersionCleaner.class, datasetVersion.getClass())); this.cleanableHiveDataset = (CleanableHiveDataset) cleanableDataset; this.hiveDatasetVersion = (HiveDatasetVersion) datasetVersion; // For post cleanup activity: // Get db / table name from which partition has to be replaced-in for the target partition being deleted. this.replacementDbName = Optional.fromNullable(ConfigUtils.getString(cleanableHiveDataset.getDatasetConfig(), REPLACEMENT_HIVE_DB_NAME_KEY, null)); this.replacementTableName = Optional.fromNullable(ConfigUtils.getString(cleanableHiveDataset.getDatasetConfig(), REPLACEMENT_HIVE_TABLE_NAME_KEY, null)); }
boolean shouldReplacePartition = shouldReplacePartition(cleanableHiveDataset.getDatasetConfig(), hiveDatasetVersion.getPartition().getTable().getDbName(), hiveDatasetVersion.getPartition().getTable().getTableName(), this.replacementDbName, this.replacementTableName);