Package org.apache.flume.instrumentation

Examples of org.apache.flume.instrumentation.SinkCounter


    MockHDFSWriter hdfsWriter = new MockHDFSWriter();
    HDFSTextFormatter formatter = new HDFSTextFormatter();
    BucketWriter bucketWriter = new BucketWriter(0, maxBytes, 0, 0, ctx,
        "/tmp/file", null, null, SequenceFile.CompressionType.NONE, hdfsWriter,
        formatter, timedRollerPool, null,
        new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
        0, null);

    Event e = EventBuilder.withBody("foo", Charsets.UTF_8);
    for (int i = 0; i < 1000; i++) {
      bucketWriter.append(e);
View Full Code Here


    MockHDFSWriter hdfsWriter = new MockHDFSWriter();
    HDFSTextFormatter formatter = new HDFSTextFormatter();
    BucketWriter bucketWriter = new BucketWriter(ROLL_INTERVAL, 0, 0, 0, ctx,
        "/tmp/file", null, null, SequenceFile.CompressionType.NONE, hdfsWriter,
        formatter, timedRollerPool, null,
        new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
        0, null);

    Event e = EventBuilder.withBody("foo", Charsets.UTF_8);
    long startNanos = System.nanoTime();
    for (int i = 0; i < NUM_EVENTS - 1; i++) {
View Full Code Here

    File tmpFile = File.createTempFile("flume", "test");
    tmpFile.deleteOnExit();
    BucketWriter bucketWriter = new BucketWriter(ROLL_INTERVAL, 0, 0, 0, ctx,
        tmpFile.getName(), null, null, SequenceFile.CompressionType.NONE, hdfsWriter,
        formatter, timedRollerPool, null,
        new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
        0, null);

    Event e = EventBuilder.withBody("foo", Charsets.UTF_8);
    for (int i = 0; i < NUM_EVENTS - 1; i++) {
      bucketWriter.append(e);
View Full Code Here

      MockHDFSWriter hdfsWriter = new MockHDFSWriter();
      HDFSTextFormatter formatter = new HDFSTextFormatter();
      BucketWriter bucketWriter = new BucketWriter(ROLL_INTERVAL, 0, 0, 0, ctx,
          "/tmp/file", suffix, null, SequenceFile.CompressionType.NONE, hdfsWriter,
          formatter, timedRollerPool, null,
          new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
          0, null);

      // Need to override system time use for test so we know what to expect
      final long testTime = System.currentTimeMillis();
      Clock testClock = new Clock() {
View Full Code Here

        MockHDFSWriter hdfsWriter = new MockHDFSWriter();
        HDFSTextFormatter formatter = new HDFSTextFormatter();
        BucketWriter bucketWriter = new BucketWriter(ROLL_INTERVAL, 0, 0, 0, ctx,
            "/tmp/file", suffix, null, SequenceFile.CompressionType.NONE, hdfsWriter,
            formatter, timedRollerPool, null,
            new SinkCounter("test-bucket-writer-" + System.currentTimeMillis()),
            0, null);

        // Need to override system time use for test so we know what to expect

        final long testTime = System.currentTimeMillis();
View Full Code Here

    batchSize = context.getInteger("sink.batchSize", defaultBatchSize);

    this.directory = new File(directory);

    if (sinkCounter == null) {
      sinkCounter = new SinkCounter(getName());
    }
  }
View Full Code Here

        DatasetSinkConstants.DEFAULT_BATCH_SIZE);
    this.rollIntervalS = context.getInteger(
        DatasetSinkConstants.CONFIG_KITE_ROLL_INTERVAL,
        DatasetSinkConstants.DEFAULT_ROLL_INTERVAL);

    this.counter = new SinkCounter(datasetName);
  }
View Full Code Here

        this.batchSize = context.getInteger(FlumeConstants.CONFIG_BATCHSIZE, FlumeConstants.DEFAULT_BATCH_SIZE);
        final String eventSerializerType = context.getString(FlumeConstants.CONFIG_SERIALIZER);
       
        Preconditions.checkNotNull(eventSerializerType,"Event serializer cannot be empty, please specify in the configuration file");
        initializeSerializer(context,eventSerializerType);
        this.sinkCounter = new SinkCounter(this.getName());
    }
View Full Code Here

TOP

Related Classes of org.apache.flume.instrumentation.SinkCounter

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.