cascading.tuple.collect
Class SpillableTupleList

java.lang.Object
  extended by cascading.tuple.collect.SpillableTupleList
All Implemented Interfaces:
Spillable, Iterable<Tuple>, Collection<Tuple>

public abstract class SpillableTupleList
extends Object
implements Collection<Tuple>, Spillable

Class SpillableTupleList is a simple durable Collection that can spill its contents to disk when the threshold is met.

Using a threshold of -1 will disable the spill, all values will remain in memory. This class is used by the CoGroup pipe, to set properties specific to a given CoGroup instance, see the Pipe.getConfigDef() method.

Use the SpillableProps fluent helper class to set properties.

See Also:
HadoopSpillableTupleList

Nested Class Summary
 
Nested classes/interfaces inherited from interface cascading.tuple.collect.Spillable
Spillable.SpillListener, Spillable.SpillStrategy
 
Field Summary
static String SPILL_CODECS
          Deprecated. 
static String SPILL_COMPRESS
          Deprecated. 
static String SPILL_THRESHOLD
          Deprecated. 
 
Constructor Summary
protected SpillableTupleList(int threshold)
           
protected SpillableTupleList(Spillable.SpillStrategy spillStrategy)
           
 
Method Summary
 boolean add(Tuple tuple)
          Method add will add the given Tuple to this list.
 boolean addAll(Collection<? extends Tuple> tuples)
           
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection<?> objects)
           
protected abstract  TupleInputStream createTupleInputStream(File file)
           
protected abstract  TupleOutputStream createTupleOutputStream(File file)
           
protected static Class getCodecClass(FlowProcess flowProcess, String defaultCodecs, Class subClass)
           
 Tuple getGrouping()
           
static int getThreshold(FlowProcess flowProcess, int defaultValue)
           
 boolean isEmpty()
           
 Iterator<Tuple> iterator()
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> objects)
           
 boolean retainAll(Collection<?> objects)
           
 void setGrouping(Tuple group)
           
 void setSpillListener(Spillable.SpillListener spillListener)
           
 void setSpillStrategy(Spillable.SpillStrategy spillStrategy)
           
 int size()
           
 int spillCount()
          The number of times this container has spilled data to disk.
 Object[] toArray()
           
<T> T[]
toArray(T[] ts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

SPILL_THRESHOLD

@Deprecated
public static final String SPILL_THRESHOLD
Deprecated. 
Number of tuples to hold in memory before spilling them to disk.

See Also:
Constant Field Values

SPILL_COMPRESS

@Deprecated
public static final String SPILL_COMPRESS
Deprecated. 
Whether to enable compress of the spills or not, on by default.

See Also:
Boolean.parseBoolean(String), Constant Field Values

SPILL_CODECS

@Deprecated
public static final String SPILL_CODECS
Deprecated. 
A comma delimited list of possible codecs to try. This is platform dependent.

See Also:
Constant Field Values
Constructor Detail

SpillableTupleList

protected SpillableTupleList(int threshold)

SpillableTupleList

protected SpillableTupleList(Spillable.SpillStrategy spillStrategy)
Method Detail

getThreshold

public static int getThreshold(FlowProcess flowProcess,
                               int defaultValue)

getCodecClass

protected static Class getCodecClass(FlowProcess flowProcess,
                                     String defaultCodecs,
                                     Class subClass)

setGrouping

public void setGrouping(Tuple group)
Specified by:
setGrouping in interface Spillable

getGrouping

public Tuple getGrouping()
Specified by:
getGrouping in interface Spillable

setSpillStrategy

public void setSpillStrategy(Spillable.SpillStrategy spillStrategy)
Specified by:
setSpillStrategy in interface Spillable

setSpillListener

public void setSpillListener(Spillable.SpillListener spillListener)
Specified by:
setSpillListener in interface Spillable

spillCount

public int spillCount()
Description copied from interface: Spillable
The number of times this container has spilled data to disk.

Specified by:
spillCount in interface Spillable
Returns:
in int

add

public boolean add(Tuple tuple)
Method add will add the given Tuple to this list.

Specified by:
add in interface Collection<Tuple>
Parameters:
tuple - of type Tuple

size

public int size()
Specified by:
size in interface Collection<Tuple>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Tuple>

createTupleOutputStream

protected abstract TupleOutputStream createTupleOutputStream(File file)

createTupleInputStream

protected abstract TupleInputStream createTupleInputStream(File file)

clear

public void clear()
Specified by:
clear in interface Collection<Tuple>

iterator

public Iterator<Tuple> iterator()
Specified by:
iterator in interface Iterable<Tuple>
Specified by:
iterator in interface Collection<Tuple>

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection<Tuple>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Tuple>

toArray

public <T> T[] toArray(T[] ts)
Specified by:
toArray in interface Collection<Tuple>

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<Tuple>

containsAll

public boolean containsAll(Collection<?> objects)
Specified by:
containsAll in interface Collection<Tuple>

addAll

public boolean addAll(Collection<? extends Tuple> tuples)
Specified by:
addAll in interface Collection<Tuple>

removeAll

public boolean removeAll(Collection<?> objects)
Specified by:
removeAll in interface Collection<Tuple>

retainAll

public boolean retainAll(Collection<?> objects)
Specified by:
retainAll in interface Collection<Tuple>


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.