Skip to content

Instantly share code, notes, and snippets.

@Arnonrgo
Created September 7, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arnonrgo/6478601 to your computer and use it in GitHub Desktop.
Save Arnonrgo/6478601 to your computer and use it in GitHub Desktop.
Setting up an embeded Hbase cluster for testing
val tableName="testTable"
val family = Bytes.toBytes("f")
val qualifier=Bytes.toBytes("q")
val hbaseTestUtil = new HBaseTestingUtility()
val config = hbaseTestUtil.getConfiguration
val tmpDir = File.createTempFile("logdir", "")
tmpDir.delete()
tmpDir.mkdir()
tmpDir.deleteOnExit()
config.set("hadoop.log.dir", tmpDir.getAbsolutePath)
config.set(CoprocessorHost.USER_REGION_COPROCESSOR_CONF_KEY,
classOf[BulkDeleteEndpoint].getName)
hbaseTestUtil.startMiniCluster(2)
//create a sample table
val admin=new HBaseAdmin(config)
.
.
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment