Package org.apache.hadoop.chukwa.datacollection.agent

Examples of org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent.shutdown()


    AsyncAckSender sender = (AsyncAckSender)conn.getSender();
    int resets = sender.adaptorReset.getResetCount();
    System.out.println(resets + " resets");
    assertTrue(resets > 0);
   
    agent.shutdown();
    collectorServ.stop();
    conn.shutdown();
    Thread.sleep(5000); //for collector to shut down
   
    long dups = TestFailedCollectorAck.checkDirs(conf, conf.get(SeqFileWriter.OUTPUT_DIR_OPT));
View Full Code Here


    String psAgentID = agent.processAddCommand(
        "add org.apache.hadoop.chukwa.datacollection.adaptor.ExecAdaptor ps ps aux 0");
    assertNotNull(psAgentID);
    Chunk c = chunks.waitForAChunk();
    System.out.println(new String(c.getData()));
    agent.shutdown();
  }
 
  /*
   * Buzz in a loop, starting ls every 100 ms.
   * Length of loop controlled by sleep statement near bottom of function
View Full Code Here

    String[] stat = agent.getAdaptorList().get("constSend").split(" ");
    long kbytesPerSec = Long.valueOf(stat[stat.length -1]) / TEST_DURATION_SECS / 1000;
    System.out.println("data rate was " + kbytesPerSec + " kb /second");
    assertTrue(kbytesPerSec < WRITE_RATE_KB); //write rate should throttle sends
    assertTrue(kbytesPerSec > MIN_ACCEPTABLE_PERCENT* WRITE_RATE_KB / 100);//an assumption, but should hold true
    agent.shutdown();
  }
}
View Full Code Here

      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    agent.stopAdaptor(adaptorId, false);
    agent.shutdown();
    Thread.sleep(2000);
  }

  private File makeTestFile(String name, int size) throws IOException {
    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),
View Full Code Here

    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
    //wait for timeout.  More chunks should appear.
   
    testFile.delete();
  }
View Full Code Here

      //and since some acks got lost after the adaptor was stopped.
      assertTrue(bytesPerSec > 9 * SEND_RATE/ 1000 / 10);
      AsyncAckSender sender = (AsyncAckSender)conn.getSender();
      assertEquals(0, sender.adaptorReset.getResetCount());
     
      agent.shutdown();
      collectorServ.stop();
      conn.shutdown();
      Thread.sleep(5000); //for collector to shut down
      TestDirTailingAdaptor.nukeDirContents(new File(outputDirectory));
     
View Full Code Here

      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    agent.stopAdaptor(adaptorId, false);
    agent.shutdown();
    Thread.sleep(2000);
  }

  private File makeTestFile(String name, int size) throws IOException {
    File tmpOutput = new File(System.getProperty("test.build.data", "/tmp"),
View Full Code Here

      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    agent.stopAdaptor(adaptorId, false);
    agent.shutdown();
    Thread.sleep(2000);
  }
 
  public void testRepeatedlyOnBigFile() throws IOException,
  ChukwaAgent.AlreadyRunningException, InterruptedException {
View Full Code Here

      assertTrue(dat.endsWith("9 abcdefghijklmnopqrstuvwxyz\n"));
      assertTrue(c.getDataType().equals("raw"));
      if(agent.adaptorCount() > 0)
        agent.stopAdaptor("test", false);
    }
    agent.shutdown();
  }

  private File makeTestFile(String name, int size) throws IOException {
    File tmpOutput = new File(baseDir, name);
    tmpOutput.deleteOnExit();
View Full Code Here

    assertEquals(1, agent.adaptorCount());
    Thread.sleep(2000);
    agent.processAddCommand("add test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
    assertEquals(1, agent.adaptorCount());
    chunks.clear();
    agent.shutdown();
  }

  public static void main(String[] args) {
    try {
      TestFileTailingAdaptors tests = new TestFileTailingAdaptors();
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.