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_r148891875
 
 

 ##########
 File path: tour/basic-read-write.md
 ##########
 @@ -1,5 +1,67 @@
 ---
-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.
+1. Start by connecting to Mini Accumulo and create a table called "superheroes".  For now,
connect as the root user.
+```java
+Connector conn = mac.getConnector("root", "tourguide");
+conn.tableOperations().create("superheroes");
+```
+
+2. Create a Mutation object for row1
+```java
+Mutation mutation = new Mutation("row1");
+```
+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.
+```java
+mutation.put("name", "", "Batman");
+mutation.put("real-name", "", "Bruce Wayne");
+mutation.put("wearsCape?", "", "true");
+mutation.put("flies?", "", "false");
+```
+Every Mutation in Accumulo is atomic. This means that all the changes to a single row will
happen at once. The Mutation
+object conveniently allows us to put all the changes for the row in one spot. 
+
+4. Create a BatchWriter to the superhero table and add your mutation to it.
 
 Review comment:
   Could say `Write the mutation to the superhero table` The fact that a batch writer is used
to do is self evident from 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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message