[
https://issues.apache.org/jira/browse/HBASE-10409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13880413#comment-13880413
]
Elliott Clark commented on HBASE-10409:
---------------------------------------
Here's an example:
{code}
package org.apache.hadoop.hbase.util;
import org.apache.commons.cli.CommandLine;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.util.ToolRunner;
public class TestTool extends AbstractHBaseTool {
@Override
protected void addOptions() {
}
@Override
protected void processOptions(CommandLine cmd) {
}
@Override
protected int doWork() throws Exception {
System.out.println(getConf().get("testValue","default"));
return 0;
}
public static void main(String[] args) {
int ret;
try {
ret = ToolRunner.run(HBaseConfiguration.create(), new TestTool(), args);
} catch (Exception ex) {
ret = 1;
}
System.exit(ret);
}
}
{code}
Then running that simple code results in:
{code}
eclark@eclark-MBPr ~/Code/public/hbase (trunk●●)$ bin/hbase
org.apache.hadoop.hbase.util.TestTool -DtestValue="my string"
my string
{code}
> Allow config options related to zookeeper to be passed to
> IntegrationTestsDriver
> --------------------------------------------------------------------------------
>
> Key: HBASE-10409
> URL: https://issues.apache.org/jira/browse/HBASE-10409
> Project: HBase
> Issue Type: Test
> Reporter: Ted Yu
> Assignee: Ted Yu
> Fix For: 0.98.0, 0.99.0
>
> Attachments: 10409-v1.txt
>
>
> Currently IntegrationTestsDriver only accepts one parameter: regex for
> integration test.
> {code}
> public static void main(String[] args) throws Exception {
> int ret = ToolRunner.run(new IntegrationTestsDriver(), args);
> {code}
> To allow IntegrationTestsDriver to be activated through Java API, support for
> passing config options related to zookeeper should be added - similarly to
> what LoadTestTool supports.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)