Examples of ToolsPigServer


Examples of org.apache.pig.tools.ToolsPigServer

    static MiniCluster cluster = MiniCluster.buildCluster();
    private File stdOutRedirectedFile;

    @Before
    public void setUp() throws Exception{
        pig = new ToolsPigServer(ExecType.MAPREDUCE, cluster.getProperties());
        stdOutRedirectedFile = new File("stdout.redirected");
        // Create file if it does not exist
        if(!stdOutRedirectedFile.createNewFile())
            fail("Unable to create input files");
    }
View Full Code Here

Examples of org.apache.pig.tools.ToolsPigServer

    static MiniGenericCluster cluster = MiniGenericCluster.buildCluster();
    private File stdOutRedirectedFile;

    @Before
    public void setUp() throws Exception{
        pig = new ToolsPigServer(cluster.getExecType(), cluster.getProperties());
        stdOutRedirectedFile = new File("stdout.redirected");
        // Create file if it does not exist
        if(!stdOutRedirectedFile.createNewFile())
            fail("Unable to create input files");
    }
View Full Code Here

Examples of org.apache.pig.tools.ToolsPigServer

   
    public static Object launch(PigContext pigContext, LogicalPlan queryPlan, ClassWithArgs coordinatorClass) throws Exception {
        Coordinator coord = (Coordinator) coordinatorClass.theClass().newInstance();
        CoordinatorHarness coordHarness = new CoordinatorHarness(coord);
        coord.init(coordinatorClass.args());
        ToolsPigServer pigServer = new ToolsPigServer(pigContext);
       
        if (!(new File(pennyJarFilename)).exists()) {
            throw new RuntimeException("Cannot find " + pennyJarFilename + " in working directory.");
        }
        pigServer.registerJar(pennyJarFilename);

        pigServer.runPlan(queryPlan, "penny");
        return coordHarness.finish();
    }
View Full Code Here

Examples of org.apache.pig.tools.ToolsPigServer

  // Ibis change : end

    private final Random rand = new Random(System.currentTimeMillis());

  public ParsedPigScript(PigContext pigContext, String pigScriptFilename) throws IOException {
        this.pigServer = new ToolsPigServer(pigContext);
        this.pigScript = pigScriptFilename;
        pigServer.registerNoRun(pigScript, new HashMap<String, String>(), new LinkedList<String>());
        this.queryPlan = pigServer.getPlans().lp;
        /* debug: */ //System.out.println("ORIGINAL PLAN: " + queryPlan);
        aliasOperatorMap = new HashMap<String, LogicalRelationalOperator>();
View Full Code Here

Examples of org.apache.pig.tools.ToolsPigServer

            if (!aliases.contains(alias)) throw new IllegalArgumentException("Illegal request to monitor pig script alias " + alias);
        }
       
        // first, make a fresh copy of the query plan so we can mutate (i.e. instrument) it
        // since LogicalPlan does not offer a deepCopy() method, we'll do this by re-parsing the original script
        ToolsPigServer newPigServer = new ToolsPigServer(pigServer.getPigContext());
        newPigServer.registerNoRun(pigScript, new HashMap<String, String>(), new LinkedList<String>());
        LogicalPlan instrumentedQueryPlan = newPigServer.getPlans().lp;
        if (truncateAtAlias != null) truncate(instrumentedQueryPlan, truncateAtAlias);
        Map<String, LogicalRelationalOperator> cloneAliasOperatorMap = new HashMap<String, LogicalRelationalOperator>();
    // Ibis change : start
        populateAliasOperatorMap(instrumentedQueryPlan, cloneAliasOperatorMap, null);
    // Ibis change : end
View Full Code Here

Examples of org.apache.pig.tools.ToolsPigServer

    private File stdOutRedirectedFile;

    @Before
    @Override
    public void setUp() throws Exception{
        pig = new ToolsPigServer(ExecType.MAPREDUCE, cluster.getProperties());
        stdOutRedirectedFile = new File("stdout.redirected");
        // Create file if it does not exist
        try {
            if(!stdOutRedirectedFile.createNewFile())
                fail("Unable to create input files");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.