You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2021/01/21 00:42:10 UTC

[accumulo-website] branch main updated: Update Accumulo Tour Source Code (#255)

This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 4d074aa  Update Accumulo Tour Source Code (#255)
4d074aa is described below

commit 4d074aa3808c6376f87eaca6cc148b033e9c7a33
Author: slackwinner <50...@users.noreply.github.com>
AuthorDate: Wed Jan 20 19:41:23 2021 -0500

    Update Accumulo Tour Source Code (#255)
    
    Minor coding, grammar, and comment enhancements have been made
    within the "tour" folder to improve the Accumulo Tour
    experience for new users.
---
 tour/authorizations-code.md     | 38 ++++++++++++-------------
 tour/authorizations.md          | 35 ++++++++++++-----------
 tour/basic-read-write.md        | 24 ++++++++--------
 tour/batch-scanner-code.md      | 63 ++++++++++++++++++++---------------------
 tour/batch-scanner.md           | 31 ++++++++++----------
 tour/client.md                  |  6 ++--
 tour/conditional-writer-code.md |  3 +-
 tour/conditional-writer.md      | 24 +++++++---------
 tour/data-model-code.md         | 27 +++++++++---------
 tour/data-model.md              |  2 +-
 tour/getting-started.md         | 12 ++++----
 tour/ranges-splits.md           | 12 ++++----
 12 files changed, 138 insertions(+), 139 deletions(-)

diff --git a/tour/authorizations-code.md b/tour/authorizations-code.md
index 45893ac..3a73850 100644
--- a/tour/authorizations-code.md
+++ b/tour/authorizations-code.md
@@ -5,29 +5,31 @@ title: Authorizations Code
 Below is a solution for the exercise.
 
 ```java
-static void exercise(AccumuloClient client) throws Exception {
-    // create a table called "GothamPD".
+  static void exercise(AccumuloClient client) throws Exception {
+    // Create a table called "GothamPD".
     client.tableOperations().create("GothamPD");
 
-    // Create a "secretId" authorization & visibility
+	// Create a "secretId" authorization & visibility
     final String secretId = "secretId";
     Authorizations auths = new Authorizations(secretId);
     ColumnVisibility colVis = new ColumnVisibility(secretId);
 
-    // Create a user with the "secretId" authorization and grant him read permissions on our table
+    // Create a user with the "secretId" authorization and grant the commissioner read permissions on our table
     client.securityOperations().createLocalUser("commissioner", new PasswordToken("gordonrocks"));
     client.securityOperations().changeUserAuthorizations("commissioner", auths);
     client.securityOperations().grantTablePermission("commissioner", "GothamPD", TablePermission.READ);
 
-    // Create 3 Mutation objects, securing the proper columns.
+    // Create three Mutation objects, securing the proper columns.
     Mutation mutation1 = new Mutation("id0001");
     mutation1.put("hero", "alias", "Batman");
     mutation1.put("hero", "name", colVis, "Bruce Wayne");
     mutation1.put("hero", "wearsCape?", "true");
+
     Mutation mutation2 = new Mutation("id0002");
     mutation2.put("hero", "alias", "Robin");
     mutation2.put("hero", "name", colVis, "Dick Grayson");
     mutation2.put("hero", "wearsCape?", "true");
+
     Mutation mutation3 = new Mutation("id0003");
     mutation3.put("villain", "alias", "Joker");
     mutation3.put("villain", "name", "Unknown");
@@ -36,24 +38,22 @@ static void exercise(AccumuloClient client) throws Exception {
     // Create a BatchWriter to the GothamPD table and add your mutations to it.
     // Once the BatchWriter is closed by the try w/ resources, data will be available to scans.
     try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
-        writer.addMutation(mutation1);
-        writer.addMutation(mutation2);
-        writer.addMutation(mutation3);
+      writer.addMutation(mutation1);
+      writer.addMutation(mutation2);
+      writer.addMutation(mutation3);
     }
 
-    // Create a second client for the commissioner. Then print all the rows visibile to the
-    // commissioner. Make sure to pass the proper authorizations to the Scanner
-    try (AccumuloClient commishClient = Accumulo.newClient().from(client.properties())
-            .as("commissioner", "gordonrocks").build();
-        Scanner scan = commishClient.createScanner("GothamPD", auths)) {
-        System.out.println("Gotham Police Department Persons of Interest:");
-        for (Map.Entry<Key, Value> entry : scan) {
-            System.out.printf("Key : %-60s  Value : %s\n", entry.getKey(), entry.getValue());
-        }
+    // Create a second client for the commissioner user and output all the rows visible to them.  
+    // Make sure to pass the proper authorizations.
+    try (AccumuloClient commishClient = Accumulo.newClient().from(client.properties()).as("commissioner", "gordonrocks").build()) {
+      Scanner scan = commishClient.createScanner("GothamPD", auths);
+      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());
+	   }
     }
-}
+  }
 ```
-
 The solution above will print (timestamp will differ):
 
 ```commandline
diff --git a/tour/authorizations.md b/tour/authorizations.md
index dd25d2f..f025145 100644
--- a/tour/authorizations.md
+++ b/tour/authorizations.md
@@ -2,7 +2,7 @@
 title: Authorizations
 ---
 
-[Authorizations] are a set of Strings that enable a user to read protected data. Users are granted authorizations
+[Authorizations] are a set of `String`s that enable a user to read protected data. Users are granted authorizations
 and choose which ones to use when scanning a table. The chosen authorizations are evaluated against the [ColumnVisibility]
 of each Accumulo key in the scan. If the boolean expression of the ColumnVisibility evaluates to true, the data will be
 visible to the user.
@@ -18,30 +18,31 @@ We now want to secure our secret identities of the heroes so that only users wit
 
 1. Using the code from the previous exercise, add the following to the beginning of the _exercise_ method.
 ```java
-        // Create a "secretId" authorization & visibility
-        final String secretId = "secretId";
-        Authorizations auths = new Authorizations(secretId);
-        ColumnVisibility colVis = new ColumnVisibility(secretId);
-        
-        // Create a user with the "secretId" authorization and grant him read permissions on our table
-        client.securityOperations().createLocalUser("commissioner", new PasswordToken("gordonrocks"));
-        client.securityOperations().changeUserAuthorizations("commissioner", auths);
-        client.securityOperations().grantTablePermission("commissioner", "GothamPD", TablePermission.READ);
+  // Create a "secretId" authorization & visibility
+  final String secretId = "secretId";
+  Authorizations auths = new Authorizations(secretId);
+  ColumnVisibility colVis = new ColumnVisibility(secretId);
+	
+  // Create a user with the "secretId" authorization and grant him read permissions on our table
+  client.securityOperations().createLocalUser("commissioner", new PasswordToken("gordonrocks"));
+  client.securityOperations().changeUserAuthorizations("commissioner", auths);
+  client.securityOperations().grantTablePermission("commissioner", "GothamPD", TablePermission.READ);
 ```
 
 2. The [Mutation] API allows you to set the `secretId` visibility on a column. Find the proper method for setting a column visibility in
 the Mutation API and modify the code so the `colVis` variable created above secures the "name" columns.
 
-3. Build and run.  What data do you see?
-* You should see all of the data except the secret identities of Batman and Robin. This is because the Scanner was created
- from the root user which doesn't have the `secretId` authorization.
-* Replace the `Authorizations.EMPTY` in the Scanner with the `auths` variable created above and run it again.
+3. Build and run.  What data do you see? 
+* You should see all of the data except the secret identities of Batman and Robin. This is because the `Scanner` was created from the root user which doesn't have the `secretId` authorization. 
+* Replace the `Authorizations.EMPTY` in the Scanner with the `auths` variable created above and run it again. 
 * This should result in an error since the root user doesn't have the authorizations we tried to pass to the Scanner.
 
 4. Use the following to create a client for the "commissioner" using the [Accumulo] entry point.
 ```java
-try (AccumuloClient commishClient = Accumulo.newClient().from(client.properties())
-    .as("commissioner", "gordonrocks").build();
+  try (AccumuloClient commishClient = Accumulo.newClient().from(client.properties()).as("commissioner", "gordonrocks").build()) {
+    // Insert your code here
+  
+  };
 ```
 
 5. Using the commissioner client, create a Scanner with the authorizations needed to view the secret identities.
@@ -55,4 +56,4 @@ Key : id0002 hero:name [secretId] 1511900180231 false         Value : Dick Grays
 [Authorizations]: {% jurl org.apache.accumulo.core.security.Authorizations %}
 [ColumnVisibility]: {% jurl org.apache.accumulo.core.security.ColumnVisibility %}
 [Mutation]: {% jurl org.apache.accumulo.core.data.Mutation %}
-[Accumulo]: {% jurl org.apache.accumulo.core.client.Accumulo %}
+[Accumulo]: {% jurl org.apache.accumulo.core.client.Accumulo %}
\ No newline at end of file
diff --git a/tour/basic-read-write.md b/tour/basic-read-write.md
index e7e4a8f..89780eb 100644
--- a/tour/basic-read-write.md
+++ b/tour/basic-read-write.md
@@ -6,8 +6,8 @@ data in tables and rows.  Each row in an Accumulo table can hold many key/value
 write and read from a table.
 
 ```java
-static void exercise(AccumuloClient client) throws Exception {
-    // create a table called "GothamPD".
+  static void exercise(AccumuloClient client) throws Exception {
+    // Create a table called "GothamPD".
     client.tableOperations().create("GothamPD");
 
     // Create a Mutation object to hold all changes to a row in a table.  Each row has a unique row ID.
@@ -20,20 +20,20 @@ static void exercise(AccumuloClient client) throws Exception {
 
     // Create a BatchWriter to the GothamPD table and add your mutation to it. Try w/ resources will close for us.
     try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
-        writer.addMutation(mutation);
+      writer.addMutation(mutation);
     }
-
     // Read and print all rows of the "GothamPD" table. Try w/ resources will close for us.
     try (Scanner scan = client.createScanner("GothamPD", Authorizations.EMPTY)) {
-        System.out.println("Gotham Police Department Persons of Interest:");
-        // A Scanner is an extension of java.lang.Iterable so behaves just like one.
-        for (Map.Entry<Key, Value> entry : scan) {
-            System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
-        }
+      System.out.println("Gotham Police Department Persons of Interest:");
+
+      // Note: A Scanner is an extension of java.lang.Iterable so it will traverse through the scanner's range.
+      // In this case, since no range was set on the Scanner, it will traverse the entire table.
+      for (Map.Entry<Key, Value> entry : scan) {
+        System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
+      }
     }
-}
+  }
 ```
-
 Copy this code into your `exercise` method then compile and run.
 
 Good job! That is all it takes to write and read from Accumulo.
@@ -43,7 +43,7 @@ Notice a lot of other information was printed from the Keys we created. Accumulo
 
 ### 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
+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! 
 
diff --git a/tour/batch-scanner-code.md b/tour/batch-scanner-code.md
index 8e4de7a..16cd49d 100644
--- a/tour/batch-scanner-code.md
+++ b/tour/batch-scanner-code.md
@@ -5,46 +5,45 @@ title: Batch Scanner Code
 Below is a solution to the exercise.
 
 ```java
-static void exercise(AccumuloClient client) throws Exception {
-    // create a table called "GothamPD".
+  static void exercise(AccumuloClient client) throws Exception {
+    // Create a table called "GothamPD".
     client.tableOperations().create("GothamPD");
 
     // Generate 10,000 rows of henchman data
-    try(BatchWriter writer = client.createBatchWriter("GothamPD")) {
-        for(int i = 0; i < 10_000; i++) {
-            Mutation m = new Mutation(String.format("id%04d", i));
-            m.put("villain", "alias", "henchman" + i);
-            m.put("villain", "yearsOfService", "" + (new Random().nextInt(50)));
-            m.put("villain", "wearsCape?", "false");
-            writer.addMutation(m);
-        }
+    try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
+      for (int i = 0; i < 10_000; i++) {
+        Mutation m = new Mutation(String.format("id%04d", i));
+        m.put("villain", "alias", "henchman" + i);
+        m.put("villain", "yearsOfService", "" + (new Random().nextInt(50)));
+        m.put("villain", "wearsCape?", "false");
+        writer.addMutation(m);
+      }
     }
-
     // 1. Create a BatchScanner with 5 query threads
-    try(BatchScanner batchScanner = client.createBatchScanner("GothamPD", Authorizations.EMPTY, 5)) {
-        // 2. Create a collection of 2 sample ranges and set it to the batchScanner
-        List ranges = new ArrayList<Range>();
-        ranges.add(new Range("id1000", "id1999"));
-        ranges.add(new Range("id9000", "id9999"));
-        batchScanner.setRanges(ranges);
-
-        // 3. Fetch just the columns we want
-        batchScanner.fetchColumn(new Text("villain"), new Text("yearsOfService"));
-
-        // 4. Calculate average years of service
-        Long totalYears = 0L;
-        Long entriesRead = 0L;
-        for (Map.Entry<Key, Value> entry : batchScanner) {
-            totalYears += Long.valueOf(entry.getValue().toString());
-            entriesRead++;
-        }
-        System.out.println("The average years of service of " + entriesRead + " villians is " + totalYears / entriesRead);
+    try (BatchScanner batchScanner = client.createBatchScanner("GothamPD", Authorizations.EMPTY, 5)) {
+
+      // 2. Create a collection of 2 sample ranges and set it to the batchScanner
+  	  List<Range>ranges = new ArrayList<Range>();
+  	  ranges.add(new Range("id1000", "id1999"));
+  	  ranges.add(new Range("id9000", "id9999"));
+  	  batchScanner.setRanges(ranges);
+
+  	  // 3. Fetch just the columns we want
+  	  batchScanner.fetchColumn(new Text("villain"), new Text("yearsOfService"));
+
+  	  // 4. Calculate average years of service
+  	  Long totalYears = 0L;
+  	  Long entriesRead = 0L;
+  	  for (Map.Entry<Key, Value> entry : batchScanner) {
+  	    totalYears += Long.valueOf(entry.getValue().toString());
+  	    entriesRead++;
+      }
+      System.out.println("The average years of service of " + entriesRead + " villains is " + totalYears / entriesRead);
     }
-}
+  }
 ```
-
 Running the solution above should print output similar to below:
 
 ```
-The average years of service of 2000 villians is 24
+The average years of service of 2000 villains is 24
 ```
diff --git a/tour/batch-scanner.md b/tour/batch-scanner.md
index f80433e..bf27771 100644
--- a/tour/batch-scanner.md
+++ b/tour/batch-scanner.md
@@ -1,34 +1,35 @@
 ---
 title: Batch Scanner
 ---
-Running on a single thread, a Scanner will retrieve a single Range of data and return Keys in sorted order. A [BatchScanner] 
-will retrieve multiple Ranges of data using multiple threads.  A BatchScanner can be more efficient but does not guarantee Keys will be returned in sorted order.
+Running on a single thread, a `Scanner` will retrieve a single `Range` of data and return `Key`s in sorted order. A [BatchScanner] 
+will retrieve multiple `Range`s of data using multiple threads.  A `BatchScanner` can be more efficient but does not guarantee `Key`s will be returned in sorted order.
+
+For this exercise, we need to generate a bunch of data to test BatchScanner.  Copy the code below into your _exercise_ method.
 
-For this exercise, we need to generate a bunch of data to test BatchScanner.  Copy the code below into your `exercise` method.
 ```java
-static void exercise(AccumuloClient client) throws Exception {
-    // create a table called "GothamPD".
+  static void exercise(AccumuloClient client) throws Exception {
+    // Create a table called "GothamPD".
     client.tableOperations().create("GothamPD");
 
     // Generate 10,000 rows of henchman data, each with a different number yearsOfService
     try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
-        for (int i = 0; i < 10_000; i++) {
-            Mutation m = new Mutation(String.format("id%04d", i));
-            m.put("villain", "alias", "henchman" + i);
-            m.put("villain", "yearsOfService", "" + (new Random().nextInt(50)));
-            m.put("villain", "wearsCape?", "false");
-            writer.addMutation(m);
-        }
+      for (int i = 0; i < 10_000; i++) {
+        Mutation m = new Mutation(String.format("id%04d", i));
+        m.put("villain", "alias", "henchman" + i);
+        m.put("villain", "yearsOfService", "" + (new Random().nextInt(50)));
+        m.put("villain", "wearsCape?", "false");
+        writer.addMutation(m);
+      }
     }
-}
+  }
 ```
 
 We want to calculate the average years of service from a sample of 2000 villains. A BatchScanner would be good for this task because we
 don't need the returned keys to be sorted. Follow these steps to efficiently scan the table with 10,000 entries.
 
-1. After the above code, create a BatchScanner with 5 query threads.  Similar to a Scanner, use the [createBatchScanner] method.
+1. After the above code, create a BatchScanner with five query threads.  Similar to a Scanner, use the [createBatchScanner] method.
 
-2. Create an ArrayList of 2 sample Ranges (`id1000` to `id1999` and `id9000` to `id9999`) and set the ranges of the [BatchScanner] using `setRanges`.
+2. Create an ArrayList of two sample `Range`s (`id1000` to `id1999` and `id9000` to `id9999`) and set the ranges of the [BatchScanner] using `setRanges`.
 
 3. We can make the scan more efficient by only bringing back the columns we want.  Use [fetchColumn] to get the `villain` family
 and `yearsOfService` qualifier.
diff --git a/tour/client.md b/tour/client.md
index 739a818..ba2510c 100644
--- a/tour/client.md
+++ b/tour/client.md
@@ -15,10 +15,10 @@ Notice the client can be wrapped in a Java try-with-resources since it is AutoCl
 
 Start by using table operations to list the default tables and instance operations to get the instance ID.
 ```java
-static void exercise(AccumuloClient client) throws Exception {
+  static void exercise(AccumuloClient client) throws Exception {
     for (String t : client.tableOperations().list())
-        System.out.println("Table: " + t);
-
+      System.out.println("Table: " + t);
+     
     System.out.println("Instance ID: " + client.instanceOperations().getInstanceID());
 }
 ```
diff --git a/tour/conditional-writer-code.md b/tour/conditional-writer-code.md
index 10f8469..8824941 100644
--- a/tour/conditional-writer-code.md
+++ b/tour/conditional-writer-code.md
@@ -8,7 +8,7 @@ Below is a solution to the exercise.
   static boolean setAddress(AccumuloClient client, String id, String expectedAddr, String newAddr) {
     try (ConditionalWriter writer = client.createConditionalWriter("GothamPD", new ConditionalWriterConfig())) {
       Condition condition = new Condition("location", "home");
-      if(expectedAddr != null) {
+      if (expectedAddr != null) {
         condition.setValue(expectedAddr);
       }
       ConditionalMutation mutation = new ConditionalMutation(id, condition);
@@ -18,7 +18,6 @@ Below is a solution to the exercise.
       throw new RuntimeException(e);
     }
   }
-
 ```
 
 The following output shows running the example with a conditional writer.
diff --git a/tour/conditional-writer.md b/tour/conditional-writer.md
index 2dc8aa4..74a093a 100644
--- a/tour/conditional-writer.md
+++ b/tour/conditional-writer.md
@@ -37,7 +37,7 @@ changed since it was read.
 
 ```java
   static String getAddress(AccumuloClient client, String id) {
-    // The IsolatedScanner ensures partial changes to a row are not seen
+	// The IsolatedScanner ensures partial changes to a row are not seen
     try (Scanner scanner = new IsolatedScanner(client.createScanner("GothamPD", Authorizations.EMPTY))) {
       scanner.setRange(Range.exact(id, "location", "home"));
       for (Entry<Key,Value> entry : scanner) {
@@ -64,36 +64,34 @@ changed since it was read.
     return CompletableFuture.runAsync(() -> {
       String currAddr, newAddr;
       do {
-        currAddr = getAddress(client, id);
-        newAddr = modifier.apply(currAddr);
-        System.out.printf("Thread %3d attempting change %20s -> %-20s\n",
-            Thread.currentThread().getId(), "'"+currAddr+"'", "'"+newAddr+"'");
+       currAddr = getAddress(client, id);
+       newAddr = modifier.apply(currAddr);
+       System.out.printf("Thread %3d attempting change %20s -> %-20s\n",
+       Thread.currentThread().getId(), "'"+currAddr+"'", "'"+newAddr+"'");
       } while (!setAddress(client, id, currAddr, newAddr));
-    });
+    }
   }
 
   static void exercise(AccumuloClient client) throws Exception {
     client.tableOperations().create("GothamPD");
-
     String id = "id0001";
-
     setAddress(client, id, null, "  1007 Mountain Drive, Gotham, New York  ");
 
-    // create async operation to trim whitespace
+    // Create async operation to trim whitespace
     Future<Void> future1 = modifyAddress(client, id, String::trim);
 
-    // create async operation to replace Dr with Drive
+    // Create async operation to replace Dr with Drive
     Future<Void> future2 = modifyAddress(client, id, addr -> addr.replace("Drive", "Dr"));
 
-    // create async operation to replace New York with NY
+    // Create async operation to replace New York with NY
     Future<Void> future3 = modifyAddress(client, id, addr -> addr.replace("New York", "NY"));
 
-    // wait for async operations to complete
+    // Wait for async operations to complete
     future1.get();
     future2.get();
     future3.get();
 
-    // print the address stored in Accumulo
+    // Print the address stored in Accumulo
     System.out.println("Final address : '"+getAddress(client, id)+"'");
   }
 ```
diff --git a/tour/data-model-code.md b/tour/data-model-code.md
index e76edee..988433f 100644
--- a/tour/data-model-code.md
+++ b/tour/data-model-code.md
@@ -5,8 +5,8 @@ title: Data Model Code
 Below is the solution for the exercise.
 
 ```java
-static void exercise(AccumuloClient client) throws Exception {
-    // create a table called "GothamPD".
+  static void exercise(AccumuloClient client) throws Exception {
+    // Create a table called "GothamPD".
     client.tableOperations().create("GothamPD");
 
     // Create a row for Batman
@@ -30,23 +30,24 @@ static void exercise(AccumuloClient client) throws Exception {
     // Create a BatchWriter to the GothamPD table and add your mutations to it.
     // Once the BatchWriter is closed by the try w/ resources, data will be available to scans.
     try (BatchWriter writer = client.createBatchWriter("GothamPD")) {
-        writer.addMutation(mutation1);
-        writer.addMutation(mutation2);
-        writer.addMutation(mutation3);
+      writer.addMutation(mutation1);
+      writer.addMutation(mutation2);
+      writer.addMutation(mutation3);
     }
 
     // Read and print all rows of the "GothamPD" table. Try w/ resources will close for us.
     try (Scanner scan = client.createScanner("GothamPD", Authorizations.EMPTY)) {
-        System.out.println("Gotham Police Department Persons of Interest:");
-        // A Scanner is an extension of java.lang.Iterable so behaves just like one.
-        for (Map.Entry<Key, Value> entry : scan) {
-            System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
-        }
+      System.out.println("Gotham Police Department Persons of Interest:");
+
+     // Note: A Scanner is an extension of java.lang.Iterable so it will traverse through the table.
+     for (Map.Entry<Key, Value> entry : scan) {
+       System.out.printf("Key : %-50s  Value : %s\n", entry.getKey(), entry.getValue());
+     }
     }
-}
+  }
 ```
-
 The code above will print (timestamp will differ):
+
 ```commandline
 Gotham Police Department Persons of Interest:
 Key : id0001 hero:alias [] 1511306370025 false            Value : Batman
@@ -58,4 +59,4 @@ Key : id0002 hero:wearsCape? [] 1511306370025 false       Value : true
 Key : id0003 villain:alias [] 1511306370025 false         Value : Joker
 Key : id0003 villain:name [] 1511306370025 false          Value : Unknown
 Key : id0003 villain:wearsCape? [] 1511306370025 false    Value : false
-``` 
+```
diff --git a/tour/data-model.md b/tour/data-model.md
index 6160f72..59124dc 100644
--- a/tour/data-model.md
+++ b/tour/data-model.md
@@ -1,7 +1,7 @@
 ---
 title: Data Model
 ---
-Data is stored in Accumulo in a distributed sorted map. The Keys of the map are broken up logically into a few different parts, 
+Data is stored in Accumulo in a distributed sorted map. The `Key`s of the map are broken up logically into a few different parts, 
 as seen in the image below.
 
 ![key value pair]({{ site.baseurl }}/images/docs/key_value.png)
diff --git a/tour/getting-started.md b/tour/getting-started.md
index 7aff174..2028090 100644
--- a/tour/getting-started.md
+++ b/tour/getting-started.md
@@ -18,12 +18,12 @@ version of Accumulo that runs on your local filesystem.  It should only be used
 great here on the tour.  Files and logs used by [MiniAccumuloCluster] can be seen in the `target/mac######` directory.
 
 3. Modify the _exercise_ method to print a hello message. You will put your code in this method for each lesson.
-    ```java
-    static void exercise(AccumuloClient client) {
-        // start writing your code here
-        System.out.println("Hello world");
-    }
-    ```
+```java
+  static void exercise(AccumuloClient client) {
+    // Write your code here
+    System.out.println("Hello world"); 
+  }
+```
 4. Use the following Maven command to build and run the tour.
 ```commandline
 mvn -q clean verify exec:exec
diff --git a/tour/ranges-splits.md b/tour/ranges-splits.md
index 17197db..0cf8727 100644
--- a/tour/ranges-splits.md
+++ b/tour/ranges-splits.md
@@ -2,7 +2,7 @@
 title: Ranges and Splits
 ---
 
-A [Range] is a specified group of Keys. There are many different ways to create a Range.  Here are a few examples:
+A [Range] is a specified group of `Key`s. There are many different ways to create a `Range`.  Here are a few examples:
 
 ```java
 Range r1 = new Range(startKey, endKey);  // Creates a range from startKey inclusive to endKey inclusive.
@@ -10,14 +10,14 @@ Range r2 = new Range(row);               // Creates a range that covers an entir
 Range r3 = new Range(startRow, endRow);  // Creates a range from startRow inclusive to endRow inclusive.
 ```
 
-A Scanner by default will scan all Keys in a table but this can be inefficient. It is a good practice to set a range on a Scanner.
+A `Scanner` by default will scan all `Key`s in a table but this can be inefficient. It is a good practice to set a range on a Scanner.
 
 ```java
 scanner.setRange(new Range("id0000", "id0010"));  // returns rows from id0000 to id0010
 ```
 
-As your data grows larger, Accumulo will split tables into smaller pieces called Tablets.  Tablets can then be distributed across multiple Tablet Servers.  
-By default, a table will get split into Tablets on row boundaries, guaranteeing an entire row to be on one Tablet Server.  We have the ability to 
+As your data grows larger, Accumulo will split tables into smaller pieces called `Tablet`s which can be distributed across multiple Tablet Servers.  
+By default, a table will get split into `Tablet`s on row boundaries, guaranteeing an entire row to be on one Tablet Server.  We have the ability to 
 tell Accumulo where to split tables by setting split points. This is done using `addSplits` in the [TableOperations] API.  The image below 
 demonstrates how Accumulo splits data.  
 
@@ -32,8 +32,8 @@ Take a minute to learn these Accumulo terms:
 
 Knowing these terms are critical when working closely with Accumulo.  Iterators are especially unique and powerful.  More on them later.
 
-When working with large amounts of data across many Tablet Servers, a simple Scanner might not do the trick. Next lesson we learn about the power of 
-the multi-threaded BatchScanner!  
+When working with large amounts of data across many 'Tablet Server's, a simple Scanner might not do the trick. Next lesson we learn about the power of 
+the multi-threaded `BatchScanner`!  
 
 [Range]: {% jurl org.apache.accumulo.core.data.Range %}
 [TableOperations]: {% jurl org.apache.accumulo.core.client.admin.TableOperations %}