You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2013/02/25 01:59:00 UTC

svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Author: elserj
Date: Mon Feb 25 00:59:00 2013
New Revision: 1449573

URL: http://svn.apache.org/r1449573
Log:
ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as a ColumnVisibility instead of only a Text.

Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
    accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java Mon Feb 25 00:59:00 2013
@@ -478,6 +478,17 @@ public class Key implements WritableComp
   }
   
   /**
+   * This method creates a new ColumnVisibility representing the column visibility for this key
+   * 
+   * WARNING: using this method may inhibit performance since a new ColumnVisibility object is created on every call.
+   * 
+   * @return A new object representing the column visibility field
+   */
+  public final ColumnVisibility getColumnVisibilityParsed() {
+    return new ColumnVisibility(colVisibility);
+  }
+  
+  /**
    * Sets this key's row, column family, column qualifier, column visibility, timestamp, and delete marker to be the same as another key's.
    */
   public void set(Key k) {

Modified: accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java (original)
+++ accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java Mon Feb 25 00:59:00 2013
@@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
 
 import junit.framework.TestCase;
 
+import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.hadoop.io.Text;
 
 public class KeyTest extends TestCase {
@@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
     Key k = new Key("r", "f", "q", "v");
     assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(), "r f:q [v%00;] " + Long.MAX_VALUE + " false");
   }
+  
+  public void testVisibilityGetters() {
+    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
+    
+    Text expression = k.getColumnVisibility();
+    ColumnVisibility parsed = k.getColumnVisibilityParsed();
+    
+    assertEquals(expression, new Text(parsed.getExpression()));
+  }
 }



Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Josh Elser <jo...@gmail.com>.
I just modified my previous message. I'll try to remember to add the 
contributor's name in the commit message as well.

On 02/25/2013 11:24 AM, Billie Rinaldi wrote:
> On Mon, Feb 25, 2013 at 7:33 AM, Keith Turner <ke...@deenlo.com> wrote:
>
>> On Mon, Feb 25, 2013 at 10:24 AM, Josh Elser <jo...@gmail.com> wrote:
>>> I figured the reference to the ticket being assigned to the contributor
>> was
>>> sufficient.
>>
>> Someone would have to do the join.  Automated web/svn indexing tools
>> will probably no do this join.    If you were a contributor to another
>> project, would this matter to you?
>>
>
> Not infrequently, I find myself analyzing svn and git logs to understand
> people's contributions to a project and sometimes to get an idea of their
> coding styles.  This process would be made easier if patch author were
> included in the log message as Keith suggests, so I'm in favor of that idea.
>
> Every time a committer applies someone else's patch, a kitten gets its
> wings.
>
> Billie
>
>
>
>>
>>>
>>>
>>> On 2/25/13 10:11 AM, Keith Turner wrote:
>>>>
>>>> On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
>>>>>
>>>>> Author: elserj
>>>>> Date: Mon Feb 25 00:59:00 2013
>>>>> New Revision: 1449573
>>>>>
>>>>> URL: http://svn.apache.org/r1449573
>>>>> Log:
>>>>> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as
>> a
>>>>> ColumnVisibility instead of only a Text.
>>>>
>>>> When applying a patch for someone else, I think we should include
>>>> their name in the svn commit msg.   You can edit commit messages if
>>>> you agree :)
>>>>
>>>>> Modified:
>>>>>
>>>>>
>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>>>
>>>>>
>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>>>
>>>>> Modified:
>>>>>
>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>>> URL:
>>>>>
>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>>>
>>>>>
>> ==============================================================================
>>>>> ---
>>>>>
>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>>> (original)
>>>>> +++
>>>>>
>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>>> Mon Feb 25 00:59:00 2013
>>>>> @@ -478,6 +478,17 @@ public class Key implements WritableComp
>>>>>      }
>>>>>
>>>>>      /**
>>>>> +   * This method creates a new ColumnVisibility representing the
>> column
>>>>> visibility for this key
>>>>> +   *
>>>>> +   * WARNING: using this method may inhibit performance since a new
>>>>> ColumnVisibility object is created on every call.
>>>>> +   *
>>>>> +   * @return A new object representing the column visibility field
>>>>> +   */
>>>>> +  public final ColumnVisibility getColumnVisibilityParsed() {
>>>>> +    return new ColumnVisibility(colVisibility);
>>>>> +  }
>>>>> +
>>>>> +  /**
>>>>>       * Sets this key's row, column family, column qualifier, column
>>>>> visibility, timestamp, and delete marker to be the same as another
>> key's.
>>>>>       */
>>>>>      public void set(Key k) {
>>>>>
>>>>> Modified:
>>>>>
>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>>> URL:
>>>>>
>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>>>
>>>>>
>> ==============================================================================
>>>>> ---
>>>>>
>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>>> (original)
>>>>> +++
>>>>>
>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>>> Mon Feb 25 00:59:00 2013
>>>>> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
>>>>>
>>>>>    import junit.framework.TestCase;
>>>>>
>>>>> +import org.apache.accumulo.core.security.ColumnVisibility;
>>>>>    import org.apache.hadoop.io.Text;
>>>>>
>>>>>    public class KeyTest extends TestCase {
>>>>> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
>>>>>        Key k = new Key("r", "f", "q", "v");
>>>>>
>>>>>
>> assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(),
>>>>> "r f:q [v%00;] " + Long.MAX_VALUE + " false");
>>>>>      }
>>>>> +
>>>>> +  public void testVisibilityGetters() {
>>>>> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
>>>>> +
>>>>> +    Text expression = k.getColumnVisibility();
>>>>> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
>>>>> +
>>>>> +    assertEquals(expression, new Text(parsed.getExpression()));
>>>>> +  }
>>>>>    }
>>>>>
>>>>>
>>>
>>
>

Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Billie Rinaldi <bi...@apache.org>.
On Mon, Feb 25, 2013 at 7:33 AM, Keith Turner <ke...@deenlo.com> wrote:

> On Mon, Feb 25, 2013 at 10:24 AM, Josh Elser <jo...@gmail.com> wrote:
> > I figured the reference to the ticket being assigned to the contributor
> was
> > sufficient.
>
> Someone would have to do the join.  Automated web/svn indexing tools
> will probably no do this join.    If you were a contributor to another
> project, would this matter to you?
>

Not infrequently, I find myself analyzing svn and git logs to understand
people's contributions to a project and sometimes to get an idea of their
coding styles.  This process would be made easier if patch author were
included in the log message as Keith suggests, so I'm in favor of that idea.

Every time a committer applies someone else's patch, a kitten gets its
wings.

Billie



>
> >
> >
> > On 2/25/13 10:11 AM, Keith Turner wrote:
> >>
> >> On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
> >>>
> >>> Author: elserj
> >>> Date: Mon Feb 25 00:59:00 2013
> >>> New Revision: 1449573
> >>>
> >>> URL: http://svn.apache.org/r1449573
> >>> Log:
> >>> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as
> a
> >>> ColumnVisibility instead of only a Text.
> >>
> >> When applying a patch for someone else, I think we should include
> >> their name in the svn commit msg.   You can edit commit messages if
> >> you agree :)
> >>
> >>> Modified:
> >>>
> >>>
> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
> >>>
> >>>
> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
> >>>
> >>> Modified:
> >>>
> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
> >>>
> >>>
> ==============================================================================
> >>> ---
> >>>
> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
> >>> (original)
> >>> +++
> >>>
> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
> >>> Mon Feb 25 00:59:00 2013
> >>> @@ -478,6 +478,17 @@ public class Key implements WritableComp
> >>>     }
> >>>
> >>>     /**
> >>> +   * This method creates a new ColumnVisibility representing the
> column
> >>> visibility for this key
> >>> +   *
> >>> +   * WARNING: using this method may inhibit performance since a new
> >>> ColumnVisibility object is created on every call.
> >>> +   *
> >>> +   * @return A new object representing the column visibility field
> >>> +   */
> >>> +  public final ColumnVisibility getColumnVisibilityParsed() {
> >>> +    return new ColumnVisibility(colVisibility);
> >>> +  }
> >>> +
> >>> +  /**
> >>>      * Sets this key's row, column family, column qualifier, column
> >>> visibility, timestamp, and delete marker to be the same as another
> key's.
> >>>      */
> >>>     public void set(Key k) {
> >>>
> >>> Modified:
> >>>
> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
> >>> URL:
> >>>
> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
> >>>
> >>>
> ==============================================================================
> >>> ---
> >>>
> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
> >>> (original)
> >>> +++
> >>>
> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
> >>> Mon Feb 25 00:59:00 2013
> >>> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
> >>>
> >>>   import junit.framework.TestCase;
> >>>
> >>> +import org.apache.accumulo.core.security.ColumnVisibility;
> >>>   import org.apache.hadoop.io.Text;
> >>>
> >>>   public class KeyTest extends TestCase {
> >>> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
> >>>       Key k = new Key("r", "f", "q", "v");
> >>>
> >>>
> assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(),
> >>> "r f:q [v%00;] " + Long.MAX_VALUE + " false");
> >>>     }
> >>> +
> >>> +  public void testVisibilityGetters() {
> >>> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
> >>> +
> >>> +    Text expression = k.getColumnVisibility();
> >>> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
> >>> +
> >>> +    assertEquals(expression, new Text(parsed.getExpression()));
> >>> +  }
> >>>   }
> >>>
> >>>
> >
>

Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Josh Elser <jo...@gmail.com>.
Personally, I would argue that the assignee to the contributor on Jira 
is sufficient and is just as likely to be indexed by search engines, but 
I do think that the assignee attribute on the Jira issue is very 
important from a recognition standpoint.

I will admit that I thought about adding Luke's name to the message and 
immediately thought, "his name is already on the ticket which is 
mentioned right there". No offense intended to Luke, I merely didn't 
think it mattered.

If we want to make this the normal action when applying a patch, that's 
fine. It's not painful or anything to have the committer include the 
name in the message.

On 2/25/13 10:33 AM, Keith Turner wrote:
> On Mon, Feb 25, 2013 at 10:24 AM, Josh Elser <jo...@gmail.com> wrote:
>> I figured the reference to the ticket being assigned to the contributor was
>> sufficient.
> Someone would have to do the join.  Automated web/svn indexing tools
> will probably no do this join.    If you were a contributor to another
> project, would this matter to you?
>
>>
>> On 2/25/13 10:11 AM, Keith Turner wrote:
>>> On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
>>>> Author: elserj
>>>> Date: Mon Feb 25 00:59:00 2013
>>>> New Revision: 1449573
>>>>
>>>> URL: http://svn.apache.org/r1449573
>>>> Log:
>>>> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as a
>>>> ColumnVisibility instead of only a Text.
>>> When applying a patch for someone else, I think we should include
>>> their name in the svn commit msg.   You can edit commit messages if
>>> you agree :)
>>>
>>>> Modified:
>>>>
>>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>>
>>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>>
>>>> Modified:
>>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>> URL:
>>>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>>
>>>> ==============================================================================
>>>> ---
>>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>> (original)
>>>> +++
>>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>> Mon Feb 25 00:59:00 2013
>>>> @@ -478,6 +478,17 @@ public class Key implements WritableComp
>>>>      }
>>>>
>>>>      /**
>>>> +   * This method creates a new ColumnVisibility representing the column
>>>> visibility for this key
>>>> +   *
>>>> +   * WARNING: using this method may inhibit performance since a new
>>>> ColumnVisibility object is created on every call.
>>>> +   *
>>>> +   * @return A new object representing the column visibility field
>>>> +   */
>>>> +  public final ColumnVisibility getColumnVisibilityParsed() {
>>>> +    return new ColumnVisibility(colVisibility);
>>>> +  }
>>>> +
>>>> +  /**
>>>>       * Sets this key's row, column family, column qualifier, column
>>>> visibility, timestamp, and delete marker to be the same as another key's.
>>>>       */
>>>>      public void set(Key k) {
>>>>
>>>> Modified:
>>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>> URL:
>>>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>>
>>>> ==============================================================================
>>>> ---
>>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>> (original)
>>>> +++
>>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>> Mon Feb 25 00:59:00 2013
>>>> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
>>>>
>>>>    import junit.framework.TestCase;
>>>>
>>>> +import org.apache.accumulo.core.security.ColumnVisibility;
>>>>    import org.apache.hadoop.io.Text;
>>>>
>>>>    public class KeyTest extends TestCase {
>>>> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
>>>>        Key k = new Key("r", "f", "q", "v");
>>>>
>>>> assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(),
>>>> "r f:q [v%00;] " + Long.MAX_VALUE + " false");
>>>>      }
>>>> +
>>>> +  public void testVisibilityGetters() {
>>>> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
>>>> +
>>>> +    Text expression = k.getColumnVisibility();
>>>> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
>>>> +
>>>> +    assertEquals(expression, new Text(parsed.getExpression()));
>>>> +  }
>>>>    }
>>>>
>>>>


Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Keith Turner <ke...@deenlo.com>.
On Mon, Feb 25, 2013 at 10:24 AM, Josh Elser <jo...@gmail.com> wrote:
> I figured the reference to the ticket being assigned to the contributor was
> sufficient.

Someone would have to do the join.  Automated web/svn indexing tools
will probably no do this join.    If you were a contributor to another
project, would this matter to you?

>
>
> On 2/25/13 10:11 AM, Keith Turner wrote:
>>
>> On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
>>>
>>> Author: elserj
>>> Date: Mon Feb 25 00:59:00 2013
>>> New Revision: 1449573
>>>
>>> URL: http://svn.apache.org/r1449573
>>> Log:
>>> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as a
>>> ColumnVisibility instead of only a Text.
>>
>> When applying a patch for someone else, I think we should include
>> their name in the svn commit msg.   You can edit commit messages if
>> you agree :)
>>
>>> Modified:
>>>
>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>>
>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>>
>>> Modified:
>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>> URL:
>>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>> (original)
>>> +++
>>> accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>> Mon Feb 25 00:59:00 2013
>>> @@ -478,6 +478,17 @@ public class Key implements WritableComp
>>>     }
>>>
>>>     /**
>>> +   * This method creates a new ColumnVisibility representing the column
>>> visibility for this key
>>> +   *
>>> +   * WARNING: using this method may inhibit performance since a new
>>> ColumnVisibility object is created on every call.
>>> +   *
>>> +   * @return A new object representing the column visibility field
>>> +   */
>>> +  public final ColumnVisibility getColumnVisibilityParsed() {
>>> +    return new ColumnVisibility(colVisibility);
>>> +  }
>>> +
>>> +  /**
>>>      * Sets this key's row, column family, column qualifier, column
>>> visibility, timestamp, and delete marker to be the same as another key's.
>>>      */
>>>     public void set(Key k) {
>>>
>>> Modified:
>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>> URL:
>>> http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>> (original)
>>> +++
>>> accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>> Mon Feb 25 00:59:00 2013
>>> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
>>>
>>>   import junit.framework.TestCase;
>>>
>>> +import org.apache.accumulo.core.security.ColumnVisibility;
>>>   import org.apache.hadoop.io.Text;
>>>
>>>   public class KeyTest extends TestCase {
>>> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
>>>       Key k = new Key("r", "f", "q", "v");
>>>
>>> assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(),
>>> "r f:q [v%00;] " + Long.MAX_VALUE + " false");
>>>     }
>>> +
>>> +  public void testVisibilityGetters() {
>>> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
>>> +
>>> +    Text expression = k.getColumnVisibility();
>>> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
>>> +
>>> +    assertEquals(expression, new Text(parsed.getExpression()));
>>> +  }
>>>   }
>>>
>>>
>

Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Josh Elser <jo...@gmail.com>.
I figured the reference to the ticket being assigned to the contributor 
was sufficient.

On 2/25/13 10:11 AM, Keith Turner wrote:
> On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
>> Author: elserj
>> Date: Mon Feb 25 00:59:00 2013
>> New Revision: 1449573
>>
>> URL: http://svn.apache.org/r1449573
>> Log:
>> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as a ColumnVisibility instead of only a Text.
> When applying a patch for someone else, I think we should include
> their name in the svn commit msg.   You can edit commit messages if
> you agree :)
>
>> Modified:
>>      accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>>      accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>>
>> Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>> URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>> ==============================================================================
>> --- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java (original)
>> +++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java Mon Feb 25 00:59:00 2013
>> @@ -478,6 +478,17 @@ public class Key implements WritableComp
>>     }
>>
>>     /**
>> +   * This method creates a new ColumnVisibility representing the column visibility for this key
>> +   *
>> +   * WARNING: using this method may inhibit performance since a new ColumnVisibility object is created on every call.
>> +   *
>> +   * @return A new object representing the column visibility field
>> +   */
>> +  public final ColumnVisibility getColumnVisibilityParsed() {
>> +    return new ColumnVisibility(colVisibility);
>> +  }
>> +
>> +  /**
>>      * Sets this key's row, column family, column qualifier, column visibility, timestamp, and delete marker to be the same as another key's.
>>      */
>>     public void set(Key k) {
>>
>> Modified: accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>> URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
>> ==============================================================================
>> --- accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java (original)
>> +++ accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java Mon Feb 25 00:59:00 2013
>> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
>>
>>   import junit.framework.TestCase;
>>
>> +import org.apache.accumulo.core.security.ColumnVisibility;
>>   import org.apache.hadoop.io.Text;
>>
>>   public class KeyTest extends TestCase {
>> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
>>       Key k = new Key("r", "f", "q", "v");
>>       assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(), "r f:q [v%00;] " + Long.MAX_VALUE + " false");
>>     }
>> +
>> +  public void testVisibilityGetters() {
>> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
>> +
>> +    Text expression = k.getColumnVisibility();
>> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
>> +
>> +    assertEquals(expression, new Text(parsed.getExpression()));
>> +  }
>>   }
>>
>>


Re: svn commit: r1449573 - in /accumulo/branches/1.5/core/src: main/java/org/apache/accumulo/core/data/Key.java test/java/org/apache/accumulo/core/data/KeyTest.java

Posted by Keith Turner <ke...@deenlo.com>.
On Sun, Feb 24, 2013 at 7:59 PM,  <el...@apache.org> wrote:
> Author: elserj
> Date: Mon Feb 25 00:59:00 2013
> New Revision: 1449573
>
> URL: http://svn.apache.org/r1449573
> Log:
> ACCUMULO-498 Applying patch to retrieve ColumnVisibility from a Key as a ColumnVisibility instead of only a Text.

When applying a patch for someone else, I think we should include
their name in the svn commit msg.   You can edit commit messages if
you agree :)

>
> Modified:
>     accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
>     accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
>
> Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java
> URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1449573&r1=1449572&r2=1449573&view=diff
> ==============================================================================
> --- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java (original)
> +++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/data/Key.java Mon Feb 25 00:59:00 2013
> @@ -478,6 +478,17 @@ public class Key implements WritableComp
>    }
>
>    /**
> +   * This method creates a new ColumnVisibility representing the column visibility for this key
> +   *
> +   * WARNING: using this method may inhibit performance since a new ColumnVisibility object is created on every call.
> +   *
> +   * @return A new object representing the column visibility field
> +   */
> +  public final ColumnVisibility getColumnVisibilityParsed() {
> +    return new ColumnVisibility(colVisibility);
> +  }
> +
> +  /**
>     * Sets this key's row, column family, column qualifier, column visibility, timestamp, and delete marker to be the same as another key's.
>     */
>    public void set(Key k) {
>
> Modified: accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
> URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1449573&r1=1449572&r2=1449573&view=diff
> ==============================================================================
> --- accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java (original)
> +++ accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java Mon Feb 25 00:59:00 2013
> @@ -18,6 +18,7 @@ package org.apache.accumulo.core.data;
>
>  import junit.framework.TestCase;
>
> +import org.apache.accumulo.core.security.ColumnVisibility;
>  import org.apache.hadoop.io.Text;
>
>  public class KeyTest extends TestCase {
> @@ -97,4 +98,13 @@ public class KeyTest extends TestCase {
>      Key k = new Key("r", "f", "q", "v");
>      assertEquals(k.followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS).toString(), "r f:q [v%00;] " + Long.MAX_VALUE + " false");
>    }
> +
> +  public void testVisibilityGetters() {
> +    Key k = new Key("r", "f", "q", "v1|(v2&v3)");
> +
> +    Text expression = k.getColumnVisibility();
> +    ColumnVisibility parsed = k.getColumnVisibilityParsed();
> +
> +    assertEquals(expression, new Text(parsed.getExpression()));
> +  }
>  }
>
>