Skip to content

Instantly share code, notes, and snippets.

@wjsl
Created November 13, 2015 14:44
Show Gist options
  • Save wjsl/5f0e1208bb1e78ccafa9 to your computer and use it in GitHub Desktop.
Save wjsl/5f0e1208bb1e78ccafa9 to your computer and use it in GitHub Desktop.
How set up MiniAccumuloCluster and set custom configuration parameters
// Similar to setting up the regular MiniAccumuloCluster, but we use the *Impl classes directly
object Demo {
def main(args : Array[String]): Unit = {
var dir: File = null
var accumulo: MiniAccumuloClusterImpl = null
try {
dir = Files.createTempDir();
dir.deleteOnExit()
println("Working in " + dir)
// Custom config parameters here
val conf = new MiniAccumuloConfigImpl(dir, "password")
conf.setProperty(Property.getPropertyByKey("instance.security.authorizor"), classOf[AOKAuthorizor].getName)
conf.setProperty(Property.getPropertyByKey("instance.security.authenticator"), classOf[BBAuthenticator].getName)
conf.setProperty(Property.getPropertyByKey("instance.security.permissionHandler"), classOf[AOKPermHandler].getName)
accumulo = new MiniAccumuloClusterImpl(conf)
accumulo.start()
// work goes here
} finally {
if(accumulo != null) accumulo.stop()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment