org.apache.hadoop.chukwa.util
Class MaxRateSender
java.lang.Object
java.lang.Thread
org.apache.hadoop.chukwa.util.MaxRateSender
- All Implemented Interfaces:
- Runnable, Adaptor
public class MaxRateSender
- extends Thread
- implements Adaptor
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
ADAPTOR_NAME
public static final String ADAPTOR_NAME
- See Also:
- Constant Field Values
MaxRateSender
public MaxRateSender()
getCurrentStatus
public String getCurrentStatus()
throws AdaptorException
- Description copied from interface:
Adaptor
- Return the adaptor's state Should not include class name, datatype or byte
offset, which are written by caller.
- Specified by:
getCurrentStatus
in interface Adaptor
- Returns:
- the adaptor state as a string
- Throws:
AdaptorException
start
public void start(long adaptor,
String type,
String status,
long offset,
ChunkReceiver dest)
throws AdaptorException
- Description copied from interface:
Adaptor
- Start this adaptor
- Specified by:
start
in interface Adaptor
type
- the application type, who is starting this adaptorstatus
- the status string to use for configuration.offset
- the stream offset of the first byte sent by this adaptor
- Throws:
AdaptorException
getStreamName
public String getStreamName()
- Description copied from interface:
Adaptor
- Return the stream name
- Specified by:
getStreamName
in interface Adaptor
- Returns:
- Stream name as a string
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
toString
public String toString()
- Overrides:
toString
in class Thread
shutdown
public long shutdown()
throws AdaptorException
- Description copied from interface:
Adaptor
- Signals this adaptor to come to an orderly stop. The adaptor ought to push
out all the data it can before exiting.
This method is synchronous: In other words, after shutdown() returns, no
new data should be written.
- Specified by:
shutdown
in interface Adaptor
- Returns:
- the logical offset at which the adaptor stops
- Throws:
AdaptorException
hardStop
public void hardStop()
throws AdaptorException
- Description copied from interface:
Adaptor
- Signals this adaptor to come to an abrupt stop, as quickly as it can. The
use case here is "Whups, I didn't mean to start that adaptor tailing a
gigabyte file, stop it now".
Adaptors might need to do something nontrivial here, e.g., in the case in
which they have registered periodic timer interrupts, or use a shared
worker thread from which they need to disengage.
This method is synchronous: In other words, after shutdown() returns, no
new data should be written.
- Specified by:
hardStop
in interface Adaptor
- Throws:
AdaptorException
getType
public String getType()
- Specified by:
getType
in interface Adaptor
Copyright © ${year} The Apache Software Foundation