Git Push Summary

2015-03-19 Thread larsh
Repository: hbase
Updated Tags:  refs/tags/0.94.27RC0 [created] 44a7cef23


Git Push Summary

2015-03-19 Thread larsh
Repository: hbase
Updated Tags:  refs/tags/0.94.27RC0 [deleted] aeea9e842


[2/2] hbase git commit: HBASE-13235 Revisit the security auditing semantics (Srikanth Srungarapu)

2015-03-19 Thread mbertozzi
HBASE-13235 Revisit the security auditing semantics (Srikanth Srungarapu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6b411b5d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6b411b5d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6b411b5d

Branch: refs/heads/branch-1
Commit: 6b411b5d00e114946aeee1c6fa6f0d60fe04087a
Parents: 78a55ac
Author: Matteo Bertozzi matteo.berto...@cloudera.com
Authored: Thu Mar 19 07:01:21 2015 +
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 07:01:55 2015 +

--
 .../java/org/apache/hadoop/hbase/TableName.java | 13 +++
 .../hbase/security/access/AccessController.java | 88 ++--
 .../hbase/security/access/AuthResult.java   | 77 +++--
 3 files changed, 166 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/6b411b5d/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
index 10c2285..34c8155 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
@@ -241,6 +241,19 @@ public final class TableName implements 
ComparableTableName {
 return namespaceAsString;
   }
 
+  /**
+   * Ideally, getNameAsString should contain namespace within it,
+   * but if the namespace is default, it just returns the name. This method
+   * takes care of this corner case.
+   */
+  public String getNameWithNamespaceInclAsString() {
+
if(getNamespaceAsString().equals(NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR))
 {
+  return NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR +
+  TableName.NAMESPACE_DELIM + getNameAsString();
+}
+return getNameAsString();
+  }
+
   public byte[] getQualifier() {
 return qualifier;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6b411b5d/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index 1c6ed22..fc349f1 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -430,6 +430,39 @@ public class AccessController extends 
BaseMasterAndRegionObserver
   }
 
   /**
+   * Authorizes that the current user has any of the given permissions for the
+   * given table, column family and column qualifier.
+   * @param tableName Table requested
+   * @param family Column family param
+   * @param qualifier Column qualifier param
+   * @throws IOException if obtaining the current user fails
+   * @throws AccessDeniedException if user has no authorization
+   */
+  private void requireTablePermission(String request, TableName tableName, 
byte[] family,
+  byte[] qualifier, Action... permissions) throws IOException {
+User user = getActiveUser();
+AuthResult result = null;
+
+for (Action permission : permissions) {
+  if (authManager.authorize(user, tableName, null, null, permission)) {
+result = AuthResult.allow(request, Table permission granted, user,
+permission, tableName, null, null);
+result.getParams().setFamily(family).setQualifier(qualifier);
+break;
+  } else {
+// rest of the world
+result = AuthResult.deny(request, Insufficient permissions, user,
+permission, tableName, family, qualifier);
+result.getParams().setFamily(family).setQualifier(qualifier);
+  }
+}
+logResult(result);
+if (!result.isAllowed()) {
+  throw new AccessDeniedException(Insufficient permissions  + 
result.toContextString());
+}
+  }
+
+  /**
* Authorizes that the current user has any of the given permissions to 
access the table.
*
* @param tableName Table requested
@@ -505,10 +538,15 @@ public class AccessController extends 
BaseMasterAndRegionObserver
   private void requireGlobalPermission(String request, Action perm, TableName 
tableName,
   Mapbyte[], ? extends Collectionbyte[] familyMap) throws IOException {
 User user = getActiveUser();
+AuthResult result = null;
 if (authManager.authorize(user, perm)) {
-  logResult(AuthResult.allow(request, Global check allowed, user, perm, 
tableName, familyMap));
+  result = 

[1/2] hbase git commit: HBASE-13235 Revisit the security auditing semantics (Srikanth Srungarapu)

2015-03-19 Thread mbertozzi
Repository: hbase
Updated Branches:
  refs/heads/branch-1 78a55ac71 - 6b411b5d0
  refs/heads/master 014b81210 - 535ebbfde


HBASE-13235 Revisit the security auditing semantics (Srikanth Srungarapu)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/535ebbfd
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/535ebbfd
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/535ebbfd

Branch: refs/heads/master
Commit: 535ebbfde9e424fab27f79bfa6b40964c4918fc6
Parents: 014b812
Author: Matteo Bertozzi matteo.berto...@cloudera.com
Authored: Thu Mar 19 07:01:21 2015 +
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 07:01:21 2015 +

--
 .../java/org/apache/hadoop/hbase/TableName.java | 13 +++
 .../hbase/security/access/AccessController.java | 88 ++--
 .../hbase/security/access/AuthResult.java   | 77 +++--
 3 files changed, 166 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/535ebbfd/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
index 245bef5..17fd3b7 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
@@ -241,6 +241,19 @@ public final class TableName implements 
ComparableTableName {
 return namespaceAsString;
   }
 
+  /**
+   * Ideally, getNameAsString should contain namespace within it,
+   * but if the namespace is default, it just returns the name. This method
+   * takes care of this corner case.
+   */
+  public String getNameWithNamespaceInclAsString() {
+
if(getNamespaceAsString().equals(NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR))
 {
+  return NamespaceDescriptor.DEFAULT_NAMESPACE_NAME_STR +
+  TableName.NAMESPACE_DELIM + getNameAsString();
+}
+return getNameAsString();
+  }
+
   public byte[] getQualifier() {
 return qualifier;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/535ebbfd/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index 3029413..140534d 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -432,6 +432,39 @@ public class AccessController extends 
BaseMasterAndRegionObserver
   }
 
   /**
+   * Authorizes that the current user has any of the given permissions for the
+   * given table, column family and column qualifier.
+   * @param tableName Table requested
+   * @param family Column family param
+   * @param qualifier Column qualifier param
+   * @throws IOException if obtaining the current user fails
+   * @throws AccessDeniedException if user has no authorization
+   */
+  private void requireTablePermission(String request, TableName tableName, 
byte[] family,
+  byte[] qualifier, Action... permissions) throws IOException {
+User user = getActiveUser();
+AuthResult result = null;
+
+for (Action permission : permissions) {
+  if (authManager.authorize(user, tableName, null, null, permission)) {
+result = AuthResult.allow(request, Table permission granted, user,
+permission, tableName, null, null);
+result.getParams().setFamily(family).setQualifier(qualifier);
+break;
+  } else {
+// rest of the world
+result = AuthResult.deny(request, Insufficient permissions, user,
+permission, tableName, family, qualifier);
+result.getParams().setFamily(family).setQualifier(qualifier);
+  }
+}
+logResult(result);
+if (!result.isAllowed()) {
+  throw new AccessDeniedException(Insufficient permissions  + 
result.toContextString());
+}
+  }
+
+  /**
* Authorizes that the current user has any of the given permissions to 
access the table.
*
* @param tableName Table requested
@@ -507,10 +540,15 @@ public class AccessController extends 
BaseMasterAndRegionObserver
   private void requireGlobalPermission(String request, Action perm, TableName 
tableName,
   Mapbyte[], ? extends Collectionbyte[] familyMap) throws IOException {
 User user = getActiveUser();
+AuthResult result = null;
 if (authManager.authorize(user, perm)) {
-

hbase git commit: missed one misassigned issue in CHANGES.txt

2015-03-19 Thread larsh
Repository: hbase
Updated Branches:
  refs/heads/0.94 260f2137b - fb4346177


missed one misassigned issue in CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/fb434617
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/fb434617
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/fb434617

Branch: refs/heads/0.94
Commit: fb434617716493eac82b55180b0bbd653beb90bf
Parents: 260f213
Author: Lars Hofhansl la...@apache.org
Authored: Wed Mar 18 23:12:31 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Wed Mar 18 23:12:31 2015 -0700

--
 CHANGES.txt | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/fb434617/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 2d6f60c..3d368f1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@ Bug
 
 [HBASE-10528] - DefaultBalancer selects plans to move regions onto 
draining nodes
 [HBASE-12792] - [backport] HBASE-5835: Catch and handle 
NotServingRegionException when close region attempt fails
+[HBASE-12801] - Failed to truncate a table while maintaing binary region 
boundaries
 [HBASE-12968] - [0.94]SecureServer should not ignore CallQueueSize
 [HBASE-13039] - Add patchprocess/* to .gitignore to fix builds of branches
 [HBASE-13131] - ReplicationAdmin leaks connections if there's an error in 
the constructor



[1/2] hbase git commit: Reapply HBASE-12976 Set default value for hbase.client.scanner.max.result.size. in 1.1 and 2.0 only

2015-03-19 Thread larsh
Repository: hbase
Updated Branches:
  refs/heads/branch-1 14fa34513 - 676fb753d
  refs/heads/master 2bf904f21 - 0d7665441


Reapply HBASE-12976 Set default value for 
hbase.client.scanner.max.result.size. in 1.1 and 2.0 only

This reverts commit 64589abe9936337fcbccdbe82e538d05020c8ee4.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0d766544
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0d766544
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0d766544

Branch: refs/heads/master
Commit: 0d766544166fc9630bb00ae14a4a34a69d93f127
Parents: 2bf904f
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 15:07:15 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 15:07:15 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 ++
 2 files changed, 12 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/0d766544/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 7d93904..19e251a 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -624,9 +624,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is unlimited.
+   * The default value is 2MB.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/0d766544/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index 69017f6..a3092b5 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1290,6 +1290,16 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
+namehbase.client.scanner.max.result.size/name
+value2097152/value
+descriptionMaximum number of bytes returned when calling a scanner's 
next method.
+Note that when a single row is larger than this limit the row is still 
returned completely.
+The default value is 2MB, which is good for 1ge networks.
+With faster and/or high latency networks this value should be increased.
+/description
+  /property
+
+  property
 namehbase.status.published/name
 valuefalse/value
 description



[2/2] hbase git commit: Reapply HBASE-12976 Set default value for hbase.client.scanner.max.result.size. in 1.1 and 2.0 only

2015-03-19 Thread larsh
Reapply HBASE-12976 Set default value for 
hbase.client.scanner.max.result.size. in 1.1 and 2.0 only

This reverts commit 64589abe9936337fcbccdbe82e538d05020c8ee4.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/676fb753
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/676fb753
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/676fb753

Branch: refs/heads/branch-1
Commit: 676fb753d996b60772284393ac3581b47c7a8afa
Parents: 14fa345
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 15:07:15 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 15:07:56 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 ++
 2 files changed, 12 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/676fb753/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 2658868..4429d81 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -607,9 +607,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is unlimited.
+   * The default value is 2MB.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/676fb753/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index e72484a..df1894b 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1179,6 +1179,16 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
+namehbase.client.scanner.max.result.size/name
+value2097152/value
+descriptionMaximum number of bytes returned when calling a scanner's 
next method.
+Note that when a single row is larger than this limit the row is still 
returned completely.
+The default value is 2MB, which is good for 1ge networks.
+With faster and/or high latency networks this value should be increased.
+/description
+  /property
+
+  property
 namehbase.status.published/name
 valuefalse/value
 description



[2/2] hbase git commit: Update branch documentation with changes from HBASE-13283

2015-03-19 Thread apurtell
Update branch documentation with changes from HBASE-13283


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/38286ec3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/38286ec3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/38286ec3

Branch: refs/heads/0.98
Commit: 38286ec3a0d39f4a14777a81a99024bc8266c8d7
Parents: ffb47e8
Author: Andrew Purtell apurt...@apache.org
Authored: Thu Mar 19 17:30:58 2015 -0700
Committer: Andrew Purtell apurt...@apache.org
Committed: Thu Mar 19 17:30:58 2015 -0700

--
 src/main/asciidoc/_chapters/security.adoc | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/38286ec3/src/main/asciidoc/_chapters/security.adoc
--
diff --git a/src/main/asciidoc/_chapters/security.adoc 
b/src/main/asciidoc/_chapters/security.adoc
index ae74661..25153a5 100644
--- a/src/main/asciidoc/_chapters/security.adoc
+++ b/src/main/asciidoc/_chapters/security.adoc
@@ -1057,6 +1057,9 @@ The default plugin passes through labels specified in 
Authorizations added to th
 When the client passes labels for which the user is not authenticated, the 
default plugin drops them.
 You can pass a subset of user authenticated labels via the 
`Get#setAuthorizations(Authorizations(String,...))` and 
`Scan#setAuthorizations(Authorizations(String,...));` methods.
 
+Groups can be granted visibility labels the same way as users. Groups are 
prefixed with an @ symbol. When checking visibility labels of a user, the 
server will include the visibility labels of the groups of which the user is a 
member, together with the user's own labels.
+When the visibility labels are retrieved using API `VisibilityClient#getAuths` 
or Shell command `get_auths` for a user, we will return labels added 
specifically for that user alone, not the group level labels.
+
 Visibility label access checking is performed by the VisibilityController 
coprocessor.
 You can use interface `VisibilityLabelService` to provide a custom 
implementation and/or control the way that visibility labels are stored with 
cells.
 See the source file 
_hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabelsWithCustomVisLabService.java_
for one example.
@@ -1171,12 +1174,16 @@ hbase set_auths 'service', [ 'service' ]
 
 
 
-gbase set_auths 'testuser', [ 'test' ]
+hbase set_auths 'testuser', [ 'test' ]
 
 
 
 hbase set_auths 'qa', [ 'test', 'developer' ]
 
+
+
+hbase set_auths '@qagroup', [ 'test' ]
+
 
 +
 .Java API
@@ -1213,6 +1220,10 @@ hbase clear_auths 'testuser', [ 'test' ]
 
 hbase clear_auths 'qa', [ 'test', 'developer' ]
 
+
+
+hbase clear_auths '@qagroup', [ 'test', 'developer' ]
+
 
 +
 .Java API



hbase git commit: HBASE-13280 TestSecureRPC failed

2015-03-19 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/branch-1 6b411b5d0 - 9e92e3362


HBASE-13280 TestSecureRPC failed


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9e92e336
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9e92e336
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9e92e336

Branch: refs/heads/branch-1
Commit: 9e92e33629127169dfe869c5beedfc24d5953f72
Parents: 6b411b5
Author: zhangduo zhang...@wandoujia.com
Authored: Thu Mar 19 21:46:15 2015 +0800
Committer: zhangduo zhang...@wandoujia.com
Committed: Thu Mar 19 21:46:15 2015 +0800

--
 .../java/org/apache/hadoop/hbase/security/TestSecureRPC.java | 8 +---
 .../hbase/security/TestUsersOperationsWithSecureHadoop.java  | 4 +---
 .../hbase/security/token/TestGenerateDelegationToken.java| 4 +---
 3 files changed, 3 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/9e92e336/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
index 02a205a..b4dd62b 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertSame;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.List;
@@ -37,10 +36,6 @@ import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.ServerName;
-import org.apache.hadoop.hbase.testclassification.SmallTests;
-import org.apache.hadoop.hbase.ipc.FifoRpcScheduler;
-import org.apache.hadoop.hbase.ipc.RpcClient;
-import org.apache.hadoop.hbase.ipc.RpcClientFactory;
 import org.apache.hadoop.hbase.ipc.AsyncRpcClient;
 import org.apache.hadoop.hbase.ipc.FifoRpcScheduler;
 import org.apache.hadoop.hbase.ipc.RpcClient;
@@ -75,7 +70,7 @@ public class TestSecureRPC {
 
   private static MiniKdc KDC;
 
-  private static String HOST;
+  private static String HOST = localhost;
 
   private static String PRINCIPAL;
 
@@ -85,7 +80,6 @@ public class TestSecureRPC {
 conf.put(MiniKdc.DEBUG, true);
 KDC = new MiniKdc(conf, new 
File(TEST_UTIL.getDataTestDir(kdc).toUri().getPath()));
 KDC.start();
-HOST = InetAddress.getLocalHost().getHostName();
 PRINCIPAL = hbase/ + HOST;
 KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
 HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/hbase/blob/9e92e336/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
index 4d6fa21..b664564 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.util.Properties;
 
 import org.apache.hadoop.conf.Configuration;
@@ -50,7 +49,7 @@ public class TestUsersOperationsWithSecureHadoop {
 
   private static MiniKdc KDC;
 
-  private static String HOST;
+  private static String HOST = localhost;
 
   private static String PRINCIPAL;
 
@@ -60,7 +59,6 @@ public class TestUsersOperationsWithSecureHadoop {
 conf.put(MiniKdc.DEBUG, true);
 KDC = new MiniKdc(conf, new 
File(TEST_UTIL.getDataTestDir(kdc).toUri().getPath()));
 KDC.start();
-HOST = InetAddress.getLocalHost().getHostName();
 PRINCIPAL = hbase/ + HOST;
 KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
 HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/hbase/blob/9e92e336/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
 

hbase git commit: HBASE-13280 TestSecureRPC failed

2015-03-19 Thread zhangduo
Repository: hbase
Updated Branches:
  refs/heads/master 535ebbfde - 27cf749af


HBASE-13280 TestSecureRPC failed


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/27cf749a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/27cf749a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/27cf749a

Branch: refs/heads/master
Commit: 27cf749af884edae55454c885c7fb066f0a33c79
Parents: 535ebbf
Author: zhangduo zhang...@wandoujia.com
Authored: Thu Mar 19 17:49:15 2015 +0800
Committer: zhangduo zhang...@wandoujia.com
Committed: Thu Mar 19 21:36:06 2015 +0800

--
 .../java/org/apache/hadoop/hbase/security/TestSecureRPC.java | 4 +---
 .../hbase/security/TestUsersOperationsWithSecureHadoop.java  | 4 +---
 .../hadoop/hbase/security/token/TestGenerateDelegationToken.java | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/27cf749a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
index 8ac38fa..8eff063 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecureRPC.java
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertSame;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.List;
@@ -72,7 +71,7 @@ public class TestSecureRPC {
 
   private static MiniKdc KDC;
 
-  private static String HOST;
+  private static String HOST = localhost;
 
   private static String PRINCIPAL;
 
@@ -82,7 +81,6 @@ public class TestSecureRPC {
 conf.put(MiniKdc.DEBUG, true);
 KDC = new MiniKdc(conf, new 
File(TEST_UTIL.getDataTestDir(kdc).toUri().getPath()));
 KDC.start();
-HOST = InetAddress.getLocalHost().getHostName();
 PRINCIPAL = hbase/ + HOST;
 KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
 HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/hbase/blob/27cf749a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
index 0089556..0226d49 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestUsersOperationsWithSecureHadoop.java
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.util.Properties;
 
 import org.apache.hadoop.conf.Configuration;
@@ -51,7 +50,7 @@ public class TestUsersOperationsWithSecureHadoop {
 
   private static MiniKdc KDC;
 
-  private static String HOST;
+  private static String HOST = localhost;
 
   private static String PRINCIPAL;
 
@@ -61,7 +60,6 @@ public class TestUsersOperationsWithSecureHadoop {
 conf.put(MiniKdc.DEBUG, true);
 KDC = new MiniKdc(conf, new 
File(TEST_UTIL.getDataTestDir(kdc).toUri().getPath()));
 KDC.start();
-HOST = InetAddress.getLocalHost().getHostName();
 PRINCIPAL = hbase/ + HOST;
 KDC.createPrincipal(KEYTAB_FILE, PRINCIPAL);
 HBaseKerberosUtils.setKeytabFileForTesting(KEYTAB_FILE.getAbsolutePath());

http://git-wip-us.apache.org/repos/asf/hbase/blob/27cf749a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
index d3f3040..e2752a0 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestGenerateDelegationToken.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.InetAddress;
 import java.util.Properties;
 
 import org.apache.hadoop.hbase.HBaseTestingUtility;
@@ -70,7 +69,7 @@ public class 

[3/4] hbase git commit: HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()

2015-03-19 Thread mbertozzi
HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bc029b9e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bc029b9e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bc029b9e

Branch: refs/heads/branch-1.0
Commit: bc029b9ea4f82fbb6f9e848efd430a2a795c45b8
Parents: d443c70
Author: Matteo Bertozzi matteo.berto...@cloudera.com
Authored: Thu Mar 19 17:54:46 2015 +
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 18:38:18 2015 +

--
 .../hbase/security/access/TestAccessController.java   | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bc029b9e/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
index 2d8be95..44135f5 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
@@ -230,7 +230,7 @@ public class TestAccessController extends SecureTestUtil {
 htd.addFamily(hcd);
 htd.setOwner(USER_OWNER);
 admin.createTable(htd, new byte[][] { Bytes.toBytes(s) });
-TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName());
+TEST_UTIL.waitUntilAllRegionsAssigned(TEST_TABLE.getTableName());
 
 HRegion region = 
TEST_UTIL.getHBaseCluster().getRegions(TEST_TABLE.getTableName()).get(0);
 RegionCoprocessorHost rcpHost = region.getCoprocessorHost();
@@ -2112,13 +2112,13 @@ public class TestAccessController extends 
SecureTestUtil {
 String namespace = testNamespaceUserGrant;
 NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
 TEST_UTIL.getMiniHBaseCluster().getMaster().createNamespace(desc);
-
+
 // Grant namespace READ to USER_NONE, this should supersede any table 
permissions
 grantOnNamespace(TEST_UTIL, USER_NONE.getShortName(), namespace, 
Permission.Action.READ);
 
 // Now USER_NONE should be able to read also
 verifyAllowed(getAction, USER_NONE);
-
+
 TEST_UTIL.getMiniHBaseCluster().getMaster().deleteNamespace(namespace);
   }
 
@@ -2331,7 +2331,7 @@ public class TestAccessController extends SecureTestUtil {
 // Verify that EXEC permission is checked correctly
 verifyDenied(execEndpointAction, userB);
 verifyAllowed(execEndpointAction, userA);
-
+
 String namespace = testCoprocessorExec;
 NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
 TEST_UTIL.getMiniHBaseCluster().getMaster().createNamespace(desc);
@@ -2341,7 +2341,7 @@ public class TestAccessController extends SecureTestUtil {
 
 // User B should now be allowed also
 verifyAllowed(execEndpointAction, userA, userB);
-
+
 TEST_UTIL.getMiniHBaseCluster().getMaster().deleteNamespace(namespace);
   }
 



[4/4] hbase git commit: HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()

2015-03-19 Thread mbertozzi
HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cab71fd8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cab71fd8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cab71fd8

Branch: refs/heads/0.98
Commit: cab71fd86c36f98e444695150b8a4cf32df2d763
Parents: 8947187
Author: Matteo Bertozzi matteo.berto...@cloudera.com
Authored: Thu Mar 19 18:53:08 2015 +
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 18:53:08 2015 +

--
 .../apache/hadoop/hbase/security/access/TestAccessController.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/cab71fd8/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
index 646a0a6..9ee7450 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
@@ -224,7 +224,7 @@ public class TestAccessController extends SecureTestUtil {
 htd.addFamily(hcd);
 htd.setOwner(USER_OWNER);
 admin.createTable(htd, new byte[][] { Bytes.toBytes(s) });
-TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName().getName());
+TEST_UTIL.waitUntilAllRegionsAssigned(TEST_TABLE.getTableName());
 
 HRegion region = 
TEST_UTIL.getHBaseCluster().getRegions(TEST_TABLE.getTableName()).get(0);
 RegionCoprocessorHost rcpHost = region.getCoprocessorHost();



[2/4] hbase git commit: HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()

2015-03-19 Thread mbertozzi
HBASE-13285 Fix flaky getRegions() in TestAccessController.setUp()


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1f7b7781
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1f7b7781
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1f7b7781

Branch: refs/heads/branch-1
Commit: 1f7b7781a10fa22f3aa0246822b1f6611e5cf9cc
Parents: 9e92e33
Author: Matteo Bertozzi matteo.berto...@cloudera.com
Authored: Thu Mar 19 17:54:46 2015 +
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 18:28:58 2015 +

--
 .../hbase/security/access/TestAccessController.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/1f7b7781/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
index e3a810f3..e148558 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
@@ -230,7 +230,7 @@ public class TestAccessController extends SecureTestUtil {
 htd.addFamily(hcd);
 htd.setOwner(USER_OWNER);
 admin.createTable(htd, new byte[][] { Bytes.toBytes(s) });
-TEST_UTIL.waitTableEnabled(TEST_TABLE.getTableName());
+TEST_UTIL.waitUntilAllRegionsAssigned(TEST_TABLE.getTableName());
 
 HRegion region = 
TEST_UTIL.getHBaseCluster().getRegions(TEST_TABLE.getTableName()).get(0);
 RegionCoprocessorHost rcpHost = region.getCoprocessorHost();
@@ -928,7 +928,7 @@ public class TestAccessController extends SecureTestUtil {
   setPermission(loadPath, FsPermission.valueOf(-rwxrwxrwx));
 
   try (HTable table = 
(HTable)TEST_UTIL.getConnection().getTable(tableName)) {
-TEST_UTIL.waitTableEnabled(tableName);
+TEST_UTIL.waitUntilAllRegionsAssigned(tableName);
 LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf);
 loader.doBulkLoad(loadPath, table);
   }
@@ -2101,13 +2101,13 @@ public class TestAccessController extends 
SecureTestUtil {
 String namespace = testNamespaceUserGrant;
 NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
 TEST_UTIL.getMiniHBaseCluster().getMaster().createNamespace(desc);
-
+
 // Grant namespace READ to USER_NONE, this should supersede any table 
permissions
 grantOnNamespace(TEST_UTIL, USER_NONE.getShortName(), namespace, 
Permission.Action.READ);
 
 // Now USER_NONE should be able to read also
 verifyAllowed(getAction, USER_NONE);
-
+
 TEST_UTIL.getMiniHBaseCluster().getMaster().deleteNamespace(namespace);
   }
 
@@ -2320,7 +2320,7 @@ public class TestAccessController extends SecureTestUtil {
 // Verify that EXEC permission is checked correctly
 verifyDenied(execEndpointAction, userB);
 verifyAllowed(execEndpointAction, userA);
-
+
 String namespace = testCoprocessorExec;
 NamespaceDescriptor desc = NamespaceDescriptor.create(namespace).build();
 TEST_UTIL.getMiniHBaseCluster().getMaster().createNamespace(desc);
@@ -2330,7 +2330,7 @@ public class TestAccessController extends SecureTestUtil {
 
 // User B should now be allowed also
 verifyAllowed(execEndpointAction, userA, userB);
-
+
 TEST_UTIL.getMiniHBaseCluster().getMaster().deleteNamespace(namespace);
   }
 



[1/2] hbase git commit: TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta - ADDENDUM

2015-03-19 Thread mbertozzi
Repository: hbase
Updated Branches:
  refs/heads/branch-1 1f7b7781a - f6095adea
  refs/heads/master 6a95dd355 - b728e6670


TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta - ADDENDUM


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b728e667
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b728e667
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b728e667

Branch: refs/heads/master
Commit: b728e66708cba45e1a030a8e06971a3c9d431dc7
Parents: 6a95dd3
Author: Esteban Gutierrez este...@cloudera.com
Authored: Wed Mar 18 18:02:35 2015 -0700
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 20:35:12 2015 +

--
 .../master/handler/TestEnableTableHandler.java  | 95 +++-
 1 file changed, 92 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/b728e667/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
index 6788d7d..f5c8b90 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
@@ -21,6 +21,7 @@ package org.apache.hadoop.hbase.master.handler;
 import java.util.ArrayList;
 import java.util.List;
 import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
@@ -43,6 +44,10 @@ import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.coprocessor.BaseMasterObserver;
+import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
+import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -54,6 +59,7 @@ import org.junit.experimental.categories.Category;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 @Category({ MasterTests.class, MediumTests.class })
 public class TestEnableTableHandler {
@@ -63,6 +69,8 @@ public class TestEnableTableHandler {
 
   @Before
   public void setUp() throws Exception {
+
TEST_UTIL.getConfiguration().set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
+  MasterSyncObserver.class.getName());
 TEST_UTIL.startMiniCluster(1);
   }
 
@@ -140,7 +148,12 @@ public class TestEnableTableHandler {
 final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
 final HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.addFamily(new HColumnDescriptor(FAMILYNAME));
-admin.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+try {
+  createTable(TEST_UTIL, desc, 
HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+} catch (Exception e) {
+  e.printStackTrace();
+  fail(Got an exception while creating  + tableName);
+}
 // Now I have a nice table, mangle it by removing the 
HConstants.REGIONINFO_QUALIFIER_STR
 // content from a few of the rows.
 try (Table metaTable = 
TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME)) {
@@ -157,8 +170,13 @@ public class TestEnableTableHandler {
   }
   admin.disableTable(tableName);
   TEST_UTIL.waitTableDisabled(tableName.getName());
-  // Presume this synchronous all is.
-  admin.deleteTable(tableName);
+  // Rely on the coprocessor based latch to make the operation synchronous.
+  try {
+deleteTable(TEST_UTIL, tableName);
+  } catch (Exception e) {
+e.printStackTrace();
+fail(Got an exception while deleting  + tableName);
+  }
   int rowCount = 0;
   try (ResultScanner scanner =
   
metaTable.getScanner(MetaTableAccessor.getScanForTableName(TEST_UTIL.getConnection(),
 tableName))) {
@@ -170,4 +188,75 @@ public class TestEnableTableHandler {
   assertEquals(0, rowCount);
 }
   }
+
+  public  static class MasterSyncObserver extends BaseMasterObserver {
+volatile CountDownLatch tableCreationLatch = null;
+volatile CountDownLatch tableDeletionLatch = null;
+
+@Override
+public void postCreateTableHandler(final 

[2/2] hbase git commit: TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta - ADDENDUM

2015-03-19 Thread mbertozzi
TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta - ADDENDUM


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f6095ade
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f6095ade
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f6095ade

Branch: refs/heads/branch-1
Commit: f6095adea64912deaebfaf2a6a5881b820d315b2
Parents: 1f7b778
Author: Esteban Gutierrez este...@cloudera.com
Authored: Wed Mar 18 18:02:35 2015 -0700
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 21:01:38 2015 +

--
 .../master/handler/TestEnableTableHandler.java  | 109 +--
 1 file changed, 97 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/f6095ade/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
index 5266975..87b6e9b 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
@@ -18,7 +18,8 @@
  */
 package org.apache.hadoop.hbase.master.handler;
 
-import java.util.Collections;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -32,11 +33,18 @@ import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.ResultScanner;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.coprocessor.BaseMasterObserver;
+import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;
+import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.FSTableDescriptors;
 import org.apache.hadoop.hbase.util.JVMClusterUtil;
 import org.junit.After;
 import org.junit.Before;
@@ -45,13 +53,7 @@ import org.junit.experimental.categories.Category;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.ResultScanner;
-import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Table;
+import static org.junit.Assert.fail;
 
 @Category({ MediumTests.class })
 public class TestEnableTableHandler {
@@ -62,6 +64,8 @@ public class TestEnableTableHandler {
   @Before
   public void setUp() throws Exception {
 TEST_UTIL.getConfiguration().set(hbase.balancer.tablesOnMaster, 
hbase:meta);
+
TEST_UTIL.getConfiguration().set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
+  MasterSyncObserver.class.getName());
 TEST_UTIL.startMiniCluster(1);
   }
 
@@ -122,7 +126,12 @@ public class TestEnableTableHandler {
 final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
 final HTableDescriptor desc = new HTableDescriptor(tableName);
 desc.addFamily(new HColumnDescriptor(FAMILYNAME));
-admin.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+try {
+  createTable(TEST_UTIL, desc, 
HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+} catch (Exception e) {
+  e.printStackTrace();
+  fail(Got an exception while creating  + tableName);
+}
 // Now I have a nice table, mangle it by removing the 
HConstants.REGIONINFO_QUALIFIER_STR
 // content from a few of the rows.
 try (Table metaTable = 
TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME)) {
@@ -139,8 +148,13 @@ public class TestEnableTableHandler {
   }
   admin.disableTable(tableName);
   TEST_UTIL.waitTableDisabled(tableName.getName());
-  // Presume this synchronous all is.
-  admin.deleteTable(tableName);
+  // Rely on the coprocessor based latch to make the operation synchronous.
+  try {
+deleteTable(TEST_UTIL, tableName);
+  } catch (Exception e) {
+e.printStackTrace();
+fail(Got an exception while deleting  + 

[3/4] hbase git commit: Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

2015-03-19 Thread larsh
Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

This reverts commit 2583e8de574ae4b002c5dbc80b0da666b42dd699.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/be95f532
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/be95f532
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/be95f532

Branch: refs/heads/branch-1.0
Commit: be95f5329ae4603e727fb1ac5102edb1e7d2d3a2
Parents: bc029b9
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 14:19:41 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 14:21:07 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 --
 2 files changed, 2 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/be95f532/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 4411343..a4e6784 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -607,9 +607,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is 2MB.
+   * The default value is unlimited.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/be95f532/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index 6c7fa12..ad28368 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1157,16 +1157,6 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
-namehbase.client.scanner.max.result.size/name
-value2097152/value
-descriptionMaximum number of bytes returned when calling a scanner's 
next method.
-Note that when a single row is larger than this limit the row is still 
returned completely.
-The default value is 2MB, which is good for 1ge networks.
-With faster and/or high latency networks this value should be increased.
-/description
-  /property
-
-  property
 namehbase.status.published/name
 valuefalse/value
 description



[4/4] hbase git commit: Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

2015-03-19 Thread larsh
Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

This reverts commit 2583e8de574ae4b002c5dbc80b0da666b42dd699.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e5a5c13c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e5a5c13c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e5a5c13c

Branch: refs/heads/0.98
Commit: e5a5c13c5b166aae5afa074b35f675ca6b514a48
Parents: cab71fd
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 14:19:41 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 14:21:30 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 --
 2 files changed, 2 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/e5a5c13c/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 2c6c7ec..57957ff 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -580,9 +580,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is 2MB.
+   * The default value is unlimited.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/e5a5c13c/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index f4c5e57..ece1559 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1138,16 +1138,6 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
-namehbase.client.scanner.max.result.size/name
-value2097152/value
-descriptionMaximum number of bytes returned when calling a scanner's 
next method.
-Note that when a single row is larger than this limit the row is still 
returned completely.
-The default value is 2MB, which is good for 1ge networks.
-With faster and/or high latency networks this value should be increased.
-/description
-  /property
-
-  property
 namehbase.status.published/name
 valuefalse/value
 description



[2/4] hbase git commit: Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

2015-03-19 Thread larsh
Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

This reverts commit 2583e8de574ae4b002c5dbc80b0da666b42dd699.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/aad299fa
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/aad299fa
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/aad299fa

Branch: refs/heads/branch-1
Commit: aad299fabacdb1cb47573fa9068967aea0a6e450
Parents: f6095ad
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 14:19:41 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 14:20:46 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 --
 2 files changed, 2 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/aad299fa/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 4429d81..2658868 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -607,9 +607,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is 2MB.
+   * The default value is unlimited.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/aad299fa/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index df1894b..e72484a 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1179,16 +1179,6 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
-namehbase.client.scanner.max.result.size/name
-value2097152/value
-descriptionMaximum number of bytes returned when calling a scanner's 
next method.
-Note that when a single row is larger than this limit the row is still 
returned completely.
-The default value is 2MB, which is good for 1ge networks.
-With faster and/or high latency networks this value should be increased.
-/description
-  /property
-
-  property
 namehbase.status.published/name
 valuefalse/value
 description



[1/4] hbase git commit: Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

2015-03-19 Thread larsh
Repository: hbase
Updated Branches:
  refs/heads/0.98 cab71fd86 - e5a5c13c5
  refs/heads/branch-1 f6095adea - aad299fab
  refs/heads/branch-1.0 bc029b9ea - be95f5329
  refs/heads/master b728e6670 - 64589abe9


Revert HBASE-12976 Set default value for hbase.client.scanner.max.result.size.

This reverts commit 2583e8de574ae4b002c5dbc80b0da666b42dd699.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/64589abe
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/64589abe
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/64589abe

Branch: refs/heads/master
Commit: 64589abe9936337fcbccdbe82e538d05020c8ee4
Parents: b728e66
Author: Lars Hofhansl la...@apache.org
Authored: Thu Mar 19 14:19:41 2015 -0700
Committer: Lars Hofhansl la...@apache.org
Committed: Thu Mar 19 14:19:41 2015 -0700

--
 .../src/main/java/org/apache/hadoop/hbase/HConstants.java |  4 ++--
 hbase-common/src/main/resources/hbase-default.xml | 10 --
 2 files changed, 2 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/64589abe/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
--
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
index 19e251a..7d93904 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
@@ -624,9 +624,9 @@ public final class HConstants {
* Note that when a single row is larger than this limit the row is still
* returned completely.
*
-   * The default value is 2MB.
+   * The default value is unlimited.
*/
-  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 2 * 
1024 * 1024;
+  public static final long DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE = 
Long.MAX_VALUE;
 
   /**
* Parameter name for client pause value, used mostly as value to wait

http://git-wip-us.apache.org/repos/asf/hbase/blob/64589abe/hbase-common/src/main/resources/hbase-default.xml
--
diff --git a/hbase-common/src/main/resources/hbase-default.xml 
b/hbase-common/src/main/resources/hbase-default.xml
index a3092b5..69017f6 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -1290,16 +1290,6 @@ possible configurations would overwhelm and obscure the 
important.
   /property
 
   property
-namehbase.client.scanner.max.result.size/name
-value2097152/value
-descriptionMaximum number of bytes returned when calling a scanner's 
next method.
-Note that when a single row is larger than this limit the row is still 
returned completely.
-The default value is 2MB, which is good for 1ge networks.
-With faster and/or high latency networks this value should be increased.
-/description
-  /property
-
-  property
 namehbase.status.published/name
 valuefalse/value
 description



[3/3] hbase git commit: HBASE-13241 Add tests for group level grants

2015-03-19 Thread mbertozzi
HBASE-13241 Add tests for group level grants


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2bf904f2
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2bf904f2
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2bf904f2

Branch: refs/heads/master
Commit: 2bf904f216ab8315c37a65e4860f51c526a3b654
Parents: 64589ab
Author: Ashish Singhi ashish.sin...@huawei.com
Authored: Thu Mar 19 15:48:12 2015 +0530
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 21:39:12 2015 +

--
 .../security/access/TestAccessController2.java  | 229 ++-
 1 file changed, 226 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/2bf904f2/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
index 80c4fac..9e10104 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
@@ -17,20 +17,26 @@
  */
 package org.apache.hadoop.hbase.security.access;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.NamespaceDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
@@ -42,7 +48,9 @@ import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.testclassification.SecurityTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.TestTableName;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
@@ -50,6 +58,7 @@ import org.junit.experimental.categories.Category;
 
 @Category({SecurityTests.class, LargeTests.class})
 public class TestAccessController2 extends SecureTestUtil {
+  private static final Log LOG = 
LogFactory.getLog(TestAccessController2.class);
 
   private static final byte[] TEST_ROW = Bytes.toBytes(test);
   private static final byte[] TEST_FAMILY = Bytes.toBytes(f);
@@ -59,7 +68,29 @@ public class TestAccessController2 extends SecureTestUtil {
   private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static Configuration conf;
 
-  @Rule public TestTableName TEST_TABLE = new TestTableName();
+  private static Connection connection;
+
+  private final static byte[] Q1 = Bytes.toBytes(q1);
+  private final static byte[] value1 = Bytes.toBytes(value1);
+
+  private static byte[] TEST_FAMILY_2 = Bytes.toBytes(f2);
+  private static byte[] TEST_ROW_2 = Bytes.toBytes(r2);
+  private final static byte[] Q2 = Bytes.toBytes(q2);
+  private final static byte[] value2 = Bytes.toBytes(value2);
+
+  private static byte[] TEST_ROW_3 = Bytes.toBytes(r3);
+
+  private static final String TESTGROUP_1 = testgroup_1;
+  private static final String TESTGROUP_2 = testgroup_2;
+
+  private static User TESTGROUP1_USER1;
+  private static User TESTGROUP2_USER1;
+
+  @Rule
+  public TestTableName TEST_TABLE = new TestTableName();
+  private String namespace = testNamespace;
+  private String tname = namespace + :testtable1;
+  private TableName tableName = TableName.valueOf(tname);
 
   @BeforeClass
   public static void setupBeforeClass() throws Exception {
@@ -70,14 +101,72 @@ public class TestAccessController2 extends SecureTestUtil {
 verifyConfiguration(conf);
 TEST_UTIL.startMiniCluster();
 // Wait for the ACL table to become available
-TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
+TEST_UTIL.waitUntilAllRegionsAssigned(AccessControlLists.ACL_TABLE_NAME);
+
+

[2/3] hbase git commit: HBASE-13241 Add tests for group level grants

2015-03-19 Thread mbertozzi
HBASE-13241 Add tests for group level grants


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/aceb4e80
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/aceb4e80
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/aceb4e80

Branch: refs/heads/branch-1.0
Commit: aceb4e804ddeebfbc769c1685b7846e59f2eb6e8
Parents: be95f53
Author: Ashish Singhi ashish.sin...@huawei.com
Authored: Thu Mar 19 15:48:12 2015 +0530
Committer: Matteo Bertozzi matteo.berto...@cloudera.com
Committed: Thu Mar 19 21:38:59 2015 +

--
 .../security/access/TestAccessController2.java  | 226 ++-
 1 file changed, 223 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/aceb4e80/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
index 2736164..316105c 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController2.java
@@ -17,17 +17,23 @@
  */
 package org.apache.hadoop.hbase.security.access;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.testclassification.LargeTests;
+import org.apache.hadoop.hbase.NamespaceDescriptor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.TableNotFoundException;
 import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.ConnectionFactory;
@@ -36,11 +42,15 @@ import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.security.access.Permission.Action;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.TestTableName;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
@@ -48,6 +58,7 @@ import org.junit.experimental.categories.Category;
 
 @Category(LargeTests.class)
 public class TestAccessController2 extends SecureTestUtil {
+  private static final Log LOG = 
LogFactory.getLog(TestAccessController2.class);
 
   private static final byte[] TEST_ROW = Bytes.toBytes(test);
   private static final byte[] TEST_FAMILY = Bytes.toBytes(f);
@@ -57,7 +68,29 @@ public class TestAccessController2 extends SecureTestUtil {
   private static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static Configuration conf;
 
-  @Rule public TestTableName TEST_TABLE = new TestTableName();
+  private static Connection connection;
+
+  private final static byte[] Q1 = Bytes.toBytes(q1);
+  private final static byte[] value1 = Bytes.toBytes(value1);
+
+  private static byte[] TEST_FAMILY_2 = Bytes.toBytes(f2);
+  private static byte[] TEST_ROW_2 = Bytes.toBytes(r2);
+  private final static byte[] Q2 = Bytes.toBytes(q2);
+  private final static byte[] value2 = Bytes.toBytes(value2);
+
+  private static byte[] TEST_ROW_3 = Bytes.toBytes(r3);
+
+  private static final String TESTGROUP_1 = testgroup_1;
+  private static final String TESTGROUP_2 = testgroup_2;
+
+  private static User TESTGROUP1_USER1;
+  private static User TESTGROUP2_USER1;
+
+  @Rule
+  public TestTableName TEST_TABLE = new TestTableName();
+  private String namespace = testNamespace;
+  private String tname = namespace + :testtable1;
+  private TableName tableName = TableName.valueOf(tname);
 
   @BeforeClass
   public static void setupBeforeClass() throws Exception {
@@ -68,14 +101,67 @@ public class TestAccessController2 extends SecureTestUtil {
 verifyConfiguration(conf);
 TEST_UTIL.startMiniCluster();
 // Wait for the ACL table to become available
-