org.edg.info
Class StreamingThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.edg.info.StreamingThread
All Implemented Interfaces:
java.lang.Runnable

public class StreamingThread
extends java.lang.Thread

Thread that periodically initiates streaming for a single producer.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StreamingThread(InsertableInstance streamingProducer)
          Creates a new StreamingThread for the given producer.
 
Method Summary
 long getLastStreamDurationMillis()
           
 long getStreamDurationMillis()
           
 void run()
          Main loop of thread.
 void shutdown()
          Stop the streaming thread
 void streamChanged()
          Indicates to the thread that a new consumer has arrived or more tuples have been inserted (so streaming should be initiated).
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamingThread

public StreamingThread(InsertableInstance streamingProducer)
Creates a new StreamingThread for the given producer.

Parameters:
streamingProducer - Insertable producer.
Method Detail

streamChanged

public void streamChanged()
Indicates to the thread that a new consumer has arrived or more tuples have been inserted (so streaming should be initiated).


shutdown

public void shutdown()
Stop the streaming thread


run

public void run()
Main loop of thread. Waits for 10 times STREAMING_PERIOD_MILLIS (or until streamChanged is true), then calls streamTuples on its streamingProducer.


getStreamDurationMillis

public long getStreamDurationMillis()
Returns:
The current duration of the streaming request. If no streaming is being carried out, -1 is returned.

getLastStreamDurationMillis

public long getLastStreamDurationMillis()
Returns:
The duration of the last request.