Created
September 7, 2013 19:42
-
-
Save Arnonrgo/6478601 to your computer and use it in GitHub Desktop.
Setting up an embeded Hbase cluster for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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