Created
November 13, 2015 14:44
-
-
Save wjsl/5f0e1208bb1e78ccafa9 to your computer and use it in GitHub Desktop.
How set up MiniAccumuloCluster and set custom configuration parameters
This file contains 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
// 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