public interface TupleMapFactory<Config> extends CascadingFactory<Config,java.util.Map<Tuple,java.util.Collection<Tuple>>>
The Map
classes returned must take a Tuple
as a key, and a Collection
of Tuples as
a value. Further, Map.get(Object)
must never return null
, but on the first call to get() on the map
an empty Collection must be created and stored.
That is, Map.put(Object, Object)
is never called on the map instance internally,
only map.get(groupTuple).add(valuesTuple)
.
Using the TupleCollectionFactory
to create the underlying Tuple Collections would allow that aspect
to be pluggable as well.
If the Map implementation implements the Spillable
interface, it will receive a Spillable.SpillListener
instance that calls back to the appropriate logging mechanism for the platform. This instance should be passed
down to any child Spillable types, namely an implementation of SpillableTupleList
.
The default implementation for the Hadoop platform is the HadoopTupleMapFactory
which created a HadoopSpillableTupleMap
instance.
The class SpillableTupleMap
may be used as a base class.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TUPLE_MAP_FACTORY |
create, initialize
static final java.lang.String TUPLE_MAP_FACTORY
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.