accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1438312 [4/5] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ core/ core/src/main/java/org/apache/accumulo/core/client/ core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/client/mapred/...
Date Fri, 25 Jan 2013 03:56:16 GMT
Modified: accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveCompaction.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveCompaction.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveCompaction.java (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveCompaction.java Fri Jan 25 03:56:14 2013
@@ -1112,13 +1112,13 @@ import org.slf4j.LoggerFactory;
           case 3: // INPUT_FILES
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
-                struct.inputFiles = new ArrayList<String>(_list42.size);
-                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
+                org.apache.thrift.protocol.TList _list90 = iprot.readListBegin();
+                struct.inputFiles = new ArrayList<String>(_list90.size);
+                for (int _i91 = 0; _i91 < _list90.size; ++_i91)
                 {
-                  String _elem44; // required
-                  _elem44 = iprot.readString();
-                  struct.inputFiles.add(_elem44);
+                  String _elem92; // required
+                  _elem92 = iprot.readString();
+                  struct.inputFiles.add(_elem92);
                 }
                 iprot.readListEnd();
               }
@@ -1178,14 +1178,14 @@ import org.slf4j.LoggerFactory;
           case 10: // ITERATORS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list45 = iprot.readListBegin();
-                struct.iterators = new ArrayList<IteratorSetting>(_list45.size);
-                for (int _i46 = 0; _i46 < _list45.size; ++_i46)
+                org.apache.thrift.protocol.TList _list93 = iprot.readListBegin();
+                struct.iterators = new ArrayList<IteratorSetting>(_list93.size);
+                for (int _i94 = 0; _i94 < _list93.size; ++_i94)
                 {
-                  IteratorSetting _elem47; // required
-                  _elem47 = new IteratorSetting();
-                  _elem47.read(iprot);
-                  struct.iterators.add(_elem47);
+                  IteratorSetting _elem95; // required
+                  _elem95 = new IteratorSetting();
+                  _elem95.read(iprot);
+                  struct.iterators.add(_elem95);
                 }
                 iprot.readListEnd();
               }
@@ -1221,9 +1221,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(INPUT_FILES_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.inputFiles.size()));
-          for (String _iter48 : struct.inputFiles)
+          for (String _iter96 : struct.inputFiles)
           {
-            oprot.writeString(_iter48);
+            oprot.writeString(_iter96);
           }
           oprot.writeListEnd();
         }
@@ -1259,9 +1259,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(ITERATORS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.iterators.size()));
-          for (IteratorSetting _iter49 : struct.iterators)
+          for (IteratorSetting _iter97 : struct.iterators)
           {
-            _iter49.write(oprot);
+            _iter97.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -1325,9 +1325,9 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetInputFiles()) {
         {
           oprot.writeI32(struct.inputFiles.size());
-          for (String _iter50 : struct.inputFiles)
+          for (String _iter98 : struct.inputFiles)
           {
-            oprot.writeString(_iter50);
+            oprot.writeString(_iter98);
           }
         }
       }
@@ -1352,9 +1352,9 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetIterators()) {
         {
           oprot.writeI32(struct.iterators.size());
-          for (IteratorSetting _iter51 : struct.iterators)
+          for (IteratorSetting _iter99 : struct.iterators)
           {
-            _iter51.write(oprot);
+            _iter99.write(oprot);
           }
         }
       }
@@ -1375,13 +1375,13 @@ import org.slf4j.LoggerFactory;
       }
       if (incoming.get(2)) {
         {
-          org.apache.thrift.protocol.TList _list52 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-          struct.inputFiles = new ArrayList<String>(_list52.size);
-          for (int _i53 = 0; _i53 < _list52.size; ++_i53)
+          org.apache.thrift.protocol.TList _list100 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.inputFiles = new ArrayList<String>(_list100.size);
+          for (int _i101 = 0; _i101 < _list100.size; ++_i101)
           {
-            String _elem54; // required
-            _elem54 = iprot.readString();
-            struct.inputFiles.add(_elem54);
+            String _elem102; // required
+            _elem102 = iprot.readString();
+            struct.inputFiles.add(_elem102);
           }
         }
         struct.setInputFilesIsSet(true);
@@ -1412,14 +1412,14 @@ import org.slf4j.LoggerFactory;
       }
       if (incoming.get(9)) {
         {
-          org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.iterators = new ArrayList<IteratorSetting>(_list55.size);
-          for (int _i56 = 0; _i56 < _list55.size; ++_i56)
+          org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.iterators = new ArrayList<IteratorSetting>(_list103.size);
+          for (int _i104 = 0; _i104 < _list103.size; ++_i104)
           {
-            IteratorSetting _elem57; // required
-            _elem57 = new IteratorSetting();
-            _elem57.read(iprot);
-            struct.iterators.add(_elem57);
+            IteratorSetting _elem105; // required
+            _elem105 = new IteratorSetting();
+            _elem105.read(iprot);
+            struct.iterators.add(_elem105);
           }
         }
         struct.setIteratorsIsSet(true);

Modified: accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java Fri Jan 25 03:56:14 2013
@@ -1263,14 +1263,14 @@ import org.slf4j.LoggerFactory;
           case 9: // COLUMNS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list18 = iprot.readListBegin();
-                struct.columns = new ArrayList<Column>(_list18.size);
-                for (int _i19 = 0; _i19 < _list18.size; ++_i19)
+                org.apache.thrift.protocol.TList _list66 = iprot.readListBegin();
+                struct.columns = new ArrayList<Column>(_list66.size);
+                for (int _i67 = 0; _i67 < _list66.size; ++_i67)
                 {
-                  Column _elem20; // required
-                  _elem20 = new Column();
-                  _elem20.read(iprot);
-                  struct.columns.add(_elem20);
+                  Column _elem68; // required
+                  _elem68 = new Column();
+                  _elem68.read(iprot);
+                  struct.columns.add(_elem68);
                 }
                 iprot.readListEnd();
               }
@@ -1282,14 +1282,14 @@ import org.slf4j.LoggerFactory;
           case 10: // ITERATORS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
-                struct.iterators = new ArrayList<IteratorSetting>(_list21.size);
-                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
+                org.apache.thrift.protocol.TList _list69 = iprot.readListBegin();
+                struct.iterators = new ArrayList<IteratorSetting>(_list69.size);
+                for (int _i70 = 0; _i70 < _list69.size; ++_i70)
                 {
-                  IteratorSetting _elem23; // required
-                  _elem23 = new IteratorSetting();
-                  _elem23.read(iprot);
-                  struct.iterators.add(_elem23);
+                  IteratorSetting _elem71; // required
+                  _elem71 = new IteratorSetting();
+                  _elem71.read(iprot);
+                  struct.iterators.add(_elem71);
                 }
                 iprot.readListEnd();
               }
@@ -1301,13 +1301,13 @@ import org.slf4j.LoggerFactory;
           case 11: // AUTHORIZATIONS
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
-                struct.authorizations = new ArrayList<ByteBuffer>(_list24.size);
-                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
+                org.apache.thrift.protocol.TList _list72 = iprot.readListBegin();
+                struct.authorizations = new ArrayList<ByteBuffer>(_list72.size);
+                for (int _i73 = 0; _i73 < _list72.size; ++_i73)
                 {
-                  ByteBuffer _elem26; // required
-                  _elem26 = iprot.readBinary();
-                  struct.authorizations.add(_elem26);
+                  ByteBuffer _elem74; // required
+                  _elem74 = iprot.readBinary();
+                  struct.authorizations.add(_elem74);
                 }
                 iprot.readListEnd();
               }
@@ -1371,9 +1371,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
-          for (Column _iter27 : struct.columns)
+          for (Column _iter75 : struct.columns)
           {
-            _iter27.write(oprot);
+            _iter75.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -1383,9 +1383,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(ITERATORS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.iterators.size()));
-          for (IteratorSetting _iter28 : struct.iterators)
+          for (IteratorSetting _iter76 : struct.iterators)
           {
-            _iter28.write(oprot);
+            _iter76.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -1395,9 +1395,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.authorizations.size()));
-          for (ByteBuffer _iter29 : struct.authorizations)
+          for (ByteBuffer _iter77 : struct.authorizations)
           {
-            oprot.writeBinary(_iter29);
+            oprot.writeBinary(_iter77);
           }
           oprot.writeListEnd();
         }
@@ -1482,27 +1482,27 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetColumns()) {
         {
           oprot.writeI32(struct.columns.size());
-          for (Column _iter30 : struct.columns)
+          for (Column _iter78 : struct.columns)
           {
-            _iter30.write(oprot);
+            _iter78.write(oprot);
           }
         }
       }
       if (struct.isSetIterators()) {
         {
           oprot.writeI32(struct.iterators.size());
-          for (IteratorSetting _iter31 : struct.iterators)
+          for (IteratorSetting _iter79 : struct.iterators)
           {
-            _iter31.write(oprot);
+            _iter79.write(oprot);
           }
         }
       }
       if (struct.isSetAuthorizations()) {
         {
           oprot.writeI32(struct.authorizations.size());
-          for (ByteBuffer _iter32 : struct.authorizations)
+          for (ByteBuffer _iter80 : struct.authorizations)
           {
-            oprot.writeBinary(_iter32);
+            oprot.writeBinary(_iter80);
           }
         }
       }
@@ -1547,41 +1547,41 @@ import org.slf4j.LoggerFactory;
       }
       if (incoming.get(8)) {
         {
-          org.apache.thrift.protocol.TList _list33 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.columns = new ArrayList<Column>(_list33.size);
-          for (int _i34 = 0; _i34 < _list33.size; ++_i34)
+          org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.columns = new ArrayList<Column>(_list81.size);
+          for (int _i82 = 0; _i82 < _list81.size; ++_i82)
           {
-            Column _elem35; // required
-            _elem35 = new Column();
-            _elem35.read(iprot);
-            struct.columns.add(_elem35);
+            Column _elem83; // required
+            _elem83 = new Column();
+            _elem83.read(iprot);
+            struct.columns.add(_elem83);
           }
         }
         struct.setColumnsIsSet(true);
       }
       if (incoming.get(9)) {
         {
-          org.apache.thrift.protocol.TList _list36 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.iterators = new ArrayList<IteratorSetting>(_list36.size);
-          for (int _i37 = 0; _i37 < _list36.size; ++_i37)
+          org.apache.thrift.protocol.TList _list84 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.iterators = new ArrayList<IteratorSetting>(_list84.size);
+          for (int _i85 = 0; _i85 < _list84.size; ++_i85)
           {
-            IteratorSetting _elem38; // required
-            _elem38 = new IteratorSetting();
-            _elem38.read(iprot);
-            struct.iterators.add(_elem38);
+            IteratorSetting _elem86; // required
+            _elem86 = new IteratorSetting();
+            _elem86.read(iprot);
+            struct.iterators.add(_elem86);
           }
         }
         struct.setIteratorsIsSet(true);
       }
       if (incoming.get(10)) {
         {
-          org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-          struct.authorizations = new ArrayList<ByteBuffer>(_list39.size);
-          for (int _i40 = 0; _i40 < _list39.size; ++_i40)
+          org.apache.thrift.protocol.TList _list87 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.authorizations = new ArrayList<ByteBuffer>(_list87.size);
+          for (int _i88 = 0; _i88 < _list87.size; ++_i88)
           {
-            ByteBuffer _elem41; // required
-            _elem41 = iprot.readBinary();
-            struct.authorizations.add(_elem41);
+            ByteBuffer _elem89; // required
+            _elem89 = iprot.readBinary();
+            struct.authorizations.add(_elem89);
           }
         }
         struct.setAuthorizationsIsSet(true);

Modified: accumulo/branches/ACCUMULO-259/proxy/src/main/thrift/proxy.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/main/thrift/proxy.thrift?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/main/thrift/proxy.thrift (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/main/thrift/proxy.thrift Fri Jan 25 03:56:14 2013
@@ -17,11 +17,11 @@
 namespace java org.apache.accumulo.proxy.thrift
 
 struct Key {
-	1:binary row;
-	2:binary colFamily;
-	3:binary colQualifier;
-	4:binary colVisibility;
-	5:optional i64 timestamp
+  1:binary row;
+  2:binary colFamily;
+  3:binary colQualifier;
+  4:binary colVisibility;
+  5:optional i64 timestamp
 }
 
 enum PartialKey {
@@ -34,47 +34,66 @@ enum PartialKey {
 }
 
 struct ColumnUpdate {
-	1:binary colFamily;
-	2:binary colQualifier;
-	3:optional binary colVisibility;
-	4:optional i64 timestamp;
-	5:optional binary value;
-	6:optional bool deleteCell;
+  1:binary colFamily,
+  2:binary colQualifier,
+  3:optional binary colVisibility,
+  4:optional i64 timestamp,
+  5:optional binary value,
+  6:optional bool deleteCell
 }
 
 struct KeyValue {
-	1:Key key,
-	2:binary value
+  1:Key key,
+  2:binary value
 }
 
 struct ScanResult {
-	1:list<KeyValue> results,
-	2:bool more
+  1:list<KeyValue> results,
+  2:bool more
 }
 
 struct Range {
-        1:Key start,
-	2:bool startInclusive
-        3:Key stop,
-	4:bool stopInclusive
+  1:Key start,
+  2:bool startInclusive
+  3:Key stop,
+  4:bool stopInclusive
 }
 
-struct UserPass
-{
-  1:string username;
-  2:binary password;
+struct ScanColumn {
+  1:binary colFamily,
+  2:optional binary colQualifier
 }
 
-struct IteratorSetting {
-  1: i32 priority;
-  2: string name;
-  3: string iteratorClass;
-  4: map<string,string> properties;
+struct UserPass {
+  1:string username,
+  2:binary password
 }
 
-struct KeyValueAndPeek{
-    1:KeyValue keyValue;
-    2:bool hasNext;
+struct IteratorSetting {
+  1: i32 priority,
+  2: string name,
+  3: string iteratorClass,
+  4: map<string,string> properties
+}
+
+struct ScanOptions {
+  1:optional set<binary> authorizations;
+  2:optional Range range,
+  3:optional list<ScanColumn> columns;
+  4:optional list<IteratorSetting> iterators;
+  5:optional i32 bufferSize;
+} 
+
+struct BatchScanOptions {
+  1:optional set<binary> authorizations;
+  2:optional list<ScanColumn> columns;
+  3:optional list<IteratorSetting> iterators;
+  4:optional i32 threads;
+} 
+
+struct KeyValueAndPeek {
+  1:KeyValue keyValue,
+  2:bool hasNext
 }
 
 enum TablePermission {
@@ -121,17 +140,17 @@ struct Column {
 }
 
 struct ActiveScan {
-    1:string client
-    2:string user
-    3:string table
-    4:i64 age
-    5:i64 idleTime
-    6:ScanType type
-    7:ScanState state
-    8:KeyExtent extent
-    9:list<Column> columns
-    10:list<IteratorSetting> iterators
-    11:list<binary> authorizations
+  1:string client
+  2:string user
+  3:string table
+  4:i64 age
+  5:i64 idleTime
+  6:ScanType type
+  7:ScanState state
+  8:KeyExtent extent
+  9:list<Column> columns
+  10:list<IteratorSetting> iterators
+  11:list<binary> authorizations
 }
 
 enum CompactionType {
@@ -150,16 +169,23 @@ enum CompactionReason {
 }
 
 struct ActiveCompaction {
-    1:KeyExtent extent
-    2:i64 age
-    3:list<string> inputFiles
-    4:string outputFile
-    5:CompactionType type
-    6:CompactionReason reason
-    7:string localityGroup
-    8:i64 entriesRead
-    9:i64 entriesWritten
-    10:list<IteratorSetting> iterators;
+  1:KeyExtent extent
+  2:i64 age
+  3:list<string> inputFiles
+  4:string outputFile
+  5:CompactionType type
+  6:CompactionReason reason
+  7:string localityGroup
+  8:i64 entriesRead
+  9:i64 entriesWritten
+  10:list<IteratorSetting> iterators;
+}
+
+struct WriterOptions {
+ 1:i64 maxMemory
+ 2:i64 latencyMs
+ 3:i64 timeoutMs
+ 4:i32 threads
 }
 
 enum IteratorScope {
@@ -173,37 +199,32 @@ enum TimeType {
   MILLIS
 }
 
-exception UnknownScanner
-{
- 1:string msg;
+exception UnknownScanner {
+  1:string msg
 }
 
-exception UnknownWriter
-{
- 1:string msg;
+exception UnknownWriter {
+  1:string msg
 }
 
-exception NoMoreEntriesException
-{
- 1:string msg;
+exception NoMoreEntriesException {
+  1:string msg
 }
 
-exception AccumuloException
-{
-  1:string msg;
+exception AccumuloException {
+  1:string msg
 }
-exception AccumuloSecurityException
-{
-  1:string msg;
+
+exception AccumuloSecurityException {
+  1:string msg
 }
-exception TableNotFoundException
-{
-  1:string msg;
+
+exception TableNotFoundException {
+  1:string msg
 }
 
-exception TableExistsException
-{
-  1:string msg;
+exception TableExistsException {
+  1:string msg
 }
 
 service AccumuloProxy
@@ -211,86 +232,104 @@ service AccumuloProxy
   bool ping (1:UserPass userpass);
 
   // table operations
-  i32 addConstraint (1:UserPass userpass, 2:string tableName, 3:string constraintClassName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void addSplits (1:UserPass userpass, 2:string tableName, 3:set<binary> splits) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void attachIterator (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 4:set<IteratorScope> scopes) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void checkIteratorConflicts (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 4:set<IteratorScope> scopes) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void clearLocatorCache (1:UserPass userpass, 2:string tableName) throws (1:TableNotFoundException ouch1);
-  void cloneTable (1:UserPass userpass, 2:string tableName, 3:string newTableName, 4:bool flush, 5:map<string,string> propertiesToSet, 6:set<string> propertiesToExclude) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3, 4:TableExistsException ouch4);
-  void compactTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:list<IteratorSetting> iterators, 6:bool flush, 7:bool wait) throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
-  void createTable (1:UserPass userpass, 2:string tableName, 3:bool versioningIter, 4:TimeType type) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
-  void deleteTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void deleteRows (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void exportTable (1:UserPass userpass, 2:string tableName, 3:string exportDir) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void flushTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 5:bool wait) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,set<string>> getLocalityGroups (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  IteratorSetting getIteratorSetting (1:UserPass userpass, 2:string tableName, 3:string iteratorName, 4:IteratorScope scope) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  binary getMaxRow (1:UserPass userpass, 2:string tableName, 3:list<binary> auths, 4:binary startRow, 5:bool startInclusive, 6:binary endRow, 7:bool endInclusive) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  map<string,string> getTableProperties (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  list<binary> getSplits (1:UserPass userpass, 2:string tableName, 3:i32 maxSplits) throws (1:TableNotFoundException ouch1);
-  void importDirectory (1:UserPass userpass, 2:string tableName, 3:string importDir, 4:string failureDir, 5:bool setTime) throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch3, 3:AccumuloSecurityException ouch4);
-  void importTable (1:UserPass userpass, 2:string tableName, 3:string importDir) throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  i32 addConstraint (1:UserPass userpass, 2:string tableName, 3:string constraintClassName)                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void addSplits (1:UserPass userpass, 2:string tableName, 3:set<binary> splits)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void attachIterator (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 
+                       4:set<IteratorScope> scopes) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void checkIteratorConflicts (1:UserPass userpass, 2:string tableName, 3:IteratorSetting setting, 
+                               4:set<IteratorScope> scopes) 
+                                                                                                            throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void clearLocatorCache (1:UserPass userpass, 2:string tableName)                                          throws (1:TableNotFoundException ouch1);
+  void cloneTable (1:UserPass userpass, 2:string tableName, 3:string newTableName, 4:bool flush, 
+                   5:map<string,string> propertiesToSet, 6:set<string> propertiesToExclude) 
+                                                                                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3, 4:TableExistsException ouch4);
+  void compactTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 
+		     5:list<IteratorSetting> iterators, 6:bool flush, 7:bool wait) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
+  void createTable (1:UserPass userpass, 2:string tableName, 3:bool versioningIter, 4:TimeType type)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
+  void deleteTable (1:UserPass userpass, 2:string tableName)                                                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void deleteRows (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow)             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void exportTable (1:UserPass userpass, 2:string tableName, 3:string exportDir)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void flushTable (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow, 
+                   5:bool wait)
+                                                                                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,set<string>> getLocalityGroups (1:UserPass userpass, 2:string tableName)                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  IteratorSetting getIteratorSetting (1:UserPass userpass, 2:string tableName, 
+                                      3:string iteratorName, 4:IteratorScope scope) 
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  binary getMaxRow (1:UserPass userpass, 2:string tableName, 3:set<binary> auths, 4:binary startRow, 
+                    5:bool startInclusive, 6:binary endRow, 7:bool endInclusive) 
+                                                                                                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  map<string,string> getTableProperties (1:UserPass userpass, 2:string tableName)                           throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  list<binary> getSplits (1:UserPass userpass, 2:string tableName, 3:i32 maxSplits)                         throws (1:TableNotFoundException ouch1);
+  void importDirectory (1:UserPass userpass, 2:string tableName, 3:string importDir, 
+                        4:string failureDir, 5:bool setTime) 
+                                                                                                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch3, 3:AccumuloSecurityException ouch4);
+  void importTable (1:UserPass userpass, 2:string tableName, 3:string importDir)                            throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
   set<string> listTables (1:UserPass userpass);
-  map<string,set<IteratorScope>> listIterators (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  map<string,i32> listConstraints (1:UserPass userpass, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void mergeTablets (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void offlineTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void onlineTable (1:UserPass userpass, 2:string tableName) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeConstraint (1:UserPass userpass, 2:string tableName, 3:i32 constraint) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void removeIterator (1:UserPass userpass, 2:string tableName, 3:string iterName, 4:set<IteratorScope> scopes) throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeTableProperty (1:UserPass userpass, 2:string tableName, 3:string property) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void renameTable (1:UserPass userpass, 2:string oldTableName, 3:string newTableName) throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
-  void setLocalityGroups (1:UserPass userpass, 2:string tableName, 3:map<string,set<string>> groups) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void setTableProperty (1:UserPass userpass, 2:string tableName, 3:string property, 4:string value) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<Range> splitRangeByTablets (1:UserPass userpass, 2:string tableName, 3:Range range, 4:i32 maxSplits) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  map<string,set<IteratorScope>> listIterators (1:UserPass userpass, 2:string tableName)                    throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  map<string,i32> listConstraints (1:UserPass userpass, 2:string tableName)                                 throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void mergeTablets (1:UserPass userpass, 2:string tableName, 3:binary startRow, 4:binary endRow)           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void offlineTable (1:UserPass userpass, 2:string tableName)                                               throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void onlineTable (1:UserPass userpass, 2:string tableName)                                                throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeConstraint (1:UserPass userpass, 2:string tableName, 3:i32 constraint)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void removeIterator (1:UserPass userpass, 2:string tableName, 3:string iterName, 
+                       4:set<IteratorScope> scopes)
+                                                                                                            throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeTableProperty (1:UserPass userpass, 2:string tableName, 3:string property)                     throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void renameTable (1:UserPass userpass, 2:string oldTableName, 3:string newTableName)                      throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
+  void setLocalityGroups (1:UserPass userpass, 2:string tableName, 3:map<string,set<string>> groups)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void setTableProperty (1:UserPass userpass, 2:string tableName, 3:string property, 4:string value)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<Range> splitRangeByTablets (1:UserPass userpass, 2:string tableName, 3:Range range, 4:i32 maxSplits)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
   bool tableExists (1:UserPass userpass, 2:string tableName);
   map<string,string> tableIdMap (1:UserPass userpass);
 
   // instance operations
-  void pingTabletServer(1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveScan> getActiveScans (1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveCompaction> getActiveCompactions(1:UserPass userpass, 2:string tserver) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSiteConfiguration (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSystemConfiguration (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void pingTabletServer(1:UserPass userpass, 2:string tserver)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveScan> getActiveScans (1:UserPass userpass, 2:string tserver)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveCompaction> getActiveCompactions(1:UserPass userpass, 2:string tserver)                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSiteConfiguration (1:UserPass userpass)                                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSystemConfiguration (1:UserPass userpass)                                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
   list<string> getTabletServers (1:UserPass userpass);
-  void removeProperty (1:UserPass userpass, 2:string property) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void setProperty (1:UserPass userpass, 2:string property, 3:string value) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool testClassLoad (1:UserPass userpass, 2:string className, 3:string asTypeName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void removeProperty (1:UserPass userpass, 2:string property)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void setProperty (1:UserPass userpass, 2:string property, 3:string value)                               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool testClassLoad (1:UserPass userpass, 2:string className, 3:string asTypeName)                       throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // security operations
-  bool authenticateUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changeUserAuthorizations (1:UserPass userpass, 2:string user, 3:set<binary> authorizations) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changeUserPassword (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void createUser (1:UserPass userpass, 2:string user, 3:binary password) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void dropUser (1:UserPass userpass, 2:string user) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<binary> getUserAuthorizations (1:UserPass userpass, 2:string user) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<string> listUsers (1:UserPass userpass) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void revokeSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool authenticateUser (1:UserPass userpass, 2:string user, 3:binary password)                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserAuthorizations (1:UserPass userpass, 2:string user, 3:set<binary> authorizations)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserPassword (1:UserPass userpass, 2:string user, 3:binary password)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void createUser (1:UserPass userpass, 2:string user, 3:binary password)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void dropUser (1:UserPass userpass, 2:string user)                                                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<binary> getUserAuthorizations (1:UserPass userpass, 2:string user)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)                  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm)    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<string> listUsers (1:UserPass userpass)                                                             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void revokeSystemPermission (1:UserPass userpass, 2:string user, 3:SystemPermission perm)               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
   void revokeTablePermission (1:UserPass userpass, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
 
   // scanning
-  string createBatchScanner(1:UserPass userpass, 2:string tableName, 3:set<binary> authorizations, 4:list<IteratorSetting> iteratorSetting, 5:list<Range> range);
-  string createScanner(1:UserPass userpass, 2:string tableName, 3:set<binary> authorizations, 4:list<IteratorSetting> iteratorSetting, 5:Range range);
+  string createBatchScanner(1:UserPass userpass, 2:string tableName, 3:list<Range> ranges, 4:BatchScanOptions options)          throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  string createScanner(1:UserPass userpass, 2:string tableName, 3:ScanOptions options)                                          throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // use the scanner
-  bool scanner_hasnext(1:string scanner) throws (1:UnknownScanner ouch1);
-  KeyValueAndPeek scanner_next(1:string scanner) throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
-  ScanResult scanner_next_k(1:string scanner, 2:i32 k) throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
-  void close_scanner(1:string scanner) throws (1:UnknownScanner ouch1);
+  bool hasNext(1:string scanner)                                                                throws(1:UnknownScanner ouch1);
+  KeyValueAndPeek nextEntry(1:string scanner)                                                   throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
+  ScanResult nextK(1:string scanner, 2:i32 k)                                                   throws(1:NoMoreEntriesException ouch1, 2:UnknownScanner ouch2, 3:AccumuloSecurityException ouch3);
+  void closeScanner(1:string scanner)                                                           throws (1:UnknownScanner ouch1);
 
   // writing
-  void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells);
-  string createWriter(1:UserPass userpass, 2:string tableName);
+  void updateAndFlush(1:UserPass userpass, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells) throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
+  string createWriter(1:UserPass userpass, 2:string tableName, 3:WriterOptions opts)                    throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
 
   // use the writer
-  oneway void writer_update(1:string writer, 2:map<binary, list<ColumnUpdate>> cells);
-  void writer_flush(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
-  void writer_close(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
+  oneway void update(1:string writer, 2:map<binary, list<ColumnUpdate>> cells);
+  void flush(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
+  void closeWriter(1:string writer) throws (1:UnknownWriter ouch1, 2:AccumuloSecurityException ouch2);
 
   // utilities
   Range getRowRange(1:binary row);

Modified: accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Fri Jan 25 03:56:14 2013
@@ -6,10 +6,14 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -17,9 +21,16 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
 
+import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.file.FileOperations;
+import org.apache.accumulo.core.file.FileSKVWriter;
 import org.apache.accumulo.core.iterators.DevNull;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
 import org.apache.accumulo.proxy.thrift.AccumuloProxy.Client;
 import org.apache.accumulo.proxy.thrift.ActiveCompaction;
 import org.apache.accumulo.proxy.thrift.ActiveScan;
@@ -28,6 +39,12 @@ import org.apache.accumulo.proxy.thrift.
 import org.apache.accumulo.proxy.thrift.CompactionType;
 import org.apache.accumulo.proxy.thrift.IteratorScope;
 import org.apache.accumulo.proxy.thrift.IteratorSetting;
+import org.apache.accumulo.proxy.thrift.Key;
+import org.apache.accumulo.proxy.thrift.PartialKey;
+import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanColumn;
+import org.apache.accumulo.proxy.thrift.ScanOptions;
+import org.apache.accumulo.proxy.thrift.ScanResult;
 import org.apache.accumulo.proxy.thrift.ScanState;
 import org.apache.accumulo.proxy.thrift.ScanType;
 import org.apache.accumulo.proxy.thrift.SystemPermission;
@@ -36,6 +53,12 @@ import org.apache.accumulo.proxy.thrift.
 import org.apache.accumulo.proxy.thrift.UserPass;
 import org.apache.accumulo.server.test.functional.SlowIterator;
 import org.apache.accumulo.test.MiniAccumuloCluster;
+import org.apache.commons.io.FileUtils;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.Text;
 import org.apache.thrift.TException;
 import org.apache.thrift.server.TServer;
 import org.junit.AfterClass;
@@ -44,9 +67,8 @@ import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
 /**
- * An example unit test that shows how to use MiniAccumuloCluster in a unit test
+ * Call every method on the proxy and try to verify that it works.
  */
-
 public class SimpleTest {
   
   public static TemporaryFolder folder = new TemporaryFolder();
@@ -88,12 +110,12 @@ public class SimpleTest {
     client = new TestProxyClient("localhost", proxyPort).proxy();
   }
 
-  //@Test(timeout = 10000)
+  @Test(timeout = 10000)
   public void testPing() throws Exception {
     client.ping(creds);
   }
   
-  //@Test(timeout = 10000)
+  @Test(timeout = 10000)
   public void testInstanceOperations() throws Exception {
     int tservers = 0;
     for (String tserver : client.getTabletServers(creds)) {
@@ -138,9 +160,9 @@ public class SimpleTest {
         String scanner;
         try {
           Client client2 = new TestProxyClient("localhost", proxyPort).proxy();
-          scanner = client2.createScanner(creds, "slow", null, null, null);
-          client2.scanner_next_k(scanner, 10);
-          client2.close_scanner(scanner);
+          scanner = client2.createScanner(creds, "slow", null);
+          client2.nextK(scanner, 10);
+          client2.closeScanner(scanner);
         } catch (TException e) {
           throw new RuntimeException(e);
         }
@@ -255,8 +277,8 @@ public class SimpleTest {
     client.createTable(creds, "test", true, TimeType.MILLIS);
     // denied!
     try {
-      String scanner = client.createScanner(stooge, "test", null, null, null);
-      client.scanner_next_k(scanner, 100);
+      String scanner = client.createScanner(stooge, "test", null);
+      client.nextK(scanner, 100);
       fail("stooge should not read table test");
     } catch (TException ex) {
     }
@@ -264,15 +286,15 @@ public class SimpleTest {
     assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
     client.grantTablePermission(creds, "stooge", "test", TablePermission.READ);
     assertTrue(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
-    String scanner = client.createScanner(stooge, "test", null, null, null);
-    client.scanner_next_k(scanner, 10);
-    client.close_scanner(scanner);
+    String scanner = client.createScanner(stooge, "test", null);
+    client.nextK(scanner, 10);
+    client.closeScanner(scanner);
     // revoke
     client.revokeTablePermission(creds, "stooge", "test", TablePermission.READ);
     assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
     try {
-      scanner = client.createScanner(stooge, "test", null, null, null);
-      client.scanner_next_k(scanner, 100);
+      scanner = client.createScanner(stooge, "test", null);
+      client.nextK(scanner, 100);
       fail("stooge should not read table test");
     } catch (TException ex) {
     }
@@ -284,6 +306,169 @@ public class SimpleTest {
     
   }
   
+  @Test
+  public void testTableOperations() throws Exception {
+    if (client.tableExists(creds, "test"))
+      client.deleteTable(creds, "test");
+    client.createTable(creds, "test", true, TimeType.MILLIS);
+    // constraints
+    client.addConstraint(creds, "test", NumericValueConstraint.class.getName());
+    client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "123"));
+    try {
+      client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
+      fail("constraint did not fire");
+    } catch (Exception ex) {
+    }
+    client.removeConstraint(creds, "test", 1);
+    client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
+    String scanner = client.createScanner(creds, "test", null);
+    ScanResult more = client.nextK(scanner, 2);
+    client.closeScanner(scanner);
+    assertFalse(more.isMore());
+    assertEquals(1, more.getResults().size());
+    assertEquals(s2bb("x"), more.getResults().get(0).value);
+    // splits, merge
+    client.addSplits(creds, "test", new HashSet<ByteBuffer>(Arrays.asList(s2bb("a"), s2bb("m"), s2bb("z"))));
+    List<ByteBuffer> splits = client.getSplits(creds, "test", 1);
+    assertEquals(Arrays.asList(s2bb("m")), splits);
+    client.mergeTablets(creds, "test", null, s2bb("m"));
+    splits = client.getSplits(creds, "test", 10);
+    assertEquals(Arrays.asList(s2bb("m"), s2bb("z")), splits);
+    client.mergeTablets(creds, "test", null, null);
+    splits = client.getSplits(creds, "test", 10);
+    List<ByteBuffer> empty = Collections.emptyList();
+    assertEquals(empty, splits);
+    // iterators
+    client.deleteTable(creds, "test");
+    client.createTable(creds, "test", true, TimeType.MILLIS);
+    HashMap<String, String> options = new HashMap<String, String>();
+    options.put("type", "STRING");
+    options.put("columns", "cf");
+    IteratorSetting setting = new IteratorSetting(10, "test", SummingCombiner.class.getName(), options);
+    client.attachIterator(creds, "test", setting, EnumSet.allOf(IteratorScope.class));
+    for (int i = 0; i < 10; i++) {
+      client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "1"));
+    }
+    scanner = client.createScanner(creds, "test", null);
+    more = client.nextK(scanner, 2);
+    client.closeScanner(scanner);
+    assertEquals("10", new String(more.getResults().get(0).getValue()));
+    try {
+      client.checkIteratorConflicts(creds, "test", setting, EnumSet.allOf(IteratorScope.class));
+      fail("checkIteratorConflicts did not throw and exception");
+    } catch (Exception ex) {
+    }
+    client.deleteRows(creds, "test", null, null);
+    client.removeIterator(creds, "test", "test", EnumSet.allOf(IteratorScope.class));
+    for (int i = 0; i < 10; i++) {
+      client.updateAndFlush(creds, "test", mutation("row"+i, "cf", "cq", ""+i));
+      client.flushTable(creds, "test", null, null, true);
+    }
+    scanner = client.createScanner(creds, "test", null);
+    more = client.nextK(scanner, 100);
+    client.closeScanner(scanner);
+    assertEquals(10, more.getResults().size());
+    // clone
+    client.cloneTable(creds, "test", "test2", true, null, null);
+    scanner = client.createScanner(creds, "test2", null);
+    more = client.nextK(scanner, 100);
+    client.closeScanner(scanner);
+    assertEquals(10, more.getResults().size());
+    client.deleteTable(creds, "test2");
+    
+    // don't know how to test this, call it just for fun
+    client.clearLocatorCache(creds, "test");
+    
+    // compact
+    assertTrue(countFiles("test") > 1);
+    client.compactTable(creds, "test", null, null, null, true, true);
+    assertEquals(1, countFiles("test"));
+    
+    // export/import
+    String dir = folder.getRoot() + "/test";
+    String destDir = folder.getRoot() + "/test_dest";
+    client.offlineTable(creds, "test");
+    client.exportTable(creds, "test", dir);
+    // copy files to a new location
+    FileSystem fs = FileSystem.get(new Configuration());
+    FSDataInputStream is = fs.open(new Path(dir + "/distcp.txt"));
+    BufferedReader r = new BufferedReader(new InputStreamReader(is));
+    while (true) {
+      String line = r.readLine();
+      if (line == null)
+        break;
+      Path srcPath = new Path(line);
+      FileUtils.copyFile(new File(srcPath.toUri().getPath()), new File(destDir, srcPath.getName()));
+    }
+    client.deleteTable(creds, "test");
+    client.importTable(creds, "testify", destDir);
+    scanner = client.createScanner(creds, "testify", null);
+    more = client.nextK(scanner, 100);
+    client.closeScanner(scanner);
+    assertEquals(10, more.results.size());
+    
+    // Locality groups
+    client.createTable(creds, "test", true, TimeType.MILLIS);
+    Map<String, Set<String>> groups = new HashMap<String, Set<String>>();
+    groups.put("group1", Collections.singleton("cf1"));
+    groups.put("group2", Collections.singleton("cf2"));
+    client.setLocalityGroups(creds, "test", groups);
+    assertEquals(groups, client.getLocalityGroups(creds, "test"));
+    // table properties
+    Map<String,String> orig = client.getTableProperties(creds, "test");
+    client.setTableProperty(creds, "test", "table.split.threshold", "500M");
+    Map<String,String> update = client.getTableProperties(creds, "test");
+    assertEquals(update.get("table.split.threshold"), "500M");
+    client.removeTableProperty(creds, "test", "table.split.threshold");
+    update = client.getTableProperties(creds, "test");
+    assertEquals(orig, update);
+    // rename table
+    Map<String,String> tables = client.tableIdMap(creds);
+    client.renameTable(creds, "test", "bar");
+    Map<String,String> tables2 = client.tableIdMap(creds);
+    assertEquals(tables.get("test"), tables2.get("bar"));
+    // table exists
+    assertTrue(client.tableExists(creds, "bar"));
+    assertFalse(client.tableExists(creds, "test"));
+    // bulk import
+    String filename = dir + "/bulk/import/rfile.rf";
+    FileSKVWriter writer = FileOperations.getInstance().openWriter(filename, fs, fs.getConf(), DefaultConfiguration.getInstance());
+    writer.startDefaultLocalityGroup();
+    writer.append(new org.apache.accumulo.core.data.Key(new Text("a"), new Text("b"), new Text("c")), new Value("value".getBytes()));
+    writer.close();
+    fs.mkdirs(new Path(dir + "/bulk/fail"));
+    client.importDirectory(creds, "bar", dir + "/bulk/import", dir + "/bulk/fail", true);
+    scanner = client.createScanner(creds, "bar", null);
+    more = client.nextK(scanner, 100);
+    client.closeScanner(scanner);
+    assertEquals(1, more.results.size());
+    ByteBuffer maxRow = client.getMaxRow(creds, "bar", null, null, false, null, false);
+    assertEquals(s2bb("a"), maxRow);
+  }
+  
+  // scan !METADATA table for file entries for the given table
+  private int countFiles(String table) throws Exception {
+    Map<String,String> tableIdMap = client.tableIdMap(creds);
+    String tableId = tableIdMap.get(table);
+    Key start = new Key();
+    start.row = s2bb(tableId + ";");
+    Key end = new Key();
+    end.row = s2bb(tableId + "<");
+    end = client.getFollowing(end, PartialKey.ROW);
+    ScanOptions opt = new ScanOptions();
+    opt.range = new Range(start, true, end, false);
+    opt.columns = Collections.singletonList(new ScanColumn(s2bb("file")));
+    String scanner = client.createScanner(creds, Constants.METADATA_TABLE_NAME, opt);
+    int result = 0;
+    while (true) {
+      ScanResult more = client.nextK(scanner, 100);
+      result += more.getResults().size();
+      if (!more.more)
+        break;
+    }
+    return result;
+  }
+
   private Map<ByteBuffer,List<ColumnUpdate>> mutation(String row, String cf, String cq, String value) {
     ColumnUpdate upd = new ColumnUpdate(s2bb(cf), s2bb(cq));
     upd.setValue(value.getBytes());

Modified: accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java Fri Jan 25 03:56:14 2013
@@ -19,7 +19,6 @@ package org.apache.accumulo.proxy;
 import static org.junit.Assert.assertEquals;
 
 import java.nio.ByteBuffer;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -29,14 +28,13 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.apache.accumulo.core.iterators.user.RegExFilter;
-import org.apache.accumulo.proxy.Proxy;
-import org.apache.accumulo.proxy.TestProxyClient;
-import org.apache.accumulo.proxy.Util;
+import org.apache.accumulo.proxy.thrift.BatchScanOptions;
 import org.apache.accumulo.proxy.thrift.ColumnUpdate;
 import org.apache.accumulo.proxy.thrift.IteratorSetting;
 import org.apache.accumulo.proxy.thrift.Key;
 import org.apache.accumulo.proxy.thrift.KeyValue;
 import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanOptions;
 import org.apache.accumulo.proxy.thrift.ScanResult;
 import org.apache.accumulo.proxy.thrift.TimeType;
 import org.apache.accumulo.proxy.thrift.UserPass;
@@ -124,16 +122,16 @@ public class TestProxyReadWrite {
     
     Key stop = new Key();
     stop.setRow("5".getBytes());
-    List<Range> pranges = new ArrayList<Range>();
-    pranges.add(new Range(null, false, stop, false));
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, null, pranges);
+    BatchScanOptions options = new BatchScanOptions();
+    List<Range> ranges = Collections.singletonList(new Range(null, false, stop, false));
+    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, ranges, options);
     
     int i = 0;
     boolean hasNext = true;
     
     int k = 1000;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       i += kvList.getResultsSize();
       hasNext = kvList.isMore();
     }
@@ -166,14 +164,16 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    ScanOptions opts = new ScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
     
     int k = 1000;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       for (KeyValue kv : kvList.getResults()) {
         assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
         
@@ -199,14 +199,16 @@ public class TestProxyReadWrite {
     
     Key stop = new Key();
     stop.setRow("5".getBytes());
-    String cookie = tpc.proxy().createScanner(userpass, testtable, null, null, new Range(null, false, stop, false));
+    ScanOptions opts = new ScanOptions();
+    opts.range = new Range(null, false, stop, false);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
     
     int k = 1000;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       i += kvList.getResultsSize();
       hasNext = kvList.isMore();
     }
@@ -241,14 +243,16 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    ScanOptions opts = new ScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
     
     int k = 1000;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       for (KeyValue kv : kvList.getResults()) {
         assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
         
@@ -264,30 +268,30 @@ public class TestProxyReadWrite {
     int maxInserts = 1000000;
     Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
     String format = "%1$06d";
-    String writer = tpc.proxy().createWriter(userpass, testtable);
+    String writer = tpc.proxy().createWriter(userpass, testtable, null);
     for (int i = 0; i < maxInserts; i++) {
       addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
       
       if (i % 1000 == 0 || i == maxInserts - 1) {
         
-        tpc.proxy().writer_update(writer, mutations);
+        tpc.proxy().update(writer, mutations);
         mutations.clear();
         
       }
       
     }
     
-    tpc.proxy().writer_flush(writer);
-    tpc.proxy().writer_close(writer);
+    tpc.proxy().flush(writer);
+    tpc.proxy().closeWriter(writer);
     
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, null, null);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, null);
     
     int i = 0;
     boolean hasNext = true;
     
     int k = 1000;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       for (KeyValue kv : kvList.getResults()) {
         assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
         i++;
@@ -304,18 +308,18 @@ public class TestProxyReadWrite {
     int maxInserts = 10000;
     Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
     String format = "%1$05d";
-    String writer = tpc.proxy().createWriter(userpass, testtable);
+    String writer = tpc.proxy().createWriter(userpass, testtable, null);
     for (int i = 0; i < maxInserts; i++) {
       addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
       
       if (i % 1000 == 0 || i == maxInserts - 1) {
-        tpc.proxy().writer_update(writer, mutations);
+        tpc.proxy().update(writer, mutations);
         mutations.clear();
       }
     }
     
-    tpc.proxy().writer_flush(writer);
-    tpc.proxy().writer_close(writer);
+    tpc.proxy().flush(writer);
+    tpc.proxy().closeWriter(writer);
     
     String regex = ".*[02468]";
     
@@ -323,7 +327,9 @@ public class TestProxyReadWrite {
     RegExFilter.setRegexs(is, regex, null, null, null, false);
     
     IteratorSetting pis = Util.iteratorSetting2ProxyIteratorSetting(is);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, null, Collections.singletonList(pis), null);
+    ScanOptions opts = new ScanOptions();
+    opts.iterators = Collections.singletonList(pis);
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -331,7 +337,7 @@ public class TestProxyReadWrite {
     int k = 1000;
     int numRead = 0;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       for (KeyValue kv : kvList.getResults()) {
         assertEquals(i, Integer.parseInt(new String(kv.getKey().getRow())));
         numRead++;
@@ -352,7 +358,7 @@ public class TestProxyReadWrite {
     int maxInserts = 10000;
     Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
     String format = "%1$05d";
-    String writer = tpc.proxy().createWriter(userpass, testtable);
+    String writer = tpc.proxy().createWriter(userpass, testtable, null);
     for (int i = 0; i < maxInserts; i++) {
       if (i % 2 == 0)
         addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, "even", Util.randString(10));
@@ -360,14 +366,16 @@ public class TestProxyReadWrite {
         addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, "odd", Util.randString(10));
       
       if (i % 1000 == 0 || i == maxInserts - 1) {
-        tpc.proxy().writer_update(writer, mutations);
+        tpc.proxy().update(writer, mutations);
         mutations.clear();
       }
     }
     
-    tpc.proxy().writer_flush(writer);
-    tpc.proxy().writer_close(writer);
-    String cookie = tpc.proxy().createBatchScanner(userpass, testtable, auths, null, null);
+    tpc.proxy().flush(writer);
+    tpc.proxy().closeWriter(writer);
+    ScanOptions opts = new ScanOptions();
+    opts.authorizations = auths;
+    String cookie = tpc.proxy().createScanner(userpass, testtable, opts);
     
     int i = 0;
     boolean hasNext = true;
@@ -375,7 +383,7 @@ public class TestProxyReadWrite {
     int k = 1000;
     int numRead = 0;
     while (hasNext) {
-      ScanResult kvList = tpc.proxy().scanner_next_k(cookie, k);
+      ScanResult kvList = tpc.proxy().nextK(cookie, k);
       for (KeyValue kv : kvList.getResults()) {
         assertEquals(Integer.parseInt(new String(kv.getKey().getRow())), i);
         i += 2;

Modified: accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java (original)
+++ accumulo/branches/ACCUMULO-259/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java Fri Jan 25 03:56:14 2013
@@ -199,18 +199,16 @@ public class TestProxyTableOperations {
   
   @Test
   public void tableOperationsRowMethods() throws TException {
-    List<ByteBuffer> auths = tpc.proxy().getUserAuthorizations(userpass, "root");
-    // System.out.println(auths);
     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, auths, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
+    assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
     
     tpc.proxy().deleteRows(userpass,testtable,ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
-    assertEquals(tpc.proxy().getMaxRow(userpass, testtable, auths, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
+    assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
   }
   
 }

Propchange: accumulo/branches/ACCUMULO-259/server/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/server:r1437608-1438309

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/Accumulo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/Accumulo.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/Accumulo.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/Accumulo.java Fri Jan 25 03:56:14 2013
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Map.Entry;
-import java.util.TimerTask;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.Constants;
@@ -141,7 +140,7 @@ public class Accumulo {
    * 
    */
   public static void monitorSwappiness() {
-    SimpleTimer.getInstance().schedule(new TimerTask() {
+    SimpleTimer.getInstance().schedule(new Runnable() {
       @Override
       public void run() {
         try {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java Fri Jan 25 03:56:14 2013
@@ -56,6 +56,7 @@ public class TableConfiguration extends 
   /**
    * @deprecated not for client use
    */
+  @Deprecated
   private static ZooCache getTablePropCache() {
     Instance inst = HdfsZooInstance.getInstance();
     if (tablePropCache == null)

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java Fri Jan 25 03:56:14 2013
@@ -19,13 +19,18 @@ package org.apache.accumulo.server.const
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map.Entry;
+import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.constraints.Constraint;
-import org.apache.accumulo.core.constraints.Violations;
 import org.apache.accumulo.core.constraints.Constraint.Environment;
+import org.apache.accumulo.core.constraints.Violations;
 import org.apache.accumulo.core.data.ComparableBytes;
 import org.apache.accumulo.core.data.ConstraintViolationSummary;
 import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.server.conf.TableConfiguration;
+import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.log4j.Logger;
 
 public class ConstraintChecker {
@@ -33,14 +38,67 @@ public class ConstraintChecker {
   private ArrayList<Constraint> constrains;
   private static final Logger log = Logger.getLogger(ConstraintChecker.class);
   
-  public ConstraintChecker() {
+  private ClassLoader loader;
+  private TableConfiguration conf;
+
+  private AtomicLong lastCheck = new AtomicLong(0);
+
+  public ConstraintChecker(TableConfiguration conf) {
     constrains = new ArrayList<Constraint>();
+    
+    this.conf = conf;
+
+    try {
+      String context = conf.get(Property.TABLE_CLASSPATH);
+
+      if (context != null && !context.equals("")) {
+        loader = AccumuloVFSClassLoader.getContextManager().getClassLoader(context);
+      } else {
+        loader = AccumuloVFSClassLoader.getClassLoader();
+      }
+      
+      for (Entry<String,String> entry : conf) {
+        if (entry.getKey().startsWith(Property.TABLE_CONSTRAINT_PREFIX.getKey())) {
+          String className = entry.getValue();
+          Class<? extends Constraint> clazz = loader.loadClass(className).asSubclass(Constraint.class);
+          log.debug("Loaded constraint " + clazz.getName() + " for " + conf.getTableId());
+          constrains.add(clazz.newInstance());
+        }
+      }
+      
+      lastCheck.set(System.currentTimeMillis());
+
+    } catch (Throwable e) {
+      constrains.clear();
+      loader = null;
+      constrains.add(new UnsatisfiableConstraint((short) -1, "Failed to load constraints, not accepting mutations."));
+      log.error("Failed to load constraints " + conf.getTableId() + " " + e.toString(), e);
+    }
   }
   
-  public void addConstraint(Constraint c) {
-    constrains.add(c);
+  public boolean classLoaderChanged() {
+    
+    if (constrains.size() == 0)
+      return false;
+
+    try {
+      String context = conf.get(Property.TABLE_CLASSPATH);
+      
+      ClassLoader currentLoader;
+      
+      if (context != null && !context.equals("")) {
+        currentLoader = AccumuloVFSClassLoader.getContextManager().getClassLoader(context);
+      } else {
+        currentLoader = AccumuloVFSClassLoader.getClassLoader();
+      }
+      
+      return currentLoader != loader;
+    } catch (Exception e) {
+      log.debug("Failed to check " + e.getMessage());
+      return true;
+    }
   }
-  
+
   public Violations check(Environment env, Mutation m) {
     
     Violations violations = null;

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java Fri Jan 25 03:56:14 2013
@@ -27,7 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.TimerTask;
 
 import org.apache.accumulo.cloudtrace.instrument.Tracer;
 import org.apache.accumulo.core.Constants;
@@ -226,7 +225,7 @@ public class LiveTServerSet implements W
   
   public synchronized void startListeningForTabletServerChanges() {
     scanServers();
-    SimpleTimer.getInstance().schedule(new TimerTask() {
+    SimpleTimer.getInstance().schedule(new Runnable() {
       @Override
       public void run() {
         scanServers();

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java Fri Jan 25 03:56:14 2013
@@ -32,7 +32,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.SortedMap;
-import java.util.TimerTask;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -255,7 +254,7 @@ public class Master implements LiveTServ
     if (newState == MasterState.STOP) {
       // Give the server a little time before shutdown so the client
       // thread requesting the stop can return
-      SimpleTimer.getInstance().schedule(new TimerTask() {
+      SimpleTimer.getInstance().schedule(new Runnable() {
         @Override
         public void run() {
           // This frees the main thread and will cause the master to exit
@@ -2126,7 +2125,7 @@ public class Master implements LiveTServ
       
       fate = new Fate<Master>(this, store, threads);
       
-      SimpleTimer.getInstance().schedule(new TimerTask() {
+      SimpleTimer.getInstance().schedule(new Runnable() {
         
         @Override
         public void run() {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/FileManager.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/FileManager.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/FileManager.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/FileManager.java Fri Jan 25 03:56:14 2013
@@ -26,7 +26,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.TimerTask;
 import java.util.concurrent.Semaphore;
 
 import org.apache.accumulo.core.conf.Property;
@@ -113,7 +112,7 @@ public class FileManager {
   
   private final ServerConfiguration conf;
   
-  private class IdleFileCloser extends TimerTask {
+  private class IdleFileCloser implements Runnable {
     
     @Override
     public void run() {
@@ -154,10 +153,6 @@ public class FileManager {
   
   /**
    * 
-   * @param instance
-   * @param conf
-   * @param fs
-   * @param maxOpen
    * @param dataCache
    *          : underlying file can and should be able to handle a null cache
    * @param indexCache

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java Fri Jan 25 03:56:14 2013
@@ -98,8 +98,6 @@ import org.apache.accumulo.server.client
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.conf.TableConfiguration;
 import org.apache.accumulo.server.constraints.ConstraintChecker;
-import org.apache.accumulo.server.constraints.ConstraintLoader;
-import org.apache.accumulo.server.constraints.UnsatisfiableConstraint;
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.problems.ProblemReport;
 import org.apache.accumulo.server.problems.ProblemReports;
@@ -1367,19 +1365,7 @@ public class Tablet {
     acuTableConf.addObserver(configObserver = new ConfigurationObserver() {
       
       private void reloadConstraints() {
-        
-        ConstraintChecker cc = null;
-        
-        try {
-          log.debug("Reloading constraints");
-          cc = ConstraintLoader.load(getTableConfiguration());
-        } catch (IOException e) {
-          log.error("Failed to reload constraints for " + extent, e);
-          cc = new ConstraintChecker();
-          cc.addConstraint(new UnsatisfiableConstraint((short) -1, "Failed to reload constraints, not accepting mutations."));
-        }
-        
-        constraintChecker.set(cc);
+        constraintChecker.set(new ConstraintChecker(getTableConfiguration()));
       }
       
       public void propertiesChanged() {
@@ -2491,6 +2477,15 @@ public class Tablet {
     return commitSession;
   }
   
+  public void checkConstraints() {
+    ConstraintChecker cc = constraintChecker.get();
+    
+    if (cc.classLoaderChanged()) {
+      ConstraintChecker ncc = new ConstraintChecker(getTableConfiguration());
+      constraintChecker.compareAndSet(cc, ncc);
+    }
+  }
+
   public CommitSession prepareMutationsForCommit(TservConstraintEnv cenv, List<Mutation> mutations) throws TConstraintViolationException {
     
     ConstraintChecker cc = constraintChecker.get();

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Fri Jan 25 03:56:14 2013
@@ -246,7 +246,7 @@ public class TabletServer extends Abstra
     this.instance = conf.getInstance();
     this.fs = TraceFileSystem.wrap(fs);
     this.logSorter = new LogSorter(instance, fs, getSystemConfiguration());
-    SimpleTimer.getInstance().schedule(new TimerTask() {
+    SimpleTimer.getInstance().schedule(new Runnable() {
       @Override
       public void run() {
         synchronized (onlineTablets) {
@@ -348,7 +348,7 @@ public class TabletServer extends Abstra
       
       final long maxIdle = conf.getTimeInMillis(Property.TSERV_SESSION_MAXIDLE);
       
-      TimerTask r = new TimerTask() {
+      Runnable r = new Runnable() {
         @Override
         public void run() {
           sweep(maxIdle);
@@ -3095,7 +3095,7 @@ public class TabletServer extends Abstra
     }
     
     // A task that cleans up unused classloader contexts
-    TimerTask contextCleaner = new TimerTask() {
+    Runnable contextCleaner = new Runnable() {
       @Override
       public void run() {
         ArrayList<KeyExtent> extents;
@@ -3131,7 +3131,7 @@ public class TabletServer extends Abstra
     
     FileSystemMonitor.start(getSystemConfiguration(), Property.TSERV_MONITOR_FS);
     
-    TimerTask gcDebugTask = new TimerTask() {
+    Runnable gcDebugTask = new Runnable() {
       @Override
       public void run() {
         logGCInfo(getSystemConfiguration());
@@ -3140,6 +3140,24 @@ public class TabletServer extends Abstra
     
     SimpleTimer.getInstance().schedule(gcDebugTask, 0, 1000);
     
+    Runnable constraintTask = new Runnable() {
+      
+      @Override
+      public void run() {
+        ArrayList<Tablet> tablets;
+        
+        synchronized (onlineTablets) {
+          tablets = new ArrayList<Tablet>(onlineTablets.values());
+        }
+        
+        for (Tablet tablet : tablets) {
+          tablet.checkConstraints();
+        }
+      }
+    };
+    
+    SimpleTimer.getInstance().schedule(constraintTask, 0, 1000);
+
     this.resourceManager = new TabletServerResourceManager(instance, fs);
     
     lastPingTime = System.currentTimeMillis();

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServerResourceManager.java Fri Jan 25 03:56:14 2013
@@ -25,7 +25,6 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.SortedMap;
-import java.util.TimerTask;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.BlockingQueue;
@@ -104,7 +103,7 @@ public class TabletServerResourceManager
   
   private ExecutorService addEs(final Property maxThreads, String name, final ThreadPoolExecutor tp) {
     ExecutorService result = addEs(name, tp);
-    SimpleTimer.getInstance().schedule(new TimerTask() {
+    SimpleTimer.getInstance().schedule(new Runnable() {
       @Override
       public void run() {
         try {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java?rev=1438312&r1=1438311&r2=1438312&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java Fri Jan 25 03:56:14 2013
@@ -19,7 +19,6 @@ package org.apache.accumulo.server.trace
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.nio.channels.ServerSocketChannel;
-import java.util.TimerTask;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.cloudtrace.instrument.Span;
@@ -184,7 +183,7 @@ public class TraceServer implements Watc
   }
   
   public void run() throws Exception {
-    SimpleTimer.getInstance().schedule(new TimerTask() {
+    SimpleTimer.getInstance().schedule(new Runnable() {
       @Override
       public void run() {
         flush();



Mime
View raw message