[jira] [Updated] (ACCUMULO-1972) Range constructors call overridable method

2017-11-06 Thread Matthew Dinep (JIRA)

 [ 
https://issues.apache.org/jira/browse/ACCUMULO-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matthew Dinep updated ACCUMULO-1972:

Attachment: accumulo-1972.patch

Fix added. beforeStartKey and afterEndKey methods both made final and tested 
locally as working.

> Range constructors call overridable method
> --
>
> Key: ACCUMULO-1972
> URL: https://issues.apache.org/jira/browse/ACCUMULO-1972
> Project: Accumulo
>  Issue Type: Bug
>Affects Versions: 1.4.4, 1.5.0
>Reporter: Bill Havanki
>Priority: Minor
>  Labels: newbie
> Attachments: accumulo-1972.patch
>
>
> Several {{Range}} constructors call {{Range.beforeStartKey()}}, which is not 
> final. This is dangerous:
> bq. The superclass constructor runs before the subclass constructor, so the 
> overriding method in the subclass will get invoked before the subclass 
> constructor has run. If the overriding method depends on any initialization 
> performed by the subclass constructor, the method will not behave as 
> expected.  ??Item 17, Effective Java Vol. 2, Bloch??
> If {{beforeStartKey()}} cannot be made final, the code should be refactored 
> to make the constructors safe.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (ACCUMULO-1665) Update table.file.compress.type document in Property

2017-11-06 Thread Matthew Dinep (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16240862#comment-16240862
 ] 

Matthew Dinep commented on ACCUMULO-1665:
-

Master branch has:

TABLE_FILE_COMPRESSION_TYPE("table.file.compress.type", "gz", 
PropertyType.STRING, "One of gz,snappy,lzo,none"),

at line 468.

Looks like this is OBE

> Update table.file.compress.type document in Property
> 
>
> Key: ACCUMULO-1665
> URL: https://issues.apache.org/jira/browse/ACCUMULO-1665
> Project: Accumulo
>  Issue Type: Task
>  Components: client
>Affects Versions: 1.4.0
>Reporter: Josh Elser
>Priority: Minor
>  Labels: newbie
>
> Looks like the description of "One of gz,lzo,none" is wrong. I know we also 
> support snappy since ACCUMULO-139 in 1.4.0



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] milleruntime commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
milleruntime commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149193873
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
 
 Review comment:
   This is what I was thinking for the lesson on Authorizations.  I wanted to 
keep the first one as simple as possible.
   
   I was also thinking about keeping the the table in the first exercise called 
"superheroes" and making it more generic in follow on exercises.  The idea 
being a traditional table (in a relational DB) would be called superheroes with 
the DB being named "Gotham PD POI" and then explaining how Accumulo stores data 
differently aka a single table being more like a DB.   Something like.. you may 
think creating separate "villian" and "hero" tables would be a good idea but 
Accumulo allows you to store both in the same table and differentiate using 
Column Families.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] milleruntime commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
milleruntime commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149187526
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
+mutation.put("HeroAttribute","real-name", "Bruce Wayne");
+mutation.put("HeroAttribute","wearsCape?", "true");
+mutation.put("HeroAttribute","flies?","false");
+
+// 4. Create a BatchWriter to the superhero table and add your 
mutation to it.  Try w/ resources will close for us.
+try(BatchWriter writer = conn.createBatchWriter("superheroes", new 
BatchWriterConfig())) {
+writer.addMutation(mutation);
+} catch(TableNotFoundException | MutationsRejectedException e) {
 
 Review comment:
   It does throw Exception, mainly because of the Connector.  For some reason I 
felt compelled to have a catch.  I guess it just feels wrong to have a try 
without a catch haha.  But it would greatly shorten the code.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149172362
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
+mutation.put("HeroAttribute","real-name", "Bruce Wayne");
+mutation.put("HeroAttribute","wearsCape?", "true");
+mutation.put("HeroAttribute","flies?","false");
+
+// 4. Create a BatchWriter to the superhero table and add your 
mutation to it.  Try w/ resources will close for us.
+try(BatchWriter writer = conn.createBatchWriter("superheroes", new 
BatchWriterConfig())) {
+writer.addMutation(mutation);
+} catch(TableNotFoundException | MutationsRejectedException e) {
 
 Review comment:
   I think it would be nice to make the exercise method throw Exception and 
drop this catch block.  Doing this makes this first bit of code someone sees 
shorter, which I think is important.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149172480
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
+mutation.put("HeroAttribute","real-name", "Bruce Wayne");
+mutation.put("HeroAttribute","wearsCape?", "true");
+mutation.put("HeroAttribute","flies?","false");
+
+// 4. Create a BatchWriter to the superhero table and add your 
mutation to it.  Try w/ resources will close for us.
+try(BatchWriter writer = conn.createBatchWriter("superheroes", new 
BatchWriterConfig())) {
+writer.addMutation(mutation);
+} catch(TableNotFoundException | MutationsRejectedException e) {
+System.out.println("Error in the BatchWriter:");
+e.printStackTrace();
+}
+
+// 5. Read and print all rows of the "superheroes" table. Try w/ 
resources will close for us.
+try(Scanner scan = conn.createScanner("superheroes", 
Authorizations.EMPTY)) {
+System.out.println("superheroes table contents:");
+// A Scanner is an extension of java.lang.Iterable so behaves just 
like one.
+for (Map.Entry entry : scan) {
+System.out.println("Key:" + entry.getKey());
+System.out.println("Value:" + entry.getValue());
+}
+} catch(TableNotFoundException e) {
 
 Review comment:
   If exercise throws exception then could also drop this catch block.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149172362
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
+mutation.put("HeroAttribute","real-name", "Bruce Wayne");
+mutation.put("HeroAttribute","wearsCape?", "true");
+mutation.put("HeroAttribute","flies?","false");
+
+// 4. Create a BatchWriter to the superhero table and add your 
mutation to it.  Try w/ resources will close for us.
+try(BatchWriter writer = conn.createBatchWriter("superheroes", new 
BatchWriterConfig())) {
+writer.addMutation(mutation);
+} catch(TableNotFoundException | MutationsRejectedException e) {
 
 Review comment:
   I think it would be nice to make the exercise method throw Exception and 
drop this catch block.  Doing this makes this first bit of code shorter someone 
sees shorter, which I think is important.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write

2017-11-06 Thread GitBox
keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content 
for getting-started and basic-read-write
URL: https://github.com/apache/accumulo-website/pull/35#discussion_r149180231
 
 

 ##
 File path: tour/basic-read-write.md
 ##
 @@ -1,5 +1,61 @@
 ---
-title: Basic Reading & Writing
+title: Writing and Reading
 ---
+Accumulo is a big data key/value store.  Writing data to Accumulo is flexible 
and fast.  Like any database, Accumulo stores
+data in tables and rows.  Each row in an Accumulo table can hold many 
key/value pairs.  
 
-Talk about reading and writing.
+Copy and paste the code below into the _exercise_  method.
+```java
+// 1. Start by connecting to Mini Accumulo as the root user and create 
a table called "superheroes".
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+
+// 2. Create a Mutation object to write to a row
+Mutation mutation = new Mutation("hero023948092");
+// A Mutation is an object that holds all changes to a row in a table. 
 Each row has a unique row ID.
+
+// 3. Create key/value pairs for Batman.  Put them in the 
"HeroAttribute" family.
+mutation.put("HeroAttribute","name", "Batman");
 
 Review comment:
   Was thinking something shorter for the col family would be nice and thought 
of `hero`. This made me think only things applicable to a hero would be under 
that family.  More general info that is applicable to anyone could be under a 
`person` family.  This would allow non-heros and villains to be in the DB also, 
but that makes me wonder what the DB should be called. This made me wonder who 
owns the DB?  I thought of Gotham PD, some PI, some hero, some villain, or a 
news org owning the DB.  I randomly chose GPD.
   
   ```java
conn.tableOperations().create("gpd-poi");  //gotham PD persons of interest
 // 2. Create a Mutation object to write to a row
Mutation mutation = new Mutation("id023948092");
   mutation.put("hero","alias", "Batman");
   ?mutation.put("hero","wearsCape?", "true");
   mutation.put("hero","flies?","false");
   mutation.put("person","name", "Bruce Wayne");
   mutation.put("person","DOB", "XX-YY-");
   ```
   
   Thinking ahead I like this example because it allows future visibility 
labels like the following.  The visibility labels will ultimately be tied to 
who owns the db.
   
   ```java
conn.tableOperations().create("gpd-poi");  //gotham PD persons of interest
 // 2. Create a Mutation object to write to a row
Mutation mutation = new Mutation("id023948092");
   mutation.put("hero","alias", "secretId", "Batman");
   ?mutation.put("hero","wearsCape?" "secretId", "true");
   mutation.put("hero","flies?" "secretId & ability","false");
   mutation.put("person","name", "Bruce Wayne");
   mutation.put("person","DOB" ,"pii", "XX-YY-");
   ```
   
   All of the above is me just thinking out loud, do what you will with it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Updated] (ACCUMULO-4737) Clean up cipher algorithm configuration

2017-11-06 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/ACCUMULO-4737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated ACCUMULO-4737:
-
Labels: pull-request-available  (was: )

> Clean up cipher algorithm configuration
> ---
>
> Key: ACCUMULO-4737
> URL: https://issues.apache.org/jira/browse/ACCUMULO-4737
> Project: Accumulo
>  Issue Type: Improvement
>Reporter: Nick Felts
>Assignee: Nick Felts
>Priority: Minor
>  Labels: pull-request-available
>
> The two property options:
>   crypto.cipher.algorithm.name
>   crypto.cipher.suite
> are not used intuitively. For example, as far as I can tell, the only place 
> the cipher suite's algorithm name is used is to check for NullCipher. I even 
> tested this using bogus strings to confirm. Instead, once the suite is found 
> to not indicate NullCipher, the cipher.algorithm.name replaces the algorithm 
> found in the cipher suite for all further uses.
> Further, the suite is parsed out into padding and mode options, which only 
> exist to pass a few unit tests and reconstruct the cipher suite using the 
> other specified algorithm.
> This leads to some unintuitive behavior, where someone specifying an 
> algorithm in the cipher suite is not necessarily using their intended 
> algorithm, unless both options specified the the same algorithm.
> To clean this up, the algorithm specified should be renamed and used for key 
> generation, since some keys can be used across different algorithms 
> (https://docs.oracle.com/javase/8/docs/api/java/security/Key.html), and the 
> cipher suite can be used as stated, instead of deconstructing it to then 
> reconstruct it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] PircDef opened a new pull request #319: ACCUMULO-4737 Clean up cipher algorithm configuration

2017-11-06 Thread GitBox
PircDef opened a new pull request #319: ACCUMULO-4737 Clean up cipher algorithm 
configuration
URL: https://github.com/apache/accumulo/pull/319
 
 
   Renamed crypto.cipher.algorithm.name to crypto.cipher.key.algorithm.name
   Removed the unused mode/padding code in favor of passing around the crypto 
suite (instead of splitting it up and rebuilding it)
   Accumulo will now use crypto.cipher.key.algorithm.name to build the 
encryption key
   Accumulo will now use crypto.cipher.suite to build the Java Cipher object
   Unit test was updated to reflect the change
   
   Additionally, this was stumbled upon when implementing a separate cipher 
algorithm option for WAL files, so that change has been included.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Created] (ACCUMULO-4737) Clean up cipher algorithm configuration

2017-11-06 Thread Nick Felts (JIRA)
Nick Felts created ACCUMULO-4737:


 Summary: Clean up cipher algorithm configuration
 Key: ACCUMULO-4737
 URL: https://issues.apache.org/jira/browse/ACCUMULO-4737
 Project: Accumulo
  Issue Type: Improvement
Reporter: Nick Felts
Assignee: Nick Felts
Priority: Minor


The two property options:

  crypto.cipher.algorithm.name
  crypto.cipher.suite

are not used intuitively. For example, as far as I can tell, the only place the 
cipher suite's algorithm name is used is to check for NullCipher. I even tested 
this using bogus strings to confirm. Instead, once the suite is found to not 
indicate NullCipher, the cipher.algorithm.name replaces the algorithm found in 
the cipher suite for all further uses.

Further, the suite is parsed out into padding and mode options, which only 
exist to pass a few unit tests and reconstruct the cipher suite using the other 
specified algorithm.

This leads to some unintuitive behavior, where someone specifying an algorithm 
in the cipher suite is not necessarily using their intended algorithm, unless 
both options specified the the same algorithm.

To clean this up, the algorithm specified should be renamed and used for key 
generation, since some keys can be used across different algorithms 
(https://docs.oracle.com/javase/8/docs/api/java/security/Key.html), and the 
cipher suite can be used as stated, instead of deconstructing it to then 
reconstruct it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)