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:58:15 UTC
[accumulo-website] branch main updated: Remove tabs and trailing
whitespace in tour
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 25bfa81 Remove tabs and trailing whitespace in tour
25bfa81 is described below
commit 25bfa810c32edede026d9cbfc55b175f474e66bb
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Wed Jan 20 19:57:19 2021 -0500
Remove tabs and trailing whitespace in tour
As follow-up from #255, remove tab characters and trailing whitespace
from all markdown files in the tour pages.
---
tour/authorizations-code.md | 10 +++++-----
tour/authorizations.md | 13 ++++++-------
tour/basic-read-write.md | 6 +++---
tour/batch-scanner-code.md | 24 ++++++++++++------------
tour/batch-scanner.md | 2 +-
tour/client.md | 4 ++--
tour/conditional-writer.md | 2 +-
tour/data-model.md | 4 ++--
tour/getting-started.md | 2 +-
tour/ranges-splits.md | 12 ++++++------
10 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/tour/authorizations-code.md b/tour/authorizations-code.md
index 3a73850..14ef281 100644
--- a/tour/authorizations-code.md
+++ b/tour/authorizations-code.md
@@ -9,7 +9,7 @@ Below is a solution for the exercise.
// 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);
@@ -43,14 +43,14 @@ Below is a solution for the exercise.
writer.addMutation(mutation3);
}
- // Create a second client for the commissioner user and output all the rows visible to them.
+ // 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());
- }
+ for (Map.Entry<Key, Value> entry : scan) {
+ System.out.printf("Key : %-50s Value : %s\n", entry.getKey(), entry.getValue());
+ }
}
}
```
diff --git a/tour/authorizations.md b/tour/authorizations.md
index f025145..99383da 100644
--- a/tour/authorizations.md
+++ b/tour/authorizations.md
@@ -22,7 +22,7 @@ We now want to secure our secret identities of the heroes so that only users wit
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);
@@ -32,17 +32,16 @@ We now want to secure our secret identities of the heroes so that only users wit
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()) {
// Insert your code here
-
- };
+ }
```
5. Using the commissioner client, create a Scanner with the authorizations needed to view the secret identities.
@@ -56,4 +55,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 %}
\ No newline at end of file
+[Accumulo]: {% jurl org.apache.accumulo.core.client.Accumulo %}
diff --git a/tour/basic-read-write.md b/tour/basic-read-write.md
index 89780eb..9b51ae9 100644
--- a/tour/basic-read-write.md
+++ b/tour/basic-read-write.md
@@ -38,14 +38,14 @@ Copy this code into your `exercise` method then compile and run.
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
+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!
+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/data-model
[auths]: /tour/authorizations
diff --git a/tour/batch-scanner-code.md b/tour/batch-scanner-code.md
index 16cd49d..0087837 100644
--- a/tour/batch-scanner-code.md
+++ b/tour/batch-scanner-code.md
@@ -23,20 +23,20 @@ Below is a solution to the exercise.
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);
+ 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"));
+ // 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++;
+ // 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);
}
diff --git a/tour/batch-scanner.md b/tour/batch-scanner.md
index bf27771..8adfd1a 100644
--- a/tour/batch-scanner.md
+++ b/tour/batch-scanner.md
@@ -1,7 +1,7 @@
---
title: Batch Scanner
---
-Running on a single thread, a `Scanner` will retrieve a single `Range` of data and return `Key`s in sorted order. A [BatchScanner]
+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.
diff --git a/tour/client.md b/tour/client.md
index ba2510c..7fcd5b5 100644
--- a/tour/client.md
+++ b/tour/client.md
@@ -18,7 +18,7 @@ Start by using table operations to list the default tables and instance operatio
static void exercise(AccumuloClient client) throws Exception {
for (String t : client.tableOperations().list())
System.out.println("Table: " + t);
-
+
System.out.println("Instance ID: " + client.instanceOperations().getInstanceID());
}
```
@@ -35,4 +35,4 @@ client.replicationOperations();
The client is also used directly to create Scanners and perform batch operations. These will be explored later.
[AccumuloClient]: {% jurl org.apache.accumulo.core.client.AccumuloClient %}
-[Accumulo]: {% jurl org.apache.accumulo.core.client.Accumulo %}
\ No newline at end of file
+[Accumulo]: {% jurl org.apache.accumulo.core.client.Accumulo %}
diff --git a/tour/conditional-writer.md b/tour/conditional-writer.md
index 74a093a..f101326 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) {
diff --git a/tour/data-model.md b/tour/data-model.md
index 59124dc..dd25133 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 `Key`s 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)
@@ -12,7 +12,7 @@ as seen in the image below.
**Column Visibility** - Security label controlling access to the key/value pair.<br/>
**Timestamp** - Generated automatically and used for versioning.
-The **value** is where the actual data is stored. For brevity, we often refer to the 3 parts of the column as the family, qualifier and visibility.
+The **value** is where the actual data is stored. For brevity, we often refer to the 3 parts of the column as the family, qualifier and visibility.
Take a closer look at the Mutation object created in the first exercise:
```java
diff --git a/tour/getting-started.md b/tour/getting-started.md
index 2028090..6479167 100644
--- a/tour/getting-started.md
+++ b/tour/getting-started.md
@@ -21,7 +21,7 @@ great here on the tour. Files and logs used by [MiniAccumuloCluster] can be see
```java
static void exercise(AccumuloClient client) {
// Write your code here
- System.out.println("Hello world");
+ System.out.println("Hello world");
}
```
4. Use the following Maven command to build and run the tour.
diff --git a/tour/ranges-splits.md b/tour/ranges-splits.md
index 0cf8727..66685cc 100644
--- a/tour/ranges-splits.md
+++ b/tour/ranges-splits.md
@@ -16,10 +16,10 @@ A `Scanner` by default will scan all `Key`s in a table but this can be inefficie
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 `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.
+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.
![data distribution]({{ site.baseurl }}/images/docs/data_distribution.png)
@@ -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 Server's, 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 %}