@Override public void write(DataOutput dataOutput) throws IOException {
    dataOutput.writeLong(timestamp);
    dataOutput.writeInt(partition);
    dataOutput.writeLong(offset);
    dataOutput.writeInt(value.length);
    dataOutput.write(value);
    if (recordKey != null) {
      dataOutput.writeInt(recordKey.length);
      dataOutput.write(recordKey);
    } else {
      dataOutput.writeInt(-1);
    }
  }
Writable implementation of Kafka ConsumerRecord.
Serialized in the form:
{@code timestamp} long| {@code partition} (int) | {@code offset} (long) | {@code value.size()} (int) |
{@code value} (byte []) | {@code recordKey.size()}| {@code recordKey (byte [])}
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaWritable.java