|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.apache.hadoop.chukwa.util.ConstRateAdaptor
public class ConstRateAdaptor
Emits chunks at a roughly constant data rate. Chunks are in a very particular format: the output data is verifiable, but sufficiently non-deterministic that two different instances of this adaptor are very likely to have distinct outputs. Each chunk is full of random bytes; the randomness comes from an instance of java.util.Random seeded with the offset xored with the time-of-generation. The time of generation is stored, big-endian, in the first eight bytes of each chunk.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ConstRateAdaptor()
|
|
| Method Summary | |
|---|---|
static boolean |
checkChunk(Chunk chunk)
|
String |
getCurrentStatus()
Return the adaptor's state Should not include class name or byte offset, which are written by caller. |
String |
getType()
|
void |
hardStop()
Deprecated. |
ChunkImpl |
nextChunk(int arraySize)
|
String |
parseArgs(String bytesPerSecParam)
Parse args, return stream name. |
void |
run()
|
long |
shutdown()
Deprecated. |
long |
shutdown(AdaptorShutdownPolicy shutdownPolicy)
Signals this adaptor to come to an orderly stop. |
void |
start(String adaptorID,
String type,
long offset,
ChunkReceiver dest,
AdaptorManager c)
Start this adaptor |
String |
toString()
|
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConstRateAdaptor()
| Method Detail |
|---|
public String getCurrentStatus()
Adaptor
getCurrentStatus in interface Adaptor
public void start(String adaptorID,
String type,
long offset,
ChunkReceiver dest,
AdaptorManager c)
throws AdaptorException
Adaptor
start in interface Adaptortype - the application type, who is starting this adaptoroffset - the stream offset of the first byte sent by this adaptor
AdaptorExceptionpublic String parseArgs(String bytesPerSecParam)
Adaptor
parseArgs in interface Adaptorpublic void run()
run in interface Runnablerun in class Threadpublic ChunkImpl nextChunk(int arraySize)
public String toString()
toString in class Thread
@Deprecated
public void hardStop()
throws AdaptorException
Adaptor
hardStop in interface AdaptorAdaptorException
@Deprecated
public long shutdown()
throws AdaptorException
Adaptor
shutdown in interface AdaptorAdaptorExceptionpublic String getType()
getType in interface Adaptorpublic long shutdown(AdaptorShutdownPolicy shutdownPolicy)
Adaptor
shutdown in interface Adaptorpublic static boolean checkChunk(Chunk chunk)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||