Exemplo n.º 1
0
  /**
   * 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;
  }
Exemplo n.º 2
0
 /* 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);
 }
Exemplo n.º 3
0
 /**
  * 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));
 }
Exemplo n.º 4
0
 /**
  * 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));
 }
Exemplo n.º 5
0
 /**
  * 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);
 }
Exemplo n.º 6
0
 /**
  * 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());
 }
Exemplo n.º 7
0
 /**
  * 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);
 }