Package org.apache.pig.pigunit.pig

Examples of org.apache.pig.pigunit.pig.PigServer


   */
  public static Cluster getCluster() throws ExecException {
    if (cluster == null) {
      if (System.getProperties().containsKey(EXEC_CLUSTER)) {
        LOG.info("Using cluster mode");
        pig = new PigServer(ExecType.MAPREDUCE);
      } else {
        LOG.info("Using default local mode");
        pig = new PigServer(ExecType.LOCAL);
      }

      cluster = new Cluster(pig.getPigContext());
    }

View Full Code Here


        "reducers=1",
        "input=top_queries_input_data.txt",
        "output=top_3_queries",
        };

    PigServer mockServer = null;
    Cluster mockCluster = null;

    test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);

    test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
View Full Code Here

    static PigServer pig;

    @Before
    public void setup() throws IOException {
        pig = new PigServer(ExecType.LOCAL);

        Util.deleteDirectory(new File(dataDir));
        try {
            pig.mkdirs(dataDir);
        } catch (IOException e) {};
View Full Code Here

    private PigServer pig;

    @Before
    public void setup() throws IOException {
        pig = new PigServer(ExecType.LOCAL);

        Util.deleteDirectory(new File(dataDir));
        try {
            pig.mkdirs(dataDir);
View Full Code Here

                        "reducers=1",
                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };

        PigServer mockServer = null;
        Cluster mockCluster = null;

        test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);

        test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
View Full Code Here

                        "input=top_queries_input_data.txt",
                        "output=top_3_queries",
        };

        // Create a pigunit.pig.PigServer and Cluster to run this test.
        PigServer pig = null;
        if (System.getProperties().containsKey("pigunit.exectype.cluster")) {
            LOG.info("Using cluster mode");
            pig = new PigServer(ExecType.MAPREDUCE);
        } else {
            LOG.info("Using default local mode");
            pig = new PigServer(ExecType.LOCAL);
        }

        final Cluster cluster = new Cluster(pig.getPigContext());

        test = new PigTest(scriptPath, args, pig, cluster);

        String[] output = {
                        "(yahoo,25)",
View Full Code Here

  public void setUp() throws ExecException {
    override = new HashMap<String, String>() {{
      put("STORE", "");
      put("DUMP", "");
    }};
    PigServer pigServer = new PigServer(ExecType.LOCAL);
    parser = new GruntParser(new StringReader(""), pigServer, override);
  }
View Full Code Here

   */
  public static Cluster getCluster() throws ExecException {
    if (cluster.get() == null) {
      if (System.getProperties().containsKey(EXEC_CLUSTER)) {
        LOG.info("Using cluster mode");
        pig.set(new PigServer(ExecType.MAPREDUCE));
      } else {
        LOG.info("Using default local mode");
        pig.set(new PigServer(ExecType.LOCAL));
      }

      cluster.set(new Cluster(pig.get().getPigContext()));
    }

View Full Code Here

   * This tests checks that we don't get back to this behavior
   * @see HadoopShims#newJobControl(String, org.apache.hadoop.conf.Configuration, org.apache.pig.impl.PigContext)
   */
  @Test
  public void testLocalModeTakesLessThan5secs() throws Exception {
    PigServer pigServer = new PigServer(ExecType.LOCAL);
    Data data = resetData(pigServer);
    data.set("in", tuple("a"));
    long t0 = System.currentTimeMillis();
    pigServer.registerQuery(
        "A = LOAD 'in' using mock.Storage();\n"
        + "STORE A INTO 'out' USING mock.Storage();");
    long t1 = System.currentTimeMillis();
    List<Tuple> list = data.get("out");
    assertEquals(1, list.size());
View Full Code Here

        "reducers=1",
        "input=top_queries_input_data.txt",
        "output=top_3_queries",
        };

    PigServer mockServer = null;
    Cluster mockCluster = null;

    test = new PigTest(PIG_SCRIPT, args, mockServer, mockCluster);

    test.assertOutput(new File("data/top_queries_expected_top_3.txt"));
View Full Code Here

TOP

Related Classes of org.apache.pig.pigunit.pig.PigServer

Copyright © 2018 www.massapicom. 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.