@Override
  public void write(DataOutput out) throws IOException {
    LOG.debug("WRITE : " + this);

    Bytes.writeByteArray(out, Bytes.toBytes(splits.size()));

    for (HBaseTableSplit hbts : splits) {
      Bytes.writeByteArray(out, SerializationUtils.serialize(hbts));
    }

    LOG.debug("WROTE : " + out.toString());
  }
Exemple #2
0
 /**
  * @deprecated Use protobuf serialization instead. See {@link #toByteArray()} and {@link
  *     #toDelimitedByteArray()}
  */
 @Deprecated
 public void write(DataOutput out) throws IOException {
   out.writeByte(getVersion());
   Bytes.writeByteArray(out, endKey);
   out.writeBoolean(offLine);
   out.writeLong(regionId);
   Bytes.writeByteArray(out, regionName);
   out.writeBoolean(split);
   Bytes.writeByteArray(out, startKey);
   Bytes.writeByteArray(out, tableName.getName());
   out.writeInt(hashCode);
 }
 @Override
 public void write(DataOutput output) throws IOException {
   Bytes.writeByteArray(output, name.getBytes());
   Bytes.writeByteArray(
       output, familyName == null ? ByteUtil.EMPTY_BYTE_ARRAY : familyName.getBytes());
   WritableUtils.writeVInt(output, dataType.ordinal());
   WritableUtils.writeVInt(output, maxLength == null ? NO_MAXLENGTH : maxLength);
   WritableUtils.writeVInt(output, scale == null ? NO_SCALE : scale);
   output.writeBoolean(nullable);
   WritableUtils.writeVInt(output, position);
   WritableUtils.writeVInt(output, sortOrder.getSystemValue());
   WritableUtils.writeVInt(output, arraySize == null ? -1 : arraySize);
 }
Exemple #4
0
 public void write(final DataOutput out) throws IOException {
   out.writeByte(DELETE_VERSION);
   Bytes.writeByteArray(out, this.row);
   out.writeLong(this.ts);
   out.writeLong(this.lockId);
   out.writeInt(familyMap.size());
   for (Map.Entry<byte[], List<KeyValue>> entry : familyMap.entrySet()) {
     Bytes.writeByteArray(out, entry.getKey());
     List<KeyValue> list = entry.getValue();
     out.writeInt(list.size());
     for (KeyValue kv : list) {
       kv.write(out);
     }
   }
 }
Exemple #5
0
 @Override
 public void write(DataOutput output) throws IOException {
   Bytes.writeByteArray(output, name.getBytes());
   WritableUtils.writeVInt(output, type.ordinal());
   WritableUtils.writeVLong(output, sequenceNumber);
   output.writeLong(timeStamp);
   Bytes.writeByteArray(
       output, pkName == null ? ByteUtil.EMPTY_BYTE_ARRAY : Bytes.toBytes(pkName));
   WritableUtils.writeVInt(output, allColumns.size());
   for (int i = 0; i < allColumns.size(); i++) {
     PColumn column = allColumns.get(i);
     column.write(output);
   }
   stats.write(output);
 }
Exemple #6
0
 @Override
 public void write(DataOutput out) throws IOException {
   super.write(out);
   Bytes.writeByteArray(out, table.getName());
   out.writeBoolean(family != null);
   if (family != null) {
     Bytes.writeByteArray(out, family);
   }
   out.writeBoolean(qualifier != null);
   if (qualifier != null) {
     Bytes.writeByteArray(out, qualifier);
   }
   out.writeBoolean(namespace != null);
   if (namespace != null) {
     Bytes.writeByteArray(out, Bytes.toBytes(namespace));
   }
 }
    @Override
    public void write(DataOutput output) throws IOException {
      WritableUtils.writeVInt(output, returnCode.ordinal());
      output.writeLong(mutationTime);
      output.writeBoolean(table != null);
      if (table != null) {
        table.write(output);
      }
      Bytes.writeByteArray(output, columnName == null ? ByteUtil.EMPTY_BYTE_ARRAY : columnName);
      if (columnName != null) {
        Bytes.writeByteArray(output, familyName == null ? ByteUtil.EMPTY_BYTE_ARRAY : familyName);
      }
      if (tableNamesToDelete != null && tableNamesToDelete.size() > 0) {
        output.writeBoolean(true);
        output.writeInt(tableNamesToDelete.size());
        for (byte[] tableName : tableNamesToDelete) {
          Bytes.writeByteArray(output, tableName);
        }

      } else {
        output.writeBoolean(false);
      }
    }
 /** {@inheritDoc} */
 @Override
 public void write(DataOutput out) throws IOException {
   super.write(out); // write all superclass fields.
   Bytes.writeByteArray(out, mRegionStartKey);
 }
 @Override
 public void write(DataOutput out) throws IOException {
   Bytes.writeByteArray(out, nestingLevelAndValue);
 }