Implement a tool to find tajo configurations.

Details

Description

I suggest to implement a tool to find tajo configurations like the “hdfs getconf” tool. If we support the tool, users way wish to write shell scripts that interact with their tajo cluster, and it is useful to be able to fetch configs like the state of whether HA is enables or the mode of the worker.

ASF GitHub Bot
added a comment - 07/Aug/14 05:19 Github user blrunner commented on the pull request:
https://github.com/apache/tajo/pull/105#issuecomment-51432189
I updated a semantic for this patch.
For reference, I applied "showmasters" instead of "show-masters". Because, "-" is a illegal character value in Options.

ASF GitHub Bot
added a comment - 07/Aug/14 02:07 Github user hyunsik commented on the pull request:
https://github.com/apache/tajo/pull/105#issuecomment-51422456
I have some comments:
Your proposal is the similar to Hadoop's one. It looks good, but I think that some semantic does not seem to be consistent.
I'd like to propose as follows:
```
bin/tajo admin -show-masters
bin/tajo getconf tajo.rootdir
hdfs://localhost:9010/tajo
```
How do you think about that?

If you tried to find default configurations, you couldn't find the configuration. Because TajoConf::get just supports to find the configuration in tajo-site.xml. So, I updated TajoGetConf::processConfKey. And you can use this patch as follows:

{
+ // it checks if the client service address is given in configuration and distributed mode.
+ // if so, it sets entryAddr.
+ hostName = tajoConf.getVar(TajoConf.ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS).split(":")[0];
+ }

{
+ // it checks if the client service address is given in configuration and distributed mode.
+ // if so, it sets entryAddr.
+ port = Integer.parseInt(tajoConf.getVar(TajoConf.ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS).split(":")[1]);
+ }

{
+ // it checks if the client service address is given in configuration and distributed mode.
+ // if so, it sets entryAddr.
+ hostName = tajoConf.getVar(TajoConf.ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS).split(":")[0];
+ }

{
+ // it checks if the client service address is given in configuration and distributed mode.
+ // if so, it sets entryAddr.
+ port = Integer.parseInt(tajoConf.getVar(TajoConf.ConfVars.TAJO_MASTER_CLIENT_RPC_ADDRESS).split(":")[1]);
+ }

ASF GitHub Bot
added a comment - 04/Aug/14 06:17 GitHub user blrunner opened a pull request:
https://github.com/apache/tajo/pull/105
TAJO-990 : Implement a tool to find tajo configurations.
I created pull request again because I missed a title of previous request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/blrunner/tajo TAJO-990
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tajo/pull/105.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #105
commit 492bc4ed54100d5f1a7eb5c3682d25f4c2902158
Author: blrunner <blrunner@freegiansui-mbp.server.gruter.com>
Date: 2014-08-04T06:09:49Z
TAJO-990 : Implement a tool to find tajo configurations.
commit b2b6ef75355d48181461645882377e7ff24d4be2
Author: blrunner <blrunner@freegiansui-mbp.server.gruter.com>
Date: 2014-08-04T06:12:33Z
Modified local variable name.