accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1449793 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/client/ core/src/main/java/org/apache/accumulo/core/client/mapred/ core/src/main/java/org/apache/accumulo/core/client/mapreduce/ core/src/main/java/org/apache...
Date Mon, 25 Feb 2013 18:15:46 GMT
Author: vines
Date: Mon Feb 25 18:15:46 2013
New Revision: 1449793

URL: http://svn.apache.org/r1449793
Log:
ACCUMULO-670 ACCUMULO-765 - addressed minor api change


Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
    accumulo/branches/1.5/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/TestIngest.java
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
Mon Feb 25 18:15:46 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.client;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -67,8 +68,17 @@ public class MutationsRejectedException 
   
   /**
    * @return the internal list of authorization failures
+   * @deprecated since 1.5, see {@link #getAuthorizationFailuresMap()}
    */
-  public Map<KeyExtent,Set<SecurityErrorCode>> getAuthorizationFailures() {
+  List<KeyExtent> getAuthorizationFailures() {
+    return new ArrayList<KeyExtent>(af.keySet());
+  }
+  
+  /**
+   * 
+   * @return the internal mapping of keyextent mappings to SecurityErrorCode
+   */
+  public Map<KeyExtent,Set<SecurityErrorCode>> getAuthorizationFailuresMap()
{
     return af;
   }
   

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
Mon Feb 25 18:15:46 2013
@@ -483,9 +483,9 @@ public class AccumuloOutputFormat implem
       try {
         mtbw.close();
       } catch (MutationsRejectedException e) {
-        if (e.getAuthorizationFailures().size() >= 0) {
+        if (e.getAuthorizationFailuresMap().size() >= 0) {
           HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<String,Set<SecurityErrorCode>>();
-          for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailures().entrySet())
{
+          for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailuresMap().entrySet())
{
             Set<SecurityErrorCode> secCodes = tables.get(ke.getKey().getTableId().toString());
             if (secCodes == null) {
               secCodes = new HashSet<SecurityErrorCode>();

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
Mon Feb 25 18:15:46 2013
@@ -487,9 +487,9 @@ public class AccumuloOutputFormat extend
       try {
         mtbw.close();
       } catch (MutationsRejectedException e) {
-        if (e.getAuthorizationFailures().size() >= 0) {
+        if (e.getAuthorizationFailuresMap().size() >= 0) {
           HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<String,Set<SecurityErrorCode>>();
-          for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailures().entrySet())
{
+          for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailuresMap().entrySet())
{
             Set<SecurityErrorCode> secCodes = tables.get(ke.getKey().getTableId().toString());
             if (secCodes == null) {
               secCodes = new HashSet<SecurityErrorCode>();

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/shell/commands/InsertCommand.java
Mon Feb 25 18:15:46 2013
@@ -85,10 +85,10 @@ public class InsertCommand extends Comma
       bw.close();
     } catch (MutationsRejectedException e) {
       final ArrayList<String> lines = new ArrayList<String>();
-      if (e.getAuthorizationFailures().isEmpty() == false) {
+      if (e.getAuthorizationFailuresMap().isEmpty() == false) {
         lines.add("	Authorization Failures:");
       }
-      for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : e.getAuthorizationFailures().entrySet())
{
+      for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : e.getAuthorizationFailuresMap().entrySet())
{
         lines.add("		" + entry);
       }
       if (e.getConstraintViolationSummaries().isEmpty() == false) {

Modified: accumulo/branches/1.5/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
(original)
+++ accumulo/branches/1.5/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
Mon Feb 25 18:15:46 2013
@@ -148,9 +148,9 @@ public class RandomBatchWriter {
     try {
       bw.close();
     } catch (MutationsRejectedException e) {
-      if (e.getAuthorizationFailures().size() > 0) {
+      if (e.getAuthorizationFailuresMap().size() > 0) {
         HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<String,Set<SecurityErrorCode>>();
-        for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailures().entrySet())
{
+        for (Entry<KeyExtent,Set<SecurityErrorCode>> ke : e.getAuthorizationFailuresMap().entrySet())
{
           Set<SecurityErrorCode> secCodes = tables.get(ke.getKey().getTableId().toString());
           if (secCodes == null) {
             secCodes = new HashSet<SecurityErrorCode>();

Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/TestIngest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/TestIngest.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/TestIngest.java (original)
+++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/TestIngest.java Mon
Feb 25 18:15:46 2013
@@ -303,8 +303,8 @@ public class TestIngest {
         try {
           bw.close();
         } catch (MutationsRejectedException e) {
-          if (e.getAuthorizationFailures().size() > 0) {
-            for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : e.getAuthorizationFailures().entrySet())
{
+          if (e.getAuthorizationFailuresMap().size() > 0) {
+            for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : e.getAuthorizationFailuresMap().entrySet())
{
               System.err.println("ERROR : Not authorized to write to : " + entry.getKey()
+ " due to " + entry.getValue());
             }
           }

Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java?rev=1449793&r1=1449792&r2=1449793&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
(original)
+++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
Mon Feb 25 18:15:46 2013
@@ -392,7 +392,7 @@ public class PermissionsTest {
             try {
               writer.close();
             } catch (MutationsRejectedException e1) {
-              if (e1.getAuthorizationFailures().size() > 0)
+              if (e1.getAuthorizationFailuresMap().size() > 0)
                 throw new AccumuloSecurityException(test_user_conn.whoami(), SecurityErrorCode.PERMISSION_DENIED,
e1);
             }
             throw new IllegalStateException("Should NOT be able to write to a table");



Mime
View raw message