本文整理汇总了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());
}
示例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());
}
示例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;
}
示例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));
}
示例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;
}
示例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());
}
示例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());
}
示例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
});
}
});
}
示例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);
}
示例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());
}
示例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());
}
示例12: MutableContextSet
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public MutableContextSet() {
this.map = Multimaps.synchronizedSetMultimap(HashMultimap.create());
}
示例13: SubscriptionManager
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public SubscriptionManager(SimbaStoreServer server) {
this.server = server;
subscriptions = Multimaps.synchronizedSetMultimap(HashMultimap
.<String, SocketChannel> create());
}
示例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);
}