org.edg.info
Class ArchiverInstance.ArchiverThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.edg.info.ArchiverInstance.ArchiverThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ArchiverInstance

public class ArchiverInstance.ArchiverThread
extends java.lang.Thread

Gets tuples from the Consumer and inserts them into the Insertable.


Field Summary
static long BUFFER_FULL_RETRY_PERIOD
          Defines the sleep interval when no more tuples can be inserted into the producer (due to a full buffer) defined in ms.
static long CONSUMER_RECREATE_PERIOD
          Period between re-creating new consumer (if current one fails).
 int m_tuplesArchived
          Number of tuples that have been archived by this thread.
 int m_tuplesLost
          Number of tuples that have been lost by this thread.
static int MAX_POP_COUNT
          Maximum number of tuples to pop at a time.
static long POP_INITIAL_PERIOD
          Interval to wait before first pop in thread (ms).
static long POP_RETRY_PERIOD
          Interval to wait after a pop returns no tuples (ms).
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void close()
          Stops the thread and closes the consumer.
 org.edg.info.system.ServletConnection getConsumerConnection()
          Returns the servlet connection object used by the consumer.
 int getConsumerId()
           
 java.lang.String getConsumerURL()
           
 java.lang.String getLastExceptionMessage()
           
 long getLastInsertTimeMillis()
           
 int getLastInsertTupleCount()
           
 long getLastSuccessfulInsertTimeMillis()
           
 int getNumberTuplesArchived()
           
 int getNumberTuplesDropped()
           
 java.lang.String getQuery()
           
 long getQueryStartTimeMillis()
           
 long getQueryTimeoutMillis()
           
 java.lang.String getStartTime()
           
 java.lang.String getTableName()
           
 java.lang.String getTupleStatus()
          Gets a String giving the status of this archiver thread.
 boolean isProducerIsFull()
           
 void run()
          Main loop.
 
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
 

Field Detail

BUFFER_FULL_RETRY_PERIOD

public static final long BUFFER_FULL_RETRY_PERIOD
Defines the sleep interval when no more tuples can be inserted into the producer (due to a full buffer) defined in ms.

See Also:
Constant Field Values

CONSUMER_RECREATE_PERIOD

public static final long CONSUMER_RECREATE_PERIOD
Period between re-creating new consumer (if current one fails).

See Also:
Constant Field Values

POP_RETRY_PERIOD

public static final long POP_RETRY_PERIOD
Interval to wait after a pop returns no tuples (ms).

See Also:
Constant Field Values

POP_INITIAL_PERIOD

public static final long POP_INITIAL_PERIOD
Interval to wait before first pop in thread (ms).

See Also:
Constant Field Values

MAX_POP_COUNT

public static final int MAX_POP_COUNT
Maximum number of tuples to pop at a time.

See Also:
Constant Field Values

m_tuplesArchived

public int m_tuplesArchived
Number of tuples that have been archived by this thread.


m_tuplesLost

public int m_tuplesLost
Number of tuples that have been lost by this thread.

Method Detail

getTupleStatus

public java.lang.String getTupleStatus()
Gets a String giving the status of this archiver thread.

Returns:

getConsumerConnection

public org.edg.info.system.ServletConnection getConsumerConnection()
Returns the servlet connection object used by the consumer.


close

public void close()
Stops the thread and closes the consumer.


run

public void run()
Main loop.


isProducerIsFull

public boolean isProducerIsFull()
Returns:
Returns true if the producer buffer is full.

getQuery

public java.lang.String getQuery()
Returns:
Returns the query.

getStartTime

public java.lang.String getStartTime()
Returns:
Returns the query startTime.

getTableName

public java.lang.String getTableName()
Returns:
Returns the tableName.

getNumberTuplesArchived

public int getNumberTuplesArchived()
Returns:
Returns the number of archived tuples.

getNumberTuplesDropped

public int getNumberTuplesDropped()
Returns:
Returns the number of lost tuples.

getConsumerId

public int getConsumerId()
Returns:
Returns the consumer ID.

getConsumerURL

public java.lang.String getConsumerURL()
Returns:
Returns the consumer URL.

getQueryStartTimeMillis

public long getQueryStartTimeMillis()
Returns:
The time when the query was started in milliseconds.

getQueryTimeoutMillis

public long getQueryTimeoutMillis()
Returns:
The query timeout in milliseconds.

getLastInsertTimeMillis

public long getLastInsertTimeMillis()
Returns:
Time of last insert in milliseconds.

getLastSuccessfulInsertTimeMillis

public long getLastSuccessfulInsertTimeMillis()
Returns:
Time of last successful insert in milliseconds.

getLastInsertTupleCount

public int getLastInsertTupleCount()
Returns:
Number of tuples stored during last insert attempt.

getLastExceptionMessage

public java.lang.String getLastExceptionMessage()
Returns:
Returns the last internal exception message.