Examples of TPeekingTransport


Examples of org.thrudb.thrift.TPeekingTransport

  }
 
  @Override
  public boolean process(TProtocol iprot, TProtocol oprot) throws TException {
   
    TPeekingTransport peekTrans = (TPeekingTransport) iprot.getTransport();
    TPeekingTransport writeTrans = (TPeekingTransport) oprot.getTransport();
   
    //Just peek at the initial message
    peekTrans.setRecording(true);
   
    TMessage msg = iprot.readMessageBegin();
   
    peekTrans.setRecording(false);
   
    if(writeOps.contains(msg.name)){
      logger.info("logging "+msg.name);

      peekTrans.setLogging(true);
    }
   
    peekTrans.setReplayMode(true);
   
    boolean result = super.process(iprot, oprot);
 
    //only log operations that alter the db
    if(writeOps.contains(msg.name)){
      writeTrans.swapInWriteBuffer();
     
      msg = oprot.readMessageBegin();
     
      //dont log operations that caused an exceptions
      if(msg.type != TMessageType.EXCEPTION){
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.