本文整理汇总了Java中org.apache.hadoop.tools.DistCpOptions.setMaxMaps方法的典型用法代码示例。如果您正苦于以下问题:Java DistCpOptions.setMaxMaps方法的具体用法?Java DistCpOptions.setMaxMaps怎么用?Java DistCpOptions.setMaxMaps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.tools.DistCpOptions
的用法示例。
在下文中一共展示了DistCpOptions.setMaxMaps方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOptions
import org.apache.hadoop.tools.DistCpOptions; //导入方法依赖的package包/类
private static DistCpOptions getOptions(int nMaps) throws Exception {
Path sourcePath = new Path(cluster.getFileSystem().getUri().toString()
+ "/tmp/source");
Path targetPath = new Path(cluster.getFileSystem().getUri().toString()
+ "/tmp/target");
List<Path> sourceList = new ArrayList<Path>();
sourceList.add(sourcePath);
final DistCpOptions distCpOptions = new DistCpOptions(sourceList, targetPath);
distCpOptions.setMaxMaps(nMaps);
return distCpOptions;
}
示例2: getOptions
import org.apache.hadoop.tools.DistCpOptions; //导入方法依赖的package包/类
private static DistCpOptions getOptions() throws Exception {
Path sourcePath = new Path(cluster.getFileSystem().getUri().toString()
+ "/tmp/source");
Path targetPath = new Path(cluster.getFileSystem().getUri().toString()
+ "/tmp/target");
List<Path> sourceList = new ArrayList<Path>();
sourceList.add(sourcePath);
DistCpOptions options = new DistCpOptions(sourceList, targetPath);
options.setMaxMaps(NUM_SPLITS);
return options;
}
示例3: getDistCpOptions
import org.apache.hadoop.tools.DistCpOptions; //导入方法依赖的package包/类
public DistCpOptions getDistCpOptions(String[] args) throws ParseException {
Options options = new Options();
Option opt;
opt = new Option("maxMaps", true,
"max number of maps to use for this copy");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("sourcePaths", true,
"comma separtated list of source paths to be copied");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("targetPath", true, "target path");
opt.setRequired(true);
options.addOption(opt);
CommandLine cmd = new GnuParser().parse(options, args);
String[] paths = cmd.getOptionValue("sourcePaths").trim().split(",");
List<Path> srcPaths = getPaths(paths);
String trgPath = cmd.getOptionValue("targetPath").trim();
DistCpOptions distcpOptions = new DistCpOptions(srcPaths, new Path(
trgPath));
distcpOptions.setSyncFolder(true);
distcpOptions.setBlocking(true);
distcpOptions
.setMaxMaps(Integer.valueOf(cmd.getOptionValue("maxMaps")));
return distcpOptions;
}
示例4: getDistCpOptions
import org.apache.hadoop.tools.DistCpOptions; //导入方法依赖的package包/类
public DistCpOptions getDistCpOptions(String[] args) throws ParseException {
Options options = new Options();
Option opt;
opt = new Option("update", false,
"specify update for synching folders");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("blocking", true,
"should DistCp be running in blocking mode");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("maxMaps", true,
"max number of maps to use for this copy");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("sourcePaths", true,
"comma separtated list of source paths to be copied");
opt.setRequired(true);
options.addOption(opt);
opt = new Option("targetPath", true, "target path");
opt.setRequired(true);
options.addOption(opt);
CommandLine cmd = new GnuParser().parse(options, args);
String[] paths = cmd.getOptionValue("sourcePaths").trim().split(",");
List<Path> srcPaths = getPaths(paths);
String trgPath = cmd.getOptionValue("targetPath").trim();
DistCpOptions distcpOptions = new DistCpOptions(srcPaths, new Path(
trgPath));
distcpOptions.setSyncFolder(true);
distcpOptions.setBlocking(Boolean.valueOf(cmd
.getOptionValue("blocking")));
distcpOptions
.setMaxMaps(Integer.valueOf(cmd.getOptionValue("maxMaps")));
return distcpOptions;
}