accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1361382 [16/16] - in /accumulo/branches/ACCUMULO-259: ./ bin/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf/examples/3GB/native-standalone/ conf/e...
Date Fri, 13 Jul 2012 20:34:49 GMT
Modified: accumulo/branches/ACCUMULO-259/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java
(original)
+++ accumulo/branches/ACCUMULO-259/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java
Fri Jul 13 20:34:44 2012
@@ -1,11 +1,33 @@
 /**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
  */
 package org.apache.accumulo.cloudtrace.thrift;
 
-public class TestService {
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TestService {
 
   public interface Iface {
 
@@ -19,7 +41,7 @@ public class TestService {
 
   }
 
-  public static class Client implements org.apache.thrift.TServiceClient, Iface {
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
     public static class Factory implements org.apache.thrift.TServiceClientFactory<Client>
{
       public Factory() {}
       public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
@@ -32,28 +54,11 @@ public class TestService {
 
     public Client(org.apache.thrift.protocol.TProtocol prot)
     {
-      this(prot, prot);
-    }
-
-    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol
oprot)
-    {
-      iprot_ = iprot;
-      oprot_ = oprot;
-    }
-
-    protected org.apache.thrift.protocol.TProtocol iprot_;
-    protected org.apache.thrift.protocol.TProtocol oprot_;
-
-    protected int seqid_;
-
-    public org.apache.thrift.protocol.TProtocol getInputProtocol()
-    {
-      return this.iprot_;
+      super(prot, prot);
     }
 
-    public org.apache.thrift.protocol.TProtocol getOutputProtocol()
-    {
-      return this.oprot_;
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol
oprot) {
+      super(iprot, oprot);
     }
 
     public boolean checkTrace(TInfo tinfo, String message) throws org.apache.thrift.TException
@@ -64,29 +69,16 @@ public class TestService {
 
     public void send_checkTrace(TInfo tinfo, String message) throws org.apache.thrift.TException
     {
-      oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkTrace", org.apache.thrift.protocol.TMessageType.CALL,
++seqid_));
       checkTrace_args args = new checkTrace_args();
       args.setTinfo(tinfo);
       args.setMessage(message);
-      args.write(oprot_);
-      oprot_.writeMessageEnd();
-      oprot_.getTransport().flush();
+      sendBase("checkTrace", args);
     }
 
     public boolean recv_checkTrace() throws org.apache.thrift.TException
     {
-      org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin();
-      if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) {
-        org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_);
-        iprot_.readMessageEnd();
-        throw x;
-      }
-      if (msg.seqid != seqid_) {
-        throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID,
"checkTrace failed: out of sequence response");
-      }
       checkTrace_result result = new checkTrace_result();
-      result.read(iprot_);
-      iprot_.readMessageEnd();
+      receiveBase(result, "checkTrace");
       if (result.isSetSuccess()) {
         return result.success;
       }
@@ -113,16 +105,14 @@ public class TestService {
 
     public void checkTrace(TInfo tinfo, String message, org.apache.thrift.async.AsyncMethodCallback<checkTrace_call>
resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      checkTrace_call method_call = new checkTrace_call(tinfo, message, resultHandler, this,
protocolFactory, transport);
-      this.currentMethod = method_call;
-      manager.call(method_call);
+      checkTrace_call method_call = new checkTrace_call(tinfo, message, resultHandler, this,
___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
     }
 
-    @SuppressWarnings("rawtypes")
     public static class checkTrace_call extends org.apache.thrift.async.TAsyncMethodCall
{
       private TInfo tinfo;
       private String message;
-      @SuppressWarnings("unchecked")
       public checkTrace_call(TInfo tinfo, String message, org.apache.thrift.async.AsyncMethodCallback<checkTrace_call>
resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory
protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException
{
         super(client, protocolFactory, transport, resultHandler, false);
         this.tinfo = tinfo;
@@ -142,7 +132,7 @@ public class TestService {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
-                org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
         org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
         return (new Client(prot)).recv_checkTrace();
       }
@@ -150,87 +140,64 @@ public class TestService {
 
   }
 
-  public static class Processor implements org.apache.thrift.TProcessor {
-    private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
-    public Processor(Iface iface)
-    {
-      iface_ = iface;
-      processMap_.put("checkTrace", new checkTrace());
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I>
implements org.apache.thrift.TProcessor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+    public Processor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I,
? extends org.apache.thrift.TBase>>()));
     }
 
-    protected static interface ProcessFunction {
-      public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol
oprot) throws org.apache.thrift.TException;
+    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I,
? extends  org.apache.thrift.TBase>> processMap) {
+      super(iface, getProcessMap(processMap));
     }
 
-    private Iface iface_;
-    protected final java.util.HashMap<String,ProcessFunction> processMap_ = new java.util.HashMap<String,ProcessFunction>();
+    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I,
? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I,
? extends  org.apache.thrift.TBase>> processMap) {
+      processMap.put("checkTrace", new checkTrace());
+      return processMap;
+    }
 
-    public boolean process(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol
oprot) throws org.apache.thrift.TException
-    {
-      org.apache.thrift.protocol.TMessage msg = iprot.readMessageBegin();
-      ProcessFunction fn = processMap_.get(msg.name);
-      if (fn == null) {
-        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, org.apache.thrift.protocol.TType.STRUCT);
-        iprot.readMessageEnd();
-        org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.UNKNOWN_METHOD,
"Invalid method name: '"+msg.name+"'");
-        oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(msg.name, org.apache.thrift.protocol.TMessageType.EXCEPTION,
msg.seqid));
-        x.write(oprot);
-        oprot.writeMessageEnd();
-        oprot.getTransport().flush();
-        return true;
+    private static class checkTrace<I extends Iface> extends org.apache.thrift.ProcessFunction<I,
checkTrace_args> {
+      public checkTrace() {
+        super("checkTrace");
       }
-      fn.process(msg.seqid, iprot, oprot);
-      return true;
-    }
 
-    private class checkTrace implements ProcessFunction {
-      public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol
oprot) throws org.apache.thrift.TException
-      {
-        checkTrace_args args = new checkTrace_args();
-        try {
-          args.read(iprot);
-        } catch (org.apache.thrift.protocol.TProtocolException e) {
-          iprot.readMessageEnd();
-          org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR,
e.getMessage());
-          oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkTrace", org.apache.thrift.protocol.TMessageType.EXCEPTION,
seqid));
-          x.write(oprot);
-          oprot.writeMessageEnd();
-          oprot.getTransport().flush();
-          return;
-        }
-        iprot.readMessageEnd();
+      protected checkTrace_args getEmptyArgsInstance() {
+        return new checkTrace_args();
+      }
+
+      protected checkTrace_result getResult(I iface, checkTrace_args args) throws org.apache.thrift.TException
{
         checkTrace_result result = new checkTrace_result();
-        result.success = iface_.checkTrace(args.tinfo, args.message);
+        result.success = iface.checkTrace(args.tinfo, args.message);
         result.setSuccessIsSet(true);
-        oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("checkTrace", org.apache.thrift.protocol.TMessageType.REPLY,
seqid));
-        result.write(oprot);
-        oprot.writeMessageEnd();
-        oprot.getTransport().flush();
+        return result;
       }
-
     }
 
   }
 
   public static class checkTrace_args implements org.apache.thrift.TBase<checkTrace_args,
checkTrace_args._Fields>, java.io.Serializable, Cloneable   {
-private static final long serialVersionUID = 1L;
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkTrace_args");
 
     private static final org.apache.thrift.protocol.TField TINFO_FIELD_DESC = new org.apache.thrift.protocol.TField("tinfo",
org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message",
org.apache.thrift.protocol.TType.STRING, (short)2);
 
-    public TInfo tinfo;
-    public String message;
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes
= new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new checkTrace_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new checkTrace_argsTupleSchemeFactory());
+    }
+
+    public TInfo tinfo; // required
+    public String message; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)1, "tinfo"),
       MESSAGE((short)2, "message");
 
-      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String,
_Fields>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
-        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
           byName.put(field.getFieldName(), field);
         }
       }
@@ -284,15 +251,14 @@ private static final long serialVersionU
     }
 
     // isset id assignments
-
-    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData>
metaDataMap;
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new
java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields,
org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.TINFO, new org.apache.thrift.meta_data.FieldMetaData("tinfo", org.apache.thrift.TFieldRequirementType.DEFAULT,

           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
TInfo.class)));
       tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message",
org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTrace_args.class,
metaDataMap);
     }
 
@@ -501,57 +467,11 @@ private static final long serialVersionU
     }
 
     public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException
{
-      org.apache.thrift.protocol.TField field;
-      iprot.readStructBegin();
-      while (true)
-      {
-        field = iprot.readFieldBegin();
-        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (field.id) {
-          case 1: // TINFO
-            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-              this.tinfo = new TInfo();
-              this.tinfo.read(iprot);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case 2: // MESSAGE
-            if (field.type == org.apache.thrift.protocol.TType.STRING) {
-              this.message = iprot.readString();
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate
method
-      validate();
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
     }
 
     public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
{
-      validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (this.tinfo != null) {
-        oprot.writeFieldBegin(TINFO_FIELD_DESC);
-        this.tinfo.write(oprot);
-        oprot.writeFieldEnd();
-      }
-      if (this.message != null) {
-        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
-        oprot.writeString(this.message);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
     }
 
     @Override
@@ -598,24 +518,138 @@ private static final long serialVersionU
       }
     }
 
+    private static class checkTrace_argsStandardSchemeFactory implements SchemeFactory {
+      public checkTrace_argsStandardScheme getScheme() {
+        return new checkTrace_argsStandardScheme();
+      }
+    }
+
+    private static class checkTrace_argsStandardScheme extends StandardScheme<checkTrace_args>
{
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, checkTrace_args struct)
throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // TINFO
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.tinfo = new TInfo();
+                struct.tinfo.read(iprot);
+                struct.setTinfoIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // MESSAGE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.message = iprot.readString();
+                struct.setMessageIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate
method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, checkTrace_args struct)
throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.tinfo != null) {
+          oprot.writeFieldBegin(TINFO_FIELD_DESC);
+          struct.tinfo.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.message != null) {
+          oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+          oprot.writeString(struct.message);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class checkTrace_argsTupleSchemeFactory implements SchemeFactory {
+      public checkTrace_argsTupleScheme getScheme() {
+        return new checkTrace_argsTupleScheme();
+      }
+    }
+
+    private static class checkTrace_argsTupleScheme extends TupleScheme<checkTrace_args>
{
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, checkTrace_args struct)
throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetTinfo()) {
+          optionals.set(0);
+        }
+        if (struct.isSetMessage()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetTinfo()) {
+          struct.tinfo.write(oprot);
+        }
+        if (struct.isSetMessage()) {
+          oprot.writeString(struct.message);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, checkTrace_args struct)
throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.tinfo = new TInfo();
+          struct.tinfo.read(iprot);
+          struct.setTinfoIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.message = iprot.readString();
+          struct.setMessageIsSet(true);
+        }
+      }
+    }
+
   }
 
   public static class checkTrace_result implements org.apache.thrift.TBase<checkTrace_result,
checkTrace_result._Fields>, java.io.Serializable, Cloneable   {
-private static final long serialVersionUID = 1L;
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("checkTrace_result");
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success",
org.apache.thrift.protocol.TType.BOOL, (short)0);
 
-    public boolean success;
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes
= new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new checkTrace_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new checkTrace_resultTupleSchemeFactory());
+    }
+
+    public boolean success; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success");
 
-      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String,
_Fields>();
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
       static {
-        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
           byName.put(field.getFieldName(), field);
         }
       }
@@ -668,14 +702,13 @@ private static final long serialVersionU
 
     // isset id assignments
     private static final int __SUCCESS_ISSET_ID = 0;
-    private java.util.BitSet __isset_bit_vector = new java.util.BitSet(1);
-
-    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData>
metaDataMap;
+    private BitSet __isset_bit_vector = new BitSet(1);
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
-      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new
java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields,
org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success",
org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(checkTrace_result.class,
metaDataMap);
     }
 
@@ -748,7 +781,7 @@ private static final long serialVersionU
     public Object getFieldValue(_Fields field) {
       switch (field) {
       case SUCCESS:
-        return new Boolean(isSuccess());
+        return Boolean.valueOf(isSuccess());
 
       }
       throw new IllegalStateException();
@@ -823,51 +856,21 @@ private static final long serialVersionU
     }
 
     public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException
{
-      org.apache.thrift.protocol.TField field;
-      iprot.readStructBegin();
-      while (true)
-      {
-        field = iprot.readFieldBegin();
-        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-          break;
-        }
-        switch (field.id) {
-          case 0: // SUCCESS
-            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
-              this.success = iprot.readBool();
-              setSuccessIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate
method
-      validate();
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
     }
 
     public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
{
-      oprot.writeStructBegin(STRUCT_DESC);
-
-      if (this.isSetSuccess()) {
-        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-        oprot.writeBool(this.success);
-        oprot.writeFieldEnd();
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
       }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
 
     @Override
     public String toString() {
       StringBuilder sb = new StringBuilder("checkTrace_result(");
+      boolean first = true;
+
       sb.append("success:");
       sb.append(this.success);
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -892,6 +895,88 @@ private static final long serialVersionU
       }
     }
 
+    private static class checkTrace_resultStandardSchemeFactory implements SchemeFactory
{
+      public checkTrace_resultStandardScheme getScheme() {
+        return new checkTrace_resultStandardScheme();
+      }
+    }
+
+    private static class checkTrace_resultStandardScheme extends StandardScheme<checkTrace_result>
{
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, checkTrace_result struct)
throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+                struct.success = iprot.readBool();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate
method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, checkTrace_result struct)
throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+        oprot.writeBool(struct.success);
+        oprot.writeFieldEnd();
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class checkTrace_resultTupleSchemeFactory implements SchemeFactory {
+      public checkTrace_resultTupleScheme getScheme() {
+        return new checkTrace_resultTupleScheme();
+      }
+    }
+
+    private static class checkTrace_resultTupleScheme extends TupleScheme<checkTrace_result>
{
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, checkTrace_result struct)
throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          oprot.writeBool(struct.success);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, checkTrace_result struct)
throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = iprot.readBool();
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
   }
 
 }

Modified: accumulo/branches/ACCUMULO-259/trace/src/test/java/org/apache/accumulo/cloudtrace/instrument/TracerTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/trace/src/test/java/org/apache/accumulo/cloudtrace/instrument/TracerTest.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/trace/src/test/java/org/apache/accumulo/cloudtrace/instrument/TracerTest.java
(original)
+++ accumulo/branches/ACCUMULO-259/trace/src/test/java/org/apache/accumulo/cloudtrace/instrument/TracerTest.java
Fri Jul 13 20:34:44 2012
@@ -35,6 +35,8 @@ import org.apache.accumulo.cloudtrace.in
 import org.apache.accumulo.cloudtrace.instrument.thrift.TraceWrap;
 import org.apache.accumulo.cloudtrace.thrift.TInfo;
 import org.apache.accumulo.cloudtrace.thrift.TestService;
+import org.apache.accumulo.cloudtrace.thrift.TestService.Iface;
+import org.apache.accumulo.cloudtrace.thrift.TestService.Processor;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.server.TServer;
@@ -153,7 +155,7 @@ public class TracerTest {
     TServerSocket transport = new TServerSocket(socket);
     transport.listen();
     TThreadPoolServer.Args args = new TThreadPoolServer.Args(transport);
-    args.processor(new TestService.Processor(TraceWrap.service(new Service())));
+    args.processor(new Processor<Iface>(TraceWrap.service(new Service())));
     final TServer tserver = new TThreadPoolServer(args);
     Thread t = new Thread() {
       public void run() {

Modified: accumulo/branches/ACCUMULO-259/trace/thrift.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/trace/thrift.sh?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/trace/thrift.sh (original)
+++ accumulo/branches/ACCUMULO-259/trace/thrift.sh Fri Jul 13 20:34:44 2012
@@ -20,18 +20,18 @@
 
 # Generates the cloudtrace thrift code. We're explicitly using thrift0.6 because other versions
 # are not compatible
-thrift0.6 -o target -gen java src/main/thrift/cloudtrace.thrift
+thrift -o target -gen java src/main/thrift/cloudtrace.thrift
 
 # For all generated thrift code, suppress all warnings
 find target/gen-java -name '*.java' -print | xargs sed -i.orig -e 's/public class /@SuppressWarnings("all")
public class /'
 
 # Make a directory for said thrift code if does not already exist
-mkdir -p src/main/java/cloudtrace/thrift
+mkdir -p src/main/java/org/apache/accumulo/cloudtrace/thrift
 
 # For every file, move it with the appropriate path name IFF they are different
-for f in target/gen-java/cloudtrace/thrift/*
+for f in target/gen-java/org/apache/accumulo/cloudtrace/thrift/*
 do
-  DEST=src/main/java/cloudtrace/thrift/`basename $f`
+  DEST=src/main/java/org/apache/accumulo/cloudtrace/thrift/`basename $f`
   if ! cmp -s $f $DEST ; then
      echo cp $f $DEST
      cp $f $DEST



Mime
View raw message