Search in sources :

Example 1 with DefaultMetaService

use of com.ctrip.xpipe.redis.keeper.meta.DefaultMetaService in project x-pipe by ctripcorp.

the class AbstractIntegratedTest method createMetaService.

protected MetaServerKeeperService createMetaService(final List<MetaServerMeta> metaServerMetas) {
    DefaultMetaServerLocator metaServerLocator = new DefaultMetaServerLocator(new MetaServerAddressAware() {

        @Override
        public String getMetaServerUrl() {
            return String.format("http://%s:%d", "localhost", metaServerMetas.get(0).getPort());
        }
    });
    DefaultMetaService metaService = new DefaultMetaService();
    metaService.setConfig(new DefaultKeeperConfig());
    metaService.setMetaServerLocator(metaServerLocator);
    return metaService;
}
Also used : DefaultMetaService(com.ctrip.xpipe.redis.keeper.meta.DefaultMetaService) DefaultKeeperConfig(com.ctrip.xpipe.redis.keeper.config.DefaultKeeperConfig) MetaServerAddressAware(com.ctrip.xpipe.redis.core.config.MetaServerAddressAware) DefaultMetaServerLocator(com.ctrip.xpipe.redis.core.metaserver.DefaultMetaServerLocator)

Aggregations

MetaServerAddressAware (com.ctrip.xpipe.redis.core.config.MetaServerAddressAware)1 DefaultMetaServerLocator (com.ctrip.xpipe.redis.core.metaserver.DefaultMetaServerLocator)1 DefaultKeeperConfig (com.ctrip.xpipe.redis.keeper.config.DefaultKeeperConfig)1 DefaultMetaService (com.ctrip.xpipe.redis.keeper.meta.DefaultMetaService)1