use of com.github.ambry.router.RouterFactory in project ambry by linkedin.
the class AccountTool method getRouter.
/**
* Create a {@link Router} for {@link RouterStore}.
* @return The {@link Router}.
* @throws Exception Any unexpected exception.
*/
private Router getRouter() throws Exception {
// Create a HelixAccountService for the router.
AccountServiceFactory accountServiceFactory = Utils.getObj("com.github.ambry.account.HelixAccountServiceFactory", verifiableProperties, registry);
accountService = (HelixAccountService) accountServiceFactory.getAccountService();
ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties);
ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, hardwareLayout, partitionLayout);
clusterMap = clusterAgentsFactory.getClusterMap();
SSLFactory sslFactory = getSSLFactoryIfRequired();
// Create a NonBlockingRouter.
RouterFactory routerFactory = Utils.getObj("com.github.ambry.router.NonBlockingRouterFactory", verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory, accountService);
router = routerFactory.getRouter();
return router;
}
Aggregations