Package com.odiago.flumebase.exec.local

Examples of com.odiago.flumebase.exec.local.MemoryOutputElement


        getQueryOpts());
    assertNotNull(selectResponse);
    FlowId queryId = selectResponse.getFlowId();
    assertNotNull(queryId);

    MemoryOutputElement output = getOutput("select-out");
    assertNotNull(output);
    SelectableList<GenericData.Record> outRecords = output.getRecords();
    synchronized (outRecords) {
      while (outRecords.size() < 3) {
        outRecords.wait();
      }
View Full Code Here


      w.write("line3,3\n");
    } finally {
      w.close();
    }

    MemoryOutputElement output1 = getOutput("select-out");
    assertNotNull(output1);
    SelectableList<GenericData.Record> outRecords1 = output1.getRecords();
    synchronized (outRecords1) {
      while (outRecords1.size() < 3) {
        outRecords1.wait();
      }

      for(GenericData.Record r : outRecords1) {
        LOG.debug("query 1 got " + r.get("x"));
      }

      this.assertRecordExists(outRecords1, "x", new Utf8("line1"));
      this.assertRecordExists(outRecords1, "x", new Utf8("line2"));
      this.assertRecordExists(outRecords1, "x", new Utf8("line3"));
    }

    LOG.debug("first query SUCCESS");

    if (killFirstQuery) {
      LOG.debug("Canceling first query");
      env.cancelFlow(queryId1);
      joinFlow(queryId1);
      LOG.debug("First query canceled.");
    }

    // Test the second query.
    LOG.debug("Running second query");
    getConf().set(SelectStmt.CLIENT_SELECT_TARGET_KEY, "select-out2");

    QuerySubmitResponse selectResponse2 = env.submitQuery(
        "SELECT * FROM inputstream WHERE y = 6",
        getQueryOpts());
    assertNotNull(selectResponse2);
    FlowId queryId2 = selectResponse2.getFlowId();
    assertNotNull(queryId2);

    // Add more data to the stream.
    w = new BufferedWriter(new FileWriter(sourceFile, true));
    try {
      w.write("line4,4\n");
      w.write("line5,5\n");
      w.write("line6,6\n");
    } finally {
      w.close();
    }
   
    MemoryOutputElement output2 = getOutput("select-out2");
    assertNotNull(output2);
    SelectableList<GenericData.Record> outRecords2 = output2.getRecords();
    synchronized (outRecords2) {
      while (outRecords2.size() < 1) {
        outRecords2.wait();
      }

View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    synchronized (outRecords) {
      for (int i = 0; i < 3; i++) {
        Integer expected = Integer.valueOf(i + 1);
        GenericData.Record record = outRecords.get(i);
        assertEquals(expected, record.get("fieldname"));
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);
    List<GenericData.Record> outRecords = output.getRecords();
    assertNotNull(outRecords);
    assertEquals(0, outRecords.size());
  }
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(response.getMessage(), id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    synchronized (outRecords) {
      for (int i = 0; i < 3; i++) {
        Integer expected = Integer.valueOf(i + 1);
        Integer negative = Integer.valueOf(-i - 1);
        GenericData.Record record = outRecords.get(i);
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(response.getMessage(), id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    for (GenericData.Record r : outRecords) {
      LOG.info("Printing record");
      for (Schema.Field f : r.getSchema().getFields()) {
        LOG.info(f.name() + " => " + r.get(f.name()));
      }
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    GenericData.Record record = outRecords.get(0);
    for (Pair<String, Object> fieldCheck : checks) {
      String fieldName = fieldCheck.getLeft();
      Object expectedVal = fieldCheck.getRight();
      Object actualVal = record.get(fieldName);
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(response.getMessage(), id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    synchronized (outRecords) {
      assertEquals(outStrings.size(), outRecords.size());

      for (int i = 0; i < outRecords.size(); i++) {
        GenericData.Record record = outRecords.get(i);
View Full Code Here

        }
      }
    }

    // Check that we received several multiples of six out.
    MemoryOutputElement output = getOutput("test6x");
    assertNotNull(output);

    // Wait until we have received the expected amout of output data.
    // Flume processing is asynchronous, so we need to wait until all
    // our inputs have reached the output.
    SelectableList<GenericData.Record> outRecords = output.getRecords();
    synchronized (outRecords) {
      while (outRecords.size() < 3) {
        outRecords.wait();
      }
View Full Code Here

    FlowId id = response.getFlowId();
    assertNotNull(response.getMessage(), id);
    joinFlow(id);

    // Examine the response records.
    MemoryOutputElement output = getOutput("testSelect");
    assertNotNull(output);

    List<GenericData.Record> outRecords = output.getRecords();
    GenericData.Record firstRecord = outRecords.get(0);
    for (Pair<String, Object> check : checkFields) {
      String checkName = check.getLeft();
      Object checkVal = check.getRight();
      assertEquals(checkVal, firstRecord.get(checkName));
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.exec.local.MemoryOutputElement

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.