Ejemplo n.º 1
0
  @Override
  protected void encodeInProgress(
      BinaryEncoder encoder, Map<Long, TransactionManager.InProgressTx> inProgress)
      throws IOException {

    if (!inProgress.isEmpty()) {
      encoder.writeInt(inProgress.size());
      for (Map.Entry<Long, TransactionManager.InProgressTx> entry : inProgress.entrySet()) {
        encoder.writeLong(entry.getKey()); // tx id
        encoder.writeLong(entry.getValue().getExpiration());
      }
    }
    encoder.writeInt(0); // zero denotes end of list as per AVRO spec
  }
Ejemplo n.º 2
0
 @Override
 protected void encodeObsoleteAttributes(BinaryEncoder encoder) throws IOException {
   // writing watermark attribute (that was removed in newer codecs), 55L - any random value, will
   // not be used anywhere
   encoder.writeLong(55L);
 }