You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/07/20 19:24:24 UTC

[GitHub] [accumulo-website] jmark99 opened a new pull request, #330: Add JShell version of the Accumulo Tour to website

jmark99 opened a new pull request, #330:
URL: https://github.com/apache/accumulo-website/pull/330

   Added a version of the Accumulo Tour that makes use of the JShell feature of Accumulo 2.1.x. The user will have to option to go through the tour using the former version with the MiniAccumuloCluster or the newer JShell feature.
   
   Also added a new page to the tour illustrating iterators.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] jmark99 commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
jmark99 commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r927691927


##########
tour-jshell/ranges-splits2.md:
##########
@@ -0,0 +1,44 @@
+---
+title: Ranges and Splits
+---
+
+A [Range] is a specified group of `Key`s. There are many ways to create a `Range`.  Here are a few examples:
+

Review Comment:
   Although a couple of pages contain very similar content, there were several formatting changes that cause them to differ. It may be possible to replace the older tour page with the updated jshell tour page. Not sure how difficult that would be. Can look into it later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] milleruntime commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
milleruntime commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r926753597


##########
tour-jshell/ranges-splits2.md:
##########
@@ -0,0 +1,44 @@
+---
+title: Ranges and Splits
+---
+
+A [Range] is a specified group of `Key`s. There are many ways to create a `Range`.  Here are a few examples:
+

Review Comment:
   It looks like some of the pages are the same as the Mini tour? Might be able to reuse the pages between the tours.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] DomGarguilo commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r926790537


##########
tour-jshell/index.md:
##########
@@ -0,0 +1,26 @@
+---
+title: Accumulo Tour
+layout: page
+permalink: /tour-jshell/
+skiph1fortitle: true
+---
+
+{% assign tour_pages = site.data.tour-jshell.docs %}
+{% assign first_url = tour_pages[0] | prepend: '/tour-jshell/' | append: '/' %}
+{% assign first_page = site.pages | where:'url',first_url | first %}
+
+Welcome to the JShell version of the Accumulo tour! When on a tour page, the left and
+right keys on the keyboard can be used to navigate. The tour begins at the
+[{{ first_page.title }}]({{ first_url }}) page.
+
+If you have any questions or suggestions while
+going through the tour, please email our [mailing list][mlist] or [create an issue][issue].
+
+{% for p in tour_pages %}
+  {% assign doc_url = p | prepend: '/tour-jshell/' | append: '/' %}
+  {% assign link_to_page = site.pages | where:'url',doc_url | first %}
+  1. [{{ link_to_page.title }}]({{ doc_url }})
+{% endfor %}
+
+[mlist]: /contact-us/#mailing-lists

Review Comment:
   ```suggestion
   [mlist]: https://accumulo.apache.org/contact-us/contact-us/#mailing-lists
   ```
   My IDE complains about this link unless its the whole URL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] ctubbsii commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r929306465


##########
_config.yml:
##########
@@ -44,6 +44,13 @@ defaults:
     values:
       layout: "tour"
       permalink: "/tour/:basename/"
+  -
+    scope:
+      path: "tour-jshell"
+      type: "pages"
+    values:
+      layout: "tour-jshell"
+      permalink: "/tour-jshell/:basename/"

Review Comment:
   This should replace the existing tour. Not sit adjacent to it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] jmark99 commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
jmark99 commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r927693084


##########
tour-jshell/basic-read-write2.md:
##########
@@ -0,0 +1,80 @@
+---
+title: Writing and Reading
+---
+
+Accumulo is a big 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. 
+
+Our next exercise shows how to write and read from a table.
+
+Let's create a table called "GothamPD".
+
+At the JShell prompt, enter the following:
+```commandline
+jshell> client.tableOperations().create("GothamPD");
+```
+
+Accumulo uses Mutation objects to hold all changes to a row in a table. Each row has a unique row
+ID. 
+
+```commandline
+jshell> Mutation mutation1 = new Mutation("id0001");
+mutation1 ==> org.apache.accumulo.core.data.Mutation@1
+```
+
+Create key/value pairs for Batman.  Put them in the "hero" family.
+```commandline
+jshell> mutation1.put("hero","alias", "Batman");
+jshell> mutation1.put("hero","name", "Bruce Wayne");
+jshell> mutation1.put("hero","wearsCape?", "true");
+```
+
+Create a BatchWriter to the GothamPD table and add your mutation to it. Try-with-resources will 
+close for us.
+
+```commandline
+jshell> try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
+  ...>    writer.addMutation(mutation1);
+  ...>  }
+```
+Read and print all rows of the "GothamPD" table.
+
+Note that within the JShell environment, references to Scanner are ambiguous since it matches both 
+interface ```org.apache.accumulo.core.client.Scanner``` and class ```java.util.Scanner```. This can 
+be resolved by either using the fully qualified name for the Scanner, or more easily, by using the 
+base class, ```ScannerBase```, in place of ```Scanner``` (this should generally only be required when 
+within the JShell environment).
+
+```commandline
+jshell> try (ScannerBase scan = client.createScanner("GothamPD", Authorizations.EMPTY)) {
+   ...>   System.out.println("Gotham Police Department Persons of Interest:");
+   ...>   for(Map.Entry<Key, Value> entry : scan) {
+   ...>     System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
+   ...>   }
+   ...> }
+Gotham Police Department Persons of Interest:
+Key : id0001 hero:alias [] 1654274195071 false            Value : Batman
+Key : id0001 hero:name [] 1654274195071 false             Value : Bruce Wayne
+Key : id0001 hero:wearsCape? [] 1654274195071 false       Value : true
+```
+
+Be aware the timestamps will differ for you.
+
+Good job! That is all it takes to write and read from Accumulo.
+
+Notice a lot of other information was printed from the Keys we created. Accumulo is flexible 
+because hidden within its [Key] is a rich data model that can be broken up into different parts. We 
+will cover the [Data Model][dmodel] in the next lesson.
+
+### But wait... I thought Accumulo was all about Security?
+
+Spoiler Alert: It is!  Did you notice the `Authorizations.EMPTY` we passed in when creating a
+[Scanner]?  The data we created in this first lesson was not secured with Authorizations so the 
+Scanner didn't require any Authorizations to read it.  More to come later in the [Authorizations][auths] 
+lesson!
+
+[dmodel]: /tour-jshell/data-model2
+[auths]: /tour-jshell/authorizations2

Review Comment:
   I tried the changes and it would not work on my local web server. Compared these links to similar existing tour pages and then format is the same. Will keep an eye on this once it is published and update then if necessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] jmark99 merged pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
jmark99 merged PR #330:
URL: https://github.com/apache/accumulo-website/pull/330


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] jmark99 commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
jmark99 commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r929882998


##########
_config.yml:
##########
@@ -44,6 +44,13 @@ defaults:
     values:
       layout: "tour"
       permalink: "/tour/:basename/"
+  -
+    scope:
+      path: "tour-jshell"
+      type: "pages"
+    values:
+      layout: "tour-jshell"
+      permalink: "/tour-jshell/:basename/"

Review Comment:
   If we replace the existing tour then users using any 1.x or 2.0.x version would not be able to take advantage of the tour. I would think at least for a while it would be best to keep both accessible.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] ctubbsii commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r930060054


##########
_config.yml:
##########
@@ -44,6 +44,13 @@ defaults:
     values:
       layout: "tour"
       permalink: "/tour/:basename/"
+  -
+    scope:
+      path: "tour-jshell"
+      type: "pages"
+    values:
+      layout: "tour-jshell"
+      permalink: "/tour-jshell/:basename/"

Review Comment:
   JShell can be used with the older version. We just don't have the convenience tools to automatically set up the class path. The jshell-based tour would still be applicable for those versions, but setting up the classpath could be left as an exercise to the user.
   
   Also, the tour targets new users. New users are not typically starting off with old versions.
   
   I would also call the tour "Interactive" rather than "JShell". JShell is the just the tool, but the point of the tour using JShell is to be more interactive, so that's the characteristic I would emphasize in any menus/navigation/page titles.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] DomGarguilo commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r926790537


##########
tour-jshell/index.md:
##########
@@ -0,0 +1,26 @@
+---
+title: Accumulo Tour
+layout: page
+permalink: /tour-jshell/
+skiph1fortitle: true
+---
+
+{% assign tour_pages = site.data.tour-jshell.docs %}
+{% assign first_url = tour_pages[0] | prepend: '/tour-jshell/' | append: '/' %}
+{% assign first_page = site.pages | where:'url',first_url | first %}
+
+Welcome to the JShell version of the Accumulo tour! When on a tour page, the left and
+right keys on the keyboard can be used to navigate. The tour begins at the
+[{{ first_page.title }}]({{ first_url }}) page.
+
+If you have any questions or suggestions while
+going through the tour, please email our [mailing list][mlist] or [create an issue][issue].
+
+{% for p in tour_pages %}
+  {% assign doc_url = p | prepend: '/tour-jshell/' | append: '/' %}
+  {% assign link_to_page = site.pages | where:'url',doc_url | first %}
+  1. [{{ link_to_page.title }}]({{ doc_url }})
+{% endfor %}
+
+[mlist]: /contact-us/#mailing-lists

Review Comment:
   ```suggestion
   [mlist]: https://accumulo.apache.org/contact-us/#mailing-lists
   ```
   My IDE complains about this link unless its the whole URL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] DomGarguilo commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r927697126


##########
tour-jshell/basic-read-write2.md:
##########
@@ -0,0 +1,80 @@
+---
+title: Writing and Reading
+---
+
+Accumulo is a big 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. 
+
+Our next exercise shows how to write and read from a table.
+
+Let's create a table called "GothamPD".
+
+At the JShell prompt, enter the following:
+```commandline
+jshell> client.tableOperations().create("GothamPD");
+```
+
+Accumulo uses Mutation objects to hold all changes to a row in a table. Each row has a unique row
+ID. 
+
+```commandline
+jshell> Mutation mutation1 = new Mutation("id0001");
+mutation1 ==> org.apache.accumulo.core.data.Mutation@1
+```
+
+Create key/value pairs for Batman.  Put them in the "hero" family.
+```commandline
+jshell> mutation1.put("hero","alias", "Batman");
+jshell> mutation1.put("hero","name", "Bruce Wayne");
+jshell> mutation1.put("hero","wearsCape?", "true");
+```
+
+Create a BatchWriter to the GothamPD table and add your mutation to it. Try-with-resources will 
+close for us.
+
+```commandline
+jshell> try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
+  ...>    writer.addMutation(mutation1);
+  ...>  }
+```
+Read and print all rows of the "GothamPD" table.
+
+Note that within the JShell environment, references to Scanner are ambiguous since it matches both 
+interface ```org.apache.accumulo.core.client.Scanner``` and class ```java.util.Scanner```. This can 
+be resolved by either using the fully qualified name for the Scanner, or more easily, by using the 
+base class, ```ScannerBase```, in place of ```Scanner``` (this should generally only be required when 
+within the JShell environment).
+
+```commandline
+jshell> try (ScannerBase scan = client.createScanner("GothamPD", Authorizations.EMPTY)) {
+   ...>   System.out.println("Gotham Police Department Persons of Interest:");
+   ...>   for(Map.Entry<Key, Value> entry : scan) {
+   ...>     System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
+   ...>   }
+   ...> }
+Gotham Police Department Persons of Interest:
+Key : id0001 hero:alias [] 1654274195071 false            Value : Batman
+Key : id0001 hero:name [] 1654274195071 false             Value : Bruce Wayne
+Key : id0001 hero:wearsCape? [] 1654274195071 false       Value : true
+```
+
+Be aware the timestamps will differ for you.
+
+Good job! That is all it takes to write and read from Accumulo.
+
+Notice a lot of other information was printed from the Keys we created. Accumulo is flexible 
+because hidden within its [Key] is a rich data model that can be broken up into different parts. We 
+will cover the [Data Model][dmodel] in the next lesson.
+
+### But wait... I thought Accumulo was all about Security?
+
+Spoiler Alert: It is!  Did you notice the `Authorizations.EMPTY` we passed in when creating a
+[Scanner]?  The data we created in this first lesson was not secured with Authorizations so the 
+Scanner didn't require any Authorizations to read it.  More to come later in the [Authorizations][auths] 
+lesson!
+
+[dmodel]: /tour-jshell/data-model2
+[auths]: /tour-jshell/authorizations2

Review Comment:
   Sounds good :+1: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] jmark99 commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
jmark99 commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r927693959


##########
tour-jshell/index.md:
##########
@@ -0,0 +1,26 @@
+---
+title: Accumulo Tour
+layout: page
+permalink: /tour-jshell/
+skiph1fortitle: true
+---
+
+{% assign tour_pages = site.data.tour-jshell.docs %}
+{% assign first_url = tour_pages[0] | prepend: '/tour-jshell/' | append: '/' %}
+{% assign first_page = site.pages | where:'url',first_url | first %}
+
+Welcome to the JShell version of the Accumulo tour! When on a tour page, the left and
+right keys on the keyboard can be used to navigate. The tour begins at the
+[{{ first_page.title }}]({{ first_url }}) page.
+
+If you have any questions or suggestions while
+going through the tour, please email our [mailing list][mlist] or [create an issue][issue].
+
+{% for p in tour_pages %}
+  {% assign doc_url = p | prepend: '/tour-jshell/' | append: '/' %}
+  {% assign link_to_page = site.pages | where:'url',doc_url | first %}
+  1. [{{ link_to_page.title }}]({{ doc_url }})
+{% endfor %}
+
+[mlist]: /contact-us/#mailing-lists

Review Comment:
   As above, this link matches the format of the existing tour page. Again, will monitor once published and change then if necessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo-website] DomGarguilo commented on a diff in pull request #330: Add JShell version of the Accumulo Tour to website

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on code in PR #330:
URL: https://github.com/apache/accumulo-website/pull/330#discussion_r926787876


##########
tour-jshell/basic-read-write2.md:
##########
@@ -0,0 +1,80 @@
+---
+title: Writing and Reading
+---
+
+Accumulo is a big 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. 
+
+Our next exercise shows how to write and read from a table.
+
+Let's create a table called "GothamPD".
+
+At the JShell prompt, enter the following:
+```commandline
+jshell> client.tableOperations().create("GothamPD");
+```
+
+Accumulo uses Mutation objects to hold all changes to a row in a table. Each row has a unique row
+ID. 
+
+```commandline
+jshell> Mutation mutation1 = new Mutation("id0001");
+mutation1 ==> org.apache.accumulo.core.data.Mutation@1
+```
+
+Create key/value pairs for Batman.  Put them in the "hero" family.
+```commandline
+jshell> mutation1.put("hero","alias", "Batman");
+jshell> mutation1.put("hero","name", "Bruce Wayne");
+jshell> mutation1.put("hero","wearsCape?", "true");
+```
+
+Create a BatchWriter to the GothamPD table and add your mutation to it. Try-with-resources will 
+close for us.
+
+```commandline
+jshell> try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
+  ...>    writer.addMutation(mutation1);
+  ...>  }
+```
+Read and print all rows of the "GothamPD" table.
+
+Note that within the JShell environment, references to Scanner are ambiguous since it matches both 
+interface ```org.apache.accumulo.core.client.Scanner``` and class ```java.util.Scanner```. This can 
+be resolved by either using the fully qualified name for the Scanner, or more easily, by using the 
+base class, ```ScannerBase```, in place of ```Scanner``` (this should generally only be required when 
+within the JShell environment).
+
+```commandline
+jshell> try (ScannerBase scan = client.createScanner("GothamPD", Authorizations.EMPTY)) {
+   ...>   System.out.println("Gotham Police Department Persons of Interest:");
+   ...>   for(Map.Entry<Key, Value> entry : scan) {
+   ...>     System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
+   ...>   }
+   ...> }
+Gotham Police Department Persons of Interest:
+Key : id0001 hero:alias [] 1654274195071 false            Value : Batman
+Key : id0001 hero:name [] 1654274195071 false             Value : Bruce Wayne
+Key : id0001 hero:wearsCape? [] 1654274195071 false       Value : true
+```
+
+Be aware the timestamps will differ for you.
+
+Good job! That is all it takes to write and read from Accumulo.
+
+Notice a lot of other information was printed from the Keys we created. Accumulo is flexible 
+because hidden within its [Key] is a rich data model that can be broken up into different parts. We 
+will cover the [Data Model][dmodel] in the next lesson.
+
+### But wait... I thought Accumulo was all about Security?
+
+Spoiler Alert: It is!  Did you notice the `Authorizations.EMPTY` we passed in when creating a
+[Scanner]?  The data we created in this first lesson was not secured with Authorizations so the 
+Scanner didn't require any Authorizations to read it.  More to come later in the [Authorizations][auths] 
+lesson!
+
+[dmodel]: /tour-jshell/data-model2
+[auths]: /tour-jshell/authorizations2

Review Comment:
   ```suggestion
   [dmodel]: /data-model2
   [auths]: /authorizations2
   ```
   I don't think the links will work unless they are changed to this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org