gr.uoa.di.madgik.searchlibrary.operatorlibrary.join
Class JoinWorker

java.lang.Object
  extended by java.lang.Thread
      extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.join.JoinWorker
All Implemented Interfaces:
Runnable

public class JoinWorker
extends Thread

Helper thread class used to perform the join operation

Author:
UoA

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
JoinWorker(gr.uoa.di.madgik.grs.writer.IRecordWriter<gr.uoa.di.madgik.grs.record.Record> writer, gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> leftReader, gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> rightReader, String leftKeyFieldName, String rightKeyFieldName, DefinitionIndexResolver defResolver, int[] keyIndices, RecordGenerationPolicy recordGenerationPolicy, long timeout, TimeUnit timeUnit, StatsContainer stats, String uid)
          Creates a new JoinWorker
 
Method Summary
 void checkJoin(JoinElement tmp, HashJoin join1, HashJoin join2, gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> leftReader, gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> rightReader, Object synch, BlockingQueue<JoinElement> queue, EventHandler eventHandler, BooleanHolder stopNotifier)
          Checks if the provided elements must be joined and places it in the respective hash table
 void run()
           
 
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

JoinWorker

public JoinWorker(gr.uoa.di.madgik.grs.writer.IRecordWriter<gr.uoa.di.madgik.grs.record.Record> writer,
                  gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> leftReader,
                  gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> rightReader,
                  String leftKeyFieldName,
                  String rightKeyFieldName,
                  DefinitionIndexResolver defResolver,
                  int[] keyIndices,
                  RecordGenerationPolicy recordGenerationPolicy,
                  long timeout,
                  TimeUnit timeUnit,
                  StatsContainer stats,
                  String uid)
Creates a new JoinWorker

Parameters:
writer - The IRecordWriter to write records to
leftReader - The reader for the left input
rightReader - The reader for the right input
leftKeyFieldName - The name of the Field originating from the left RandomReader and containing the key to base the join on
rightKeyFieldName - The name of the Field originating from the right RandomReader and containing the key to base the join on
keyIndex - The index of the join key in the RecordDefinition of the producer
recordGenerationPolicy - The record generation policy that should be used
timeout - The timeout to be used both by the RandomReaders and the IRecordWriter
timeUnit - The time unit of the timeout that will be used
stats - statistics
uid - A unique identifier for this operation
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Runnable.run()

checkJoin

public void checkJoin(JoinElement tmp,
                      HashJoin join1,
                      HashJoin join2,
                      gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> leftReader,
                      gr.uoa.di.madgik.grs.reader.RandomReader<gr.uoa.di.madgik.grs.record.Record> rightReader,
                      Object synch,
                      BlockingQueue<JoinElement> queue,
                      EventHandler eventHandler,
                      BooleanHolder stopNotifier)
Checks if the provided elements must be joined and places it in the respective hash table

Parameters:
tmp - The element to check
join1 - The Hash table for the left input
join2 - The Hash table for the right input
leftReader - The left input reader
rightReader - The right input reader
synch - An object used to synchronize readers
queue - The record queue from which records are retrieved
eventHandler - The event handler used to propagate events
stopNotifier - An object used to signify the end of processing


Copyright © 2013. All Rights Reserved.