Use self-contained Preconditions (in hadoop common module)
This commit is contained in:
parent
b20d228c69
commit
c906c78e3e
|
@ -33,9 +33,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
|
|
||||||
import org.apache.hadoop.util.Preconditions;
|
import static org.apache.hadoop.util.Preconditions.checkArgument;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The OptionsParser parses out the command-line options passed to DistCp,
|
* The OptionsParser parses out the command-line options passed to DistCp,
|
||||||
|
@ -69,7 +67,7 @@ public class OptionsParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkSnapshotsArgs(final String[] snapshots) {
|
private static void checkSnapshotsArgs(final String[] snapshots) {
|
||||||
Preconditions.checkArgument(snapshots != null && snapshots.length == 2
|
checkArgument(snapshots != null && snapshots.length == 2
|
||||||
&& !StringUtils.isBlank(snapshots[0])
|
&& !StringUtils.isBlank(snapshots[0])
|
||||||
&& !StringUtils.isBlank(snapshots[1]),
|
&& !StringUtils.isBlank(snapshots[1]),
|
||||||
"Must provide both the starting and ending snapshot names");
|
"Must provide both the starting and ending snapshot names");
|
||||||
|
|
|
@ -60,10 +60,10 @@ import org.apache.hadoop.tools.util.ThrottledInputStream;
|
||||||
|
|
||||||
import org.apache.hadoop.classification.VisibleForTesting;
|
import org.apache.hadoop.classification.VisibleForTesting;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
|
||||||
import static org.apache.hadoop.fs.Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY;
|
import static org.apache.hadoop.fs.Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY;
|
||||||
import static org.apache.hadoop.fs.Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY_SEQUENTIAL;
|
import static org.apache.hadoop.fs.Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY_SEQUENTIAL;
|
||||||
import static org.apache.hadoop.tools.mapred.CopyMapper.getFileAttributeSettings;
|
import static org.apache.hadoop.tools.mapred.CopyMapper.getFileAttributeSettings;
|
||||||
|
import static org.apache.hadoop.util.Preconditions.checkArgument;
|
||||||
import static org.apache.hadoop.util.functional.FutureIO.awaitFuture;
|
import static org.apache.hadoop.util.functional.FutureIO.awaitFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue