anchor.diff:  === Setting the Classpath
   
   To use Jython with HBase, your CLASSPATH must include HBase's classpath as well as
  -the Jython JARs required by your code. First, use the following command on a server
  -running the HBase RegionServer process, to get HBase's classpath.
  +the Jython JARs required by your code.
  +
  +Set the path to directory containing the `jython.jar` and each additional Jython-related JAR needed for
  +your project. Then export HBASE_CLASSPATH pointing to the $JYTHON_HOME env. variable.
   
   [source, bash]
   ----
  -$ ps aux |grep regionserver| awk -F 'java.library.path=' {'print $2'} | awk {'print $1'}
  -
  -/usr/lib/hadoop/lib/native:/usr/lib/hbase/lib/native/Linux-amd64-64
  -----
  -
  -Set the `$CLASSPATH` environment variable to include the path you found in the previous
  -step, plus the path to `jython.jar` and each additional Jython-related JAR needed for
  -your project.
  -
  -[source, bash]
  -----
  -$ export CLASSPATH=$CLASSPATH:/usr/lib/hadoop/lib/native:/usr/lib/hbase/lib/native/Linux-amd64-64:/path/to/jython.jar
  +$ export HBASE_CLASSPATH=/directory/jython.jar
   ----
   
   Start a Jython shell with HBase and Hadoop JARs in the classpath:
  
positive.code: 
  .Table Creation, Population, Get, and Delete with Jython
  ====
  The following Jython code example creates a table, populates it with data, fetches
  the data, and deletes the table.
  
  [source,jython]
  ----
  import java.lang
  from org.apache.hadoop.hbase import HBaseConfiguration, HTableDescriptor, HColumnDescriptor, HConstants, TableName
  from org.apache.hadoop.hbase.client import HBaseAdmin, HTable, Get
  from org.apache.hadoop.hbase.io import Cell, RowResult
  
  # First get a conf object.  This will read in the configuration
  # that is out in your hbase-*.xml files such as location of the
  # hbase master node.
  conf = HBaseConfiguration()
  
  # Create a table named 'test' that has two column families,
  # one named 'content, and the other 'anchor'.  The colons
  # are required for column family names.
  tablename = TableName.valueOf("test")
  
  desc = HTableDescriptor(tablename)
  desc.addFamily(HColumnDescriptor("content:"))
  desc.addFamily(HColumnDescriptor("anchor:"))
  admin = HBaseAdmin(conf)
  
  # Drop and recreate if it exists
  if admin.tableExists(tablename):
      admin.disableTable(tablename)
      admin.deleteTable(tablename)
  admin.createTable(desc)
  
  tables = admin.listTables()
  table = HTable(conf, tablename)
  
  # Add content to 'column:' on a row named 'row_x'
  row = 'row_x'
  update = Get(row)
  update.put('content:', 'some content')
  table.commit(update)
  
  # Now fetch the content just added, returns a byte[]
  data_row = table.get(row, "content:")
  data = java.lang.String(data_row.value, "UTF8")
  
  print "The fetched row contains the value '%s'" % data
  
  # Delete the table.
  admin.disableTable(desc.getName())
  admin.deleteTable(desc.getName())
  ----
  ====
  
  
negative.code: 
  [source, jython]
  ----
  import java.lang
  from org.apache.hadoop.hbase import TableName, HBaseConfiguration
  from org.apache.hadoop.hbase.client import Connection, ConnectionFactory, Result, ResultScanner, Table, Admin
  from org.apache.hadoop.conf import Configuration
  conf = HBaseConfiguration.create()
  connection = ConnectionFactory.createConnection(conf)
  admin = connection.getAdmin()
  tableName = TableName.valueOf('wiki')
  table = connection.getTable(tableName)
  
  cf = "title"
  attr = "attr"
  scanner = table.getScanner(cf)
  while 1:
      result = scanner.next()
      if not result:
         break
      print java.lang.String(result.row), java.lang.String(result.getValue(cf, attr))
  ----
  ====
  