public class BigDataOutput extends Object implements DataOutput, org.apache.hadoop.io.Writable
ExtendedDataOutput
are limited because they can
only handle up to 1GB of data. This DataOutput
overcomes that
limitation, with almost no additional cost when data is not huge.
Goes in pair with BigDataInput
Modifier and Type | Field and Description |
---|---|
protected ImmutableClassesGiraphConfiguration |
conf
Configuration
|
protected ExtendedDataOutput |
currentDataOutput
Data output which we are currently writing to
|
protected List<ExtendedDataOutput> |
dataOutputs
List of filled outputs, will be null until we get a lot of data
|
Constructor and Description |
---|
BigDataOutput(ImmutableClassesGiraphConfiguration conf)
Constructor
|
BigDataOutput(int initialSize,
ImmutableClassesGiraphConfiguration conf)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected ExtendedDataOutput |
createOutput(int size)
Create next data output
|
ImmutableClassesGiraphConfiguration |
getConf() |
Iterable<ExtendedDataOutput> |
getDataOutputs()
Get DataOutputs which contain written data.
|
protected int |
getMaxSize()
Get max size for single data output
|
int |
getNumberOfDataOutputs()
Get number of DataOutputs which contain written data.
|
long |
getSize()
Get number of bytes written to this data output
|
void |
readFields(DataInput in) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(DataOutput out) |
void |
write(int b) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(String s) |
void |
writeChar(int v) |
void |
writeChars(String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String s) |
protected ExtendedDataOutput currentDataOutput
protected List<ExtendedDataOutput> dataOutputs
protected final ImmutableClassesGiraphConfiguration conf
public BigDataOutput(ImmutableClassesGiraphConfiguration conf)
conf
- Configurationpublic BigDataOutput(int initialSize, ImmutableClassesGiraphConfiguration conf)
initialSize
- Initial size of data outputconf
- Configurationprotected int getMaxSize()
protected ExtendedDataOutput createOutput(int size)
size
- Size of data output to createpublic int getNumberOfDataOutputs()
public Iterable<ExtendedDataOutput> getDataOutputs()
public ImmutableClassesGiraphConfiguration getConf()
public long getSize()
public void write(int b) throws IOException
write
in interface DataOutput
IOException
public void write(byte[] b) throws IOException
write
in interface DataOutput
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in interface DataOutput
IOException
public void writeBoolean(boolean v) throws IOException
writeBoolean
in interface DataOutput
IOException
public void writeByte(int v) throws IOException
writeByte
in interface DataOutput
IOException
public void writeShort(int v) throws IOException
writeShort
in interface DataOutput
IOException
public void writeChar(int v) throws IOException
writeChar
in interface DataOutput
IOException
public void writeInt(int v) throws IOException
writeInt
in interface DataOutput
IOException
public void writeLong(long v) throws IOException
writeLong
in interface DataOutput
IOException
public void writeFloat(float v) throws IOException
writeFloat
in interface DataOutput
IOException
public void writeDouble(double v) throws IOException
writeDouble
in interface DataOutput
IOException
public void writeBytes(String s) throws IOException
writeBytes
in interface DataOutput
IOException
public void writeChars(String s) throws IOException
writeChars
in interface DataOutput
IOException
public void writeUTF(String s) throws IOException
writeUTF
in interface DataOutput
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.