public void write(final byte[] record) throws StreamingException {
    checkIsClosed();
    boolean success = false;
    try {
      recordWriter.write(getCurrentWriteId(), record);
      success = true;
    } catch (SerializationError ex) {
      //this exception indicates that a {@code record} could not be parsed and the
      //caller can decide whether to drop it or send it to dead letter queue.
      //rolling back the txn and retrying won't help since the tuple will be exactly the same
      //when it's replayed.
      success = true;
      throw ex;
    } finally {
      markDead(success);
    }
  }
once any operation on this batch encounters a system exception
(e.g. IOException on write) it's safest to assume that we can't write to the
file backing this batch any more.  This guards important public methods
streaming/src/java/org/apache/hive/streaming/AbstractStreamingTransaction.java