accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1449883 - in /accumulo/trunk: ./ assemble/ core/ core/src/main/java/org/apache/accumulo/core/client/impl/ examples/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ server/ src/ test/src/m...
Date Mon, 25 Feb 2013 20:48:01 GMT
Author: ecn
Date: Mon Feb 25 20:48:00 2013
New Revision: 1449883

URL: http://svn.apache.org/r1449883
Log:
ACCUMULO-1105 fix issues with random walk tests

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1449794-1449881

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1449756-1449881

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1449794-1449881

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
Mon Feb 25 20:48:00 2013
@@ -135,7 +135,7 @@ class OfflineIterator implements Iterato
     this.readers = new ArrayList<SortedKeyValueIterator<Key,Value>>();
     
     try {
-      conn = instance.getConnector(credentials.getPrincipal(), credentials.getToken());
+      conn = instance.getConnector(credentials);
       nextTablet();
       
       while (iter != null && !iter.hasTop())

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1449794-1449881

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1449756-1449881

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1449756-1449881

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1449756-1449881

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1449756-1449881

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/QueryMetadataTable.java Mon
Feb 25 20:48:00 2013
@@ -58,7 +58,7 @@ public class QueryMetadataTable {
       try {
         KeyExtent extent = new KeyExtent(row, (Text) null);
         
-        Connector connector = HdfsZooInstance.getInstance().getConnector(credentials.getPrincipal(),
credentials.getToken());
+        Connector connector = HdfsZooInstance.getInstance().getConnector(credentials);
         Scanner mdScanner = connector.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
         Text row = extent.getMetadataEntry();
         

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java Mon Feb
25 20:48:00 2013
@@ -32,7 +32,6 @@ import org.apache.accumulo.core.client.Z
 import org.apache.accumulo.core.security.CredentialHelper;
 import org.apache.accumulo.core.security.thrift.Credential;
 import org.apache.accumulo.core.security.tokens.PasswordToken;
-import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.log4j.Logger;
 
 public class State {
@@ -96,10 +95,7 @@ public class State {
   
   public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
     if (connector == null) {
-      String instance = props.getProperty("INSTANCE");
-      String zookeepers = props.getProperty("ZOOKEEPERS");
-      Credential credentials = getCredentials();
-      connector = new ZooKeeperInstance(instance, zookeepers).getConnector(credentials.getPrincipal(),
credentials.getToken());
+      connector = getInstance().getConnector(getCredentials());
     }
     return connector;
   }
@@ -107,12 +103,14 @@ public class State {
   public Credential getCredentials() {
     String username = props.getProperty("USERNAME");
     String password = props.getProperty("PASSWORD");
-    return CredentialHelper.createSquelchError(username, new PasswordToken().setPassword(password.getBytes()),
this.getInstance().getInstanceID());
+    return CredentialHelper.createSquelchError(username, new PasswordToken().setPassword(password.getBytes()),
getInstance().getInstanceID());
   }
 
   public Instance getInstance() {
     if (instance == null) {
-      instance = HdfsZooInstance.getInstance();
+      String instance = props.getProperty("INSTANCE");
+      String zookeepers = props.getProperty("ZOOKEEPERS");
+      this.instance = new ZooKeeperInstance(instance, zookeepers);
     }
     return instance;
   }

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
Mon Feb 25 20:48:00 2013
@@ -28,7 +28,7 @@ public class Commit extends Test {
     state.getMultiTableBatchWriter().flush();
     
     log.debug("Committed " + state.getLong("numWrites") + " writes.  Total writes: " + state.getLong("totalWrites"));
-    state.set("numWrites", new Integer(0));
+    state.set("numWrites", new Long(0));
   }
   
 }

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
Mon Feb 25 20:48:00 2013
@@ -84,8 +84,8 @@ public class ImageFixture extends Fixtur
       log.debug("Configured locality groups for " + imageTableName + " groups = " + groups);
     }
     
-    state.set("numWrites", new Integer(0));
-    state.set("totalWrites", new Integer(0));
+    state.set("numWrites", new Long(0));
+    state.set("totalWrites", new Long(0));
     state.set("verified", new Integer(0));
     state.set("lastIndexRow", new Text(""));
   }

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
Mon Feb 25 20:48:00 2013
@@ -33,7 +33,7 @@ public class Commit extends Test {
     log.debug("Committed " + numWrites + " writes.  Total writes: " + totalWrites);
     
     state.set("totalWrites", totalWrites);
-    state.set("numWrites", new Integer(0));
+    state.set("numWrites", new Long(0));
   }
   
 }

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
Mon Feb 25 20:48:00 2013
@@ -33,8 +33,8 @@ public class MultiTableFixture extends F
     
     state.set("tableNamePrefix", String.format("multi_%s_%s_%d", hostname, state.getPid(),
System.currentTimeMillis()));
     state.set("nextId", new Integer(0));
-    state.set("numWrites", new Integer(0));
-    state.set("totalWrites", new Integer(0));
+    state.set("numWrites", new Long(0));
+    state.set("totalWrites", new Long(0));
     state.set("tableList", new ArrayList<String>());
   }
   

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/AlterTablePerm.java
Mon Feb 25 20:48:00 2013
@@ -69,7 +69,7 @@ public class AlterTablePerm extends Test
     } else {
       source = state.getCredentials();
     }
-    Connector conn = state.getInstance().getConnector(source.getPrincipal(), source.getToken());
+    Connector conn = state.getInstance().getConnector(source);
     
     canGive = WalkingSecurity.get(state).canGrantTable(source, target, WalkingSecurity.get(state).getTableName());
 

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
Mon Feb 25 20:48:00 2013
@@ -37,7 +37,7 @@ public class Authenticate extends Test {
     String targetProp = props.getProperty("target");
     boolean success = Boolean.parseBoolean(props.getProperty("valid"));
     
-    Connector conn = state.getInstance().getConnector(auth.getPrincipal(), auth.getToken());
+    Connector conn = state.getInstance().getConnector(auth);
     
     String target;
     

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
Mon Feb 25 20:48:00 2013
@@ -41,7 +41,7 @@ public class ChangePass extends Test {
     } else {
       auth = WalkingSecurity.get(state).getTabCredentials();
     }
-    Connector conn = state.getInstance().getConnector(auth.getPrincipal(), auth.getToken());
+    Connector conn = state.getInstance().getConnector(auth);
         
     boolean hasPerm;
     boolean targetExists;

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropTable.java
Mon Feb 25 20:48:00 2013
@@ -43,7 +43,7 @@ public class DropTable extends Test {
     } else {
       auth = WalkingSecurity.get(state).getSysCredentials();
     }
-    Connector conn = state.getInstance().getConnector(auth.getPrincipal(), auth.getToken());
+    Connector conn = state.getInstance().getConnector(auth);
     
     String tableName = WalkingSecurity.get(state).getTableName();
     

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java?rev=1449883&r1=1449882&r2=1449883&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
Mon Feb 25 20:48:00 2013
@@ -279,11 +279,19 @@ public class WalkingSecurity extends Sec
   }
   
   public byte[] getUserPassword(String user) {
-    return (byte[]) state.get(user + userPass);
+    Object obj = state.get(getSysUserName() + userPass);
+    if (obj instanceof PasswordToken) {
+      return ((PasswordToken)obj).getPassword();
+    }
+    return null;
   }
   
   public byte[] getSysPassword() {
-    return (byte[]) state.get(getSysUserName() + userPass);
+    Object obj = state.get(getSysUserName() + userPass);
+    if (obj instanceof PasswordToken) {
+      return ((PasswordToken)obj).getPassword();
+    }
+    return null;
   }
   
   public byte[] getTabPassword() {



Mime
View raw message