Annotation Conventions

Many of the code examples in this book are annotated using markers in the form #1, #2, #3 and so forth. Whenever you see such a marker in a code listing, know that it is not part of the code per se. It is instead a reference to an annotation resolved at the bottom of the listing.

For example, following are some lines from Listing 5-4 in Chapter 5:

public class GiraphHelloWorld extends                                    #2
   BasicComputation<IntWritable, IntWritable,
                    NullWritable, NullWritable> {
  @Override
  public void compute(Vertex<IntWritable,                                #3
                      IntWritable, NullWritable> vertex,
                  Iterable<NullWritable> messages) {

Look at that listing, and you’ll see the references #2 and #3 resolved following the listing in body text. Here’s how that looks:

...
    System.exit(ToolRunner.run(new GiraphRunner(), args));
  }
}

#1 Required important statements. We will omit those in all future listings.
#2 Extending the most basic abstract superclass for defining our graph computation.
#3 Defining compute method that would be called for every vertex.

You’ll see the foregoing annotation convention used throughout the book. Annotations in code in the form #1, #2, #3 correspond to comments given immediately following the code listing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset