public class TimestampWritable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BINARY_SORTABLE_LENGTH |
static int |
MAX_BYTES
The maximum number of bytes required for a TimestampWritable
|
static byte[] |
nullBytes |
Constructor and Description |
---|
TimestampWritable() |
TimestampWritable(byte[] bytes,
int offset) |
TimestampWritable(java.sql.Timestamp t) |
TimestampWritable(TimestampWritable t) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TimestampWritable t) |
static void |
convertTimestampToBytes(java.sql.Timestamp t,
byte[] b,
int offset)
Writes a Timestamp's serialized value to byte array b at the given offset
|
static java.sql.Timestamp |
createTimestamp(byte[] bytes,
int offset) |
static java.sql.Timestamp |
decimalToTimestamp(HiveDecimal d) |
static java.sql.Timestamp |
doubleToTimestamp(double f) |
boolean |
equals(java.lang.Object o) |
static java.sql.Timestamp |
floatToTimestamp(float f)
Interprets a float as a unix timestamp and returns a Timestamp object
|
byte[] |
getBinarySortable() |
byte[] |
getBytes()
Used to create copies of objects
|
double |
getDouble() |
int |
getNanos() |
static int |
getNanos(byte[] bytes,
int offset) |
long |
getSeconds() |
static long |
getSeconds(byte[] bytes,
int offset)
Gets seconds stored as integer at bytes[offset]
|
java.sql.Timestamp |
getTimestamp() |
static int |
getTotalLength(byte[] bytes,
int offset) |
boolean |
hasDecimal() |
int |
hashCode() |
void |
readFields(java.io.DataInput in) |
void |
set(byte[] bytes,
int offset) |
void |
set(java.sql.Timestamp t) |
void |
set(TimestampWritable t) |
void |
setBinarySortable(byte[] bytes,
int binSortOffset)
Given a byte[] that has binary sortable data, initialize the internal
structures to hold that data
|
static void |
setTimestamp(java.sql.Timestamp t,
byte[] bytes,
int offset) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
void |
write(java.io.OutputStream out) |
void |
writeToByteStream(ByteStream.Output byteStream) |
public static final byte[] nullBytes
public static final int MAX_BYTES
public static final int BINARY_SORTABLE_LENGTH
public TimestampWritable()
public TimestampWritable(byte[] bytes, int offset)
public TimestampWritable(TimestampWritable t)
public TimestampWritable(java.sql.Timestamp t)
public void set(byte[] bytes, int offset)
public void set(java.sql.Timestamp t)
public void set(TimestampWritable t)
public void writeToByteStream(ByteStream.Output byteStream)
public long getSeconds()
public int getNanos()
public static int getTotalLength(byte[] bytes, int offset)
public java.sql.Timestamp getTimestamp()
public byte[] getBytes()
public byte[] getBinarySortable()
public void setBinarySortable(byte[] bytes, int binSortOffset)
bytes
- the byte array that holds the binary sortable representationbinSortOffset
- offset of the binary-sortable representation within the buffer.public double getDouble()
public void readFields(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public int compareTo(TimestampWritable t)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static long getSeconds(byte[] bytes, int offset)
bytes
- offset
- public static int getNanos(byte[] bytes, int offset)
public static void convertTimestampToBytes(java.sql.Timestamp t, byte[] b, int offset)
timestamp
- to convert to bytesb
- destination byte arrayoffset
- destination offset in the byte arraypublic static java.sql.Timestamp floatToTimestamp(float f)
f
- public static java.sql.Timestamp decimalToTimestamp(HiveDecimal d)
public static java.sql.Timestamp doubleToTimestamp(double f)
public static void setTimestamp(java.sql.Timestamp t, byte[] bytes, int offset)
public static java.sql.Timestamp createTimestamp(byte[] bytes, int offset)
public final boolean hasDecimal()
Copyright © 2012 The Apache Software Foundation