hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [06/37] hadoop git commit: HDFS-13215. RBF: Move Router to its own module.
Date Tue, 20 Mar 2018 06:17:55 GMT
http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.html
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.html
deleted file mode 100644
index a490086..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.html
+++ /dev/null
@@ -1,422 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="X-UA-Compatible" content="IE=9" />
-<link rel="stylesheet" type="text/css" href="/static/bootstrap-3.0.2/css/bootstrap.min.css" />
-<link rel="stylesheet" type="text/css" href="/static/dataTables.bootstrap.css" />
-<link rel="stylesheet" type="text/css" href="/static/hadoop.css" />
-<title>Router Information</title>
-</head>
-<body>
-
-<header class="navbar navbar-inverse bs-docs-nav" role="banner">
-<div class="container">
-  <div class="navbar-header">
-    <div class="navbar-brand">Hadoop</div>
-  </div>
-
-  <ul class="nav navbar-nav" id="ui-tabs">
-    <li><a href="#tab-overview">Overview</a></li>
-    <li><a href="#tab-namenode">Subclusters</a></li>
-    <li><a href="#tab-router">Routers</a></li>
-    <li><a href="#tab-datanode">Datanodes</a></li>
-    <li><a href="#tab-mounttable">Mount table</a></li>
-    <li class="dropdown">
-      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Utilities <b class="caret"></b></a>
-      <ul class="dropdown-menu">
-        <li><a href="jmx">Metrics</a></li>
-        <li><a href="conf">Configuration</a></li>
-        <li><a href="logs">Logs</a></li>
-        <li><a href="fsck">FSCK</a></li>
-      </ul>
-    </li>
-  </ul>
-</div>
-</header>
-
-<div class="container">
-
-<div id="alert-panel">
-  <div class="alert alert-danger">
-    <button type="button" class="close" onclick="$('#alert-panel').hide();">&times;</button>
-    <div class="alert-body" id="alert-panel-body"></div>
-  </div>
-</div>
-
-<div class="tab-content">
-  <div class="tab-pane" id="tab-overview"></div>
-  <div class="tab-pane" id="tab-namenode"></div>
-  <div class="tab-pane" id="tab-router"></div>
-  <div class="tab-pane" id="tab-datanode"></div>
-  <div class="tab-pane" id="tab-mounttable"></div>
-</div>
-
-<div class="row">
-  <hr />
-  <div class="col-xs-2"><p>Hadoop, {release-year-token}.</p></div>
-</div>
-</div>
-
-<!-- Overview -->
-<script type="text/x-dust-template" id="tmpl-federationhealth">
-<div class="page-header"><h1>Router {#federation}<small>'{HostAndPort}'</small>{/federation}</h1></div>
-{#federation}
-<table class="table table-bordered table-striped">
-  <tr><th>Started:</th><td>{RouterStarted}</td></tr>
-  <tr><th>Version:</th><td>{Version}</td></tr>
-  <tr><th>Compiled:</th><td>{CompileInfo}</td></tr>
-  <tr><th>Cluster ID:</th><td>{ClusterId}</td></tr>
-  <tr><th>Block Pool ID:</th><td>{BlockPoolId}</td></tr>
-  <tr><th>Status:</th><td>{RouterStatus}</td></tr>
-</table>
-{/federation}
-
-<div class="page-header"><h1>Summary</h1></div>
-{#federation}
-<table class="table table-bordered table-striped">
-  <tr><th>Total capacity</th><td>{TotalCapacity|fmt_bytes}</td></tr>
-  <tr><th>Used capacity</th><td>{UsedCapacity|fmt_bytes}</td></tr>
-  <tr><th>Remaining capacity</th><td>{RemainingCapacity|fmt_bytes}</td></tr>
-  <tr><th>Nameservices</th><td>{NumNameservices}</td></tr>
-  <tr><th>Namenodes</th><td>{NumNamenodes}</td></tr>
-  <tr>
-    <th>DataNodes usages% (Min/Median/Max/stdDev)</th>
-    <td>{#NodeUsage.nodeUsage}{min} / {median} / {max} / {stdDev}{/NodeUsage.nodeUsage}</td>
-  </tr>
-  <tr><th><a href="#tab-datanode">Live Nodes</a></th><td>{NumLiveNodes} (Decommissioned: {NumDecomLiveNodes})</td></tr>
-  <tr><th><a href="#tab-datanode">Dead Nodes</a></th><td>{NumDeadNodes} (Decommissioned: {NumDecomDeadNodes})</td></tr>
-  <tr><th><a href="#tab-datanode">Decommissioning Nodes</a></th><td>{NumDecommissioningNodes}</td></tr>
-  <tr><th>Files</th><td>{NumFiles}</td></tr>
-  <tr><th>Blocks</th><td>{NumBlocks}</td></tr>
-  <tr><th title="Excludes missing blocks.">Number of Under-Replicated Blocks</th><td>{NumOfBlocksUnderReplicated}</td></tr>
-  <tr><th>Number of Blocks Pending Deletion</th><td>{NumOfBlocksPendingDeletion}</td></tr>
-</table>
-{/federation}
-</script>
-
-<!-- Subclusters info: list of nameservices and namenodes -->
-<script type="text/x-dust-template" id="tmpl-namenode">
-<div class="page-header"><h1>Nameservice Information</h1></div>
-<div>
-  <ul class="dfshealth-node-legend">
-    <li class="dfshealth-node-icon dfshealth-node-alive">Active</li>
-    <li class="dfshealth-node-icon dfshealth-node-down-decommissioned">Standby</li>
-    <li class="dfshealth-node-icon dfshealth-node-down-maintenance">Safe mode</li>
-    <li class="dfshealth-node-icon dfshealth-node-down">Unavailable</li>
-  </ul>
-</div>
-<small>
-<table class="table">
-  <thead>
-    <tr>
-      <th colspan="6"></th>
-      <th colspan="3">Blocks</th>
-      <th colspan="2">Nodes</th>
-      <th colspan="3">Decom</th>
-    </tr>
-    <tr>
-      <th></th>
-      <th>Nameservice</th>
-      <th>Namenode</th>
-      <th>Last Contact</th>
-      <th>Capacity</th>
-      <th>Files</th>
-      <th>Total</th>
-      <th>Missing</th>
-      <th>Under-Replicated</th>
-      <th>Live</th>
-      <th>Dead</th>
-      <th>Progress</th>
-      <th>Live</th>
-      <th>Dead</th>
-    </tr>
-  </thead>
-  <tbody>
-    {#Nameservices}
-    <tr>
-      <td class="dfshealth-node-icon dfshealth-node-{iconState}" title="{title}"></td>
-      <td><a href="http://{webAddress}">{nameserviceId}</a></td>
-      <td><a href="http://{webAddress}">{namenodeId}</a></td>
-      <td>{lastHeartbeat}</td>
-      <td ng-value="{usedPercentage}" style="width:210px">
-        <div>
-          <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{totalSpace|fmt_bytes}</div>
-          <div class="clearfix progress dfshealth-node-capacity-bar" title="Used: {used|fmt_bytes}">
-            <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
-            </div>
-          </div>
-        </div>
-      </td>
-      <td>{numOfFiles}</td>
-      <td>{numOfBlocks}</td>
-      <td>{numOfBlocksMissing}</td>
-      <td>{numOfBlocksUnderReplicated}</td>
-      <td>{numOfActiveDatanodes}</td>
-      <td>{numOfDeadDatanodes}</td>
-      <td>{numOfDecommissioningDatanodes}</td>
-      <td>{numOfDecomActiveDatanodes}</td>
-      <td>{numOfDecomDeadDatanodes}</td>
-    </tr>
-    {/Nameservices}
-  </tbody>
-</table>
-</small>
-
-<div class="page-header"><h1>Namenode Information</h1></div>
-<div>
-  <ul class="dfshealth-node-legend">
-    <li class="dfshealth-node-icon dfshealth-node-alive">Active</li>
-    <li class="dfshealth-node-icon dfshealth-node-down-decommissioned">Standby</li>
-    <li class="dfshealth-node-icon dfshealth-node-down-maintenance">Safe mode</li>
-    <li class="dfshealth-node-icon dfshealth-node-down">Unavailable</li>
-  </ul>
-</div>
-<small>
-<table class="table">
-  <thead>
-    <tr>
-      <th colspan="7"></th>
-      <th colspan="3">Blocks</th>
-      <th colspan="2">Nodes</th>
-      <th colspan="3">Decom</th>
-    </tr>
-    <tr>
-      <th></th>
-      <th colspan="2">Namenode</th>
-      <th>Web address</th>
-      <th>Last Contact</th>
-      <th>Capacity</th>
-      <th>Files</th>
-      <th>Total</th>
-      <th>Missing</th>
-      <th>Under-Replicated</th>
-      <th>Live</th>
-      <th>Dead</th>
-      <th>Progress</th>
-      <th>Live</th>
-      <th>Dead</th>
-    </tr>
-  </thead>
-  <tbody>
-    {#Namenodes}
-    <tr>
-      <td class="dfshealth-node-icon dfshealth-node-{iconState}" title="{title}"></td>
-      <td>{nameserviceId}</td>
-      <td>{namenodeId}</td>
-      <td><a href="http://{webAddress}">{webAddress}</a></td>
-      <td>{lastHeartbeat}</td>
-      <td ng-value="{usedPercentage}" style="width:210px">
-        <div>
-          <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{totalSpace|fmt_bytes}</div>
-          <div class="clearfix progress dfshealth-node-capacity-bar" title="Used: {used|fmt_bytes}">
-            <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
-            </div>
-          </div>
-        </div>
-      </td>
-      <td>{numOfFiles}</td>
-      <td>{numOfBlocks}</td>
-      <td>{numOfBlocksMissing}</td>
-      <td>{numOfBlocksUnderReplicated}</td>
-      <td>{numOfActiveDatanodes}</td>
-      <td>{numOfDeadDatanodes}</td>
-      <td>{numOfDecommissioningDatanodes}</td>
-      <td>{numOfDecomActiveDatanodes}</td>
-      <td>{numOfDecomDeadDatanodes}</td>
-    </tr>
-    {/Namenodes}
-  </tbody>
-</table>
-</small>
-</script>
-
-<!-- Routers -->
-<script type="text/x-dust-template" id="tmpl-router">
-<div class="page-header"><h1>Routers Information</h1></div>
-<div>
-  <ul class="dfshealth-node-legend">
-    <li class="dfshealth-node-icon dfshealth-node-alive">Active</li>
-    <li class="dfshealth-node-icon dfshealth-node-decommissioned">Safe mode</li>
-    <li class="dfshealth-node-icon dfshealth-node-down">Unavailable</li>
-  </ul>
-</div>
-<table class="table">
-  <thead>
-    <tr>
-      <th colspan="4"></th>
-      <th colspan="2">Last update</th>
-      <th></th>
-    </tr>
-    <tr>
-      <th></th>
-      <th>Address</th>
-      <th>Status</th>
-      <th>Heartbeat</th>
-      <th>Membership</th>
-      <th>Mount table</th>
-      <th>Version</th>
-    </tr>
-  </thead>
-  <tbody>
-    {#Routers}
-    <tr>
-      <td class="dfshealth-node-icon dfshealth-node-{iconState}" title="{title}"></td>
-      <td>{address}</td>
-      <td>{status}</td>
-      <td>{lastHeartbeat} sec ago</td>
-      <td>{lastMembershipUpdate}</td>
-      <td>{lastMountTableUpdate}</td>
-      <td>{version}</td>
-    </tr>
-    {/Routers}
-  </tbody>
-</table>
-</script>
-
-<!-- Datanodes -->
-<script type="text/x-dust-template" id="tmpl-datanode">
-<div class="page-header"><h1>Datanode Information</h1></div>
-<div>
-  <ul class="dfshealth-node-legend">
-    <li class="dfshealth-node-icon dfshealth-node-alive">In service</li>
-    <li class="dfshealth-node-icon dfshealth-node-down">Down</li>
-    <li class="dfshealth-node-icon dfshealth-node-decommissioned">Decommissioned</li>
-    <li class="dfshealth-node-icon dfshealth-node-down-decommissioned">Decommissioned &amp; dead</li>
-  </ul>
-</div>
-<div class="page-header"><h1><small>In operation</small></h1></div>
-<small>
-<table class="table" id="table-datanodes">
-  <thead>
-    <tr>
-      <th>Node</th>
-      <th>Last contact</th>
-      <th style="width:180px; text-align:center">Capacity</th>
-      <!--th>Blocks</th-->
-      <th>Block pool used</th>
-      <!--th>Version</th-->
-    </tr>
-  </thead>
-  {#LiveNodes}
-  <tr>
-    <td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{location}/{name} ({xferaddr})</td>
-    <td ng-value="{lastContact}">{#helper_relative_time value="{lastContact}"/}</td>
-    <td ng-value="{usedPercentage}" style="width:210px">
-      <div>
-        <div style="display:inline-block; float: left; padding-right: 10px; width:60px;">{capacity|fmt_bytes}</div>
-        <div class="clearfix progress dfshealth-node-capacity-bar" title="Non DFS: {nonDfsUsedSpace|fmt_bytes}, Used: {used|fmt_bytes}">
-          <div class="progress-bar {#helper_usage_bar value="{usedPercentage}"/}" style="width: {usedPercentage}%">
-          </div>
-        </div>
-      </div>
-    </td>
-    <!--td>{numBlocks}</td-->
-    <td ng-value="{blockPoolUsedPercent}">{blockPoolUsed|fmt_bytes} ({blockPoolUsedPercent|fmt_percentage})</td>
-    <!--td>{version}</td-->
-  </tr>
-  {/LiveNodes}
-  {#DeadNodes}
-  <tr class="danger">
-    <td ng-value="{state}-{name}" class="dfshealth-node-icon dfshealth-node-{state}">{location}/{name} ({xferaddr})</td>
-    <td>{#helper_relative_time value="{lastContact}"/}</td>
-    <td></td>
-    <!--td></td-->
-    <td></td>
-    <!--td></td-->
-  </tr>
-  {/DeadNodes}
-</table>
-</small>
-
-<div class="page-header"><h1><small>Decommissioning</small></h1></div>
-<small>
-<table class="table">
-  <thead>
-    <tr>
-      <th>Node</th>
-      <th>Under replicated blocks</th>
-      <th>Blocks with no live replicas</th>
-      <th>Under Replicated Blocks <br/>In files under construction</th>
-    </tr>
-  </thead>
-  {#DecomNodes}
-  <tr>
-    <td>{location}/{name} ({xferaddr})</td>
-    <td>{underReplicatedBlocks}</td>
-    <td>{decommissionOnlyReplicas}</td>
-    <td>{underReplicateInOpenFiles}</td>
-  </tr>
-  {/DecomNodes}
-</table>
-</small>
-</script>
-
-<!-- Mount table -->
-<script type="text/x-dust-template" id="tmpl-mounttable">
-<div class="page-header"><h1>Mount Table</h1></div>
-<small>
-<table class="table">
-  <thead>
-    <tr>
-      <th>Global path</th>
-      <th>Target nameservice</th>
-      <th>Target path</th>
-      <th>Order</th>
-      <th>Read only</th>
-      <th>Owner</th>
-      <th>Group</th>
-      <th>Permission</th>
-      <th>Date Modified</th>
-      <th>Date Created</th>
-    </tr>
-  </thead>
-  <tbody>
-    {#MountTable}
-    <tr>
-      <td>{sourcePath}</td>
-      <td>{nameserviceId}</td>
-      <td>{path}</td>
-      <td>{order}</td>
-      <td class="dfshealth-node-icon dfshealth-mount-read-only-{readonly}"/>
-      <td>{ownerName}</td>
-      <td>{groupName}</td>
-      <td>{mode}</td>
-      <td>{dateModified}</td>
-      <td>{dateCreated}</td>
-    </tr>
-    {/MountTable}
-  </tbody>
-</table>
-</small>
-</script>
-
-
-
-<script type="text/javascript" src="/static/jquery-1.10.2.min.js"></script>
-<script type="text/javascript" src="/static/jquery.dataTables.min.js"></script>
-<script type="text/javascript" src="/static/bootstrap-3.0.2/js/bootstrap.min.js"></script>
-<script type="text/javascript" src="/static/dataTables.bootstrap.js"></script>
-<script type="text/javascript" src="/static/moment.min.js"></script>
-<script type="text/javascript" src="/static/dust-full-2.0.0.min.js"></script>
-<script type="text/javascript" src="/static/dust-helpers-1.1.1.min.js"></script>
-<script type="text/javascript" src="/static/dfs-dust.js"></script>
-<script type="text/javascript" src="federationhealth.js"></script>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.js
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.js
deleted file mode 100644
index b3ed868..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/federationhealth.js
+++ /dev/null
@@ -1,381 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-(function () {
-  "use strict";
-
-  dust.loadSource(dust.compile($('#tmpl-federationhealth').html(), 'federationhealth'));
-  dust.loadSource(dust.compile($('#tmpl-namenode').html(), 'namenode-info'));
-  dust.loadSource(dust.compile($('#tmpl-router').html(), 'router-info'));
-  dust.loadSource(dust.compile($('#tmpl-datanode').html(), 'datanode-info'));
-  dust.loadSource(dust.compile($('#tmpl-mounttable').html(), 'mounttable'));
-
-  $.fn.dataTable.ext.order['ng-value'] = function (settings, col)
-  {
-    return this.api().column(col, {order:'index'} ).nodes().map(function (td, i) {
-      return $(td).attr('ng-value');
-    });
-  };
-
-  function load_overview() {
-    var BEANS = [
-      {"name": "federation",      "url": "/jmx?qry=Hadoop:service=Router,name=FederationState"}
-    ];
-
-    var HELPERS = {
-      'helper_fs_max_objects': function (chunk, ctx, bodies, params) {
-        var o = ctx.current();
-        if (o.MaxObjects > 0) {
-          chunk.write('(' + Math.round((o.FilesTotal + o.BlockTotal) / o.MaxObjects * 100) * 100 + ')%');
-        }
-      },
-
-      'helper_dir_status': function (chunk, ctx, bodies, params) {
-        var j = ctx.current();
-        for (var i in j) {
-          chunk.write('<tr><td>' + i + '</td><td>' + j[i] + '</td><td>' + params.type + '</td></tr>');
-        }
-      },
-
-      'helper_date_tostring' : function (chunk, ctx, bodies, params) {
-        var value = dust.helpers.tap(params.value, chunk, ctx);
-        return chunk.write('' + new Date(Number(value)).toLocaleString());
-      }
-    };
-
-    var data = {};
-
-    // Workarounds for the fact that JMXJsonServlet returns non-standard JSON strings
-    function workaround(nn) {
-      nn.NodeUsage = JSON.parse(nn.NodeUsage);
-      return nn;
-    }
-
-    load_json(
-      BEANS,
-      guard_with_startup_progress(function(d) {
-        for (var k in d) {
-          data[k] = k === 'federation' ? workaround(d[k].beans[0]) : d[k].beans[0];
-        }
-        render();
-      }),
-      function (url, jqxhr, text, err) {
-        show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + err + '</p>');
-      });
-
-    function render() {
-      var base = dust.makeBase(HELPERS);
-      dust.render('federationhealth', base.push(data), function(err, out) {
-        $('#tab-overview').html(out);
-        $('#ui-tabs a[href="#tab-overview"]').tab('show');
-      });
-    }
-  }
-
-  function load_namenode_info() {
-    var HELPERS = {
-      'helper_lastcontact_tostring' : function (chunk, ctx, bodies, params) {
-        var value = dust.helpers.tap(params.value, chunk, ctx);
-        return chunk.write('' + new Date(Date.now()-1000*Number(value)));
-      }
-    };
-
-    function workaround(r) {
-      function node_map_to_array(nodes) {
-        var res = [];
-        for (var n in nodes) {
-          var p = nodes[n];
-          p.name = n;
-          res.push(p);
-        }
-        return res;
-      }
-
-      function capitalise(string) {
-          return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
-      }
-
-      function augment_namenodes(nodes) {
-        for (var i = 0, e = nodes.length; i < e; ++i) {
-          var n = nodes[i];
-          n.usedPercentage = Math.round(n.used * 1.0 / n.totalSpace * 100);
-          n.title = "Unavailable";
-          n.iconState = "down";
-          if (n.isSafeMode === true) {
-            n.title = capitalise(n.state) + " (safe mode)"
-            n.iconState = "decommissioned";
-          } else if (n.state === "ACTIVE") {
-            n.title = capitalise(n.state);
-            n.iconState = "alive";
-          } else if (nodes[i].state === "STANDBY") {
-            n.title = capitalise(n.state);
-            n.iconState = "down-decommissioned";
-          } else if (nodes[i].state === "UNAVAILABLE") {
-            n.title = capitalise(n.state);
-            n.iconState = "down";
-          }
-          if (n.namenodeId === "null") {
-            n.namenodeId = "";
-          }
-        }
-      }
-
-      r.Nameservices = node_map_to_array(JSON.parse(r.Nameservices));
-      augment_namenodes(r.Nameservices);
-      r.Namenodes = node_map_to_array(JSON.parse(r.Namenodes));
-      augment_namenodes(r.Namenodes);
-      return r;
-    }
-
-    $.get(
-      '/jmx?qry=Hadoop:service=Router,name=FederationState',
-      guard_with_startup_progress(function (resp) {
-        var data = workaround(resp.beans[0]);
-        var base = dust.makeBase(HELPERS);
-        dust.render('namenode-info', base.push(data), function(err, out) {
-          $('#tab-namenode').html(out);
-          $('#ui-tabs a[href="#tab-namenode"]').tab('show');
-        });
-      })).error(ajax_error_handler);
-  }
-
-  function load_router_info() {
-    var HELPERS = {
-      'helper_lastcontact_tostring' : function (chunk, ctx, bodies, params) {
-        var value = dust.helpers.tap(params.value, chunk, ctx);
-        return chunk.write('' + new Date(Date.now()-1000*Number(value)));
-      }
-    };
-
-    function workaround(r) {
-      function node_map_to_array(nodes) {
-        var res = [];
-        for (var n in nodes) {
-          var p = nodes[n];
-          p.name = n;
-          res.push(p);
-        }
-        return res;
-      }
-
-      function capitalise(string) {
-          return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
-      }
-
-      function augment_routers(nodes) {
-        for (var i = 0, e = nodes.length; i < e; ++i) {
-          var n = nodes[i];
-          n.title = "Unavailable"
-          n.iconState = "down";
-          if (n.status === "INITIALIZING") {
-            n.title = capitalise(n.status);
-            n.iconState = "alive";
-          } else if (n.status === "RUNNING") {
-            n.title = capitalise(n.status);
-            n.iconState = "alive";
-          } else if (n.status === "SAFEMODE") {
-            n.title = capitalise(n.status);
-            n.iconState = "down-decommissioned";
-          } else if (n.status === "STOPPING") {
-            n.title = capitalise(n.status);
-            n.iconState = "decommissioned";
-          } else if (n.status === "SHUTDOWN") {
-            n.title = capitalise(n.status);
-            n.iconState = "down";
-          }
-        }
-      }
-
-      r.Routers = node_map_to_array(JSON.parse(r.Routers));
-      augment_routers(r.Routers);
-      return r;
-    }
-
-    $.get(
-      '/jmx?qry=Hadoop:service=Router,name=FederationState',
-      guard_with_startup_progress(function (resp) {
-        var data = workaround(resp.beans[0]);
-        var base = dust.makeBase(HELPERS);
-        dust.render('router-info', base.push(data), function(err, out) {
-          $('#tab-router').html(out);
-          $('#ui-tabs a[href="#tab-router"]').tab('show');
-        });
-      })).error(ajax_error_handler);
-  }
-
-  // TODO Copied directly from dfshealth.js; is there a way to import this function?
-  function load_datanode_info() {
-
-    var HELPERS = {
-      'helper_relative_time' : function (chunk, ctx, bodies, params) {
-        var value = dust.helpers.tap(params.value, chunk, ctx);
-        return chunk.write(moment().subtract(Number(value), 'seconds').format('YYYY-MM-DD HH:mm:ss'));
-      },
-      'helper_usage_bar' : function (chunk, ctx, bodies, params) {
-        var value = dust.helpers.tap(params.value, chunk, ctx);
-        var v = Number(value);
-        var r = null;
-        if (v < 70) {
-          r = 'progress-bar-success';
-        } else if (v < 85) {
-          r = 'progress-bar-warning';
-        } else {
-          r = "progress-bar-danger";
-        }
-        return chunk.write(r);
-      },
-    };
-
-    function workaround(r) {
-      function node_map_to_array(nodes) {
-        var res = [];
-        for (var n in nodes) {
-          var p = nodes[n];
-          p.name = n;
-          res.push(p);
-        }
-        return res;
-      }
-
-      function augment_live_nodes(nodes) {
-        for (var i = 0, e = nodes.length; i < e; ++i) {
-          var n = nodes[i];
-          n.usedPercentage = Math.round((n.used + n.nonDfsUsedSpace) * 1.0 / n.capacity * 100);
-          if (n.adminState === "In Service") {
-            n.state = "alive";
-          } else if (nodes[i].adminState === "Decommission In Progress") {
-            n.state = "decommissioning";
-          } else if (nodes[i].adminState === "Decommissioned") {
-            n.state = "decommissioned";
-          }
-        }
-      }
-
-      function augment_dead_nodes(nodes) {
-        for (var i = 0, e = nodes.length; i < e; ++i) {
-          if (nodes[i].decommissioned) {
-            nodes[i].state = "down-decommissioned";
-          } else {
-            nodes[i].state = "down";
-          }
-        }
-      }
-
-      r.LiveNodes = node_map_to_array(JSON.parse(r.LiveNodes));
-      augment_live_nodes(r.LiveNodes);
-      r.DeadNodes = node_map_to_array(JSON.parse(r.DeadNodes));
-      augment_dead_nodes(r.DeadNodes);
-      r.DecomNodes = node_map_to_array(JSON.parse(r.DecomNodes));
-      return r;
-    }
-
-    $.get(
-      '/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo',
-      guard_with_startup_progress(function (resp) {
-        var data = workaround(resp.beans[0]);
-        var base = dust.makeBase(HELPERS);
-        dust.render('datanode-info', base.push(data), function(err, out) {
-          $('#tab-datanode').html(out);
-          $('#table-datanodes').dataTable( {
-            'lengthMenu': [ [25, 50, 100, -1], [25, 50, 100, "All"] ],
-            'columns': [
-              { 'orderDataType': 'ng-value', 'searchable': true },
-              { 'orderDataType': 'ng-value', 'type': 'numeric' },
-              { 'orderDataType': 'ng-value', 'type': 'numeric' },
-              { 'orderDataType': 'ng-value', 'type': 'numeric'}
-            ]});
-          $('#ui-tabs a[href="#tab-datanode"]').tab('show');
-        });
-      })).error(ajax_error_handler);
-  }
-
-  function load_mount_table() {
-    var HELPERS = {}
-
-    function workaround(resource) {
-      resource.MountTable = JSON.parse(resource.MountTable)
-      return resource;
-    }
-
-    $.get(
-      '/jmx?qry=Hadoop:service=Router,name=FederationState',
-      guard_with_startup_progress(function (resp) {
-        var data = workaround(resp.beans[0]);
-        var base = dust.makeBase(HELPERS);
-        dust.render('mounttable', base.push(data), function(err, out) {
-          $('#tab-mounttable').html(out);
-          $('#ui-tabs a[href="#tab-mounttable"]').tab('show');
-        });
-      })).error(ajax_error_handler);
-  }
-
-  function toTitleCase(str) {
-    return str.replace(/\w\S*/g, function(txt){
-        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
-      });
-  }
-
-  function show_err_msg(msg) {
-    $('#alert-panel-body').html(msg);
-    $('#alert-panel').show();
-  }
-
-  function ajax_error_handler(url, jqxhr, text, err) {
-    show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + err + '</p>');
-  }
-
-  function guard_with_startup_progress(fn) {
-    return function() {
-      try {
-        fn.apply(this, arguments);
-      } catch (err) {
-        if (err instanceof TypeError) {
-          show_err_msg('Router error: ' + err);
-        }
-      }
-    };
-  }
-
-  function load_page() {
-    var hash = window.location.hash;
-    switch(hash) {
-      case "#tab-overview":
-        load_overview();
-        break;
-      case "#tab-namenode":
-        load_namenode_info();
-        break;
-      case "#tab-router":
-        load_router_info();
-        break;
-      case "#tab-datanode":
-        load_datanode_info();
-        break;
-      case "#tab-mounttable":
-        load_mount_table();
-        break;
-      default:
-        window.location.hash = "tab-overview";
-        break;
-    }
-  }
-  load_page();
-
-  $(window).bind('hashchange', function () {
-    load_page();
-  });
-})();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/index.html
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/index.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/index.html
deleted file mode 100644
index 4ee04ac..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="REFRESH" content="0;url=federationhealth.html" />
-<title>Hadoop Administration</title>
-</head>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/robots.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/robots.txt b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/robots.txt
deleted file mode 100644
index 77470cb..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/router/robots.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-User-agent: *
-Disallow: /
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSRouterFederation.md
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSRouterFederation.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSRouterFederation.md
deleted file mode 100644
index 14fa179..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSRouterFederation.md
+++ /dev/null
@@ -1,344 +0,0 @@
-<!---
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License. See accompanying LICENSE file.
--->
-
-HDFS Router-based Federation
-============================
-
-<!-- MACRO{toc|fromDepth=0|toDepth=3} -->
-
-Introduction
-------------
-
-NameNodes have scalability limits because of the metadata overhead comprised of inodes (files and directories) and file blocks, the number of Datanode heartbeats, and the number of HDFS RPC client requests.
-The common solution is to split the filesystem into smaller subclusters [HDFS Federation](./Federation.html) and provide a federated view [ViewFs](./ViewFs.html).
-The problem is how to maintain the split of the subclusters (e.g., namespace partition), which forces users to connect to multiple subclusters and manage the allocation of folders/files to them.
-
-
-Architecture
-------------
-
-A natural extension to this partitioned federation is to add a layer of software responsible for federating the namespaces.
-This extra layer allows users to access any subcluster transparently, lets subclusters manage their own block pools independently, and will support rebalancing of data across subclusters later
-(see more info in [HDFS-13123](https://issues.apache.org/jira/browse/HDFS-13123)). The subclusters in RBF are not required to be the independent HDFS clusters, a normal federation cluster
-(with multiple block pools) or a mixed cluster with federation and independent cluster is also allowed.
-To accomplish these goals, the federation layer directs block accesses to the proper subcluster, maintains the state of the namespaces, and provides mechanisms for data rebalancing.
-This layer must be scalable, highly available, and fault tolerant.
-
-This federation layer comprises multiple components.
-The _Router_ component that has the same interface as a NameNode, and forwards the client requests to the correct subcluster, based on ground-truth information from a State Store.
-The _State Store_ combines a remote _Mount Table_ (in the flavor of [ViewFs](./ViewFs.html), but shared between clients) and utilization (load/capacity) information about the subclusters.
-This approach has the same architecture as [YARN federation](../hadoop-yarn/Federation.html).
-
-![Router-based Federation Sequence Diagram | width=800](./images/routerfederation.png)
-
-
-### Example flow
-The simplest configuration deploys a Router on each NameNode machine.
-The Router monitors the local NameNode and heartbeats the state to the State Store.
-When a regular DFS client contacts any of the Routers to access a file in the federated filesystem, the Router checks the Mount Table in the State Store (i.e., the local cache) to find out which subcluster contains the file.
-Then it checks the Membership table in the State Store (i.e., the local cache) for the NameNode responsible for the subcluster.
-After it has identified the correct NameNode, the Router proxies the request.
-The client accesses Datanodes directly.
-
-
-### Router
-There can be multiple Routers in the system with soft state.
-Each Router has two roles:
-
-* Federated interface: expose a single, global NameNode interface to the clients and forward the requests to the active NameNode in the correct subcluster
-* NameNode heartbeat: maintain the information about a NameNode in the State Store
-
-#### Federated interface
-The Router receives a client request, checks the State Store for the correct subcluster, and forwards the request to the active NameNode of that subcluster.
-The reply from the NameNode then flows in the opposite direction.
-The Routers are stateless and can be behind a load balancer.
-For performance, the Router also caches remote mount table entries and the state of the subclusters.
-To make sure that changes have been propagated to all Routers, each Router heartbeats its state to the State Store.
-
-The communications between the Routers and the State Store are cached (with timed expiration for freshness).
-This improves the performance of the system.
-
-#### NameNode heartbeat
-For this role, the Router periodically checks the state of a NameNode (usually on the same server) and reports their high availability (HA) state and load/space status to the State Store.
-Note that this is an optional role, as a Router can be independent of any subcluster.
-For performance with NameNode HA, the Router uses the high availability state information in the State Store to forward the request to the NameNode that is most likely to be active.
-Note that this service can be embedded into the NameNode itself to simplify the operation.
-
-#### Availability and fault tolerance
-The Router operates with failures at multiple levels.
-
-* **Federated interface HA:**
-The Routers are stateless and metadata operations are atomic at the NameNodes.
-If a Router becomes unavailable, any Router can take over for it.
-The clients configure their DFS HA client (e.g., ConfiguredFailoverProvider or RequestHedgingProxyProvider) with all the Routers in the federation as endpoints.
-
-* **Unavailable State Store:**
-If a Router cannot contact the State Store, it will enter into a Safe Mode state which disallows it from serving requests.
-Clients will treat Routers in Safe Mode as it was an Standby NameNode and try another Router. There is a manual way to manage the Safe Mode for the Router.
-
-The Safe Mode state can be managed by using the following command:
-
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -safemode enter | leave | get
-
-* **NameNode heartbeat HA:**
-For high availability and flexibility, multiple Routers can monitor the same NameNode and heartbeat the information to the State Store.
-This increases clients' resiliency to stale information, should a Router fail.
-Conflicting NameNode information in the State Store is resolved by each Router via a quorum.
-
-* **Unavailable NameNodes:**
-If a Router cannot contact the active NameNode, then it will try the other NameNodes in the subcluster.
-It will first try those reported as standby and then the unavailable ones.
-If the Router cannot reach any NameNode, then it throws an exception.
-
-* **Expired NameNodes:**
-If a NameNode heartbeat has not been recorded in the State Store for a multiple of the heartbeat interval, the monitoring Router will record that the NameNode has expired and no Routers will attempt to access it.
-If an updated heartbeat is subsequently recorded for the NameNode, the monitoring Router will restore the NameNode from the expired state.
-
-#### Interfaces
-To interact with the users and the administrators, the Router exposes multiple interfaces.
-
-* **RPC:**
-The Router RPC implements the most common interfaces clients use to interact with HDFS.
-The current implementation has been tested using analytics workloads written in plain MapReduce, Spark, and Hive (on Tez, Spark, and MapReduce).
-Advanced functions like snapshot, encryption and tiered storage are left for future versions.
-All unimplemented functions will throw exceptions.
-
-* **Admin:**
-Administrators can query information from clusters and add/remove entries from the mount table over RPC.
-This interface is also exposed through the command line to get and modify information from the federation.
-
-* **Web UI:**
-The Router exposes a Web UI visualizing the state of the federation, mimicking the current NameNode UI.
-It displays information about the mount table, membership information about each subcluster, and the status of the Routers.
-
-* **WebHDFS:**
-The Router provides the HDFS REST interface (WebHDFS) in addition to the RPC one.
-
-* **JMX:**
-It exposes metrics through JMX mimicking the NameNode.
-This is used by the Web UI to get the cluster status.
-
-Some operations are not available in Router-based federation.
-The Router throws exceptions for those.
-Examples users may encounter include the following.
-
-* Rename file/folder in two different nameservices.
-* Copy file/folder in two different nameservices.
-* Write into a file/folder being rebalanced.
-
-
-### State Store
-The (logically centralized, but physically distributed) State Store maintains:
-
-* The state of the subclusters in terms of their block access load, available disk space, HA state, etc.
-* The mapping between folder/files and subclusters, i.e. the remote mount table.
-
-The backend of the State Store is pluggable.
-We leverage the fault tolerance of the backend implementations.
-The main information stored in the State Store and its implementation:
-
-* **Membership**:
-The membership information encodes the state of the NameNodes in the federation.
-This includes information about the subcluster, such as storage capacity and the number of nodes.
-The Router periodically heartbeats this information about one or more NameNodes.
-Given that multiple Routers can monitor a single NameNode, the heartbeat from every Router is stored.
-The Routers apply a quorum of the data when querying this information from the State Store.
-The Routers discard the entries older than a certain threshold (e.g., ten Router heartbeat periods).
-
-* **Mount Table**:
-This table hosts the mapping between folders and subclusters.
-It is similar to the mount table in [ViewFs](.ViewFs.html) where it specifies the federated folder, the destination subcluster and the path in that folder.
-
-
-### Security
-Secure authentication and authorization are not supported yet, so the Router will not proxy to Hadoop clusters with security enabled.
-
-
-Deployment
-----------
-
-By default, the Router is ready to take requests and monitor the NameNode in the local machine.
-It needs to know the State Store endpoint by setting `dfs.federation.router.store.driver.class`.
-The rest of the options are documented in [hdfs-default.xml](./hdfs-default.xml).
-
-Once the Router is configured, it can be started:
-
-    [hdfs]$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --script $HADOOP_PREFIX/bin/hdfs start dfsrouter
-
-And to stop it:
-
-    [hdfs]$ $HADOOP_PREFIX/sbin/hadoop-daemon.sh --script $HADOOP_PREFIX/bin/hdfs stop dfsrouter
-
-### Mount table management
-
-The mount table entries are pretty much the same as in [ViewFs](./ViewFs.html).
-A good practice for simplifying the management is to name the federated namespace with the same names as the destination namespaces.
-For example, if we to mount `/data/app1` in the federated namespace, it is recommended to have that same name as in the destination namespace.
-
-The federation admin tool supports managing the mount table.
-For example, to create three mount points and list them:
-
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -add /tmp ns1 /tmp
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -add /data/app1 ns2 /data/app1
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -add /data/app2 ns3 /data/app2
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -ls
-
-It also supports mount points that disallow writes:
-
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -add /readonly ns1 / -readonly
-
-If a mount point is not set, the Router will map it to the default namespace `dfs.federation.router.default.nameserviceId`.
-
-Mount table have UNIX-like *permissions*, which restrict which users and groups have access to the mount point. Write permissions allow users to add
-, update or remove mount point. Read permissions allow users to list mount point. Execute permissions are unused.
-
-Mount table permission can be set by following command:
-
-    [hdfs]$ $HADOOP_HOME/bin/hdfs dfsrouteradmin -add /tmp ns1 /tmp -owner root -group supergroup -mode 0755
-
-The option mode is UNIX-style permissions for the mount table. Permissions are specified in octal, e.g. 0755. By default, this is set to 0755.
-
-Client configuration
---------------------
-
-For clients to use the federated namespace, they need to create a new one that points to the routers.
-For example, a cluster with 4 namespaces **ns0, ns1, ns2, ns3**, can add a new one to **hdfs-site.xml** called **ns-fed** which points to two of the routers:
-
-```xml
-<configuration>
-  <property>
-    <name>dfs.nameservices</name>
-    <value>ns0,ns1,ns2,ns3,ns-fed</value>
-  </property>
-  <property>
-    <name>dfs.ha.namenodes.ns-fed</name>
-    <value>r1,r2</value>
-  </property>
-  <property>
-    <name>dfs.namenode.rpc-address.ns-fed.r1</name>
-    <value>router1:rpc-port</value>
-  </property>
-  <property>
-    <name>dfs.namenode.rpc-address.ns-fed.r2</name>
-    <value>router2:rpc-port</value>
-  </property>
-  <property>
-    <name>dfs.client.failover.proxy.provider.ns-fed</name>
-    <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
-  </property>
-  <property>
-    <name>dfs.client.failover.random.order</name>
-    <value>true</value>
-  </property>
-</configuration>
-```
-
-The `dfs.client.failover.random.order` set to `true` allows distributing the load evenly across the routers.
-
-With this setting a user can interact with `ns-fed` as a regular namespace:
-
-    $ $HADOOP_HOME/bin/hdfs dfs -ls hdfs://ns-fed/
-    /tmp
-    /data
-
-This federated namespace can also be set as the default one at **core-site.xml** using `fs.defaultFS`.
-
-
-Router configuration
---------------------
-
-One can add the configurations for Router-based federation to **hdfs-site.xml**.
-The main options are documented in [hdfs-default.xml](./hdfs-default.xml).
-The configuration values are described in this section.
-
-### RPC server
-
-The RPC server to receive connections from the clients.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.default.nameserviceId | | Nameservice identifier of the default subcluster to monitor. |
-| dfs.federation.router.rpc.enable | `true` | If `true`, the RPC service to handle client requests in the router is enabled. |
-| dfs.federation.router.rpc-address | 0.0.0.0:8888 | RPC address that handles all clients requests. |
-| dfs.federation.router.rpc-bind-host | 0.0.0.0 |  The actual address the RPC server will bind to. |
-| dfs.federation.router.handler.count | 10 | The number of server threads for the router to handle RPC requests from clients. |
-| dfs.federation.router.handler.queue.size | 100 | The size of the queue for the number of handlers to handle RPC client requests. |
-| dfs.federation.router.reader.count | 1 | The number of readers for the router to handle RPC client requests. |
-| dfs.federation.router.reader.queue.size | 100 | The size of the queue for the number of readers for the router to handle RPC client requests. |
-
-#### Connection to the Namenodes
-
-The Router forwards the client requests to the NameNodes.
-It uses a pool of connections to reduce the latency of creating them.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.connection.pool-size | 1 | Size of the pool of connections from the router to namenodes. |
-| dfs.federation.router.connection.clean.ms | 10000 | Time interval, in milliseconds, to check if the connection pool should remove unused connections. |
-| dfs.federation.router.connection.pool.clean.ms | 60000 | Time interval, in milliseconds, to check if the connection manager should remove unused connection pools. |
-
-### Admin server
-
-The administration server to manage the Mount Table.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.admin.enable | `true` | If `true`, the RPC admin service to handle client requests in the router is enabled. |
-| dfs.federation.router.admin-address | 0.0.0.0:8111 | RPC address that handles the admin requests. |
-| dfs.federation.router.admin-bind-host | 0.0.0.0 | The actual address the RPC admin server will bind to. |
-| dfs.federation.router.admin.handler.count | 1 | The number of server threads for the router to handle RPC requests from admin. |
-
-### State Store
-
-The connection to the State Store and the internal caching at the Router.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.store.enable | `true` | If `true`, the Router connects to the State Store. |
-| dfs.federation.router.store.serializer | `org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializerPBImpl` | Class to serialize State Store records. |
-| dfs.federation.router.store.driver.class | `org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreZooKeeperImpl` | Class to implement the State Store. |
-| dfs.federation.router.store.connection.test | 60000 | How often to check for the connection to the State Store in milliseconds. |
-| dfs.federation.router.cache.ttl | 60000 | How often to refresh the State Store caches in milliseconds. |
-| dfs.federation.router.store.membership.expiration | 300000 | Expiration time in milliseconds for a membership record. |
-
-### Routing
-
-Forwarding client requests to the right subcluster.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.file.resolver.client.class | `org.apache.hadoop.hdfs.server.federation.resolver.MountTableResolver` | Class to resolve files to subclusters. |
-| dfs.federation.router.namenode.resolver.client.class | `org.apache.hadoop.hdfs.server.federation.resolver.MembershipNamenodeResolver` | Class to resolve the namenode for a subcluster. |
-
-### Namenode monitoring
-
-Monitor the namenodes in the subclusters for forwarding the client requests.
-
-| Property | Default | Description|
-|:---- |:---- |:---- |
-| dfs.federation.router.heartbeat.enable | `true` | If `true`, the Router heartbeats into the State Store. |
-| dfs.federation.router.heartbeat.interval | 5000 | How often the Router should heartbeat into the State Store in milliseconds. |
-| dfs.federation.router.monitor.namenode | | The identifier of the namenodes to monitor and heartbeat. |
-| dfs.federation.router.monitor.localnamenode.enable | `true` | If `true`, the Router should monitor the namenode in the local machine. |
-
-Note: The config *dfs.nameservice.id* is recommended to configure if *dfs.federation.router.monitor.localnamenode.enable* is enabled.
-This will allow the Router finding the local node directly. Otherwise, it will find the nameservice Id by matching namenode RPC address with the
-local node address. If multiple addresses are matched, the Router will fail to start. In addition, if the local node is in a HA mode, it is recommend
-to configure *dfs.ha.namenode.id*.
-
-Metrics
--------
-
-The Router and State Store statistics are exposed in metrics/JMX. These info will be very useful for monitoring.
-More metrics info can see [Router RPC Metrics](../../hadoop-project-dist/hadoop-common/Metrics.html#RouterRPCMetrics) and [State Store Metrics](../../hadoop-project-dist/hadoop-common/Metrics.html#StateStoreMetrics).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/site/resources/images/routerfederation.png
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/resources/images/routerfederation.png b/hadoop-hdfs-project/hadoop-hdfs/src/site/resources/images/routerfederation.png
deleted file mode 100644
index 2b158bb..0000000
Binary files a/hadoop-hdfs-project/hadoop-hdfs/src/site/resources/images/routerfederation.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java
deleted file mode 100644
index 0ead93e..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/FederationTestUtils.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hdfs.server.federation;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.lang.management.ManagementFactory;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-
-import javax.management.JMX;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.UnsupportedFileSystemException;
-import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState;
-import org.apache.hadoop.hdfs.DFSConfigKeys;
-import org.apache.hadoop.hdfs.server.federation.resolver.ActiveNamenodeResolver;
-import org.apache.hadoop.hdfs.server.federation.resolver.FederationNamenodeContext;
-import org.apache.hadoop.hdfs.server.federation.resolver.FederationNamenodeServiceState;
-import org.apache.hadoop.hdfs.server.federation.resolver.NamenodeStatusReport;
-import org.apache.hadoop.hdfs.server.protocol.NamespaceInfo;
-import org.apache.hadoop.security.AccessControlException;
-import org.apache.hadoop.test.GenericTestUtils;
-
-import com.google.common.base.Supplier;
-
-/**
- * Helper utilities for testing HDFS Federation.
- */
-public final class FederationTestUtils {
-
-  public final static String[] NAMESERVICES = {"ns0", "ns1"};
-  public final static String[] NAMENODES = {"nn0", "nn1", "nn2", "nn3"};
-  public final static String[] ROUTERS =
-      {"router0", "router1", "router2", "router3"};
-
-
-  private FederationTestUtils() {
-    // Utility class
-  }
-
-  public static void verifyException(Object obj, String methodName,
-      Class<? extends Exception> exceptionClass, Class<?>[] parameterTypes,
-      Object[] arguments) {
-
-    Throwable triggeredException = null;
-    try {
-      Method m = obj.getClass().getMethod(methodName, parameterTypes);
-      m.invoke(obj, arguments);
-    } catch (InvocationTargetException ex) {
-      triggeredException = ex.getTargetException();
-    } catch (Exception e) {
-      triggeredException = e;
-    }
-    if (exceptionClass != null) {
-      assertNotNull("No exception was triggered, expected exception"
-          + exceptionClass.getName(), triggeredException);
-      assertEquals(exceptionClass, triggeredException.getClass());
-    } else {
-      assertNull("Exception was triggered but no exception was expected",
-          triggeredException);
-    }
-  }
-
-  public static NamenodeStatusReport createNamenodeReport(String ns, String nn,
-      HAServiceState state) {
-    Random rand = new Random();
-    NamenodeStatusReport report = new NamenodeStatusReport(ns, nn,
-        "localhost:" + rand.nextInt(10000), "localhost:" + rand.nextInt(10000),
-        "localhost:" + rand.nextInt(10000), "testwebaddress-" + ns + nn);
-    if (state == null) {
-      // Unavailable, no additional info
-      return report;
-    }
-    report.setHAServiceState(state);
-    NamespaceInfo nsInfo = new NamespaceInfo(
-        1, "tesclusterid", ns, 0, "testbuildvesion", "testsoftwareversion");
-    report.setNamespaceInfo(nsInfo);
-    return report;
-  }
-
-  /**
-   * Wait for a namenode to be registered with a particular state.
-   * @param resolver Active namenode resolver.
-   * @param nsId Nameservice identifier.
-   * @param nnId Namenode identifier.
-   * @param finalState State to check for.
-   * @throws Exception Failed to verify State Store registration of namenode
-   *                   nsId:nnId for state.
-   */
-  public static void waitNamenodeRegistered(
-      final ActiveNamenodeResolver resolver,
-      final String nsId, final String nnId,
-      final FederationNamenodeServiceState state) throws Exception {
-
-    GenericTestUtils.waitFor(new Supplier<Boolean>() {
-      @Override
-      public Boolean get() {
-        try {
-          List<? extends FederationNamenodeContext> namenodes =
-              resolver.getNamenodesForNameserviceId(nsId);
-          if (namenodes != null) {
-            for (FederationNamenodeContext namenode : namenodes) {
-              // Check if this is the Namenode we are checking
-              if (namenode.getNamenodeId() == nnId  ||
-                  namenode.getNamenodeId().equals(nnId)) {
-                return state == null || namenode.getState().equals(state);
-              }
-            }
-          }
-        } catch (IOException e) {
-          // Ignore
-        }
-        return false;
-      }
-    }, 1000, 20 * 1000);
-  }
-
-  public static boolean verifyDate(Date d1, Date d2, long precision) {
-    return Math.abs(d1.getTime() - d2.getTime()) < precision;
-  }
-
-  public static <T> T getBean(String name, Class<T> obj)
-      throws MalformedObjectNameException {
-    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
-    ObjectName poolName = new ObjectName(name);
-    return JMX.newMXBeanProxy(mBeanServer, poolName, obj);
-  }
-
-  public static boolean addDirectory(FileSystem context, String path)
-      throws IOException {
-    context.mkdirs(new Path(path), new FsPermission("777"));
-    return verifyFileExists(context, path);
-  }
-
-  public static FileStatus getFileStatus(FileSystem context, String path)
-      throws IOException {
-    return context.getFileStatus(new Path(path));
-  }
-
-  public static boolean verifyFileExists(FileSystem context, String path) {
-    try {
-      FileStatus status = getFileStatus(context, path);
-      if (status != null) {
-        return true;
-      }
-    } catch (Exception e) {
-      return false;
-    }
-    return false;
-  }
-
-  public static boolean checkForFileInDirectory(
-      FileSystem context, String testPath, String targetFile)
-          throws IOException, AccessControlException, FileNotFoundException,
-          UnsupportedFileSystemException, IllegalArgumentException {
-
-    FileStatus[] fileStatus = context.listStatus(new Path(testPath));
-    String file = null;
-    String verifyPath = testPath + "/" + targetFile;
-    if (testPath.equals("/")) {
-      verifyPath = testPath + targetFile;
-    }
-
-    Boolean found = false;
-    for (int i = 0; i < fileStatus.length; i++) {
-      FileStatus f = fileStatus[i];
-      file = Path.getPathWithoutSchemeAndAuthority(f.getPath()).toString();
-      if (file.equals(verifyPath)) {
-        found = true;
-      }
-    }
-    return found;
-  }
-
-  public static int countContents(FileSystem context, String testPath)
-      throws IOException {
-    Path path = new Path(testPath);
-    FileStatus[] fileStatus = context.listStatus(path);
-    return fileStatus.length;
-  }
-
-  public static void createFile(FileSystem fs, String path, long length)
-      throws IOException {
-    FsPermission permissions = new FsPermission("700");
-    FSDataOutputStream writeStream = fs.create(new Path(path), permissions,
-        true, 1000, (short) 1, DFSConfigKeys.DFS_BLOCK_SIZE_DEFAULT, null);
-    for (int i = 0; i < length; i++) {
-      writeStream.write(i);
-    }
-    writeStream.close();
-  }
-
-  public static String readFile(FileSystem fs, String path) throws IOException {
-    // Read the file from the filesystem via the active namenode
-    Path fileName = new Path(path);
-    InputStreamReader reader = new InputStreamReader(fs.open(fileName));
-    BufferedReader bufferedReader = new BufferedReader(reader);
-    StringBuilder data = new StringBuilder();
-    String line;
-
-    while ((line = bufferedReader.readLine()) != null) {
-      data.append(line);
-    }
-
-    bufferedReader.close();
-    reader.close();
-    return data.toString();
-  }
-
-  public static boolean deleteFile(FileSystem fs, String path)
-      throws IOException {
-    return fs.delete(new Path(path), true);
-  }
-}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
deleted file mode 100644
index 151d731..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hdfs.server.federation;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.server.federation.resolver.ActiveNamenodeResolver;
-import org.apache.hadoop.hdfs.server.federation.resolver.FederationNamenodeContext;
-import org.apache.hadoop.hdfs.server.federation.resolver.FederationNamenodeServiceState;
-import org.apache.hadoop.hdfs.server.federation.resolver.FederationNamespaceInfo;
-import org.apache.hadoop.hdfs.server.federation.resolver.FileSubclusterResolver;
-import org.apache.hadoop.hdfs.server.federation.resolver.NamenodePriorityComparator;
-import org.apache.hadoop.hdfs.server.federation.resolver.NamenodeStatusReport;
-import org.apache.hadoop.hdfs.server.federation.resolver.PathLocation;
-import org.apache.hadoop.hdfs.server.federation.resolver.RemoteLocation;
-import org.apache.hadoop.hdfs.server.federation.router.Router;
-import org.apache.hadoop.hdfs.server.federation.store.StateStoreService;
-import org.apache.hadoop.util.Time;
-
-/**
- * In-memory cache/mock of a namenode and file resolver. Stores the most
- * recently updated NN information for each nameservice and block pool. It also
- * stores a virtual mount table for resolving global namespace paths to local NN
- * paths.
- */
-public class MockResolver
-    implements ActiveNamenodeResolver, FileSubclusterResolver {
-
-  private Map<String, List<? extends FederationNamenodeContext>> resolver =
-      new HashMap<>();
-  private Map<String, List<RemoteLocation>> locations = new HashMap<>();
-  private Set<FederationNamespaceInfo> namespaces = new HashSet<>();
-  private String defaultNamespace = null;
-
-  public MockResolver() {
-    this.cleanRegistrations();
-  }
-
-  public MockResolver(Configuration conf) {
-    this();
-  }
-
-  public MockResolver(Configuration conf, StateStoreService store) {
-    this();
-  }
-
-  public MockResolver(Configuration conf, Router router) {
-    this();
-  }
-
-  public void addLocation(String mount, String nsId, String location) {
-    List<RemoteLocation> locationsList = this.locations.get(mount);
-    if (locationsList == null) {
-      locationsList = new LinkedList<>();
-      this.locations.put(mount, locationsList);
-    }
-
-    final RemoteLocation remoteLocation = new RemoteLocation(nsId, location);
-    if (!locationsList.contains(remoteLocation)) {
-      locationsList.add(remoteLocation);
-    }
-
-    if (this.defaultNamespace == null) {
-      this.defaultNamespace = nsId;
-    }
-  }
-
-  public synchronized void cleanRegistrations() {
-    this.resolver = new HashMap<>();
-    this.namespaces = new HashSet<>();
-  }
-
-  @Override
-  public void updateActiveNamenode(
-      String nsId, InetSocketAddress successfulAddress) {
-
-    String address = successfulAddress.getHostName() + ":" +
-        successfulAddress.getPort();
-    String key = nsId;
-    if (key != null) {
-      // Update the active entry
-      @SuppressWarnings("unchecked")
-      List<FederationNamenodeContext> namenodes =
-          (List<FederationNamenodeContext>) this.resolver.get(key);
-      for (FederationNamenodeContext namenode : namenodes) {
-        if (namenode.getRpcAddress().equals(address)) {
-          MockNamenodeContext nn = (MockNamenodeContext) namenode;
-          nn.setState(FederationNamenodeServiceState.ACTIVE);
-          break;
-        }
-      }
-      // This operation modifies the list so we need to be careful
-      synchronized(namenodes) {
-        Collections.sort(namenodes, new NamenodePriorityComparator());
-      }
-    }
-  }
-
-  @Override
-  public List<? extends FederationNamenodeContext>
-      getNamenodesForNameserviceId(String nameserviceId) {
-    // Return a copy of the list because it is updated periodically
-    List<? extends FederationNamenodeContext> namenodes =
-        this.resolver.get(nameserviceId);
-    return Collections.unmodifiableList(new ArrayList<>(namenodes));
-  }
-
-  @Override
-  public List<? extends FederationNamenodeContext> getNamenodesForBlockPoolId(
-      String blockPoolId) {
-    // Return a copy of the list because it is updated periodically
-    List<? extends FederationNamenodeContext> namenodes =
-        this.resolver.get(blockPoolId);
-    return Collections.unmodifiableList(new ArrayList<>(namenodes));
-  }
-
-  private static class MockNamenodeContext
-      implements FederationNamenodeContext {
-
-    private String namenodeId;
-    private String nameserviceId;
-
-    private String webAddress;
-    private String rpcAddress;
-    private String serviceAddress;
-    private String lifelineAddress;
-
-    private FederationNamenodeServiceState state;
-    private long dateModified;
-
-    MockNamenodeContext(
-        String rpc, String service, String lifeline, String web,
-        String ns, String nn, FederationNamenodeServiceState state) {
-      this.rpcAddress = rpc;
-      this.serviceAddress = service;
-      this.lifelineAddress = lifeline;
-      this.webAddress = web;
-      this.namenodeId = nn;
-      this.nameserviceId = ns;
-      this.state = state;
-      this.dateModified = Time.now();
-    }
-
-    public void setState(FederationNamenodeServiceState newState) {
-      this.state = newState;
-      this.dateModified = Time.now();
-    }
-
-    @Override
-    public String getRpcAddress() {
-      return rpcAddress;
-    }
-
-    @Override
-    public String getServiceAddress() {
-      return serviceAddress;
-    }
-
-    @Override
-    public String getLifelineAddress() {
-      return lifelineAddress;
-    }
-
-    @Override
-    public String getWebAddress() {
-      return webAddress;
-    }
-
-    @Override
-    public String getNamenodeKey() {
-      return nameserviceId + " " + namenodeId + " " + rpcAddress;
-    }
-
-    @Override
-    public String getNameserviceId() {
-      return nameserviceId;
-    }
-
-    @Override
-    public String getNamenodeId() {
-      return namenodeId;
-    }
-
-    @Override
-    public FederationNamenodeServiceState getState() {
-      return state;
-    }
-
-    @Override
-    public long getDateModified() {
-      return dateModified;
-    }
-  }
-
-  @Override
-  public synchronized boolean registerNamenode(NamenodeStatusReport report)
-      throws IOException {
-
-    MockNamenodeContext context = new MockNamenodeContext(
-        report.getRpcAddress(), report.getServiceAddress(),
-        report.getLifelineAddress(), report.getWebAddress(),
-        report.getNameserviceId(), report.getNamenodeId(), report.getState());
-
-    String nsId = report.getNameserviceId();
-    String bpId = report.getBlockPoolId();
-    String cId = report.getClusterId();
-
-    @SuppressWarnings("unchecked")
-    List<MockNamenodeContext> existingItems =
-        (List<MockNamenodeContext>) this.resolver.get(nsId);
-    if (existingItems == null) {
-      existingItems = new ArrayList<>();
-      this.resolver.put(bpId, existingItems);
-      this.resolver.put(nsId, existingItems);
-    }
-    boolean added = false;
-    for (int i=0; i<existingItems.size() && !added; i++) {
-      MockNamenodeContext existing = existingItems.get(i);
-      if (existing.getNamenodeKey().equals(context.getNamenodeKey())) {
-        existingItems.set(i, context);
-        added = true;
-      }
-    }
-    if (!added) {
-      existingItems.add(context);
-    }
-    Collections.sort(existingItems, new NamenodePriorityComparator());
-
-    FederationNamespaceInfo info = new FederationNamespaceInfo(bpId, cId, nsId);
-    this.namespaces.add(info);
-    return true;
-  }
-
-  @Override
-  public Set<FederationNamespaceInfo> getNamespaces() throws IOException {
-    return this.namespaces;
-  }
-
-  @Override
-  public PathLocation getDestinationForPath(String path) throws IOException {
-    List<RemoteLocation> remoteLocations = new LinkedList<>();
-    // We go from the leaves to the root
-    List<String> keys = new ArrayList<>(this.locations.keySet());
-    Collections.sort(keys, Collections.reverseOrder());
-    for (String key : keys) {
-      if (path.startsWith(key)) {
-        for (RemoteLocation location : this.locations.get(key)) {
-          String finalPath = location.getDest() + path.substring(key.length());
-          String nameservice = location.getNameserviceId();
-          RemoteLocation remoteLocation =
-              new RemoteLocation(nameservice, finalPath);
-          remoteLocations.add(remoteLocation);
-        }
-        break;
-      }
-    }
-    if (remoteLocations.isEmpty()) {
-      // Path isn't supported, mimic resolver behavior.
-      return null;
-    }
-    return new PathLocation(path, remoteLocations);
-  }
-
-  @Override
-  public List<String> getMountPoints(String path) throws IOException {
-    List<String> mounts = new ArrayList<>();
-    if (path.equals("/")) {
-      // Mounts only supported under root level
-      for (String mount : this.locations.keySet()) {
-        if (mount.length() > 1) {
-          // Remove leading slash, this is the behavior of the mount tree,
-          // return only names.
-          mounts.add(mount.replace("/", ""));
-        }
-      }
-    }
-    return mounts;
-  }
-
-  @Override
-  public void setRouterId(String router) {
-  }
-
-  @Override
-  public String getDefaultNamespace() {
-    return defaultNamespace;
-  }
-}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/62a819d5/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/RouterConfigBuilder.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/RouterConfigBuilder.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/RouterConfigBuilder.java
deleted file mode 100644
index aa7eca2..0000000
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/RouterConfigBuilder.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hdfs.server.federation;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.DFSConfigKeys;
-import org.apache.hadoop.hdfs.server.federation.store.FederationStateStoreTestUtils;
-import org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreDriver;
-
-/**
- * Constructs a router configuration with individual features enabled/disabled.
- */
-public class RouterConfigBuilder {
-
-  private Configuration conf;
-
-  private boolean enableRpcServer = false;
-  private boolean enableAdminServer = false;
-  private boolean enableHttpServer = false;
-  private boolean enableHeartbeat = false;
-  private boolean enableLocalHeartbeat = false;
-  private boolean enableStateStore = false;
-  private boolean enableMetrics = false;
-  private boolean enableSafemode = false;
-
-  public RouterConfigBuilder(Configuration configuration) {
-    this.conf = configuration;
-  }
-
-  public RouterConfigBuilder() {
-    this.conf = new Configuration(false);
-  }
-
-  public RouterConfigBuilder all() {
-    this.enableRpcServer = true;
-    this.enableAdminServer = true;
-    this.enableHttpServer = true;
-    this.enableHeartbeat = true;
-    this.enableLocalHeartbeat = true;
-    this.enableStateStore = true;
-    this.enableMetrics = true;
-    this.enableSafemode = true;
-    return this;
-  }
-
-  public RouterConfigBuilder enableLocalHeartbeat(boolean enable) {
-    this.enableLocalHeartbeat = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder rpc(boolean enable) {
-    this.enableRpcServer = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder admin(boolean enable) {
-    this.enableAdminServer = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder http(boolean enable) {
-    this.enableHttpServer = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder heartbeat(boolean enable) {
-    this.enableHeartbeat = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder stateStore(boolean enable) {
-    this.enableStateStore = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder metrics(boolean enable) {
-    this.enableMetrics = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder safemode(boolean enable) {
-    this.enableSafemode = enable;
-    return this;
-  }
-
-  public RouterConfigBuilder rpc() {
-    return this.rpc(true);
-  }
-
-  public RouterConfigBuilder admin() {
-    return this.admin(true);
-  }
-
-  public RouterConfigBuilder http() {
-    return this.http(true);
-  }
-
-  public RouterConfigBuilder heartbeat() {
-    return this.heartbeat(true);
-  }
-
-  public RouterConfigBuilder stateStore() {
-    // reset the State Store driver implementation class for testing
-    conf.setClass(DFSConfigKeys.FEDERATION_STORE_DRIVER_CLASS,
-        FederationStateStoreTestUtils.getTestDriverClass(),
-        StateStoreDriver.class);
-    return this.stateStore(true);
-  }
-
-  public RouterConfigBuilder metrics() {
-    return this.metrics(true);
-  }
-
-  public RouterConfigBuilder safemode() {
-    return this.safemode(true);
-  }
-
-  public Configuration build() {
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_STORE_ENABLE,
-        this.enableStateStore);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_RPC_ENABLE, this.enableRpcServer);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_ADMIN_ENABLE,
-        this.enableAdminServer);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_HTTP_ENABLE,
-        this.enableHttpServer);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE,
-        this.enableHeartbeat);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE,
-        this.enableLocalHeartbeat);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_METRICS_ENABLE,
-        this.enableMetrics);
-    conf.setBoolean(DFSConfigKeys.DFS_ROUTER_SAFEMODE_ENABLE,
-        this.enableSafemode);
-    return conf;
-  }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message