|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.gora.util.IOUtils
public class IOUtils
An utility class for I/O related functionality.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
|
Constructor Summary | |
---|---|
IOUtils()
|
Method Summary | ||
---|---|---|
static
|
deserialize(byte[] bytes,
PersistentDatumReader<T> datumReader,
org.apache.avro.Schema schema,
K object)
Deserializes the field object using the datumReader. |
|
static
|
deserialize(org.apache.hadoop.conf.Configuration conf,
byte[] in,
T obj)
Deserializes the object in the given datainput using available Hadoop serializations. |
|
static
|
deserialize(org.apache.hadoop.conf.Configuration conf,
DataInput in,
T obj)
Deserializes the object in the given datainput using available Hadoop serializations. |
|
static
|
deserialize(org.apache.hadoop.conf.Configuration conf,
DataInput in,
T obj,
Class<T> objClass)
Deserializes the object in the given datainput using available Hadoop serializations. |
|
static
|
deserialize(org.apache.hadoop.conf.Configuration conf,
DataInput in,
T obj,
String objClass)
Deserializes the object in the given datainput using available Hadoop serializations. |
|
static
|
deserialize(InputStream is,
PersistentDatumReader<T> datumReader,
org.apache.avro.Schema schema,
K object)
Deserializes the field object using the datumReader. |
|
static
|
deserialize(PersistentDatumWriter<T> datumWriter,
org.apache.avro.Schema schema,
Object object)
Serializes the field object using the datumWriter. |
|
static byte[] |
getAsBytes(List<ByteBuffer> buffers)
Copies the contents of the buffers into a single byte[] |
|
static
|
loadFromConf(org.apache.hadoop.conf.Configuration conf,
String dataKey)
Loads the object stored by storeToConf(Object, Configuration, String)
method from the configuration under the given dataKey. |
|
static boolean[] |
readBoolArray(DataInput in)
Reads a boolean[] from input |
|
static boolean[] |
readBoolArray(org.apache.avro.io.Decoder in)
Reads a boolean[] from input |
|
static byte[] |
readFully(InputStream in)
Reads until the end of the input stream, and returns the contents as a byte[] |
|
static boolean[] |
readNullFieldsInfo(DataInput in)
Reads the data written by writeNullFieldsInfo(DataOutput, Object...)
and returns a boolean array representing whether each field is null or not. |
|
static Object |
readObject(DataInput in)
|
|
static String[] |
readStringArray(DataInput in)
Reads and returns a String array that is written by writeStringArray(DataOutput, String[]) . |
|
static
|
serialize(org.apache.hadoop.conf.Configuration conf,
DataOutput out,
T obj)
Serializes the object to the given dataoutput using available Hadoop serializations |
|
static
|
serialize(org.apache.hadoop.conf.Configuration conf,
DataOutput out,
T obj,
Class<T> objClass)
Serializes the object to the given dataoutput using available Hadoop serializations |
|
static
|
serialize(org.apache.hadoop.conf.Configuration conf,
T obj)
Serializes the object to the given dataoutput using available Hadoop serializations |
|
static
|
serialize(OutputStream os,
PersistentDatumWriter<T> datumWriter,
org.apache.avro.Schema schema,
Object object)
Serializes the field object using the datumWriter. |
|
static
|
serialize(PersistentDatumWriter<T> datumWriter,
org.apache.avro.Schema schema,
Object object)
Serializes the field object using the datumWriter. |
|
static
|
storeToConf(T obj,
org.apache.hadoop.conf.Configuration conf,
String dataKey)
Stores the given object in the configuration under the given dataKey |
|
static void |
writeBoolArray(DataOutput out,
boolean[] boolArray)
Writes a boolean[] to the output. |
|
static void |
writeBoolArray(org.apache.avro.io.Encoder out,
boolean[] boolArray)
Writes a boolean[] to the output. |
|
static void |
writeNullFieldsInfo(DataOutput out,
Object... fields)
Writes a byte[] to the output, representing whether each given field is null or not. |
|
static void |
writeObject(DataOutput out,
Object obj)
|
|
static void |
writeStringArray(DataOutput out,
String[] arr)
Writes the String array to the given DataOutput. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
Constructor Detail |
---|
public IOUtils()
Method Detail |
---|
public static Object readObject(DataInput in) throws ClassNotFoundException, IOException
ClassNotFoundException
IOException
public static void writeObject(DataOutput out, Object obj) throws IOException
IOException
public static <T> void serialize(org.apache.hadoop.conf.Configuration conf, DataOutput out, T obj, Class<T> objClass) throws IOException
IOException
public static <T> void serialize(org.apache.hadoop.conf.Configuration conf, DataOutput out, T obj) throws IOException
IOException
public static <T> byte[] serialize(org.apache.hadoop.conf.Configuration conf, T obj) throws IOException
IOException
public static <T extends Persistent> void serialize(OutputStream os, PersistentDatumWriter<T> datumWriter, org.apache.avro.Schema schema, Object object) throws IOException
IOException
public static <T extends Persistent> byte[] serialize(PersistentDatumWriter<T> datumWriter, org.apache.avro.Schema schema, Object object) throws IOException
IOException
public static <T> T deserialize(org.apache.hadoop.conf.Configuration conf, DataInput in, T obj, String objClass) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T> T deserialize(org.apache.hadoop.conf.Configuration conf, DataInput in, T obj, Class<T> objClass) throws IOException
IOException
public static <T> T deserialize(org.apache.hadoop.conf.Configuration conf, DataInput in, T obj) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T> T deserialize(org.apache.hadoop.conf.Configuration conf, byte[] in, T obj) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <K,T extends Persistent> K deserialize(InputStream is, PersistentDatumReader<T> datumReader, org.apache.avro.Schema schema, K object) throws IOException
IOException
public static <K,T extends Persistent> K deserialize(byte[] bytes, PersistentDatumReader<T> datumReader, org.apache.avro.Schema schema, K object) throws IOException
IOException
public static <T extends Persistent> byte[] deserialize(PersistentDatumWriter<T> datumWriter, org.apache.avro.Schema schema, Object object) throws IOException
IOException
public static void writeNullFieldsInfo(DataOutput out, Object... fields) throws IOException
out
- the output to write tofields
- the fields to check for null
IOException
readNullFieldsInfo(DataInput)
public static boolean[] readNullFieldsInfo(DataInput in) throws IOException
writeNullFieldsInfo(DataOutput, Object...)
and returns a boolean array representing whether each field is null or not.
in
- the input to read from
IOException
public static void writeBoolArray(DataOutput out, boolean[] boolArray) throws IOException
IOException
public static boolean[] readBoolArray(DataInput in) throws IOException
IOException
public static void writeBoolArray(org.apache.avro.io.Encoder out, boolean[] boolArray) throws IOException
IOException
public static boolean[] readBoolArray(org.apache.avro.io.Decoder in) throws IOException
IOException
public static void writeStringArray(DataOutput out, String[] arr) throws IOException
out
- the data output to write toarr
- the array to write
IOException
readStringArray(DataInput)
public static String[] readStringArray(DataInput in) throws IOException
writeStringArray(DataOutput, String[])
.
in
- the data input to read from
IOException
public static <T> void storeToConf(T obj, org.apache.hadoop.conf.Configuration conf, String dataKey) throws IOException
obj
- the object to storeconf
- the configuration to store the object intodataKey
- the key to store the data
IOException
public static <T> T loadFromConf(org.apache.hadoop.conf.Configuration conf, String dataKey) throws IOException
storeToConf(Object, Configuration, String)
method from the configuration under the given dataKey.
conf
- the configuration to read fromdataKey
- the key to get the data from
IOException
public static byte[] getAsBytes(List<ByteBuffer> buffers)
public static byte[] readFully(InputStream in) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |