gr.uoa.di.madgik.searchlibrary.operatorlibrary.transform
Class ScriptWorker<T extends gr.uoa.di.madgik.grs.record.Record>

java.lang.Object
  extended by java.lang.Thread
      extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.transform.ScriptWorker<T>
All Implemented Interfaces:
Runnable

public class ScriptWorker<T extends gr.uoa.di.madgik.grs.record.Record>
extends Thread


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
ScriptWorker(gr.uoa.di.madgik.grs.reader.IRecordReader<T> reader, String script, String schema, StatsContainer stats, long timeout, TimeUnit timeUnit)
           
 
Method Summary
protected  URI getLocator()
           
 void run()
          Performs the transform operation
 
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, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptWorker

public ScriptWorker(gr.uoa.di.madgik.grs.reader.IRecordReader<T> reader,
                    String script,
                    String schema,
                    StatsContainer stats,
                    long timeout,
                    TimeUnit timeUnit)
             throws Exception
Parameters:
reader - The IRecordReader to consume records from
writer - The IRecordWriter which will be used to write the output
payloadFieldName - The name of the Field containing the payload on which the transformation will be applied
script - The script to apply on each record field
schema - schema that describes new result set
stats - Statistics
timeout - The timeout which will be used both by the reader and the writer
timeUnit - The unit of the timeout which will be used
Throws:
Exception - if script is not initialised right
Method Detail

run

public void run()
Performs the transform operation

Specified by:
run in interface Runnable
Overrides:
run in class Thread

getLocator

protected URI getLocator()
                  throws InterruptedException,
                         gr.uoa.di.madgik.grs.writer.GRS2WriterException
Throws:
InterruptedException
gr.uoa.di.madgik.grs.writer.GRS2WriterException


Copyright © 2013. All Rights Reserved.