incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1302915 - in /incubator/accumulo/trunk: ./ examples/ examples/wikisearch/query-war/ examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java
Date Tue, 20 Mar 2012 14:34:26 GMT
Author: ecn
Date: Tue Mar 20 14:34:25 2012
New Revision: 1302915

URL: http://svn.apache.org/viewvc?rev=1302915&view=rev
Log:
ACCUMULO-474: merge to trunk

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/examples/   (props changed)
    incubator/accumulo/trunk/examples/wikisearch/query-war/   (props changed)
    incubator/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
  Merged /incubator/accumulo/branches/1.4:r1302914

Propchange: incubator/accumulo/trunk/examples/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 20 14:34:25 2012
@@ -1,7 +1,5 @@
 target
-
 .settings
-
 .classpath
-
 .project
+lib

Propchange: incubator/accumulo/trunk/examples/wikisearch/query-war/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 20 14:34:25 2012
@@ -1,2 +1,3 @@
 .*
 target
+lib

Modified: incubator/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java?rev=1302915&r1=1302914&r2=1302915&view=diff
==============================================================================
--- incubator/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java
(original)
+++ incubator/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/EvaluatingIterator.java
Tue Mar 20 14:34:25 2012
@@ -30,12 +30,14 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.examples.wikisearch.parser.EventFields;
 import org.apache.accumulo.examples.wikisearch.parser.EventFields.FieldValue;
+import org.apache.commons.collections.map.LRUMap;
 import org.apache.hadoop.io.Text;
 
 
 public class EvaluatingIterator extends AbstractEvaluatingIterator {
   
   public static final String NULL_BYTE_STRING = "\u0000";
+  LRUMap visibilityMap = new LRUMap();
   
   public EvaluatingIterator() {
     super();
@@ -78,7 +80,20 @@ public class EvaluatingIterator extends 
     String fieldName = colq.substring(0, idx);
     String fieldValue = colq.substring(idx + 1);
     
-    event.put(fieldName, new FieldValue(new ColumnVisibility(key.getColumnVisibility().getBytes()),
fieldValue.getBytes()));
+    event.put(fieldName, new FieldValue(getColumnVisibility(key), fieldValue.getBytes()));
+  }
+
+  /**
+   * @param key
+   * @return
+   */
+  public ColumnVisibility getColumnVisibility(Key key) {
+    ColumnVisibility result = (ColumnVisibility) visibilityMap.get(key.getColumnVisibility());
+    if (result != null) 
+      return result;
+    result = new ColumnVisibility(key.getColumnVisibility().getBytes());
+    visibilityMap.put(key.getColumnVisibility(), result);
+    return result;
   }
   
   /**



Mime
View raw message