/** * Returns the details about this instance as a string. * * @return The values of this instance as a string. * @see java.lang.Object#toString() */ public String toString() { String start_str = new String(); String end_str = new String(); if (m_startrow != null) start_str = Serialization.toStringBinary(m_startrow); if (m_endrow != null) end_str = Serialization.toStringBinary(m_endrow); return m_hostname + ":" + start_str + "," + end_str; }
/* XXX add equals for columns */ public boolean equal(TableSplit split) { return Serialization.equals(m_tablename, split.m_tablename) && m_startrow.compareTo(split.getStartRow()) == 0 && m_endrow.compareTo(split.getEndRow()) == 0 && m_hostname.equals(split.m_hostname); }
/** * Writes the field values to the output. * * @param out The output to write to. * @throws IOException When writing the values to the output fails. */ public void write(DataOutput out) throws IOException { Serialization.writeByteArray(out, m_tablename); Serialization.writeByteBuffer(out, m_startrow); Serialization.writeByteBuffer(out, m_endrow); Serialization.writeByteArray(out, Serialization.toBytes(m_hostname)); }
/** * Reads the values of each field. * * @param in The input to read from. * @throws IOException When reading the input fails. */ public void readFields(DataInput in) throws IOException { m_tablename = Serialization.readByteArray(in); m_startrow = ByteBuffer.wrap(Serialization.readByteArray(in)); m_endrow = ByteBuffer.wrap(Serialization.readByteArray(in)); m_hostname = Serialization.toString(Serialization.readByteArray(in)); }
/** * Compares this row against the given one. * * @param row The split to compare to. * @return The result of the comparison. * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Row row) { return Serialization.compareTo(mRowKey, row.mRowKey); }
/** * Writes the field values to the output. * * @param out The output to write to. * @throws IOException When writing the values to the output fails. */ public void write(final DataOutput out) throws IOException { Serialization.writeByteArray(out, mRowKey); assert mSerializedCells.arrayOffset() == 0; Serialization.writeByteArray(out, mSerializedCells.array()); }
/** * Reads the values of each field. * * @param in The input to read from. * @throws IOException When reading the input fails. */ public void readFields(final DataInput in) throws IOException { mRowKey = Serialization.readByteArray(in); mSerializedCells = ByteBuffer.wrap(Serialization.readByteArray(in)); mSerializedCells.mark(); mReader.reset(mSerializedCells); }