accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #35: ACCUMULO-4734 Content for getting-started and basic-read-write
Date Thu, 01 Jan 1970 00:00:00 GMT
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-ZZZZ");
   ```
   
   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-ZZZZ");
   ```
   
   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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message