org.apache.flume.source

## Class StressSource

- java.lang.Object
- - org.apache.flume.source.BasicSourceSemantics
  - - org.apache.flume.source.AbstractPollableSource
    - - org.apache.flume.source.StressSource

- All Implemented Interfaces:
    Configurable, LifecycleAware, NamedComponent, PollableSource, Source

      public class StressSource
      extends AbstractPollableSource
      implements Configurable

  StressSource is an internal load-generating source implementation which is very useful for stress tests. It allows User to configure the size of Event payload, with empty headers. User can configure total number of events to be sent as well maximum number of Successful Events to be delivered. Useful for tests Example configuration for Agent a1

         a1.sources = stresssource-1
         a1.channels = memoryChannel-1
         a1.sources.stresssource-1.type = org.apache.flume.source.StressSource
         a1.sources.stresssource-1.size = 10240
         a1.sources.stresssource-1.maxTotalEvents = 1000000
         a1.sources.stresssource-1.channels = memoryChannel-1

  See `AbstractPollableSource.configure(Context)` for configuration options.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.flume.PollableSource

      `PollableSource.Status`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StressSource()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doConfigure(Context context)` Read parameters from context -maxTotalEvents = type long that defines the total number of Events to be sent -maxSuccessfulEvents = type long that defines the number of successful Events -size = type int that defines the number of bytes in each Event -batchSize = type int that defines the number of Events being sent in one batch
    `protected PollableSource.Status` | `doProcess()`
    `protected void` | `doStart()`
    `protected void` | `doStop()`

    - ### Methods inherited from class org.apache.flume.source.AbstractPollableSource

      `configure, getBackOffSleepIncrement, getMaxBackOffSleepInterval, process`

    - ### Methods inherited from class org.apache.flume.source.BasicSourceSemantics

      `getChannelProcessor, getLifecycleState, getName, getStartException, isStarted, setChannelProcessor, setLifecycleState, setName, start, stop, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.flume.conf.Configurable

      `configure`

    - ### Methods inherited from interface org.apache.flume.Source

      `getChannelProcessor, setChannelProcessor`

    - ### Methods inherited from interface org.apache.flume.lifecycle.LifecycleAware

      `getLifecycleState, start, stop`

    - ### Methods inherited from interface org.apache.flume.NamedComponent

      `getName, setName`

- - ### Constructor Detail

    - #### StressSource

          public StressSource()

  - ### Method Detail

    - #### doConfigure

          protected void doConfigure(Context context)
                              throws FlumeException

      Read parameters from context
    - -maxTotalEvents = type long that defines the total number of Events to be sent
    - -maxSuccessfulEvents = type long that defines the number of successful Events
    - -size = type int that defines the number of bytes in each Event
    - -batchSize = type int that defines the number of Events being sent in one batch

Specified by:
  `doConfigure` in class `BasicSourceSemantics`
Throws:
  `FlumeException`

- #### doProcess

      protected PollableSource.Status doProcess()
                                         throws EventDeliveryException

  Specified by:
    `doProcess` in class `AbstractPollableSource`
  Throws:
    `EventDeliveryException`

- #### doStart

      protected void doStart()
                      throws FlumeException

  Specified by:
    `doStart` in class `BasicSourceSemantics`
  Throws:
    `FlumeException`

- #### doStop

      protected void doStop()
                     throws FlumeException

  Specified by:
    `doStop` in class `BasicSourceSemantics`
  Throws:
    `FlumeException`

Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.