You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/04/12 16:37:29 UTC

svn commit: r1467287 [14/14] - in /accumulo/branches/1.4: ./ src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ src/core/src/main/java/org/apache/accumulo/core/client/mock/ src/core/src/main/java/org/apache/accumulo/core/data/thrift/ s...

Added: accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1467287&view=auto
==============================================================================
--- accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java (added)
+++ accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java Fri Apr 12 14:37:09 2013
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.proxy;
+
+import org.apache.accumulo.proxy.thrift.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TCompactProtocol;
+import org.apache.thrift.server.TServer;
+import org.junit.*;
+
+import java.nio.ByteBuffer;
+import java.util.*;
+
+import static org.junit.Assert.*;
+
+public class TestProxyTableOperations {
+  
+  protected static TServer proxy;
+  protected static Thread thread;
+  protected static TestProxyClient tpc;
+  protected static ByteBuffer userpass;
+  protected static final int port = 10195;
+  protected static final String testtable = "testtable";
+  
+  @SuppressWarnings("serial")
+  @BeforeClass
+  public static void setup() throws Exception {
+    Properties prop = new Properties();
+    prop.setProperty("org.apache.accumulo.proxy.ProxyServer.useMockInstance", "true");
+    
+    proxy = Proxy.createProxyServer(Class.forName("org.apache.accumulo.proxy.thrift.AccumuloProxy"), Class.forName("org.apache.accumulo.proxy.ProxyServer"),
+        port, TCompactProtocol.Factory.class, prop);
+    thread = new Thread() {
+      @Override
+      public void run() {
+        proxy.serve();
+      }
+    };
+    thread.start();
+    tpc = new TestProxyClient("localhost", port);
+    userpass = tpc.proxy().login("root", new TreeMap<String, String>() {{put("password",""); }});
+  }
+  
+  @AfterClass
+  public static void tearDown() throws InterruptedException {
+    proxy.stop();
+    thread.join();
+  }
+  
+  @Before
+  public void makeTestTable() throws Exception {
+    tpc.proxy().createTable(userpass, testtable, true, TimeType.MILLIS);
+  }
+  
+  @After
+  public void deleteTestTable() throws Exception {
+    tpc.proxy().deleteTable(userpass, testtable);
+  }
+  
+  @Test
+  public void createExistsDelete() throws TException, TableExistsException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
+    assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
+    tpc.proxy().createTable(userpass, "testtable2", true, TimeType.MILLIS);
+    assertTrue(tpc.proxy().tableExists(userpass, "testtable2"));
+    tpc.proxy().deleteTable(userpass, "testtable2");
+    assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
+  }
+  
+  @Test
+  public void listRename() throws TException, TableExistsException, AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
+    tpc.proxy().renameTable(userpass, testtable, "testtable2");
+    assertTrue(tpc.proxy().tableExists(userpass, "testtable2"));
+    tpc.proxy().renameTable(userpass, "testtable2", testtable);
+    assertTrue(tpc.proxy().listTables(userpass).contains("testtable"));
+    
+  }
+  
+  // This test does not yet function because the backing Mock instance does not yet support merging
+  // TODO: add back in as a test when Mock is improved
+  // @Test
+  public void merge() throws TException, AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
+    splits.add(ByteBuffer.wrap("a".getBytes()));
+    splits.add(ByteBuffer.wrap("c".getBytes()));
+    splits.add(ByteBuffer.wrap("z".getBytes()));
+    tpc.proxy().addSplits(userpass, testtable, splits);
+    
+    tpc.proxy().mergeTablets(userpass, testtable, ByteBuffer.wrap("b".getBytes()), ByteBuffer.wrap("d".getBytes()));
+    
+    splits.remove("c");
+    
+    List<ByteBuffer> tableSplits = tpc.proxy().listSplits(userpass, testtable, 10);
+    
+    for (ByteBuffer split : tableSplits)
+      assertTrue(splits.contains(split));
+    assertTrue(tableSplits.size() == splits.size());
+    
+  }
+  // This test does not yet function because the backing mock instance does not yet support splits
+  // TODO: add back in as a test when Mock is improved
+  //@Test
+  public void splits() throws TException, AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
+    splits.add(ByteBuffer.wrap("a".getBytes()));
+    splits.add(ByteBuffer.wrap("b".getBytes()));
+    splits.add(ByteBuffer.wrap("z".getBytes()));
+    tpc.proxy().addSplits(userpass, testtable, splits);
+    
+    List<ByteBuffer> tableSplits = tpc.proxy().listSplits(userpass, testtable, 10);
+    
+    for (ByteBuffer split : tableSplits)
+      assertTrue(splits.contains(split));
+    assertTrue(tableSplits.size() == splits.size());
+  }
+
+  @Test
+  public void constraints() throws TException, AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    int cid = tpc.proxy().addConstraint(userpass, testtable, "org.apache.accumulo.TestConstraint");
+    Map<String,Integer> constraints = tpc.proxy().listConstraints(userpass, testtable);
+    assertEquals((int) constraints.get("org.apache.accumulo.TestConstraint"), cid);
+    tpc.proxy().removeConstraint(userpass, testtable, cid);
+    constraints = tpc.proxy().listConstraints(userpass, testtable);
+    assertNull(constraints.get("org.apache.accumulo.TestConstraint"));
+  }
+  
+  // This test does not yet function because the backing Mock instance does not yet support locality groups
+  // TODO: add back in as a test when Mock is improved
+  // @Test
+  public void localityGroups() throws TException, AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
+    Set<String> group1 = new HashSet<String>();
+    group1.add("cf1");
+    groups.put("group1", group1);
+    Set<String> group2 = new HashSet<String>();
+    group2.add("cf2");
+    group2.add("cf3");
+    groups.put("group2", group2);
+    tpc.proxy().setLocalityGroups(userpass, testtable, groups);
+    
+    Map<String,Set<String>> actualGroups = tpc.proxy().getLocalityGroups(userpass, testtable);
+    
+    assertEquals(groups.size(), actualGroups.size());
+    for (String groupName : groups.keySet()) {
+      assertTrue(actualGroups.containsKey(groupName));
+      assertEquals(groups.get(groupName).size(), actualGroups.get(groupName).size());
+      for (String cf : groups.get(groupName)) {
+        assertTrue(actualGroups.get(groupName).contains(cf));
+      }
+    }
+  }
+  
+  @Test
+  public void tableProperties() throws TException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
+    tpc.proxy().setTableProperty(userpass, testtable, "test.property1", "wharrrgarbl");
+    assertEquals(tpc.proxy().getTableProperties(userpass, testtable).get("test.property1"), "wharrrgarbl");
+    tpc.proxy().removeTableProperty(userpass, testtable, "test.property1");
+    assertNull(tpc.proxy().getTableProperties(userpass, testtable).get("test.property1"));
+  }
+  
+  private static void addMutation(Map<ByteBuffer,List<ColumnUpdate>> mutations, String row, String cf, String cq, String value) {
+    ColumnUpdate update = new ColumnUpdate(ByteBuffer.wrap(cf.getBytes()), ByteBuffer.wrap(cq.getBytes()));
+    update.setValue(value.getBytes());
+    mutations.put(ByteBuffer.wrap(row.getBytes()), Collections.singletonList(update));
+  }
+  
+  @Test
+  public void tableOperationsRowMethods() throws TException, AccumuloException, TableNotFoundException, AccumuloSecurityException, MutationsRejectedException {
+    Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+    for (int i = 0; i < 10; i++) {
+      addMutation(mutations, "" + i, "cf", "cq", "");
+    }
+    tpc.proxy().updateAndFlush(userpass, testtable, mutations);
+    
+    assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
+
+      // The backing mock instance does not support deleteRows();
+//    tpc.proxy().deleteRows(userpass,testtable,ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
+//    assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
+  }
+  
+}

Propchange: accumulo/branches/1.4/src/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: accumulo/branches/1.4/src/start/src/main/java/org/apache/accumulo/start/Main.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/start/src/main/java/org/apache/accumulo/start/Main.java?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/start/src/main/java/org/apache/accumulo/start/Main.java (original)
+++ accumulo/branches/1.4/src/start/src/main/java/org/apache/accumulo/start/Main.java Fri Apr 12 14:37:09 2013
@@ -16,11 +16,11 @@
  */
 package org.apache.accumulo.start;
 
+import org.apache.accumulo.start.classloader.AccumuloClassLoader;
+
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
-import org.apache.accumulo.start.classloader.AccumuloClassLoader;
-
 public class Main {
   
   public static void main(String[] args) throws Exception {
@@ -50,6 +50,8 @@ public class Main {
         runTMP = AccumuloClassLoader.loadClass("org.apache.accumulo.server.util.Admin");
       } else if (args[0].equals("gc")) {
         runTMP = AccumuloClassLoader.loadClass("org.apache.accumulo.server.gc.SimpleGarbageCollector");
+      } else if (args[0].equals("proxy")) {
+          runTMP = AccumuloClassLoader.loadClass("org.apache.accumulo.proxy.Proxy");
       } else if (args[0].equals("monitor")) {
         runTMP = AccumuloClassLoader.loadClass("org.apache.accumulo.server.monitor.Monitor");
       } else if (args[0].equals("logger")) {

Modified: accumulo/branches/1.4/src/trace/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/pom.xml?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/trace/pom.xml (original)
+++ accumulo/branches/1.4/src/trace/pom.xml Fri Apr 12 14:37:09 2013
@@ -51,4 +51,25 @@
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <executions>
+                <execution>
+                    <id>generate-thrift</id>
+                    <phase>generate-sources</phase>
+                    <goals>
+                        <goal>exec</goal>
+                    </goals>
+                    <configuration>
+                        <executable>${basedir}/src/main/scripts/generate-thrift.sh</executable>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+    </plugins>
+  </build>
+
 </project>

Modified: accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java (original)
+++ accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java Fri Apr 12 14:37:09 2013
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 /**
  * Autogenerated by Thrift
  *
@@ -5,8 +21,22 @@
  */
 package org.apache.accumulo.cloudtrace.thrift;
 
-public class RemoteSpan implements org.apache.thrift.TBase<RemoteSpan, RemoteSpan._Fields>, java.io.Serializable, Cloneable {
-private static final long serialVersionUID = 1L;
+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 RemoteSpan implements org.apache.thrift.TBase<RemoteSpan, RemoteSpan._Fields>, java.io.Serializable, Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteSpan");
 
   private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)1);
@@ -27,10 +57,10 @@ private static final long serialVersionU
   public long start;
   public long stop;
   public String description;
-  public java.util.Map<String,String> data;
+  public Map<String,String> data;
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     SENDER((short)1, "sender"),
     SVC((short)2, "svc"),
     TRACE_ID((short)3, "traceId"),
@@ -41,10 +71,10 @@ private static final long serialVersionU
     DESCRIPTION((short)8, "description"),
     DATA((short)9, "data");
 
-    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);
       }
     }
@@ -117,11 +147,11 @@ private static final long serialVersionU
   private static final int __PARENTID_ISSET_ID = 2;
   private static final int __START_ISSET_ID = 3;
   private static final int __STOP_ISSET_ID = 4;
-  private java.util.BitSet __isset_bit_vector = new java.util.BitSet(5);
+  private BitSet __isset_bit_vector = new BitSet(5);
 
-  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.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.SVC, new org.apache.thrift.meta_data.FieldMetaData("svc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -142,7 +172,7 @@ private static final long serialVersionU
         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
             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(RemoteSpan.class, metaDataMap);
   }
 
@@ -158,7 +188,7 @@ private static final long serialVersionU
     long start,
     long stop,
     String description,
-    java.util.Map<String,String> data)
+    Map<String,String> data)
   {
     this();
     this.sender = sender;
@@ -198,8 +228,8 @@ private static final long serialVersionU
       this.description = other.description;
     }
     if (other.isSetData()) {
-      java.util.Map<String,String> __this__data = new java.util.HashMap<String,String>();
-      for (java.util.Map.Entry<String, String> other_element : other.data.entrySet()) {
+      Map<String,String> __this__data = new HashMap<String,String>();
+      for (Map.Entry<String, String> other_element : other.data.entrySet()) {
 
         String other_element_key = other_element.getKey();
         String other_element_value = other_element.getValue();
@@ -429,16 +459,16 @@ private static final long serialVersionU
 
   public void putToData(String key, String val) {
     if (this.data == null) {
-      this.data = new java.util.HashMap<String,String>();
+      this.data = new HashMap<String,String>();
     }
     this.data.put(key, val);
   }
 
-  public java.util.Map<String,String> getData() {
+  public Map<String,String> getData() {
     return this.data;
   }
 
-  public RemoteSpan setData(java.util.Map<String,String> data) {
+  public RemoteSpan setData(Map<String,String> data) {
     this.data = data;
     return this;
   }
@@ -528,9 +558,7 @@ private static final long serialVersionU
       if (value == null) {
         unsetData();
       } else {
-      @SuppressWarnings("unchecked")
-      java.util.Map<String,String> x = (java.util.Map<String,String>)value;
-        setData(x);
+        setData((Map<String,String>)value);
       }
       break;
 
@@ -881,7 +909,7 @@ private static final long serialVersionU
           if (field.type == org.apache.thrift.protocol.TType.MAP) {
             {
               org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
-              this.data = new java.util.HashMap<String,String>(2*_map0.size);
+              this.data = new HashMap<String,String>(2*_map0.size);
               for (int _i1 = 0; _i1 < _map0.size; ++_i1)
               {
                 String _key2;
@@ -945,7 +973,7 @@ private static final long serialVersionU
       oprot.writeFieldBegin(DATA_FIELD_DESC);
       {
         oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.data.size()));
-        for (java.util.Map.Entry<String, String> _iter4 : this.data.entrySet())
+        for (Map.Entry<String, String> _iter4 : this.data.entrySet())
         {
           oprot.writeString(_iter4.getKey());
           oprot.writeString(_iter4.getValue());
@@ -1033,7 +1061,7 @@ private static final long serialVersionU
   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
     try {
       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bit_vector = new java.util.BitSet(1);
+      __isset_bit_vector = new BitSet(1);
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
       throw new java.io.IOException(te);

Modified: accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java (original)
+++ accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java Fri Apr 12 14:37:09 2013
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 /**
  * Autogenerated by Thrift
  *
@@ -5,7 +21,22 @@
  */
 package org.apache.accumulo.cloudtrace.thrift;
 
-public class SpanReceiver {
+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 SpanReceiver {
 
   public interface Iface {
 
@@ -96,10 +127,8 @@ public class SpanReceiver {
       manager.call(method_call);
     }
 
-    @SuppressWarnings("rawtypes")
     public static class span_call extends org.apache.thrift.async.TAsyncMethodCall {
       private RemoteSpan span;
-      @SuppressWarnings("unchecked")
       public span_call(RemoteSpan span, org.apache.thrift.async.AsyncMethodCallback<span_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, true);
         this.span = span;
@@ -117,13 +146,15 @@ public class SpanReceiver {
         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.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
       }
     }
 
   }
 
   public static class Processor implements org.apache.thrift.TProcessor {
-    private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
     public Processor(Iface iface)
     {
       iface_ = iface;
@@ -135,7 +166,7 @@ public class SpanReceiver {
     }
 
     private Iface iface_;
-    protected final java.util.HashMap<String,ProcessFunction> processMap_ = new java.util.HashMap<String,ProcessFunction>();
+    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
 
     public boolean process(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
     {
@@ -179,7 +210,6 @@ public class SpanReceiver {
   }
 
   public static class span_args implements org.apache.thrift.TBase<span_args, span_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("span_args");
 
     private static final org.apache.thrift.protocol.TField SPAN_FIELD_DESC = new org.apache.thrift.protocol.TField("span", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@@ -187,13 +217,13 @@ private static final long serialVersionU
     public RemoteSpan span;
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SPAN((short)1, "span");
 
-      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);
         }
       }
@@ -246,12 +276,12 @@ 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.SPAN, new org.apache.thrift.meta_data.FieldMetaData("span", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemoteSpan.class)));
-      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(span_args.class, metaDataMap);
     }
 
@@ -442,12 +472,15 @@ private static final long serialVersionU
     @Override
     public String toString() {
       StringBuilder sb = new StringBuilder("span_args(");
+      boolean first = true;
+
       sb.append("span:");
       if (this.span == null) {
         sb.append("null");
       } else {
         sb.append(this.span);
       }
+      first = false;
       sb.append(")");
       return sb.toString();
     }

Modified: accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TInfo.java?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TInfo.java (original)
+++ accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TInfo.java Fri Apr 12 14:37:09 2013
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 /**
  * Autogenerated by Thrift
  *
@@ -5,8 +21,22 @@
  */
 package org.apache.accumulo.cloudtrace.thrift;
 
-public class TInfo implements org.apache.thrift.TBase<TInfo, TInfo._Fields>, java.io.Serializable, Cloneable {
-private static final long serialVersionUID = 1L;
+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 TInfo implements org.apache.thrift.TBase<TInfo, TInfo._Fields>, java.io.Serializable, Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TInfo");
 
   private static final org.apache.thrift.protocol.TField TRACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("traceId", org.apache.thrift.protocol.TType.I64, (short)1);
@@ -16,14 +46,14 @@ private static final long serialVersionU
   public long parentId;
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     TRACE_ID((short)1, "traceId"),
     PARENT_ID((short)2, "parentId");
 
-    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);
       }
     }
@@ -79,16 +109,16 @@ private static final long serialVersionU
   // isset id assignments
   private static final int __TRACEID_ISSET_ID = 0;
   private static final int __PARENTID_ISSET_ID = 1;
-  private java.util.BitSet __isset_bit_vector = new java.util.BitSet(2);
+  private BitSet __isset_bit_vector = new BitSet(2);
 
-  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.TRACE_ID, new org.apache.thrift.meta_data.FieldMetaData("traceId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
     tmpMap.put(_Fields.PARENT_ID, new org.apache.thrift.meta_data.FieldMetaData("parentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TInfo.class, metaDataMap);
   }
 
@@ -378,7 +408,7 @@ private static final long serialVersionU
   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
     try {
       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-      __isset_bit_vector = new java.util.BitSet(1);
+      __isset_bit_vector = new BitSet(1);
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
       throw new java.io.IOException(te);

Modified: accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java?rev=1467287&r1=1467286&r2=1467287&view=diff
==============================================================================
--- accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java (original)
+++ accumulo/branches/1.4/src/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/TestService.java Fri Apr 12 14:37:09 2013
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 /**
  * Autogenerated by Thrift
  *
@@ -5,7 +21,22 @@
  */
 package org.apache.accumulo.cloudtrace.thrift;
 
-public class TestService {
+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 {
 
@@ -118,11 +149,9 @@ public class TestService {
       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 +171,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();
       }
@@ -151,7 +180,7 @@ 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());
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
     public Processor(Iface iface)
     {
       iface_ = iface;
@@ -163,7 +192,7 @@ public class TestService {
     }
 
     private Iface iface_;
-    protected final java.util.HashMap<String,ProcessFunction> processMap_ = new java.util.HashMap<String,ProcessFunction>();
+    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
 
     public boolean process(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
     {
@@ -213,7 +242,6 @@ public class TestService {
   }
 
   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);
@@ -223,14 +251,14 @@ private static final long serialVersionU
     public String message;
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") 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);
         }
       }
@@ -285,14 +313,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);
     }
 
@@ -601,7 +629,6 @@ private static final long serialVersionU
   }
 
   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);
@@ -609,13 +636,13 @@ private static final long serialVersionU
     public boolean success;
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") 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 +695,14 @@ 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);
+    private BitSet __isset_bit_vector = new BitSet(1);
 
-    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.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);
     }
 
@@ -866,8 +893,11 @@ private static final long serialVersionU
     @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();
     }

Added: accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh?rev=1467287&view=auto
==============================================================================
--- accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh (added)
+++ accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh Fri Apr 12 14:37:09 2013
@@ -0,0 +1,23 @@
+#! /usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script will regenerate the thrift code for accumulo-trace.
+INCLUDED_MODULES=(-)
+BASE_OUTPUT_PACKAGE='org.apache.accumulo'
+PACKAGES_TO_GENERATE=(cloudtrace)
+
+. ../core/src/main/thrift/thrift.sh
\ No newline at end of file

Propchange: accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: accumulo/branches/1.4/src/trace/src/main/scripts/generate-thrift.sh
------------------------------------------------------------------------------
    svn:executable = *