accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1442362 [3/3] - in /accumulo/trunk/proxy/src: main/java/org/apache/accumulo/proxy/ main/java/org/apache/accumulo/proxy/thrift/ main/thrift/ test/java/org/apache/accumulo/proxy/
Date Mon, 04 Feb 2013 21:11:31 GMT
Modified: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java (original)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ActiveScan.java Mon Feb  4 21:11:30 2013
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ActiveScan");
 
   private static final org.apache.thrift.protocol.TField CLIENT_FIELD_DESC = new org.apache.thrift.protocol.TField("client", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField PRINCIPAL_FIELD_DESC = new org.apache.thrift.protocol.TField("principal", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)2);
   private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)3);
   private static final org.apache.thrift.protocol.TField AGE_FIELD_DESC = new org.apache.thrift.protocol.TField("age", org.apache.thrift.protocol.TType.I64, (short)4);
   private static final org.apache.thrift.protocol.TField IDLE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("idleTime", org.apache.thrift.protocol.TType.I64, (short)5);
@@ -68,7 +68,7 @@ import org.slf4j.LoggerFactory;
   }
 
   public String client; // required
-  public String principal; // required
+  public String user; // required
   public String table; // required
   public long age; // required
   public long idleTime; // required
@@ -90,7 +90,7 @@ import org.slf4j.LoggerFactory;
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     CLIENT((short)1, "client"),
-    PRINCIPAL((short)2, "principal"),
+    USER((short)2, "user"),
     TABLE((short)3, "table"),
     AGE((short)4, "age"),
     IDLE_TIME((short)5, "idleTime"),
@@ -124,8 +124,8 @@ import org.slf4j.LoggerFactory;
       switch(fieldId) {
         case 1: // CLIENT
           return CLIENT;
-        case 2: // PRINCIPAL
-          return PRINCIPAL;
+        case 2: // USER
+          return USER;
         case 3: // TABLE
           return TABLE;
         case 4: // AGE
@@ -192,7 +192,7 @@ import org.slf4j.LoggerFactory;
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.CLIENT, new org.apache.thrift.meta_data.FieldMetaData("client", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.PRINCIPAL, new org.apache.thrift.meta_data.FieldMetaData("principal", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
@@ -224,7 +224,7 @@ import org.slf4j.LoggerFactory;
 
   public ActiveScan(
     String client,
-    String principal,
+    String user,
     String table,
     long age,
     long idleTime,
@@ -237,7 +237,7 @@ import org.slf4j.LoggerFactory;
   {
     this();
     this.client = client;
-    this.principal = principal;
+    this.user = user;
     this.table = table;
     this.age = age;
     setAgeIsSet(true);
@@ -259,8 +259,8 @@ import org.slf4j.LoggerFactory;
     if (other.isSetClient()) {
       this.client = other.client;
     }
-    if (other.isSetPrincipal()) {
-      this.principal = other.principal;
+    if (other.isSetUser()) {
+      this.user = other.user;
     }
     if (other.isSetTable()) {
       this.table = other.table;
@@ -308,7 +308,7 @@ import org.slf4j.LoggerFactory;
   @Override
   public void clear() {
     this.client = null;
-    this.principal = null;
+    this.user = null;
     this.table = null;
     setAgeIsSet(false);
     this.age = 0;
@@ -346,27 +346,27 @@ import org.slf4j.LoggerFactory;
     }
   }
 
-  public String getPrincipal() {
-    return this.principal;
+  public String getUser() {
+    return this.user;
   }
 
-  public ActiveScan setPrincipal(String principal) {
-    this.principal = principal;
+  public ActiveScan setUser(String user) {
+    this.user = user;
     return this;
   }
 
-  public void unsetPrincipal() {
-    this.principal = null;
+  public void unsetUser() {
+    this.user = null;
   }
 
-  /** Returns true if field principal is set (has been assigned a value) and false otherwise */
-  public boolean isSetPrincipal() {
-    return this.principal != null;
+  /** Returns true if field user is set (has been assigned a value) and false otherwise */
+  public boolean isSetUser() {
+    return this.user != null;
   }
 
-  public void setPrincipalIsSet(boolean value) {
+  public void setUserIsSet(boolean value) {
     if (!value) {
-      this.principal = null;
+      this.user = null;
     }
   }
 
@@ -655,11 +655,11 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
-    case PRINCIPAL:
+    case USER:
       if (value == null) {
-        unsetPrincipal();
+        unsetUser();
       } else {
-        setPrincipal((String)value);
+        setUser((String)value);
       }
       break;
 
@@ -743,8 +743,8 @@ import org.slf4j.LoggerFactory;
     case CLIENT:
       return getClient();
 
-    case PRINCIPAL:
-      return getPrincipal();
+    case USER:
+      return getUser();
 
     case TABLE:
       return getTable();
@@ -786,8 +786,8 @@ import org.slf4j.LoggerFactory;
     switch (field) {
     case CLIENT:
       return isSetClient();
-    case PRINCIPAL:
-      return isSetPrincipal();
+    case USER:
+      return isSetUser();
     case TABLE:
       return isSetTable();
     case AGE:
@@ -832,12 +832,12 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
-    boolean this_present_principal = true && this.isSetPrincipal();
-    boolean that_present_principal = true && that.isSetPrincipal();
-    if (this_present_principal || that_present_principal) {
-      if (!(this_present_principal && that_present_principal))
+    boolean this_present_user = true && this.isSetUser();
+    boolean that_present_user = true && that.isSetUser();
+    if (this_present_user || that_present_user) {
+      if (!(this_present_user && that_present_user))
         return false;
-      if (!this.principal.equals(that.principal))
+      if (!this.user.equals(that.user))
         return false;
     }
 
@@ -948,12 +948,12 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetPrincipal()).compareTo(typedOther.isSetPrincipal());
+    lastComparison = Boolean.valueOf(isSetUser()).compareTo(typedOther.isSetUser());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetPrincipal()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.principal, typedOther.principal);
+    if (isSetUser()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, typedOther.user);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -1076,11 +1076,11 @@ import org.slf4j.LoggerFactory;
     }
     first = false;
     if (!first) sb.append(", ");
-    sb.append("principal:");
-    if (this.principal == null) {
+    sb.append("user:");
+    if (this.user == null) {
       sb.append("null");
     } else {
-      sb.append(this.principal);
+      sb.append(this.user);
     }
     first = false;
     if (!first) sb.append(", ");
@@ -1203,10 +1203,10 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 2: // PRINCIPAL
+          case 2: // USER
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.principal = iprot.readString();
-              struct.setPrincipalIsSet(true);
+              struct.user = iprot.readString();
+              struct.setUserIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
@@ -1336,9 +1336,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeString(struct.client);
         oprot.writeFieldEnd();
       }
-      if (struct.principal != null) {
-        oprot.writeFieldBegin(PRINCIPAL_FIELD_DESC);
-        oprot.writeString(struct.principal);
+      if (struct.user != null) {
+        oprot.writeFieldBegin(USER_FIELD_DESC);
+        oprot.writeString(struct.user);
         oprot.writeFieldEnd();
       }
       if (struct.table != null) {
@@ -1424,7 +1424,7 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetClient()) {
         optionals.set(0);
       }
-      if (struct.isSetPrincipal()) {
+      if (struct.isSetUser()) {
         optionals.set(1);
       }
       if (struct.isSetTable()) {
@@ -1458,8 +1458,8 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetClient()) {
         oprot.writeString(struct.client);
       }
-      if (struct.isSetPrincipal()) {
-        oprot.writeString(struct.principal);
+      if (struct.isSetUser()) {
+        oprot.writeString(struct.user);
       }
       if (struct.isSetTable()) {
         oprot.writeString(struct.table);
@@ -1517,8 +1517,8 @@ import org.slf4j.LoggerFactory;
         struct.setClientIsSet(true);
       }
       if (incoming.get(1)) {
-        struct.principal = iprot.readString();
-        struct.setPrincipalIsSet(true);
+        struct.user = iprot.readString();
+        struct.setUserIsSet(true);
       }
       if (incoming.get(2)) {
         struct.table = iprot.readString();

Modified: accumulo/trunk/proxy/src/main/thrift/proxy.thrift
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/thrift/proxy.thrift?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/thrift/proxy.thrift (original)
+++ accumulo/trunk/proxy/src/main/thrift/proxy.thrift Mon Feb  4 21:11:30 2013
@@ -64,9 +64,9 @@ struct ScanColumn {
   2:optional binary colQualifier
 }
 
-struct PrincipalToken {
-  1:string principal,
-  2:binary token
+struct UserPass {
+  1:string username,
+  2:binary password
 }
 
 struct IteratorSetting {
@@ -142,7 +142,7 @@ struct Column {
 
 struct ActiveScan {
   1:string client
-  2:string principal
+  2:string user
   3:string table
   4:i64 age
   5:i64 idleTime
@@ -230,95 +230,104 @@ exception TableExistsException {
 
 service AccumuloProxy
 {
-  bool ping (1:PrincipalToken principalToken);
+  // get an identity token
+  binary login(1:UserPass login);
 
   // table operations
-  i32 addConstraint (1:PrincipalToken principalToken, 2:string tableName, 3:string constraintClassName)      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void addSplits (1:PrincipalToken principalToken, 2:string tableName, 3:set<binary> splits)                 throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void attachIterator (1:PrincipalToken principalToken, 2:string tableName, 3:IteratorSetting setting, 
-                       4:set<IteratorScope> scopes)                                                          throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void checkIteratorConflicts (1:PrincipalToken principalToken, 2:string tableName, 
-                               3:IteratorSetting setting, 4:set<IteratorScope> scopes)                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void clearLocatorCache (1:PrincipalToken principalToken, 2:string tableName)                               throws (1:TableNotFoundException ouch1);
-  void cloneTable (1:PrincipalToken principalToken, 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:PrincipalToken principalToken, 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 cancelCompaction(1:PrincipalToken principalToken, 2:string tableName)                                 throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
+  i32 addConstraint (1:binary login, 2:string tableName, 3:string constraintClassName)                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void addSplits (1:binary login, 2:string tableName, 3:set<binary> splits)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void attachIterator (1:binary login, 2:string tableName, 3:IteratorSetting setting, 
+                       4:set<IteratorScope> scopes) 
+                                                                                                       throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void checkIteratorConflicts (1:binary login, 2:string tableName, 3:IteratorSetting setting, 
+                               4:set<IteratorScope> scopes) 
+                                                                                                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void clearLocatorCache (1:binary login, 2:string tableName)                                          throws (1:TableNotFoundException ouch1);
+  void cloneTable (1:binary login, 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:binary login, 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 cancelCompaction(1:binary login, 2:string tableName)                                            throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3);
                                                                                                             
-  void createTable (1:PrincipalToken principalToken, 2:string tableName, 3:bool versioningIter, 4:TimeType type) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
-  void deleteTable (1:PrincipalToken principalToken, 2:string tableName)                                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void deleteRows (1:PrincipalToken principalToken, 2:string tableName, 3:binary startRow, 4:binary endRow)   throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void exportTable (1:PrincipalToken principalToken, 2:string tableName, 3:string exportDir)                  throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  void flushTable (1:PrincipalToken principalToken, 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:PrincipalToken principalToken, 2:string tableName)             throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  IteratorSetting getIteratorSetting (1:PrincipalToken principalToken, 2:string tableName, 
-                                      3:string iteratorName, 4:IteratorScope scope)                           throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  binary getMaxRow (1:PrincipalToken principalToken, 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:PrincipalToken principalToken, 2:string tableName)                 throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  list<binary> getSplits (1:PrincipalToken principalToken, 2:string tableName, 3:i32 maxSplits)               throws (1:TableNotFoundException ouch1);
-  void importDirectory (1:PrincipalToken principalToken, 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:PrincipalToken principalToken, 2:string tableName, 3:string importDir)                  throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
-  set<string> listTables (1:PrincipalToken principalToken);
-  map<string,set<IteratorScope>> listIterators (1:PrincipalToken principalToken, 2:string tableName)          throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  map<string,i32> listConstraints (1:PrincipalToken principalToken, 2:string tableName)                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
-  void mergeTablets (1:PrincipalToken principalToken, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void offlineTable (1:PrincipalToken principalToken, 2:string tableName)                                     throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void onlineTable (1:PrincipalToken principalToken, 2:string tableName)                                      throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeConstraint (1:PrincipalToken principalToken, 2:string tableName, 3:i32 constraint)               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void removeIterator (1:PrincipalToken principalToken, 2:string tableName, 3:string iterName, 
-                       4:set<IteratorScope> scopes)                                                           throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
-  void removeTableProperty (1:PrincipalToken principalToken, 2:string tableName, 3:string property)           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void renameTable (1:PrincipalToken principalToken, 2:string oldTableName, 3:string newTableName)            throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
-  void setLocalityGroups (1:PrincipalToken principalToken, 2:string tableName, 3:map<string,set<string>> groups) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  void setTableProperty (1:PrincipalToken principalToken, 2:string tableName, 3:string property, 4:string value) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<Range> splitRangeByTablets (1:PrincipalToken principalToken, 2:string tableName, 3:Range range, 4:i32 maxSplits)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
-  bool tableExists (1:PrincipalToken principalToken, 2:string tableName);
-  map<string,string> tableIdMap (1:PrincipalToken principalToken);
+  void createTable (1:binary login, 2:string tableName, 3:bool versioningIter, 4:TimeType type)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableExistsException ouch3);
+  void deleteTable (1:binary login, 2:string tableName)                                                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void deleteRows (1:binary login, 2:string tableName, 3:binary startRow, 4:binary endRow)             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void exportTable (1:binary login, 2:string tableName, 3:string exportDir)                            throws (1:TableNotFoundException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  void flushTable (1:binary login, 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:binary login, 2:string tableName)                       throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  IteratorSetting getIteratorSetting (1:binary login, 2:string tableName, 
+                                      3:string iteratorName, 4:IteratorScope scope) 
+                                                                                                       throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  binary getMaxRow (1:binary login, 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:binary login, 2:string tableName)                           throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  list<binary> getSplits (1:binary login, 2:string tableName, 3:i32 maxSplits)                         throws (1:TableNotFoundException ouch1);
+  void importDirectory (1:binary login, 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:binary login, 2:string tableName, 3:string importDir)                            throws (1:TableExistsException ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+  set<string> listTables (1:binary login);
+  map<string,set<IteratorScope>> listIterators (1:binary login, 2:string tableName)                    throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  map<string,i32> listConstraints (1:binary login, 2:string tableName)                                 throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
+  void mergeTablets (1:binary login, 2:string tableName, 3:binary startRow, 4:binary endRow)           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void offlineTable (1:binary login, 2:string tableName)                                               throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void onlineTable (1:binary login, 2:string tableName)                                                throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeConstraint (1:binary login, 2:string tableName, 3:i32 constraint)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void removeIterator (1:binary login, 2:string tableName, 3:string iterName, 
+                       4:set<IteratorScope> scopes)
+                                                                                                       throws (1:AccumuloSecurityException ouch1, 2:AccumuloException ouch2, 3:TableNotFoundException ouch3);
+  void removeTableProperty (1:binary login, 2:string tableName, 3:string property)                     throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void renameTable (1:binary login, 2:string oldTableName, 3:string newTableName)                      throws (1:AccumuloSecurityException ouch1, 2:TableNotFoundException ouch2, 3:AccumuloException ouch3, 4:TableExistsException ouch4);
+  void setLocalityGroups (1:binary login, 2:string tableName, 3:map<string,set<string>> groups)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  void setTableProperty (1:binary login, 2:string tableName, 3:string property, 4:string value)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<Range> splitRangeByTablets (1:binary login, 2:string tableName, 3:Range range, 4:i32 maxSplits)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+  bool tableExists (1:binary login, 2:string tableName);
+  map<string,string> tableIdMap (1:binary login);
 
   // instance operations
-  void pingTabletServer(1:PrincipalToken principalToken, 2:string tserver)                                    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveScan> getActiveScans (1:PrincipalToken principalToken, 2:string tserver)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<ActiveCompaction> getActiveCompactions(1:PrincipalToken principalToken, 2:string tserver)              throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSiteConfiguration (1:PrincipalToken principalToken)                                   throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  map<string,string> getSystemConfiguration (1:PrincipalToken principalToken)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<string> getTabletServers (1:PrincipalToken principalToken);
-  void removeProperty (1:PrincipalToken principalToken, 2:string property)                                    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void setProperty (1:PrincipalToken principalToken, 2:string property, 3:string value)                       throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool testClassLoad (1:PrincipalToken principalToken, 2:string className, 3:string asTypeName)               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void pingTabletServer(1:binary login, 2:string tserver)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveScan> getActiveScans (1:binary login, 2:string tserver)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<ActiveCompaction> getActiveCompactions(1:binary login, 2:string tserver)                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSiteConfiguration (1:binary login)                                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  map<string,string> getSystemConfiguration (1:binary login)                                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<string> getTabletServers (1:binary login);
+  void removeProperty (1:binary login, 2:string property)                                            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void setProperty (1:binary login, 2:string property, 3:string value)                               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool testClassLoad (1:binary login, 2:string className, 3:string asTypeName)                       throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // security operations
-  bool authenticateUser (1:PrincipalToken principalToken, 2:string principal, 3:binary token)                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changeUserAuthorizations (1:PrincipalToken principalToken, 2:string principal, 3:set<binary> authorizations) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void changePrincipalTokenword (1:PrincipalToken principalToken, 2:string principal, 3:binary token)         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void createUser (1:PrincipalToken principalToken, 2:string principal, 3:binary token)                       throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void dropUser (1:PrincipalToken principalToken, 2:string principal)                                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  list<binary> getUserAuthorizations (1:PrincipalToken principalToken, 2:string principal)                    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantSystemPermission (1:PrincipalToken principalToken, 2:string principal, 3:SystemPermission perm)   throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void grantTablePermission (1:PrincipalToken principalToken, 2:string principal, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasSystemPermission (1:PrincipalToken principalToken, 2:string principal, 3:SystemPermission perm)     throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  bool hasTablePermission (1:PrincipalToken principalToken, 2:string principal, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  set<string> listUsers (1:PrincipalToken principalToken)                                                     throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void revokeSystemPermission (1:PrincipalToken principalToken, 2:string principal, 3:SystemPermission perm)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  void revokeTablePermission (1:PrincipalToken principalToken, 2:string principal, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool authenticateUser (1:binary login, 2:string user, 3:binary password)                           throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserAuthorizations (1:binary login, 2:string user, 3:set<binary> authorizations)        throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void changeUserPassword (1:binary login, 2:string user, 3:binary password)                         throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void createUser (1:binary login, 2:string user, 3:binary password)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void dropUser (1:binary login, 2:string user)                                                      throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  list<binary> getUserAuthorizations (1:binary login, 2:string user)                                 throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm)                throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void grantTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm)                  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  bool hasTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm)    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  set<string> listUsers (1:binary login)                                                             throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void revokeSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm)               throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  void revokeTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
 
   // scanning
-  string createBatchScanner(1:PrincipalToken principalToken, 2:string tableName, 3:BatchScanOptions options)  throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
-  string createScanner(1:PrincipalToken principalToken, 2:string tableName, 3:ScanOptions options)            throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  string createBatchScanner(1:binary login, 2:string tableName, 3:BatchScanOptions options)          throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+  string createScanner(1:binary login, 2:string tableName, 3:ScanOptions options)                    throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
 
   // use the scanner
-  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);
+  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:PrincipalToken principalToken, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells) throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
-  string createWriter(1:PrincipalToken principalToken, 2:string tableName, 3:WriterOptions opts)              throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
+  void updateAndFlush(1:binary login, 2:string tableName, 3:map<binary, list<ColumnUpdate>> cells) throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
+  string createWriter(1:binary login, 2:string tableName, 3:WriterOptions opts)                    throws(1:AccumuloException outch1, 2:AccumuloSecurityException ouch2);
 
   // use the writer
   oneway void update(1:string writer, 2:map<binary, list<ColumnUpdate>> cells);

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Mon Feb  4 21:11:30 2013
@@ -58,7 +58,6 @@ import org.apache.accumulo.proxy.thrift.
 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.PrincipalToken;
 import org.apache.accumulo.proxy.thrift.Range;
 import org.apache.accumulo.proxy.thrift.ScanColumn;
 import org.apache.accumulo.proxy.thrift.ScanOptions;
@@ -68,6 +67,7 @@ import org.apache.accumulo.proxy.thrift.
 import org.apache.accumulo.proxy.thrift.SystemPermission;
 import org.apache.accumulo.proxy.thrift.TablePermission;
 import org.apache.accumulo.proxy.thrift.TimeType;
+import org.apache.accumulo.proxy.thrift.UserPass;
 import org.apache.accumulo.test.MiniAccumuloCluster;
 import org.apache.accumulo.test.functional.SlowIterator;
 import org.apache.commons.io.FileUtils;
@@ -98,10 +98,11 @@ public class SimpleTest {
   private static Thread thread;
   private static int proxyPort;
   private static org.apache.accumulo.proxy.thrift.AccumuloProxy.Client client;
-  private static PrincipalToken creds = new PrincipalToken("root", ByteBuffer.wrap(secret.getBytes()));
-  
+  private static UserPass userpass = new UserPass("root", ByteBuffer.wrap(secret.getBytes()));
+  private static ByteBuffer creds = null;
+
   private static Class<? extends TProtocolFactory> protocolClass;
-  
+
   static Class<? extends TProtocolFactory> getRandomProtocol() {
     List<Class<? extends TProtocolFactory>> protocolFactories = new ArrayList<Class<? extends TProtocolFactory>>();
     protocolFactories.add(org.apache.thrift.protocol.TJSONProtocol.Factory.class);
@@ -112,20 +113,20 @@ public class SimpleTest {
     Random rand = new Random();
     return protocolFactories.get(rand.nextInt(protocolFactories.size()));
   }
-  
+
   @BeforeClass
   public static void setupMiniCluster() throws Exception {
     folder.create();
     accumulo = new MiniAccumuloCluster(folder.getRoot(), secret);
     accumulo.start();
-    
+  
     Properties props = new Properties();
     props.put("org.apache.accumulo.proxy.ProxyServer.instancename", accumulo.getInstanceName());
     props.put("org.apache.accumulo.proxy.ProxyServer.zookeepers", accumulo.getZookeepers());
     
     protocolClass = getRandomProtocol();
     System.out.println(protocolClass.getName());
-    
+
     proxyPort = 40000 + random.nextInt(20000);
     proxyServer = Proxy.createProxyServer(org.apache.accumulo.proxy.thrift.AccumuloProxy.class, org.apache.accumulo.proxy.ProxyServer.class, proxyPort,
         protocolClass, props);
@@ -139,13 +140,9 @@ public class SimpleTest {
     while (!proxyServer.isServing())
       UtilWaitThread.sleep(100);
     client = new TestProxyClient("localhost", proxyPort, protocolClass.newInstance()).proxy();
+    creds = client.login(userpass);
   }
-  
-  @Test(timeout = 10000)
-  public void testPing() throws Exception {
-    client.ping(creds);
-  }
-  
+
   @Test(timeout = 10000)
   public void testInstanceOperations() throws Exception {
     int tservers = 0;
@@ -174,7 +171,7 @@ public class SimpleTest {
     // try to load some classes via the proxy
     assertTrue(client.testClassLoad(creds, DevNull.class.getName(), SortedKeyValueIterator.class.getName()));
     assertFalse(client.testClassLoad(creds, "foo.bar", SortedKeyValueIterator.class.getName()));
-    
+
     // create a table that's very slow, so we can look for scans/compactions
     client.createTable(creds, "slow", true, TimeType.MILLIS);
     IteratorSetting setting = new IteratorSetting(100, "slow", SlowIterator.class.getName(), Collections.singletonMap("sleepTime", "100"));
@@ -202,18 +199,19 @@ public class SimpleTest {
     t.start();
     // look for the scan
     List<ActiveScan> scans = Collections.emptyList();
-    loop: for (int i = 0; i < 100; i++) {
-      for (String tserver : client.getTabletServers(creds)) {
-        scans = client.getActiveScans(creds, tserver);
-        if (!scans.isEmpty())
-          break loop;
-        UtilWaitThread.sleep(10);
+    loop:
+    for (int i = 0; i < 100; i++) {
+      for (String tserver: client.getTabletServers(creds)) {
+       scans = client.getActiveScans(creds, tserver);
+       if (!scans.isEmpty())
+         break loop;
+       UtilWaitThread.sleep(10);
       }
     }
     t.join();
     assertFalse(scans.isEmpty());
     ActiveScan scan = scans.get(0);
-    assertEquals("root", scan.getPrincipal());
+    assertEquals("root", scan.getUser());
     assertEquals(ScanState.RUNNING, scan.getState());
     assertEquals(ScanType.SINGLE, scan.getType());
     assertEquals("slow", scan.getTable());
@@ -238,8 +236,9 @@ public class SimpleTest {
     
     // try to catch it in the act
     List<ActiveCompaction> compactions = Collections.emptyList();
-    loop2: for (int i = 0; i < 100; i++) {
-      for (String tserver : client.getTabletServers(creds)) {
+    loop2:
+    for (int i = 0; i < 100; i++) {
+      for (String tserver: client.getTabletServers(creds)) {
         compactions = client.getActiveCompactions(creds, tserver);
         if (!compactions.isEmpty())
           break loop2;
@@ -263,23 +262,24 @@ public class SimpleTest {
     // check password
     assertTrue(client.authenticateUser(creds, "root", s2bb(secret)));
     assertFalse(client.authenticateUser(creds, "root", s2bb("")));
-    
+
     // create a user
     client.createUser(creds, "stooge", s2bb("password"));
     // change auths
     Set<String> users = client.listUsers(creds);
     assertEquals(new HashSet<String>(Arrays.asList("root", "stooge")), users);
-    HashSet<ByteBuffer> auths = new HashSet<ByteBuffer>(Arrays.asList(s2bb("A"), s2bb("B")));
+    HashSet<ByteBuffer> auths = new HashSet<ByteBuffer>(Arrays.asList(s2bb("A"),s2bb("B")));
     client.changeUserAuthorizations(creds, "stooge", auths);
     List<ByteBuffer> update = client.getUserAuthorizations(creds, "stooge");
     assertEquals(auths, new HashSet<ByteBuffer>(update));
     
     // change password
-    client.changePrincipalTokenword(creds, "stooge", s2bb(""));
+    client.changeUserPassword(creds, "stooge", s2bb(""));
     assertTrue(client.authenticateUser(creds, "stooge", s2bb("")));
     
     // check permission failure
-    PrincipalToken stooge = new PrincipalToken("stooge", s2bb(""));
+    ByteBuffer stooge = client.login(new UserPass("stooge", s2bb("")));
+    
     try {
       client.createTable(stooge, "fail", true, TimeType.MILLIS);
       fail("should not create the table");
@@ -309,7 +309,8 @@ public class SimpleTest {
       String scanner = client.createScanner(stooge, "test", null);
       client.nextK(scanner, 100);
       fail("stooge should not read table test");
-    } catch (TException ex) {}
+    } catch (TException ex) {
+    }
     // grant
     assertFalse(client.hasTablePermission(creds, "stooge", "test", TablePermission.READ));
     client.grantTablePermission(creds, "stooge", "test", TablePermission.READ);
@@ -324,7 +325,8 @@ public class SimpleTest {
       scanner = client.createScanner(stooge, "test", null);
       client.nextK(scanner, 100);
       fail("stooge should not read table test");
-    } catch (TException ex) {}
+    } catch (TException ex) {
+    }
     
     // delete user
     client.dropUser(creds, "stooge");
@@ -344,7 +346,8 @@ public class SimpleTest {
     try {
       client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
       fail("constraint did not fire");
-    } catch (Exception ex) {}
+    } catch (Exception ex) {
+    }
     client.removeConstraint(creds, "test", 1);
     client.updateAndFlush(creds, "test", mutation("row1", "cf", "cq", "x"));
     String scanner = client.createScanner(creds, "test", null);
@@ -367,7 +370,7 @@ public class SimpleTest {
     // iterators
     client.deleteTable(creds, "test");
     client.createTable(creds, "test", true, TimeType.MILLIS);
-    HashMap<String,String> options = new HashMap<String,String>();
+    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);
@@ -382,11 +385,12 @@ public class SimpleTest {
     try {
       client.checkIteratorConflicts(creds, "test", setting, EnumSet.allOf(IteratorScope.class));
       fail("checkIteratorConflicts did not throw and exception");
-    } catch (Exception ex) {}
+    } 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.updateAndFlush(creds, "test", mutation("row"+i, "cf", "cq", ""+i));
       client.flushTable(creds, "test", null, null, true);
     }
     scanner = client.createScanner(creds, "test", null);
@@ -434,7 +438,7 @@ public class SimpleTest {
     
     // Locality groups
     client.createTable(creds, "test", true, TimeType.MILLIS);
-    Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
+    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);
@@ -493,17 +497,17 @@ public class SimpleTest {
     }
     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());
     return Collections.singletonMap(s2bb(row), Collections.singletonList(upd));
   }
-  
+
   private ByteBuffer s2bb(String cf) {
     return ByteBuffer.wrap(cf.getBytes());
   }
-  
+
   @AfterClass
   public static void tearDownMiniCluster() throws Exception {
     accumulo.stop();

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java Mon Feb  4 21:11:30 2013
@@ -21,10 +21,9 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 
 import java.nio.ByteBuffer;
-import java.util.Collections;
 import java.util.Properties;
 
-import org.apache.accumulo.proxy.thrift.PrincipalToken;
+import org.apache.accumulo.proxy.thrift.UserPass;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TCompactProtocol;
 import org.apache.thrift.server.TServer;
@@ -36,7 +35,7 @@ public class TestProxyInstanceOperations
   protected static TServer proxy;
   protected static Thread thread;
   protected static TestProxyClient tpc;
-  protected static PrincipalToken userpass;
+  protected static ByteBuffer userpass;
   protected static final int port = 10197;
   
   @BeforeClass
@@ -54,7 +53,7 @@ public class TestProxyInstanceOperations
     };
     thread.start();
     tpc = new TestProxyClient("localhost", port);
-    userpass = new PrincipalToken("root", ByteBuffer.wrap("".getBytes()));
+    userpass = tpc.proxy.login(new UserPass("root", ByteBuffer.wrap("".getBytes())));
   }
   
   @AfterClass

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java Mon Feb  4 21:11:30 2013
@@ -33,11 +33,11 @@ import org.apache.accumulo.proxy.thrift.
 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.PrincipalToken;
 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;
 import org.apache.thrift.protocol.TCompactProtocol;
 import org.apache.thrift.server.TServer;
 import org.junit.After;
@@ -50,7 +50,7 @@ public class TestProxyReadWrite {
   protected static TServer proxy;
   protected static Thread thread;
   protected static TestProxyClient tpc;
-  protected static PrincipalToken userpass;
+  protected static ByteBuffer userpass;
   protected static final int port = 10194;
   protected static final String testtable = "testtable";
   
@@ -69,7 +69,7 @@ public class TestProxyReadWrite {
     };
     thread.start();
     tpc = new TestProxyClient("localhost", port);
-    userpass = new PrincipalToken("root", ByteBuffer.wrap("".getBytes()));
+    userpass = tpc.proxy().login(new UserPass("root", ByteBuffer.wrap("".getBytes())));
   }
   
   @AfterClass

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java Mon Feb  4 21:11:30 2013
@@ -25,10 +25,10 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.accumulo.proxy.thrift.PrincipalToken;
 import org.apache.accumulo.proxy.thrift.SystemPermission;
 import org.apache.accumulo.proxy.thrift.TablePermission;
 import org.apache.accumulo.proxy.thrift.TimeType;
+import org.apache.accumulo.proxy.thrift.UserPass;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TCompactProtocol;
 import org.apache.thrift.server.TServer;
@@ -42,7 +42,7 @@ public class TestProxySecurityOperations
   protected static TServer proxy;
   protected static Thread thread;
   protected static TestProxyClient tpc;
-  protected static PrincipalToken userpass;
+  protected static ByteBuffer userpass;
   protected static final int port = 10196;
   protected static final String testtable = "testtable";
   protected static final String testuser = "VonJines";
@@ -64,7 +64,7 @@ public class TestProxySecurityOperations
     thread.start();
     
     tpc = new TestProxyClient("localhost", port);
-    userpass = new PrincipalToken("root", ByteBuffer.wrap("".getBytes()));
+    userpass = tpc.proxy().login(new UserPass("root", ByteBuffer.wrap("".getBytes())));
   }
   
   @AfterClass
@@ -98,7 +98,7 @@ public class TestProxySecurityOperations
     assertTrue(tpc.proxy().authenticateUser(userpass, testuser, testpw));
     assertFalse(tpc.proxy().authenticateUser(userpass, "EvilUser", testpw));
     
-    tpc.proxy().changePrincipalTokenword(userpass, testuser, ByteBuffer.wrap("newpass".getBytes()));
+    tpc.proxy().changeUserPassword(userpass, testuser, ByteBuffer.wrap("newpass".getBytes()));
     assertFalse(tpc.proxy().authenticateUser(userpass, testuser, testpw));
     assertTrue(tpc.proxy().authenticateUser(userpass, testuser, ByteBuffer.wrap("newpass".getBytes())));
     

Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1442362&r1=1442361&r2=1442362&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java Mon Feb  4 21:11:30 2013
@@ -31,8 +31,8 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.apache.accumulo.proxy.thrift.ColumnUpdate;
-import org.apache.accumulo.proxy.thrift.PrincipalToken;
 import org.apache.accumulo.proxy.thrift.TimeType;
+import org.apache.accumulo.proxy.thrift.UserPass;
 import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TCompactProtocol;
 import org.apache.thrift.server.TServer;
@@ -47,7 +47,7 @@ public class TestProxyTableOperations {
   protected static TServer proxy;
   protected static Thread thread;
   protected static TestProxyClient tpc;
-  protected static PrincipalToken userpass;
+  protected static ByteBuffer userpass;
   protected static final int port = 10195;
   protected static final String testtable = "testtable";
   
@@ -66,7 +66,7 @@ public class TestProxyTableOperations {
     };
     thread.start();
     tpc = new TestProxyClient("localhost", port);
-    userpass = new PrincipalToken("root", ByteBuffer.wrap("".getBytes()));
+    userpass = tpc.proxy().login(new UserPass("root", ByteBuffer.wrap("".getBytes())));
   }
   
   @AfterClass
@@ -86,11 +86,6 @@ public class TestProxyTableOperations {
   }
   
   @Test
-  public void ping() throws Exception {
-    tpc.proxy().ping(userpass);
-  }
-  
-  @Test
   public void createExistsDelete() throws TException {
     assertFalse(tpc.proxy().tableExists(userpass, "testtable2"));
     tpc.proxy().createTable(userpass, "testtable2", true, TimeType.MILLIS);



Mime
View raw message