当前位置: 首页>>代码示例>>Java>>正文


Java LoadFunc.join方法代码示例

本文整理汇总了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);
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:25,代码来源:ScriptState.java

示例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'");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:25,代码来源:GruntParser.java

示例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);
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:25,代码来源:MRScriptState.java

示例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();
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:19,代码来源:TezScriptState.java

示例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'");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:26,代码来源:GruntParser.java

示例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, ",");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:16,代码来源:TestAvroStorage.java

示例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");
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:DryRunGruntParser.java

示例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");
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:DryRunGruntParser.java

示例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'");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:57,代码来源:GruntParser.java

示例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'");
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:58,代码来源:GruntParser.java


注:本文中的org.apache.pig.LoadFunc.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。