Package com.cloudera.flume.conf.SourceFactory

Examples of com.cloudera.flume.conf.SourceFactory.SourceBuilder


      throw new IOException("Waiting for queue element was interrupted! " + e);
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {

      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 1, "usage: tsource(port)");
View Full Code Here


      throw new IOException(e);
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(Context ctx, String... argv) {
        Preconditions.checkArgument(argv.length == 4,
            "usage: ircSource(server, port, nick, chan)");
        String server = argv[0];
View Full Code Here

    helloWorld = null;
  }

  public static SourceBuilder builder() {
    // construct a new parameterized source
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        Preconditions.checkArgument(argv.length == 0,
            "usage: helloWorldSource");
View Full Code Here

            .getProperty("file.encoding"))));
    rd = new ConsoleReader(is, out);
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        return new JLineStdinSource();
      }
    };
View Full Code Here

   */
  @Test
  public void testFailOpenSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failOpen", new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        return new EventSource.Base() {
          @Override
          public void open() throws IOException {
View Full Code Here

  @Test
  public void testFailNextSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failNext", new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        return new EventSource.Base() {
          @Override
          public Event next() throws IOException {
View Full Code Here

  @Test
  public void testFailCloseSource() throws IOException, RuntimeException,
      FlumeSpecException, InterruptedException {
    SourceFactoryImpl srcfact = new SourceFactoryImpl();
    srcfact.setSource("failClose", new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        return new EventSource.Base() {
          @Override
          public void close() throws IOException {
View Full Code Here

  /**
   * This setups and executes a poller on the FlumeNode's reporter.
   */
  @Test
  public void testReportPoller() throws FlumeSpecException, IOException {
    SourceBuilder bld = PollingSource.reporterPollBuilder();
    EventSource src = bld.build("50");
    EventSink snk =
        new CompositeSink(new ReportTestingContext(), "[ console , counter(\"count\") ]");
    src.open();
    snk.open();
    for (int i = 0; i < 10; i++) {
View Full Code Here

  /**
   * This is a source that periodically gets the report from the ReportManager
   */
  public static SourceBuilder reporterPollBuilder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        Preconditions.checkArgument(argv.length >= 0 && argv.length <= 1,
            "reportPoller[(periodMs)]");

View Full Code Here

          + e.getMessage(), e);
    }
  }

  public static SourceBuilder builder() {
    return new SourceBuilder() {
      @Override
      public EventSource build(String... argv) {
        Preconditions.checkArgument(argv.length == 1,
            "usage: thriftSource(port)");
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.SourceFactory.SourceBuilder

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.