Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8AE1D688 for ; Fri, 28 Sep 2012 07:26:57 +0000 (UTC) Received: (qmail 28133 invoked by uid 500); 28 Sep 2012 07:26:57 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 27949 invoked by uid 500); 28 Sep 2012 07:26:51 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 27893 invoked by uid 99); 28 Sep 2012 07:26:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2012 07:26:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2012 07:26:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 04DDF2388A33 for ; Fri, 28 Sep 2012 07:26:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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/src/main/java/org/apache/accumulo/server/master/tab... Date: Fri, 28 Sep 2012 07:26:00 -0000 To: commits@accumulo.apache.org From: vines@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120928072602.04DDF2388A33@eris.apache.org> 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=1391344&r1=1391343&r2=1391344&view=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 AccumuloException("Table user didn't exist when they should.", ae); else return; Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Initialize.java URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Initialize.java?rev=1391344&r1=1391343&r2=1391344&view=diff ============================================================================== --- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Initialize.java (original) +++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/util/Initialize.java Fri Sep 28 07:25:59 2012 @@ -50,8 +50,8 @@ import org.apache.accumulo.server.conf.S import org.apache.accumulo.server.constraints.MetadataConstraints; import org.apache.accumulo.server.iterators.MetadataBulkLoadFilter; import org.apache.accumulo.server.master.state.tables.TableManager; -import org.apache.accumulo.server.security.AuditedSecurityOperation; import org.apache.accumulo.server.security.SecurityConstants; +import org.apache.accumulo.server.security.SecurityOperationImpl; import org.apache.accumulo.server.security.SecurityUtil; import org.apache.accumulo.server.tabletserver.TabletTime; import org.apache.accumulo.server.zookeeper.ZooReaderWriter; @@ -412,19 +412,11 @@ public class Initialize { } private static void initSecurity(String iid, byte[] rootpass) throws AccumuloSecurityException, ThriftSecurityException { - AuditedSecurityOperation.getInstance(iid).initializeSecurity(SecurityConstants.getSystemCredentials(), ROOT_USER, rootpass); + SecurityOperationImpl.getInstance(iid).initializeSecurity(SecurityConstants.getSystemCredentials(), ROOT_USER, rootpass); } protected static void initMetadataConfig() throws IOException { try { - Configuration conf = CachedConfiguration.getInstance(); - int max = conf.getInt("dfs.replication.max", 512); - // Hadoop 0.23 switched the min value configuration name - int min = Math.max(conf.getInt("dfs.replication.min", 1), conf.getInt("dfs.namenode.replication.min", 1)); - if (max < 5) - setMetadataReplication(max, "max"); - if (min > 5) - setMetadataReplication(min, "min"); for (Entry entry : initialMetadataConf.entrySet()) if (!TablePropUtil.setTableProperty(Constants.METADATA_TABLE_ID, entry.getKey(), entry.getValue())) throw new IOException("Cannot create per-table property " + entry.getKey()); @@ -434,18 +426,6 @@ public class Initialize { } } - private static void setMetadataReplication(int replication, String reason) throws IOException { - String rep = getConsoleReader().readLine( - "Your HDFS replication " + reason - + " is not compatible with our default !METADATA replication of 5. What do you want to set your !METADATA replication to? (" + replication + ") "); - if (rep == null || rep.length() == 0) - rep = Integer.toString(replication); - else - // Lets make sure it's a number - Integer.parseInt(rep); - initialMetadataConf.put(Property.TABLE_FILE_REPLICATION.getKey(), rep); - } - public static boolean isInitialized(FileSystem fs) throws IOException { return (fs.exists(ServerConstants.getInstanceIdLocation()) || fs.exists(ServerConstants.getDataVersionLocation())); } Propchange: accumulo/branches/ACCUMULO-259/src/ ------------------------------------------------------------------------------ Reverse-merged /accumulo/trunk/src:r1362561-1363473 Reverse-merged /accumulo/branches/1.4/src/src:r1363430