Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.FlumeConfiguration


   * required by logreceiver.
   *
   * Don't call this until flume.home/flume.conf.dir have been set appropriately.
   */
  private FlumeConfiguration getFlumeConf() {
    FlumeConfiguration conf = FlumeConfiguration.get();

    // Ensure that our FlumePlugin class is at the head of the registry.
    String existingPlugins = conf.getPluginClasses();
    String newPlugins = FlumePlugin.class.getName();
    if (null != existingPlugins && existingPlugins.length() > 0) {
      newPlugins = newPlugins + "," + existingPlugins;
    }
    conf.set(FlumeConfiguration.PLUGIN_CLASSES, newPlugins);
   
    return conf;
  }
View Full Code Here


  FaultyFlumeLocalAgentOOME(FlumeConfiguration conf) {
    super(conf);
  }

  public static void main(String[] argv) {
    FlumeConfiguration conf = FlumeConfiguration.get();
    FaultyFlumeLocalAgentOOME agent = new FaultyFlumeLocalAgentOOME(conf);
    agent.start();

    new MemHog().start();
    // hangout, waiting for other agent thread to exit.
View Full Code Here

public class TimeTrigger implements RollTrigger {
  Tagger tagger;
  long maxAge;

  public TimeTrigger() {
    FlumeConfiguration conf = FlumeConfiguration.get();
    this.maxAge = conf.getAgentLogMaxAge();
    this.tagger = new ProcessTagger();
  }
View Full Code Here

  @Test
  public void testStatusManagerHeartbeats() throws IOException {
    StatusManager stats = new StatusManager();
   
    FlumeConfiguration cfg = FlumeConfiguration.createTestableConfiguration();
    Clock.resetDefault();
    cfg.set(FlumeConfiguration.WEBAPPS_PATH, "build/webapps");
    cfg.set(FlumeConfiguration.MASTER_STORE, "memory");
   
    // avoiding gossip ack manager until it shuts down cleanly.
    ConfigStore cfgStore = FlumeMaster.createConfigStore(cfg);
    FlumeMaster fm = new FlumeMaster(new CommandManager(), new ConfigManager(
        cfgStore), stats, new MasterAckManager(), cfg);
View Full Code Here

          + port + " : " + e);
    }
  }

  public static void main(String argv[]) {
    FlumeConfiguration conf = FlumeConfiguration.get();
    ThriftAckedEventSink sink = new ThriftAckedEventSink("localhost", conf
        .getCollectorPort());
    try {
      sink.open();

      for (int i = 0; i < 100; i++) {
View Full Code Here

    rpt.setLongMetric(A_SENTBYTES, sentBytes.get());
    return rpt;
  }

  public static void main(String argv[]) {
    FlumeConfiguration conf = FlumeConfiguration.get();
    ThriftEventSink sink = new ThriftEventSink("localhost", conf
        .getCollectorPort());
    try {
      sink.open();

      for (int i = 0; i < 100; i++) {
View Full Code Here

    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();

    FlumeConfiguration conf = FlumeConfiguration.get();
    final ThriftEventSource tes = new ThriftEventSource(
        conf.getCollectorPort() + 1); // this is a slight
    // tweak to avoid port conflicts
    tes.open();

    final CounterSink cnt = new CounterSink("count");
    cnt.open();
    Thread t = new Thread("drain") {
      public void run() {
        try {
          EventUtil.dumpAll(tes, cnt);
        } catch (IOException e) {
        } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    };
    t.start(); // drain the sink.

    // mem -> ThriftEventSink
    ThriftEventSink snk = new ThriftEventSink("0.0.0.0", conf
        .getCollectorPort() + 1);
    snk.open();
    EventUtil.dumpAll(mem, snk);
    mem.close();
    snk.close();
View Full Code Here

    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();

    FlumeConfiguration conf = FlumeConfiguration.get();
    final ThriftEventSource tes = new ThriftEventSource(conf.getCollectorPort());
    tes.open();

    final CounterSink cnt = new CounterSink("count");
    cnt.open();
    Thread t = new Thread("drain") {
      public void run() {
        try {
          EventUtil.dumpAll(tes, cnt);
        } catch (Exception e) {
        }
      }
    };
    t.start(); // drain the sink.

    // mem -> thriftRawEventSink
    ThriftRawEventSink snk = new ThriftRawEventSink("0.0.0.0", conf
        .getCollectorPort());
    snk.open();
    EventUtil.dumpAll(mem, snk);
    mem.close();
    snk.close();
View Full Code Here

   */
  @Test
  public void testManyThreadsThriftSend() throws IOException,
      InterruptedException {
    final int threads = 100;
    final FlumeConfiguration conf = FlumeConfiguration.get();
    // this is a slight tweak to avoid port conflicts
    final ThriftEventSource tes = new ThriftEventSource(
        conf.getCollectorPort() + 1);
    tes.open();

    final CounterSink cnt = new CounterSink("count");
    cnt.open();
    Thread t = new Thread("drain") {
      public void run() {
        try {
          EventUtil.dumpAll(tes, cnt);
        } catch (Exception e) {
        }
      }
    };
    t.start(); // drain the sink.

    // fork off threads threads and have them start all the same time.
    final CountDownLatch sendStarted = new CountDownLatch(threads);
    final CountDownLatch sendDone = new CountDownLatch(threads);
    final AtomicLong sendByteSum = new AtomicLong(0);
    for (int i = 0; i < threads; i++) {
      final int id = i;
      Thread th = new Thread() {
        public void run() {
          try {
            // TODO (jon) this may have different sizes due to the host it is
            // running on . Needs to be fixed.
            EventSource txt = new NoNlASCIISynthSource(25, 100);

            txt.open();
            MemorySinkSource mem = new MemorySinkSource();
            mem.open();
            EventUtil.dumpAll(txt, mem);
            txt.close();

            // mem -> ThriftEventSink
            ThriftEventSink snk = new ThriftEventSink("0.0.0.0", conf
                .getCollectorPort() + 1);
            snk.open();

            sendStarted.countDown();
            sendStarted.await();
View Full Code Here

   * @throws InterruptedException
   */
  @Test
  public void testThriftEventServerCloseTimeout() throws IOException,
      InterruptedException {
    final FlumeConfiguration conf = FlumeConfiguration.get();
    // this is a slight tweak to avoid port conflicts
    final ThriftEventSource tes = new ThriftEventSource(
        conf.getCollectorPort() + 1);
    tes.open();

    tes.enqueue(new EventImpl(new byte[0]));

    tes.close();
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.FlumeConfiguration

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.