com.ebay.erl.mobius.util
Class Util

java.lang.Object
  extended by com.ebay.erl.mobius.util.Util

public class Util
extends java.lang.Object

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


Field Summary
static java.lang.String[] ZERO_SIZE_STRING_ARRAY
           
 
Constructor Summary
Util()
           
 
Method Summary
static
<E> void
close(java.util.Iterator<E> it)
           
static java.lang.Iterable<Tuple> crossProduct(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.mapred.Reporter reporter, java.lang.Iterable<Tuple>... datasets)
          Perform cross product for the given datasets
static java.lang.Iterable<Tuple> crossProduct(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.mapred.Reporter reporter, java.util.List<BigTupleList> datasets)
           
 boolean equalContent(java.io.File f1, java.io.File f2)
           
static int findBoundary(java.lang.Object[] sorted, java.lang.Object x, java.util.Comparator<java.lang.Object> comparator, boolean isUpper)
           
static
<T> java.util.List<T>
findByType(java.util.List<? super T> list, java.lang.Class<T> type)
           
static
<U,T extends U>
T[]
findByType(U[] list, java.lang.Class<T> type)
           
static int findLowerBound(java.lang.Object[] sorted, java.lang.Object x, java.util.Comparator<java.lang.Object> comparator)
           
static int findRepeatTimes(java.lang.Object[] sorted, java.lang.Object x, java.util.Comparator<java.lang.Object> comparator)
           
static int findUpperBound(java.lang.Object[] sorted, java.lang.Object x, java.util.Comparator<java.lang.Object> comparator)
           
static java.lang.Class<?> getClass(java.lang.String fullClassName)
          Get the Class reference by the given fullClassName.
static java.lang.Iterable<Tuple> inMemoryCrossProduct(java.lang.Iterable<Tuple>... datasets)
           
static org.apache.hadoop.conf.Configuration merge(org.apache.hadoop.conf.Configuration... confs)
          Merge the given confs into ones.
static java.lang.Object newInstance(java.lang.String fullClassName)
          Get the instance by the given fullClassName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_SIZE_STRING_ARRAY

public static final java.lang.String[] ZERO_SIZE_STRING_ARRAY
Constructor Detail

Util

public Util()
Method Detail

getClass

public static java.lang.Class<?> getClass(java.lang.String fullClassName)
Get the Class reference by the given fullClassName.


newInstance

public static java.lang.Object newInstance(java.lang.String fullClassName)
Get the instance by the given fullClassName.


crossProduct

public static java.lang.Iterable<Tuple> crossProduct(org.apache.hadoop.conf.Configuration conf,
                                                     org.apache.hadoop.mapred.Reporter reporter,
                                                     java.util.List<BigTupleList> datasets)
                                              throws java.io.IOException
Throws:
java.io.IOException

crossProduct

public static java.lang.Iterable<Tuple> crossProduct(org.apache.hadoop.conf.Configuration conf,
                                                     org.apache.hadoop.mapred.Reporter reporter,
                                                     java.lang.Iterable<Tuple>... datasets)
                                              throws java.io.IOException
Perform cross product for the given datasets

Throws:
java.io.IOException

inMemoryCrossProduct

public static java.lang.Iterable<Tuple> inMemoryCrossProduct(java.lang.Iterable<Tuple>... datasets)

merge

public static org.apache.hadoop.conf.Configuration merge(org.apache.hadoop.conf.Configuration... confs)
Merge the given confs into ones.

The value from same property key in the later configuration objects in the confs will override the previous one.

Returns:
a new Configuration that has all the values in the given confs list.

equalContent

public boolean equalContent(java.io.File f1,
                            java.io.File f2)
                     throws java.io.IOException
Throws:
java.io.IOException

findBoundary

public static int findBoundary(java.lang.Object[] sorted,
                               java.lang.Object x,
                               java.util.Comparator<java.lang.Object> comparator,
                               boolean isUpper)

findUpperBound

public static int findUpperBound(java.lang.Object[] sorted,
                                 java.lang.Object x,
                                 java.util.Comparator<java.lang.Object> comparator)

findLowerBound

public static int findLowerBound(java.lang.Object[] sorted,
                                 java.lang.Object x,
                                 java.util.Comparator<java.lang.Object> comparator)

findRepeatTimes

public static int findRepeatTimes(java.lang.Object[] sorted,
                                  java.lang.Object x,
                                  java.util.Comparator<java.lang.Object> comparator)

findByType

public static <T> java.util.List<T> findByType(java.util.List<? super T> list,
                                               java.lang.Class<T> type)

findByType

public static <U,T extends U> T[] findByType(U[] list,
                                             java.lang.Class<T> type)

close

public static <E> void close(java.util.Iterator<E> it)
                  throws java.io.IOException
Throws:
java.io.IOException