本文整理汇总了Java中org.apache.pig.LoadFunc.join方法的典型用法代码示例。如果您正苦于以下问题:Java LoadFunc.join方法的具体用法?Java LoadFunc.join怎么用?Java LoadFunc.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.pig.LoadFunc
的用法示例。
在下文中一共展示了LoadFunc.join方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAlias
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
private void setAlias(MapReduceOper mro) {
ArrayList<String> alias = new ArrayList<String>();
String aliasLocationStr = "";
try {
ArrayList<String> aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.mapPlan, alias, aliasLocation).visit();
aliasLocationStr += "M: "+LoadFunc.join(aliasLocation, ",");
if (mro.combinePlan != null) {
aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.combinePlan, alias, aliasLocation).visit();
aliasLocationStr += " C: "+LoadFunc.join(aliasLocation, ",");
}
aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.reducePlan, alias, aliasLocation).visit();
aliasLocationStr += " R: "+LoadFunc.join(aliasLocation, ",");
if (!alias.isEmpty()) {
Collections.sort(alias);
}
} catch (VisitorException e) {
LOG.warn("unable to get alias", e);
}
aliasMap.put(mro, LoadFunc.join(alias, ","));
aliasLocationMap.put(mro, aliasLocationStr);
}
示例2: processFsCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processFsCommand(String[] cmdTokens) throws IOException{
if(mExplain == null) { // process only if not in "explain" mode
executeBatch();
int retCode = -1;
try {
retCode = shell.run(cmdTokens);
} catch (Exception e) {
throw new IOException(e);
}
if (retCode != 0 && !mInteractive) {
String s = LoadFunc.join(
(AbstractList<String>) Arrays.asList(cmdTokens), " ");
throw new IOException("fs command '" + s
+ "' failed. Please check output logs for details");
}
} else {
log.warn("'fs' statement is ignored while processing 'explain -script' or '-check'");
}
}
示例3: setAlias
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
private void setAlias(MapReduceOper mro) {
ArrayList<String> alias = new ArrayList<String>();
String aliasLocationStr = "";
try {
ArrayList<String> aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.mapPlan, alias, aliasLocation).visit();
aliasLocationStr += "M: "+LoadFunc.join(aliasLocation, ",");
if (mro.combinePlan != null) {
aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.combinePlan, alias, aliasLocation).visit();
aliasLocationStr += " C: "+LoadFunc.join(aliasLocation, ",");
}
aliasLocation = new ArrayList<String>();
new AliasVisitor(mro.reducePlan, alias, aliasLocation).visit();
aliasLocationStr += " R: "+LoadFunc.join(aliasLocation, ",");
if (!alias.isEmpty()) {
Collections.sort(alias);
}
} catch (VisitorException e) {
LOG.warn("unable to get alias", e);
}
aliasMap.put(mro, LoadFunc.join(alias, ","));
aliasLocationMap.put(mro, aliasLocationStr);
}
示例4: visit
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
public void visit() throws VisitorException {
super.visit();
if (!aliases.isEmpty()) {
ArrayList<String> aliasList = new ArrayList<String>(aliases);
ArrayList<String> aliasLocationList = new ArrayList<String>(aliasLocations);
Collections.sort(aliasList);
Collections.sort(aliasLocationList);
alias = LoadFunc.join(aliasList, ",");
aliasLocation = LoadFunc.join(aliasLocationList, ",");
}
StringBuilder sb = new StringBuilder();
for (int i = featureSet.nextSetBit(0); i >= 0; i = featureSet.nextSetBit(i+1)) {
if (sb.length() > 0) sb.append(",");
sb.append(PIG_FEATURE.values()[i].name());
}
features = sb.toString();
}
示例5: processFsCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processFsCommand(String[] cmdTokens) throws IOException {
filter.validate(PigCommandFilter.Command.FS);
if(mExplain == null) { // process only if not in "explain" mode
executeBatch();
int retCode = -1;
try {
retCode = shell.run(cmdTokens);
} catch (Exception e) {
throw new IOException(e);
}
if (retCode != 0 && !mInteractive) {
String s = LoadFunc.join(
(AbstractList<String>) Arrays.asList(cmdTokens), " ");
throw new IOException("fs command '" + s
+ "' failed. Please check output logs for details");
}
} else {
log.warn("'fs' statement is ignored while processing 'explain -script' or '-check'");
}
}
示例6: getInputFile
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
private static String getInputFile(String file) {
String locations[] = LoadFunc.getPathStrings(file);
if (locations.length == 1)
return System.getProperty("user.dir") + "/" + basedir
+ file;
else {
ArrayList<String> pathStrings = new ArrayList<String>();
for (int index = 0; index < locations.length; index++) {
String f = System.getProperty("user.dir") + "/"
+ basedir + locations[index].trim();
pathStrings.add(f);
}
return LoadFunc.join(pathStrings, ",");
}
}
示例7: processFsCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processFsCommand(String[] cmdTokens) throws IOException {
String cmds = LoadFunc.join((AbstractList<String>)Arrays.asList(cmdTokens), " ");
sb.append("fs ").append(cmds).append("\n");
}
示例8: processShCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processShCommand(String[] cmdTokens) throws IOException {
String cmds = LoadFunc.join((AbstractList<String>)Arrays.asList(cmdTokens), " ");
sb.append("sh ").append(cmds).append("\n");
}
示例9: processShCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processShCommand(String[] cmdTokens) throws IOException{
if(mExplain == null) { // process only if not in "explain" mode
try {
executeBatch();
// For sh command, create a process with the following syntax
// <shell exe> <invoke arg> <command-as-string>
String shellName = "sh";
String shellInvokeArg = "-c";
// Insert cmd /C in front of the array list to execute to
// support built-in shell commands like mkdir on Windows
if (System.getProperty("os.name").startsWith("Windows")) {
shellName = "cmd";
shellInvokeArg = "/C";
}
List<String> stringList = new ArrayList<String>();
stringList.add(shellName);
stringList.add(shellInvokeArg);
StringBuffer commandString = new StringBuffer();
for (String currToken : cmdTokens) {
commandString.append(" ");
commandString.append(currToken);
}
stringList.add(commandString.toString());
String[] newCmdTokens = stringList.toArray(new String[0]);
Process executor = Runtime.getRuntime().exec(newCmdTokens);
StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out);
StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, System.err);
outPrinter.start();
errPrinter.start();
int ret = executor.waitFor();
outPrinter.join();
errPrinter.join();
if (ret != 0 && !mInteractive) {
String s = LoadFunc.join(
(AbstractList<String>) Arrays.asList(cmdTokens), " ");
throw new IOException("sh command '" + s
+ "' failed. Please check output logs for details");
}
} catch (Exception e) {
throw new IOException(e);
}
} else {
log.warn("'sh' statement is ignored while processing 'explain -script' or '-check'");
}
}
示例10: processShCommand
import org.apache.pig.LoadFunc; //导入方法依赖的package包/类
@Override
protected void processShCommand(String[] cmdTokens) throws IOException {
filter.validate(PigCommandFilter.Command.SH);
if(mExplain == null) { // process only if not in "explain" mode
try {
executeBatch();
// For sh command, create a process with the following syntax
// <shell exe> <invoke arg> <command-as-string>
String shellName = "sh";
String shellInvokeArg = "-c";
// Insert cmd /C in front of the array list to execute to
// support built-in shell commands like mkdir on Windows
if (System.getProperty("os.name").startsWith("Windows")) {
shellName = "cmd";
shellInvokeArg = "/C";
}
List<String> stringList = new ArrayList<String>();
stringList.add(shellName);
stringList.add(shellInvokeArg);
StringBuffer commandString = new StringBuffer();
for (String currToken : cmdTokens) {
commandString.append(" ");
commandString.append(currToken);
}
stringList.add(commandString.toString());
String[] newCmdTokens = stringList.toArray(new String[0]);
Process executor = Runtime.getRuntime().exec(newCmdTokens);
StreamPrinter outPrinter = new StreamPrinter(executor.getInputStream(), null, System.out);
StreamPrinter errPrinter = new StreamPrinter(executor.getErrorStream(), null, System.err);
outPrinter.start();
errPrinter.start();
int ret = executor.waitFor();
outPrinter.join();
errPrinter.join();
if (ret != 0 && !mInteractive) {
String s = LoadFunc.join(
(AbstractList<String>) Arrays.asList(cmdTokens), " ");
throw new IOException("sh command '" + s
+ "' failed. Please check output logs for details");
}
} catch (Exception e) {
throw new IOException(e);
}
} else {
log.warn("'sh' statement is ignored while processing 'explain -script' or '-check'");
}
}