|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.crunch.materialize.pobject.PObjectImpl<S,T>
S - The type contained in the underlying PCollection.T - The type encapsulated by this PObject.public abstract class PObjectImpl<S,T>
An abstract implementation of PObject that is backed by a PCollection.
Clients creating a concrete implementation should override the method
process(Iterable), which transforms the backing PCollection into the
singleton value encapsulated by the PObject. Once this {code PObject}'s value has been
calculated, the value is cached to prevent subsequent materializations of the backing
PCollection.
| Constructor Summary | |
|---|---|
PObjectImpl(PCollection<S> collect)
Constructs a new instance of this PObject implementation. |
|
| Method Summary | |
|---|---|
T |
getValue()
Gets the value associated with this PObject. |
protected abstract T |
process(Iterable<S> input)
Transforms the provided Iterable, obtained from the backing PCollection,
into the value encapsulated by this PObject. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PObjectImpl(PCollection<S> collect)
PObject implementation.
collect - The backing PCollection for this PObject.| Method Detail |
|---|
public String toString()
toString in class Objectpublic final T getValue()
PObject. Calling this method will trigger
whatever computation is necessary to obtain the value and block until that computation
succeeds.
getValue in interface PObject<T>PObject.protected abstract T process(Iterable<S> input)
PCollection,
into the value encapsulated by this PObject.
input - An Iterable whose elements correspond to those of the backing PCollection.
PObject.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||