コード例 #1
0
ファイル: Cassandra.cs プロジェクト: achinn/fluentcassandra
 public void cas_Process(int seqid, TProtocol iprot, TProtocol oprot)
 {
   cas_args args = new cas_args();
   args.Read(iprot);
   iprot.ReadMessageEnd();
   cas_result result = new cas_result();
   try {
     result.Success = iface_.cas(args.Key, args.Column_family, args.Expected, args.Updates, args.Serial_consistency_level, args.Commit_consistency_level);
   } catch (InvalidRequestException ire) {
     result.Ire = ire;
   } catch (UnavailableException ue) {
     result.Ue = ue;
   } catch (TimedOutException te) {
     result.Te = te;
   }
   oprot.WriteMessageBegin(new TMessage("cas", TMessageType.Reply, seqid)); 
   result.Write(oprot);
   oprot.WriteMessageEnd();
   oprot.Transport.Flush();
 }
コード例 #2
0
ファイル: Cassandra.cs プロジェクト: achinn/fluentcassandra
 public CASResult recv_cas()
 {
   TMessage msg = iprot_.ReadMessageBegin();
   if (msg.Type == TMessageType.Exception) {
     TApplicationException x = TApplicationException.Read(iprot_);
     iprot_.ReadMessageEnd();
     throw x;
   }
   cas_result result = new cas_result();
   result.Read(iprot_);
   iprot_.ReadMessageEnd();
   if (result.__isset.success) {
     return result.Success;
   }
   if (result.__isset.ire) {
     throw result.Ire;
   }
   if (result.__isset.ue) {
     throw result.Ue;
   }
   if (result.__isset.te) {
     throw result.Te;
   }
   throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "cas failed: unknown result");
 }