public class Utf8StorageConverter extends java.lang.Object implements LoadStoreCaster
PigStorage
).Modifier and Type | Field and Description |
---|---|
protected BagFactory |
mBagFactory |
protected org.apache.commons.logging.Log |
mLog |
protected TupleFactory |
mTupleFactory |
Constructor and Description |
---|
Utf8StorageConverter() |
Modifier and Type | Method and Description |
---|---|
DataBag |
bytesToBag(byte[] b,
ResourceSchema.ResourceFieldSchema schema)
Cast data from bytearray to bag value.
|
java.math.BigDecimal |
bytesToBigDecimal(byte[] b)
Cast data from bytearray to BigDecimal value.
|
java.math.BigInteger |
bytesToBigInteger(byte[] b)
Cast data from bytearray to BigInteger value.
|
java.lang.Boolean |
bytesToBoolean(byte[] b)
Cast data from bytearray to boolean value.
|
java.lang.String |
bytesToCharArray(byte[] b)
Cast data from bytearray to chararray value.
|
org.joda.time.DateTime |
bytesToDateTime(byte[] b)
Cast data from bytearray to datetime value.
|
java.lang.Double |
bytesToDouble(byte[] b)
Cast data from bytearray to double value.
|
java.lang.Float |
bytesToFloat(byte[] b)
Cast data from bytearray to float value.
|
java.lang.Integer |
bytesToInteger(byte[] b)
Cast data from bytearray to integer value.
|
java.lang.Long |
bytesToLong(byte[] b)
Cast data from bytearray to long value.
|
java.util.Map<java.lang.String,java.lang.Object> |
bytesToMap(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
Cast data from bytearray to map value.
|
Tuple |
bytesToTuple(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
Cast data from bytearray to tuple value.
|
byte[] |
toBytes(java.math.BigDecimal bd) |
byte[] |
toBytes(java.math.BigInteger bi) |
byte[] |
toBytes(java.lang.Boolean b) |
byte[] |
toBytes(DataBag bag) |
byte[] |
toBytes(DataByteArray a) |
byte[] |
toBytes(org.joda.time.DateTime dt) |
byte[] |
toBytes(java.lang.Double d) |
byte[] |
toBytes(java.lang.Float f) |
byte[] |
toBytes(java.lang.Integer i) |
byte[] |
toBytes(java.lang.Long l) |
byte[] |
toBytes(java.util.Map<java.lang.String,java.lang.Object> m) |
byte[] |
toBytes(java.lang.String s) |
byte[] |
toBytes(Tuple t) |
protected BagFactory mBagFactory
protected TupleFactory mTupleFactory
protected final org.apache.commons.logging.Log mLog
public DataBag bytesToBag(byte[] b, ResourceSchema.ResourceFieldSchema schema) throws java.io.IOException
LoadCaster
bytesToBag
in interface LoadCaster
b
- bytearray to be cast.schema
- field schema for the output bagjava.io.IOException
- if the value cannot be cast.public java.lang.String bytesToCharArray(byte[] b) throws java.io.IOException
LoadCaster
bytesToCharArray
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.lang.Double bytesToDouble(byte[] b)
LoadCaster
bytesToDouble
in interface LoadCaster
b
- bytearray to be cast.public java.lang.Float bytesToFloat(byte[] b) throws java.io.IOException
LoadCaster
bytesToFloat
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.lang.Boolean bytesToBoolean(byte[] b) throws java.io.IOException
LoadCaster
bytesToBoolean
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.lang.Integer bytesToInteger(byte[] b) throws java.io.IOException
LoadCaster
bytesToInteger
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.lang.Long bytesToLong(byte[] b) throws java.io.IOException
LoadCaster
bytesToLong
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public org.joda.time.DateTime bytesToDateTime(byte[] b) throws java.io.IOException
LoadCaster
bytesToDateTime
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.util.Map<java.lang.String,java.lang.Object> bytesToMap(byte[] b, ResourceSchema.ResourceFieldSchema fieldSchema) throws java.io.IOException
LoadCaster
bytesToMap
in interface LoadCaster
b
- bytearray to be cast.fieldSchema
- field schema for the output mapjava.io.IOException
- if the value cannot be cast.public Tuple bytesToTuple(byte[] b, ResourceSchema.ResourceFieldSchema fieldSchema) throws java.io.IOException
LoadCaster
bytesToTuple
in interface LoadCaster
b
- bytearray to be cast.fieldSchema
- field schema for the output tuplejava.io.IOException
- if the value cannot be cast.public java.math.BigInteger bytesToBigInteger(byte[] b) throws java.io.IOException
LoadCaster
bytesToBigInteger
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public java.math.BigDecimal bytesToBigDecimal(byte[] b) throws java.io.IOException
LoadCaster
bytesToBigDecimal
in interface LoadCaster
b
- bytearray to be cast.java.io.IOException
- if the value cannot be cast.public byte[] toBytes(DataBag bag) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.String s) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.Double d) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.Float f) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.Integer i) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.Long l) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.lang.Boolean b) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(org.joda.time.DateTime dt) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.util.Map<java.lang.String,java.lang.Object> m) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(Tuple t) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(DataByteArray a) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.math.BigInteger bi) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
public byte[] toBytes(java.math.BigDecimal bd) throws java.io.IOException
toBytes
in interface StoreCaster
java.io.IOException
Copyright © 2007-2012 The Apache Software Foundation