com.ebay.erl.mobius.core.datajoin
Class DataJoinKey

java.lang.Object
  extended by com.ebay.erl.mobius.core.model.Tuple
      extended by com.ebay.erl.mobius.core.datajoin.DataJoinKey
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<Tuple>, java.util.Comparator<Tuple>, org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.RawComparator<Tuple>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Tuple>

public class DataJoinKey
extends Tuple

This product is licensed under the Apache License, Version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0. This product contains portions derived from Apache hadoop which is licensed under the Apache License, Version 2.0, available at http://hadoop.apache.org. © 2007 – 2012 eBay Inc., Evan Chiu, Woody Zhou, Neel Sundaresan


Nested Class Summary
static class DataJoinKey.Comparator
           
 
Nested classes/interfaces inherited from class com.ebay.erl.mobius.core.model.Tuple
Tuple.TupleColumnName
 
Field Summary
static java.lang.String DATASET_ID_FIELDNAME
           
static java.lang.String KEY_FIELDNAME
           
 
Fields inherited from class com.ebay.erl.mobius.core.model.Tuple
_INSERT_KEY, BOOLEAN_TYPE, BYTE_ARRAY_TYPE, BYTE_TYPE, conf, DATE_TYPE, DOUBLE_TYPE, estimate_size_in_bytes, FLOAT_TYPE, INTEGER_TYPE, isMutable, LONG_TYPE, lowerCases, namesToIdxMapping, NULL, NULL_TYPE, NULL_WRITABLE_TYPE, RESULT_WRAPPER_TYPE, SERIALIZABLE_TYPE, SHORT_TYPE, sortedKeys, STRING_MAP_TYPE, STRING_TYPE, TIME_TYPE, TIMESTAMP_TYPE, toStringOrdering, TUPLE_TYPE, values, WRITABLE_TYPE
 
Constructor Summary
DataJoinKey()
           
DataJoinKey(java.lang.String datasetID, org.apache.hadoop.io.WritableComparable<?> key)
           
DataJoinKey(org.apache.hadoop.io.Text datasetID, org.apache.hadoop.io.WritableComparable<?> key)
           
DataJoinKey(org.apache.hadoop.io.Text datasetID, org.apache.hadoop.io.WritableComparable<?> key, org.apache.hadoop.io.WritableComparable<?> sortKeyword, java.lang.Class<?> sortComparator)
           
 
Method Summary
 int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)
          compare two tuples in low level row format.
 int compare(Tuple t1, Tuple t2)
          Comparing two tuples.
 int compareTo(Tuple other)
          Compare this tuple with other.
 java.lang.String getDatasetID()
           
 org.apache.hadoop.io.WritableComparable getKey()
           
 java.lang.Class getSortComparator()
           
 org.apache.hadoop.io.WritableComparable getSortKeyword()
           
 void readFields(java.io.DataInput in)
          Deserialize the tuple from the input in.
 void set(java.lang.String datasetID, org.apache.hadoop.io.WritableComparable<?> key, org.apache.hadoop.io.WritableComparable<?> sortKeyword, java.lang.Class<?> sortComparator)
           
 
Methods inherited from class com.ebay.erl.mobius.core.model.Tuple
check_in_schema, clone, equals, get, get, get, get, getBoolean, getBoolean, getByte, getByte, getConf, getDate, getDate, getDouble, getDouble, getDouble, getEstimatedSizeInMemory, getFloat, getFloat, getInt, getInt, getLong, getLong, getMap, getSchema, getShort, getShort, getSorted, getString, getString, getTime, getTime, getTimestamp, getTimestamp, getType, getTypeString, hashCode, hasSchema, immutable, insert, isDateType, isNumericalType, lowerCase, main, merge, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putNull, setConf, setSchema, setToStringOrdering, toString, valueOf, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_FIELDNAME

public static java.lang.String KEY_FIELDNAME

DATASET_ID_FIELDNAME

public static java.lang.String DATASET_ID_FIELDNAME
Constructor Detail

DataJoinKey

public DataJoinKey()

DataJoinKey

public DataJoinKey(java.lang.String datasetID,
                   org.apache.hadoop.io.WritableComparable<?> key)

DataJoinKey

public DataJoinKey(org.apache.hadoop.io.Text datasetID,
                   org.apache.hadoop.io.WritableComparable<?> key)

DataJoinKey

public DataJoinKey(org.apache.hadoop.io.Text datasetID,
                   org.apache.hadoop.io.WritableComparable<?> key,
                   org.apache.hadoop.io.WritableComparable<?> sortKeyword,
                   java.lang.Class<?> sortComparator)
Method Detail

set

public void set(java.lang.String datasetID,
                org.apache.hadoop.io.WritableComparable<?> key,
                org.apache.hadoop.io.WritableComparable<?> sortKeyword,
                java.lang.Class<?> sortComparator)

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Description copied from class: Tuple
Deserialize the tuple from the input in.

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class Tuple
Throws:
java.io.IOException

getKey

public org.apache.hadoop.io.WritableComparable getKey()

getDatasetID

public java.lang.String getDatasetID()

getSortKeyword

public org.apache.hadoop.io.WritableComparable getSortKeyword()

getSortComparator

public java.lang.Class getSortComparator()

compareTo

public int compareTo(Tuple other)
Description copied from class: Tuple
Compare this tuple with other.

It calls Tuple.compare(Tuple, Tuple) underline.

Specified by:
compareTo in interface java.lang.Comparable<Tuple>
Overrides:
compareTo in class Tuple

compare

public int compare(Tuple t1,
                   Tuple t2)
Description copied from class: Tuple
Comparing two tuples.

It compares the values of the two tuples one by one in sequence, and as long as there is a difference between two values, then the difference is returned.

If the number of values in the tuples are different, the values are compared up to the boundary of the smaller size tuple. If all the values before the boundary have no differences, then the smaller size tuple is considered to be placed before the bigger size tuple.

Specified by:
compare in interface java.util.Comparator<Tuple>
Overrides:
compare in class Tuple

compare

public int compare(byte[] b1,
                   int s1,
                   int l1,
                   byte[] b2,
                   int s2,
                   int l2)
Description copied from class: Tuple
compare two tuples in low level row format.

Specified by:
compare in interface org.apache.hadoop.io.RawComparator<Tuple>
Overrides:
compare in class Tuple