當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。