当前位置: 首页>>代码示例>>Java>>正文


Java Multimaps.synchronizedSetMultimap方法代码示例

本文整理汇总了Java中com.google.common.collect.Multimaps.synchronizedSetMultimap方法的典型用法代码示例。如果您正苦于以下问题:Java Multimaps.synchronizedSetMultimap方法的具体用法?Java Multimaps.synchronizedSetMultimap怎么用?Java Multimaps.synchronizedSetMultimap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.Multimaps的用法示例。


在下文中一共展示了Multimaps.synchronizedSetMultimap方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
@Activate
public void activate() {
    ribTable4 = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());
    ribTable6 = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());

    routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
            HashMultimap.create());

    coreService.registerApplication(ROUTER_APP_ID);

    bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
            new ThreadFactoryBuilder()
            .setNameFormat("rib-updates-%d").build());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:DefaultRouter.java

示例2: RemoteConfigLongPollService

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
 * Constructor.
 */
public RemoteConfigLongPollService() {
  m_longPollFailSchedulePolicyInSecond = new ExponentialSchedulePolicy(1, 120); //in second
  m_longPollingStopped = new AtomicBoolean(false);
  m_longPollingService = Executors.newSingleThreadExecutor(
      ApolloThreadFactory.create("RemoteConfigLongPollService", true));
  m_longPollStarted = new AtomicBoolean(false);
  m_longPollNamespaces =
      Multimaps.synchronizedSetMultimap(HashMultimap.<String, RemoteConfigRepository>create());
  m_notifications = Maps.newConcurrentMap();
  m_remoteNotificationMessages = Maps.newConcurrentMap();
  m_responseType = new TypeToken<List<ApolloConfigNotification>>() {
  }.getType();
  gson = new Gson();
  m_configUtil = ApolloInjector.getInstance(ConfigUtil.class);
  m_httpUtil = ApolloInjector.getInstance(HttpUtil.class);
  m_serviceLocator = ApolloInjector.getInstance(ConfigServiceLocator.class);
  m_longPollRateLimiter = RateLimiter.create(m_configUtil.getLongPollQPS());
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:22,代码来源:RemoteConfigLongPollService.java

示例3: Consultant

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
private Consultant(ScheduledExecutorService executor, ObjectMapper mapper, URI consulUri,
		ServiceIdentifier identifier, SetMultimap<String, SettingListener> settingListeners,
		Set<ConfigListener> configListeners, ConfigValidator validator, CloseableHttpClient http,
		boolean pullConfig, String healthEndpoint, String kvPrefix) {

	this.registered = new AtomicBoolean();
	this.settingListeners = Multimaps.synchronizedSetMultimap(settingListeners);
	this.configListeners = Sets.newConcurrentHashSet(configListeners);
	this.serviceInstanceBackend = new ServiceInstanceBackend(identifier.getDatacenter(), consulUri, mapper, http);
	this.mapper = mapper;
	this.validator = validator;
	this.executor = executor;
	this.consulUri = consulUri;
	this.id = identifier;
	this.pullConfig = pullConfig;
	this.validated = new Properties();
	this.healthEndpoint = healthEndpoint;
	this.http = http;
       this.kvPrefix = kvPrefix;
}
 
开发者ID:Magnetme,项目名称:consultant,代码行数:21,代码来源:Consultant.java

示例4: GrayReleaseRulesHolder

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public GrayReleaseRulesHolder() {
  loadVersion = new AtomicLong();
  grayReleaseRuleCache = Multimaps.synchronizedSetMultimap(HashMultimap.create());
  reversedGrayReleaseRuleCache = Multimaps.synchronizedSetMultimap(HashMultimap.create());
  executorService = Executors.newScheduledThreadPool(1, ApolloThreadFactory
      .create("GrayReleaseRulesHolder", true));
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:8,代码来源:GrayReleaseRulesHolder.java

示例5: init

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
private void init(ExecutorService executor) {
    tree = Maps.newTreeMap();
    if (executor != null) {
        this.executor = executor;
    } else {
        this.executor = Executors.newFixedThreadPool(1, new DefaultThreadFactory("mock-zookeeper"));
    }
    SetMultimap<String, Watcher> w = HashMultimap.create();
    watchers = Multimaps.synchronizedSetMultimap(w);
    stopped = false;
    stepsToFail = new AtomicInteger(-1);
    failReturnCode = KeeperException.Code.OK;
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:14,代码来源:MockZooKeeper.java

示例6: onSessionInitiated

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
@Override
public void onSessionInitiated(ProviderContext session) {
	LOG.info("Router Session Initiated");
	routesWaitingOnArp = Multimaps.synchronizedSetMultimap(HashMultimap.<AtriumIpAddress, RouteEntry> create());
	ribTable4 = new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
	bgpUpdatesExecutor = Executors
			.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("atrium-bgp-updates-%d").build());
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:9,代码来源:RibManager.java

示例7: activate

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
@Activate
public void activate() {
    ribTable4 = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());
    ribTable6 = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());

    routesWaitingOnArp = Multimaps.synchronizedSetMultimap(
            HashMultimap.<IpAddress, RouteEntry>create());

    bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
            new ThreadFactoryBuilder()
            .setNameFormat("sdnip-bgp-updates-%d").build());
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:15,代码来源:Router.java

示例8: PluginManager

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public PluginManager(Server server) {
    this.listenersByPlugin = Multimaps.synchronizedSetMultimap(HashMultimap.create());
    this.commandsByPlugin = Multimaps.synchronizedSetMultimap(HashMultimap.create());
    this.commandMap = new MapMaker().makeMap();
    this.plugins = Lists.newArrayList();
    this.server = server;
    this.eventBus = new EventBus((exception, context) -> {
        if (Listener.class.isAssignableFrom(context.getSubscriber().getClass())) {
            Event event = (Event) context.getEvent();
            Events.record(event, context.getSubscriber());

            Listener listener = (Listener) context.getSubscriber();
            for (Entry<Plugin, Listener> entry : listenersByPlugin.entries()) {
                if (listener == entry.getValue()) {
                    Plugin plugin = entry.getKey();
                    plugin.getLogger().error(PocketLogging.Plugin.EVENT, "An unhandled exception was " +
                        "thrown by {}", new Object[]{
                        printMethod(context.getSubscriberMethod()),
                        exception
                    });
                    return;
                }
            }
            server.getLogger().error(PocketLogging.Plugin.EVENT, "An unhandled exception was thrown " +
                "whilst handling {}", new Object[]{
                context.getEvent().getClass().getName(),
                exception
            });
        }
    });
}
 
开发者ID:PocketServer,项目名称:PocketServer-Ref,代码行数:32,代码来源:PluginManager.java

示例9: FileTree

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public FileTree(FSNamesystem namesystem, INodeIdentifier subtreeRootId,
    FsAction subAccess) throws AccessControlException {
  super(namesystem, subtreeRootId, subAccess);
  HashMultimap<Integer, ProjectedINode> parentMap = HashMultimap.create();
  inodesByParent = Multimaps.synchronizedSetMultimap(parentMap);
  HashMultimap<Integer, ProjectedINode> levelMap = HashMultimap.create();
  inodesByLevel = Multimaps.synchronizedSetMultimap(levelMap);
  HashMultimap<Integer, ProjectedINode> dirsLevelMap = HashMultimap.create();
  dirsByLevel = Multimaps.synchronizedSetMultimap(dirsLevelMap);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:11,代码来源:AbstractFileTree.java

示例10: SubscriptionManager

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public SubscriptionManager(BackendConnector client) {
	this.backend = client;
	tableSchemas = new ConcurrentHashMap<String, List<Column>>();
	tableVersions = new ConcurrentHashMap<String, Integer>();
	subscribers = Multimaps.synchronizedSetMultimap(HashMultimap
			.<String, ClientState> create());
}
 
开发者ID:SimbaService,项目名称:Simba,代码行数:8,代码来源:SubscriptionManager.java

示例11: init

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
@Override
public void init(FloodlightModuleContext context) {
    this.configService = context.getServiceImpl(IConfigInfoService.class);
    this.restApi = context.getServiceImpl(IRestApiService.class);
    this.datagrid = context.getServiceImpl(IDatagridService.class);
    this.topologyService = context.getServiceImpl(ITopologyService.class);
    this.packetService = context.getServiceImpl(IPacketService.class);

    arpRequests = Multimaps.synchronizedSetMultimap(HashMultimap
            .<InetAddress, ArpRequest>create());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:12,代码来源:ProxyArpManager.java

示例12: MutableContextSet

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public MutableContextSet() {
    this.map = Multimaps.synchronizedSetMultimap(HashMultimap.create());
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:4,代码来源:MutableContextSet.java

示例13: SubscriptionManager

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public SubscriptionManager(SimbaStoreServer server) {
	this.server = server;
	subscriptions = Multimaps.synchronizedSetMultimap(HashMultimap
			.<String, SocketChannel> create());
}
 
开发者ID:SimbaService,项目名称:Simba,代码行数:6,代码来源:SubscriptionManager.java

示例14: init

import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
        throws FloodlightModuleException {

    bgpRoutes = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());
    interfaceRoutes = new ConcurrentInvertedRadixTree<>(
            new DefaultByteArrayNodeFactory());
    externalNetworkSwitchPorts = new HashSet<SwitchPort>();

    ribUpdates = new LinkedBlockingQueue<>();

    // Register REST handler.
    restApi = context.getServiceImpl(IRestApiService.class);
    proxyArp = context.getServiceImpl(IProxyArpService.class);

    controllerRegistryService = context
            .getServiceImpl(IControllerRegistryService.class);
    pathRuntime = context.getServiceImpl(IPathCalcRuntimeService.class);
    linkDiscoveryService = context.getServiceImpl(ILinkDiscoveryService.class);

    intentIdGenerator = new IdBlockAllocatorBasedIntentIdGenerator(
            controllerRegistryService);

    // TODO: initialize intentService

    pushedRouteIntents = new ConcurrentHashMap<>();

    prefixesWaitingOnArp = Multimaps.synchronizedSetMultimap(
            HashMultimap.<InetAddress, RibUpdate>create());

    //flowCache = new FlowCache(floodlightProvider);

    bgpUpdatesExecutor = Executors.newSingleThreadExecutor(
            new ThreadFactoryBuilder().setNameFormat("bgp-updates-%d").build());

    // Read in config values
    bgpdRestIp = context.getConfigParams(this).get("BgpdRestIp");
    if (bgpdRestIp == null) {
        log.error("BgpdRestIp property not found in config file");
        throw new ConfigurationRuntimeException(
                "BgpdRestIp property not found in config file");
    } else {
        log.info("BgpdRestIp set to {}", bgpdRestIp);
    }

    routerId = context.getConfigParams(this).get("RouterId");
    if (routerId == null) {
        log.error("RouterId property not found in config file");
        throw new ConfigurationRuntimeException(
                "RouterId property not found in config file");
    } else {
        log.info("RouterId set to {}", routerId);
    }

    String configFilenameParameter = context.getConfigParams(this).get("configfile");
    if (configFilenameParameter != null) {
        currentConfigFilename = configFilenameParameter;
    }
    log.debug("Config file set to {}", currentConfigFilename);

    readConfiguration(currentConfigFilename);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:64,代码来源:SdnIp.java


注:本文中的com.google.common.collect.Multimaps.synchronizedSetMultimap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。