Router extends CompositeService implements
    TokenVerifier<DelegationTokenIdentifier> { public NamenodeBeanMetrics getNamenodeMetrics() throws IOException { if (this.metrics == null) { throw new IOException("Namenode metrics is not initialized"); } return this.metrics.getNamenodeMetrics(); } Router(); void shutDown(); RouterRpcServer getRpcServer(); InetSocketAddress getRpcServerAddress(); InetSocketAddress getAdminServerAddress(); InetSocketAddress getHttpServerAddress(); @Override void verifyToken(DelegationTokenIdentifier tokenId, byte[] password); void updateRouterState(RouterServiceState newState); RouterServiceState getRouterState(); boolean isRouterState(RouterServiceState routerState); StateStoreService getStateStore(); RouterMetrics getRouterMetrics(); RBFMetrics getMetrics(); NamenodeBeanMetrics getNamenodeMetrics(); FileSubclusterResolver getSubclusterResolver(); ActiveNamenodeResolver getNamenodeResolver(); RouterStore getRouterStateManager(); long getStartTime(); String getRouterId(); void setRouterId(String id); boolean isQuotaEnabled(); RouterQuotaManager getQuotaManager(); RouterAdminServer getAdminServer();  }
@Test public void testRouterMetricsWhenDisabled() throws Exception { Router router = new Router(); router.init(new RouterConfigBuilder(conf).rpc().build()); router.start(); intercept(IOException.class, "Namenode metrics is not initialized", () -> router.getNamenodeMetrics().getCacheCapacity()); router.stop(); router.close(); }