Examples of waitForAChunk()


Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    agent.processAddCommand("add edu.berkeley.chukwa_xtrace.XtrAdaptor XTrace TcpReportSource 0");
    assertEquals(1, agent.adaptorCount());
   
    XTraceContext.startTrace("test", "testtrace", "atag");
    XTraceContext.logEvent("test", "label");
    Chunk c = chunks.waitForAChunk();
    String report = new String(c.getData());
    assertTrue(report.contains("Agent: test"));
    assertTrue(report.contains("Tag: atag"));
    System.out.println(report);
    System.out.println("-- next chunk --- ");
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    assertTrue(report.contains("Agent: test"));
    assertTrue(report.contains("Tag: atag"));
    System.out.println(report);
    System.out.println("-- next chunk --- ");

    c = chunks.waitForAChunk();
    report = new String(c.getData());
    assertTrue(report.contains("Agent: test"));
    assertTrue(report.contains("Label: label"));
    System.out.println(report);
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    agent.processAddCommand("add fta = "+ FileTailingAdaptor.class.getCanonicalName()
        + " testdata " + testFile.getCanonicalPath() + " 0" );
   
   
    assertEquals(1, agent.adaptorCount());
    Chunk c1 = chunks.waitForAChunk();
    assertNotNull(c1);
    List<CommitListEntry> pendingAcks = new ArrayList<CommitListEntry>();
    pendingAcks.add(new DelayedCommit(c1.getInitiator(), c1.getSeqID(),
        c1.getData().length, "foo", c1.getSeqID(), agent.getAdaptorName(c1.getInitiator())));
    restart.reportPending(pendingAcks);
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    restart.reportPending(pendingAcks);

    assertEquals(len, c1.getData().length);
    Thread.sleep(ACK_TIMEOUT*2);
    int resetCount = restart.resetTimedOutAdaptors(ACK_TIMEOUT);
    Chunk c2 = chunks.waitForAChunk(1000);
    assertNotNull(c2);
    assertEquals(len, c2.getData().length);
    assertTrue(resetCount > 0);
    agent.shutdown();
   
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    agent.processAddCommand("add fta = "+ FileTailingAdaptor.class.getCanonicalName()
        + " testdata " + testFile.getCanonicalPath() + " 0" );
   
   
    assertEquals(1, agent.adaptorCount());
    Chunk c1 = chunks.waitForAChunk();
    assertNotNull(c1);
    List<CommitListEntry> pendingAcks = new ArrayList<CommitListEntry>();
    pendingAcks.add(new DelayedCommit(c1.getInitiator(), c1.getSeqID(),
        c1.getData().length, "foo", c1.getSeqID(), agent.getAdaptorName(c1.getInitiator())));
    restart.reportPending(pendingAcks);
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    restart.reportPending(pendingAcks);

    assertEquals(len, c1.getData().length);
    Thread.sleep(ACK_TIMEOUT*2);
    int resetCount = restart.resetTimedOutAdaptors(ACK_TIMEOUT);
    Chunk c2 = chunks.waitForAChunk(1000);
    assertNotNull(c2);
    assertEquals(len, c2.getData().length);
    assertTrue(resetCount > 0);
    agent.shutdown();
//start an adaptor -- chunks should appear in the connector
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    out.delete();
    ChukwaDailyRollingFileAppender app = new ChukwaDailyRollingFileAppender(
        new SimpleLayout(), out.getAbsolutePath(), "yyyy-MM-dd");
    app.append(new LoggingEvent("foo", myLogger,  System.currentTimeMillis(),Priority.INFO, "foo", null));
    assertEquals(1, agent.adaptorCount());
    Chunk c = chunks.waitForAChunk();
    System.out.println("read a chunk OK");
    String logLine = new String(c.getData());
    assertTrue(logLine.equals("INFO - foo\n"));
    System.out.println(new String(c.getData()));
    //
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    long startTime = System.currentTimeMillis();
    adaptorId = agent.processAddCommand("add adaptor_test ="
        + "filetailer.FileTailingAdaptor testDontSleepIfHasMoreData "
        + testFile.getCanonicalPath() + " 0");

    chunks.waitForAChunk();
    chunks.waitForAChunk();
   
    long endTime = System.currentTimeMillis();
    assertTrue( endTime - startTime < 300 ); // ensure that everything finishes very fast
                         // faster than SAMPLE_PERIOD_MS (ie: we don't sleep)
View Full Code Here

Examples of org.apache.hadoop.chukwa.datacollection.connector.ChunkCatcherConnector.waitForAChunk()

    adaptorId = agent.processAddCommand("add adaptor_test ="
        + "filetailer.FileTailingAdaptor testDontSleepIfHasMoreData "
        + testFile.getCanonicalPath() + " 0");

    chunks.waitForAChunk();
    chunks.waitForAChunk();
   
    long endTime = System.currentTimeMillis();
    assertTrue( endTime - startTime < 300 ); // ensure that everything finishes very fast
                         // faster than SAMPLE_PERIOD_MS (ie: we don't sleep)
  }
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.