Search in sources :

Example 1 with RouterFactory

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;
}
Also used : SSLFactory(com.github.ambry.commons.SSLFactory) RouterFactory(com.github.ambry.router.RouterFactory) LoggingNotificationSystem(com.github.ambry.commons.LoggingNotificationSystem) ClusterAgentsFactory(com.github.ambry.clustermap.ClusterAgentsFactory) ClusterMapConfig(com.github.ambry.config.ClusterMapConfig)

Aggregations

ClusterAgentsFactory (com.github.ambry.clustermap.ClusterAgentsFactory)1 LoggingNotificationSystem (com.github.ambry.commons.LoggingNotificationSystem)1 SSLFactory (com.github.ambry.commons.SSLFactory)1 ClusterMapConfig (com.github.ambry.config.ClusterMapConfig)1 RouterFactory (com.github.ambry.router.RouterFactory)1