summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
authorVenky Shankar <venky@gluster.com>2011-09-13 11:36:55 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-13 10:14:04 -0700
commitd705b28fd1bb066632854da493031118776d00df (patch)
treefa1e2710695b2c0ad6d9bc93d7b235922c634f7e /xlators/mgmt/glusterd/src/glusterd.c
parentb039cb193eddc51c6f31bf9a230281faada475fe (diff)
GlusterFS Hadoop specific DSL for mountbroker
Change-Id: Ie379992bdea0974c8c5e1a4d7bc3e87cefe0d256 BUG: 3539 Reviewed-on: http://review.gluster.com/404 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index d85777b1bf1..69923256c0a 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -664,23 +664,32 @@ check_prepare_mountbroker_root (char *mountbroker_root)
static void
_install_mount_spec (dict_t *opts, char *key, data_t *value, void *data)
{
- glusterd_conf_t *priv = THIS->private;
- char *label = NULL;
- gf_boolean_t georep = _gf_false;
- char *pdesc = value->data;
- char *volname = NULL;
- int *ret = data;
- int rv = 0;
- gf_mount_spec_t *mspec = NULL;
- char *user = NULL;
+ glusterd_conf_t *priv = THIS->private;
+ char *label = NULL;
+ gf_boolean_t georep = _gf_false;
+ gf_boolean_t ghadoop = _gf_false;
+ char *pdesc = value->data;
+ char *volname = NULL;
+ int *ret = data;
+ int rv = 0;
+ gf_mount_spec_t *mspec = NULL;
+ char *user = NULL;
+ char *volfile_server = NULL;
if (*ret == -1)
return;
label = strtail (key, "mountbroker.");
+
+ /* check for presence of geo-rep/hadoop label */
if (!label) {
- georep = _gf_true;
label = strtail (key, "mountbroker-"GEOREP".");
+ if (label)
+ georep = _gf_true;
+
+ label = strtail (key, "mountbroker-"GHADOOP".");
+ if (label)
+ ghadoop = _gf_true;
}
if (!label)
@@ -691,7 +700,7 @@ _install_mount_spec (dict_t *opts, char *key, data_t *value, void *data)
goto err;
mspec->label = label;
- if (georep) {
+ if (georep || ghadoop) {
volname = gf_strdup (pdesc);
if (!volname)
goto err;
@@ -701,7 +710,20 @@ _install_mount_spec (dict_t *opts, char *key, data_t *value, void *data)
user++;
} else
user = label;
- rv = make_georep_mountspec (mspec, volname, user);
+
+ if (georep)
+ rv = make_georep_mountspec (mspec, volname, user);
+
+ if (ghadoop) {
+ volfile_server = strchr (user, ':');
+ if (volfile_server)
+ *volfile_server++ = '\0';
+ else
+ volfile_server = "localhost";
+
+ rv = make_ghadoop_mountspec (mspec, volname, user, volfile_server);
+ }
+
GF_FREE (volname);
if (rv != 0)
goto err;
@@ -1073,6 +1095,9 @@ struct volume_options options[] = {
{ .key = {"mountbroker-"GEOREP".*"},
.type = GF_OPTION_TYPE_ANY,
},
+ { .key = {"mountbroker-"GHADOOP".*"},
+ .type = GF_OPTION_TYPE_ANY,
+ },
{ .key = {GEOREP"-log-group"},
.type = GF_OPTION_TYPE_ANY,
},