|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebay.erl.mobius.core.function.base.Projectable
public class Projectable
Base class for all projection operations.
Users do not extend this class directly, and instead extend
ExtendFunction
, GroupFunction
or their sub-classes.
A projectable takes one to many columns from one to many datasets
as it inputs, then performs calculation to generate X number
of rows as the output, where X can be zero to many. The schema of
each outputted row is defined in the setOutputSchema(String...)
method.
When providing a customized implementation of a projection operation, users must make sure the output schema is consistent with the actual output.
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
GroupFunction
,
ExtendFunction
,
Serialized FormField Summary | |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf
|
protected int |
hashCode
|
protected Column[] |
inputs
the input columns that are required by this function to compute its result. |
protected java.lang.String[] |
outputSchema
the name of the output columns in the #getResult() tuple |
protected org.apache.hadoop.mapred.Reporter |
reporter
|
protected boolean |
requireDataFromMultiDatasets
|
Constructor Summary | |
---|---|
protected |
Projectable()
should be invoked by Column only |
|
Projectable(Column[] inputs)
Create a Projectable which takes the inputs
to compute some result. |
Method Summary | |
---|---|
boolean |
calledByCombiner()
|
boolean |
equals(java.lang.Object obj)
|
org.apache.hadoop.conf.Configuration |
getConf()
|
Column[] |
getInputColumns()
Get the input columns. |
java.lang.String[] |
getOutputSchema()
Get the output schema of the result of this function. |
java.util.Set<Dataset> |
getParticipatedDataset()
return the Dataset that is required in computing
the result of this function. |
int |
hashCode()
|
protected void |
init(Column[] inputs)
|
boolean |
isCombinable()
Determine this function can be run in a combiner or not, default is false. |
boolean |
requireDataFromMultiDatasets()
true if this function require columns from more than one dataset to compute its value. |
void |
setCalledByCombiner(boolean calledByCombiner)
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
Projectable |
setOutputSchema(java.lang.String... schema)
Set the output schema of the result of this function. |
void |
setReporter(org.apache.hadoop.mapred.Reporter reporter)
|
java.lang.String |
toString()
|
boolean |
useGroupKeyOnly()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Column[] inputs
protected java.lang.String[] outputSchema
protected transient org.apache.hadoop.conf.Configuration conf
protected int hashCode
protected boolean requireDataFromMultiDatasets
protected org.apache.hadoop.mapred.Reporter reporter
Constructor Detail |
---|
public Projectable(Column[] inputs)
Projectable
which takes the inputs
to compute some result. The schema of the result will be, by
default, this.getClass().getSimpleName()+"_"+aColumn.getOutputName()
,
for each inputs
.
The number of output column doesn't have to be the same as the number of input
column, user can use setOutputSchema(String...)
to set the real output
schema.
protected Projectable()
Column
only
Method Detail |
---|
protected void init(Column[] inputs)
public final boolean requireDataFromMultiDatasets()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Projectable setOutputSchema(java.lang.String... schema)
public java.lang.String[] getOutputSchema()
public Column[] getInputColumns()
public java.util.Set<Dataset> getParticipatedDataset()
Dataset
that is required in computing
the result of this function.
If only one Dataset
is required, this function
should be applied before the cross product phase.
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public final boolean useGroupKeyOnly()
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public void setReporter(org.apache.hadoop.mapred.Reporter reporter)
public boolean isCombinable()
public boolean calledByCombiner()
public void setCalledByCombiner(boolean calledByCombiner)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |