svn commit: r1391344 [2/2] - in /accumulo/branches/ACCUMULO-259: ./ core/ server/ server/src/main/java/org/apache/accumulo/server/client/ server/src/main/java/org/apache/accumulo/server/master/ server
Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/security/Validate.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/security/Validate.java?rev=1391344r1=1391343r2=1391344view=diff == --- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/security/Validate.java (original) +++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/test/randomwalk/security/Validate.java Fri Sep 28 07:25:59 2012 @@ -39,13 +39,13 @@ public class Validate extends Test { public static void validate(State state, Logger log) throws Exception { Connector conn = state.getConnector(); -boolean tableExists = WalkingSecurity.get(state).getTableExists(); -boolean cloudTableExists = conn.tableOperations().list().contains(WalkingSecurity.get(state).getTableName()); +boolean tableExists = SecurityHelper.getTableExists(state); +boolean cloudTableExists = conn.tableOperations().list().contains(SecurityHelper.getTableName(state)); if (tableExists != cloudTableExists) throw new AccumuloException(Table existance out of sync); -boolean tableUserExists = WalkingSecurity.get(state).userExists(WalkingSecurity.get(state).getTabUserName()); -boolean cloudTableUserExists = conn.securityOperations().listUsers().contains(WalkingSecurity.get(state).getTabUserName()); +boolean tableUserExists = SecurityHelper.getTabUserExists(state); +boolean cloudTableUserExists = conn.securityOperations().listUsers().contains(SecurityHelper.getTabUserName(state)); if (tableUserExists != cloudTableUserExists) throw new AccumuloException(Table User existance out of sync); @@ -55,16 +55,17 @@ public class Validate extends Test { props.setProperty(target, table); Authenticate.authenticate(conn, state, props); -for (String user : new String[] {WalkingSecurity.get(state).getSysUserName(), WalkingSecurity.get(state).getTabUserName()}) { +boolean tabUserExists = SecurityHelper.getTabUserExists(state); +for (String user : new String[] {SecurityHelper.getSysUserName(state), SecurityHelper.getTabUserName(state)}) { for (SystemPermission sp : SystemPermission.values()) { -boolean hasSp = WalkingSecurity.get(state).hasSystemPermission(user, sp); +boolean hasSp = SecurityHelper.getSysPerm(state, user, sp); boolean accuHasSp; try { accuHasSp = conn.securityOperations().hasSystemPermission(user, sp); log.debug(Just checked to see if user + user + has system perm + sp.name() + with answer + accuHasSp); } catch (AccumuloSecurityException ae) { if (ae.getErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) { -if (tableUserExists) +if (tabUserExists) throw new AccumuloException(Got user DNE error when they should, ae); else continue; @@ -76,14 +77,14 @@ public class Validate extends Test { } for (TablePermission tp : TablePermission.values()) { -boolean hasTp = WalkingSecurity.get(state).hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp); +boolean hasTp = SecurityHelper.getTabPerm(state, user, tp); boolean accuHasTp; try { - accuHasTp = conn.securityOperations().hasTablePermission(user, WalkingSecurity.get(state).getTableName(), tp); + accuHasTp = conn.securityOperations().hasTablePermission(user, SecurityHelper.getTableName(state), tp); log.debug(Just checked to see if user + user + has table perm + tp.name() + with answer + accuHasTp); } catch (AccumuloSecurityException ae) { if (ae.getErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) { -if (tableUserExists) +if (tabUserExists) throw new AccumuloException(Got user DNE error when they should, ae); else continue; @@ -101,13 +102,13 @@ public class Validate extends Test { } -Authorizations auths = WalkingSecurity.get(state).getUserAuthorizations(WalkingSecurity.get(state).getTabAuthInfo()); +Authorizations auths = SecurityHelper.getUserAuths(state, SecurityHelper.getTabUserName(state)); Authorizations accuAuths; try { - accuAuths = conn.securityOperations().getUserAuthorizations(WalkingSecurity.get(state).getTabUserName()); + accuAuths = conn.securityOperations().getUserAuthorizations(SecurityHelper.getTabUserName(state)); } catch (AccumuloSecurityException ae) { if (ae.getErrorCode().equals(SecurityErrorCode.USER_DOESNT_EXIST)) { -if (tableUserExists) +if (tabUserExists) throw new
svn commit: r1391754 [11/11] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ conf/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examp
Modified: accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java?rev=1391754r1=1391753r2=1391754view=diff == --- accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java (original) +++ accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java Sat Sep 29 05:42:59 2012 @@ -23,6 +23,7 @@ import java.util.Map.Entry; import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchScanner; import org.apache.accumulo.core.client.BatchWriter; +import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.client.IteratorSetting; @@ -46,7 +47,7 @@ public class RegExTest { public void runTest() throws Exception { conn = inst.getConnector(user, pass); conn.tableOperations().create(ret); -BatchWriter bw = conn.createBatchWriter(ret, 10l, 60l, 1); +BatchWriter bw = conn.createBatchWriter(ret, new BatchWriterConfig()); ArrayListCharacter chars = new ArrayListCharacter(); for (char c = 'a'; c = 'z'; c++) Modified: accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java?rev=1391754r1=1391753r2=1391754view=diff == --- accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java (original) +++ accumulo/branches/ACCUMULO-259/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java Sat Sep 29 05:42:59 2012 @@ -23,6 +23,7 @@ import junit.framework.TestCase; import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.BatchWriter; +import org.apache.accumulo.core.client.BatchWriterConfig; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.Scanner; import org.apache.accumulo.core.client.mock.MockInstance; @@ -30,9 +31,6 @@ import org.apache.accumulo.core.data.Key import org.apache.accumulo.core.data.KeyExtent; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; -import org.apache.accumulo.core.util.ColumnFQ; -import org.apache.accumulo.server.util.MetadataTable; -import org.apache.accumulo.server.util.TabletIterator; import org.apache.hadoop.io.Text; public class CloneTest extends TestCase { @@ -44,16 +42,16 @@ public class CloneTest extends TestCase KeyExtent ke = new KeyExtent(new Text(0), null, null); Mutation mut = ke.getPrevRowUpdateMutation(); -ColumnFQ.put(mut, Constants.METADATA_TIME_COLUMN, new Value(M0.getBytes())); -ColumnFQ.put(mut, Constants.METADATA_DIRECTORY_COLUMN, new Value(/default_tablet.getBytes())); +Constants.METADATA_TIME_COLUMN.put(mut, new Value(M0.getBytes())); +Constants.METADATA_DIRECTORY_COLUMN.put(mut, new Value(/default_tablet.getBytes())); -BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000, 6l, 1); +BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig()); bw1.addMutation(mut); bw1.close(); -BatchWriter bw2 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000, 6l, 1); +BatchWriter bw2 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig()); MetadataTable.initializeClone(0, 1, conn, bw2); @@ -72,17 +70,17 @@ public class CloneTest extends TestCase KeyExtent ke = new KeyExtent(new Text(0), null, null); Mutation mut = ke.getPrevRowUpdateMutation(); -ColumnFQ.put(mut, Constants.METADATA_TIME_COLUMN, new Value(M0.getBytes())); -ColumnFQ.put(mut, Constants.METADATA_DIRECTORY_COLUMN, new Value(/default_tablet.getBytes())); +Constants.METADATA_TIME_COLUMN.put(mut, new Value(M0.getBytes())); +Constants.METADATA_DIRECTORY_COLUMN.put(mut, new Value(/default_tablet.getBytes())); mut.put(Constants.METADATA_DATAFILE_COLUMN_FAMILY.toString(), /default_tablet/0_0.rf, 1,200); -BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000, 6l, 1); +BatchWriter bw1 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig()); bw1.addMutation(mut); bw1.flush(); -BatchWriter bw2 = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, 1000, 6l, 1); +BatchWriter bw2 =