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

java.lang.Object
  extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.join.JoinOp

public class JoinOp
extends Object

Operator class used to perform a hash inner join on its input and produces an output holding the joined results. The operator can also function as part of an intersection operation if its RecordGenerationPolicy is set to RecordGenerationPolicy.KeepLeft (or, less commonly to RecordGenerationPolicy.KeepRight. If not set, the RecordGenerationPolicy is equal to RecordGenerationPolicy.Concatenate which yields standard inner join functionality.

Author:
UoA

Field Summary
static int BufferCapacityDef
          The default capacity of the RecordWriters and, if applicable, of all IRecordReaders' buffers
 Map<IndexPair,Integer> producerDefinitionMap
          A mapping from pairs of definition indices to producer definition indices.
static RecordGenerationPolicy recordGenerationPolicyDef
          The default record generation policy.
static long TimeoutDef
          The default timeout
static TimeUnit TimeUnitDef
          The default time unit
 
Constructor Summary
JoinOp(URI leftLocator, URI rightLocator, RecordGenerationPolicy recordGenerationPolicy, long timeout, TimeUnit timeUnit, int bufferCapacity, StatsContainer stats)
          Creates a new JoinOp with configurable timeout
JoinOp(URI leftLocator, URI rightLocator, RecordGenerationPolicy recordGenerationPolicy, long timeout, TimeUnit timeUnit, StatsContainer stats)
          Creates a new JoinOp with configurable timeout
JoinOp(URI leftLocator, URI rightLocator, RecordGenerationPolicy recordGenerationPolicy, StatsContainer stats)
           
JoinOp(URI leftLocator, URI rightLocator, StatsContainer stats)
          Creates a new JoinOp with the default timeout
 
Method Summary
 URI compute(String leftKeyFieldName, String rightKeyFieldName)
          Performs the join operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

recordGenerationPolicyDef

public static final RecordGenerationPolicy recordGenerationPolicyDef
The default record generation policy. Currently set to RecordGenerationPolicy.Concatenate which corresponds to the standard inner join policy


TimeoutDef

public static final long TimeoutDef
The default timeout

See Also:
Constant Field Values

TimeUnitDef

public static final TimeUnit TimeUnitDef
The default time unit


BufferCapacityDef

public static final int BufferCapacityDef
The default capacity of the RecordWriters and, if applicable, of all IRecordReaders' buffers

See Also:
Constant Field Values

producerDefinitionMap

public Map<IndexPair,Integer> producerDefinitionMap
A mapping from pairs of definition indices to producer definition indices. Used when record generation policy is RecordGenerationPolicy.Concatenate

Constructor Detail

JoinOp

public JoinOp(URI leftLocator,
              URI rightLocator,
              StatsContainer stats)
Creates a new JoinOp with the default timeout

Parameters:
leftLocator - The locator of the left input
rightLocator - The locator of the right input
stats - statistics

JoinOp

public JoinOp(URI leftLocator,
              URI rightLocator,
              RecordGenerationPolicy recordGenerationPolicy,
              StatsContainer stats)
Parameters:
leftLocator - The locator of the left input
rightLocator - The locator of the right input
recordGenerationPolicy - The record generation policy that should be followed. RecordGenerationPolicy.Concatenate should be used for standard inner join functionality. RecordGenerationPolicy.KeepLeft should be used if the client wishes to use the operator as the first step an intersection operation, the second one being a duplicate elimination step. RecordGenerationPolicy.KeepRight, if used for the same reason as the former, should yield the same results and is included for completeness.
stats - Statistics

JoinOp

public JoinOp(URI leftLocator,
              URI rightLocator,
              RecordGenerationPolicy recordGenerationPolicy,
              long timeout,
              TimeUnit timeUnit,
              StatsContainer stats)
Creates a new JoinOp with configurable timeout

Parameters:
leftLocator - The locator of the left input
rightLocator - The locator of the right input
recordGenerationPolicy - The record generation policy that should be followed. RecordGenerationPolicy.Concatenate should be used for standard inner join functionality. RecordGenerationPolicy.KeepLeft should be used if the client wishes to use the operator as the first step an intersection operation, the second one being a duplicate elimination step. RecordGenerationPolicy.KeepRight, if used for the same reason as the former, should yield the same results and is included for completeness.
timeout - The timeout which will be used by the two RandomReaders and the RecordWriter
timeUnit - The unit of the timeout
stats - Statistics

JoinOp

public JoinOp(URI leftLocator,
              URI rightLocator,
              RecordGenerationPolicy recordGenerationPolicy,
              long timeout,
              TimeUnit timeUnit,
              int bufferCapacity,
              StatsContainer stats)
Creates a new JoinOp with configurable timeout

Parameters:
leftLocator - The locator of the left input
rightLocator - The locator of the right input
recordGenerationPolicy - The record generation policy that should be followed. RecordGenerationPolicy.Concatenate should be used for standard inner join functionality. RecordGenerationPolicy.KeepLeft should be used if the client wishes to use the operator as the first step an intersection operation, the second one being a duplicate elimination step. RecordGenerationPolicy.KeepRight, if used for the same reason as the former, should yield the same results and is included for completeness.
timeout - The timeout which will be used by the two RandomReaders and the RecordWriter
timeUnit - The unit of the timeout
bufferCapacity - The capacity of the buffer which will be used by the RecordWriter and all RandomReaders (if applicable)
stats - Statistics
Method Detail

compute

public URI compute(String leftKeyFieldName,
                   String rightKeyFieldName)
            throws Exception
Performs the join operation

Parameters:
type - The type of resource to create
leftKeyFieldName - The name of the Field of the join key originating from the left locator
rightKeyFieldName - The name of the Field of the join key origiating from the right locator
Returns:
The join result
Throws:
Exception - An unrecoverable for the operation error occured


Copyright © 2013. All Rights Reserved.