Examples of TTransaction


Examples of co.cask.tephra.distributed.thrift.TTransaction

  public TransactionCodec() {
  }

  public byte[] encode(Transaction tx) throws IOException {
    TTransaction thriftTx = new TTransaction(tx.getWritePointer(), tx.getReadPointer(),
                                             Longs.asList(tx.getInvalids()), Longs.asList(tx.getInProgress()),
                                             tx.getFirstShortInProgress());
    TSerializer serializer = new TSerializer();
    try {
      return serializer.serialize(thriftTx);
View Full Code Here

Examples of co.cask.tephra.distributed.thrift.TTransaction

      throw new IOException(te);
    }
  }

  public Transaction decode(byte[] encoded) throws IOException {
    TTransaction thriftTx = new TTransaction();
    TDeserializer deserializer = new TDeserializer();
    try {
      deserializer.deserialize(thriftTx, encoded);
      return new Transaction(thriftTx.getReadPointer(), thriftTx.getWritePointer(),
                             Longs.toArray(thriftTx.getInvalids()), Longs.toArray(thriftTx.getInProgress()),
                             thriftTx.getFirstShort());
    } catch (TException te) {
      throw new IOException(te);
    }
  }
View Full Code Here

Examples of co.cask.tephra.distributed.thrift.TTransaction

    }
    List<Long> inProgress = Lists.newArrayListWithCapacity(tx.getInProgress().length);
    for (long txid : tx.getInProgress()) {
      inProgress.add(txid);
    }
    return new TTransaction(tx.getWritePointer(), tx.getReadPointer(),
                             invalids, inProgress, tx.getFirstShortInProgress());
  }
View Full Code Here

Examples of com.continuuity.tephra.distributed.thrift.TTransaction

  public TransactionCodec() {
  }

  public byte[] encode(Transaction tx) throws IOException {
    TTransaction thriftTx = new TTransaction(tx.getWritePointer(), tx.getReadPointer(),
                                             Longs.asList(tx.getInvalids()), Longs.asList(tx.getInProgress()),
                                             tx.getFirstShortInProgress());
    TSerializer serializer = new TSerializer();
    try {
      return serializer.serialize(thriftTx);
View Full Code Here

Examples of com.continuuity.tephra.distributed.thrift.TTransaction

      throw new IOException(te);
    }
  }

  public Transaction decode(byte[] encoded) throws IOException {
    TTransaction thriftTx = new TTransaction();
    TDeserializer deserializer = new TDeserializer();
    try {
      deserializer.deserialize(thriftTx, encoded);
      return new Transaction(thriftTx.getReadPointer(), thriftTx.getWritePointer(),
                             Longs.toArray(thriftTx.getInvalids()), Longs.toArray(thriftTx.getInProgress()),
                             thriftTx.getFirstShort());
    } catch (TException te) {
      throw new IOException(te);
    }
  }
View Full Code Here

Examples of com.continuuity.tephra.distributed.thrift.TTransaction

    }
    List<Long> inProgress = Lists.newArrayListWithCapacity(tx.getInProgress().length);
    for (long txid : tx.getInProgress()) {
      inProgress.add(txid);
    }
    return new TTransaction(tx.getWritePointer(), tx.getReadPointer(),
                             invalids, inProgress, tx.getFirstShortInProgress());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.