|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.data.DefaultAbstractBag
public abstract class DefaultAbstractBag
Default implementation of DataBag. This is the an abstract class used as a parent for all three of the types of data bags.
Nested Class Summary | |
---|---|
static class |
DefaultAbstractBag.BagDelimiterTuple
|
static class |
DefaultAbstractBag.EndBag
|
static class |
DefaultAbstractBag.StartBag
|
Field Summary | |
---|---|
static Tuple |
endBag
|
protected static int |
MAX_SPILL_FILES
|
protected Collection<Tuple> |
mContents
|
protected int |
mLastContentsSize
|
protected long |
mMemSize
|
protected long |
mSize
|
protected FileList |
mSpillFiles
|
static Tuple |
startBag
|
Constructor Summary | |
---|---|
DefaultAbstractBag()
|
Method Summary | |
---|---|
void |
add(Tuple t)
Add a tuple to the bag. |
void |
addAll(Collection<Tuple> c)
Add contents of a container to the bag. |
void |
addAll(DataBag b)
Add contents of a bag to the bag. |
void |
clear()
Clear out the contents of the bag, both on disk and in memory. |
int |
compareTo(Object other)
This method is potentially very expensive since it may require a sort of the bag; don't call it unless you have to. |
boolean |
equals(Object other)
|
long |
getMemorySize()
Return the size of memory usage. |
protected DataOutputStream |
getSpillFile()
Get a file to spill contents to. |
int |
hashCode()
|
protected void |
incSpillCount(Enum counter)
|
protected void |
incSpillCount(Enum counter,
long numRecsSpilled)
|
void |
markStale(boolean stale)
This is used by FuncEvalSpec.FakeDataBag. |
void |
readFields(DataInput in)
Read a bag from disk. |
protected void |
reportProgress()
Report progress to HDFS. |
long |
size()
Get the number of elements in the bag, both in memory and on disk. |
String |
toString()
Write the bag into a string. |
protected void |
warn(String msg,
Enum warningEnum,
Exception e)
|
void |
write(DataOutput out)
Write a bag's contents to disk. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.pig.data.DataBag |
---|
isDistinct, isSorted, iterator |
Methods inherited from interface org.apache.pig.impl.util.Spillable |
---|
spill |
Field Detail |
---|
protected Collection<Tuple> mContents
protected FileList mSpillFiles
protected long mSize
protected int mLastContentsSize
protected long mMemSize
public static final Tuple startBag
public static final Tuple endBag
protected static final int MAX_SPILL_FILES
Constructor Detail |
---|
public DefaultAbstractBag()
Method Detail |
---|
public long size()
size
in interface DataBag
public void add(Tuple t)
add
in interface DataBag
t
- tuple to add.public void addAll(DataBag b)
addAll
in interface DataBag
b
- bag to add contents of.public void addAll(Collection<Tuple> c)
c
- Collection to add contents of.public long getMemorySize()
getMemorySize
in interface Spillable
public void clear()
clear
in interface DataBag
public int compareTo(Object other)
compareTo
in interface Comparable
public boolean equals(Object other)
equals
in class Object
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
out
- DataOutput to write data to.
IOException
- (passes it on from underlying calls).public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
in
- DataInput to read data from.
IOException
- (passes it on from underlying calls).public void markStale(boolean stale)
markStale
in interface DataBag
stale
- Set stale state.public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
protected DataOutputStream getSpillFile() throws IOException
IOException
protected void reportProgress()
protected void warn(String msg, Enum warningEnum, Exception e)
protected void incSpillCount(Enum counter)
protected void incSpillCount(Enum counter, long numRecsSpilled)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |