public QueryManager() { this.queries = Multimaps.synchronizedSetMultimap( HashMultimap.create() ); this.queryDatasources = Multimaps.synchronizedSetMultimap( HashMultimap.create() ); }
public GrayReleaseRulesHolder() { loadVersion = new AtomicLong(); grayReleaseRuleCache = Multimaps.synchronizedSetMultimap(HashMultimap.create()); reversedGrayReleaseRuleCache = Multimaps.synchronizedSetMultimap(HashMultimap.create()); executorService = Executors.newScheduledThreadPool(1, ApolloThreadFactory .create("GrayReleaseRulesHolder", true)); }
/** get or create the multimap object for the given {@code index} */ public Multimap<String, String> getOrCreate(String index) { Multimap<String, String> mmap = storeMap.get(index); if (mmap == null) { SetMultimap<String, String> multimap = Multimaps.newSetMultimap(new HashMap<String, Collection<String>>(), new Supplier<Set<String>>() { public Set<String> get() { return Sets.newSetFromMap(new ConcurrentHashMap<String, Boolean>()); } }); mmap = concurrent ? Multimaps.synchronizedSetMultimap(multimap) : multimap; storeMap.put(index,mmap); } return mmap; }
/** get or create the multimap object for the given {@code index} */ public Multimap<String, String> getOrCreate(String index) { Multimap<String, String> mmap = storeMap.get(index); if (mmap == null) { SetMultimap<String, String> multimap = Multimaps.newSetMultimap(new HashMap<String, Collection<String>>(), new Supplier<Set<String>>() { public Set<String> get() { return Sets.newSetFromMap(new ConcurrentHashMap<String, Boolean>()); } }); mmap = concurrent ? Multimaps.synchronizedSetMultimap(multimap) : multimap; storeMap.put(index,mmap); } return mmap; }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedHashMultimap() { checkUnmodifiableMultimap( Multimaps.synchronizedSetMultimap(HashMultimap.<String, Integer>create()), false); }
/** * 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()); }
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; }
@GwtIncompatible // SerializableTester public void testSerializingUnmodifiableSynchronizedHashMultimap() { Multimap<String, Integer> unmodifiable = prepareUnmodifiableTests( Multimaps.synchronizedSetMultimap(HashMultimap.<String, Integer>create()), false, null, null); SerializableTester.reserializeAndAssert(unmodifiable); }
Multimaps.<FileSet<CopyEntity>, WorkUnit>synchronizedSetMultimap( HashMultimap.<FileSet<CopyEntity>, WorkUnit>create());
public QueryManager() { this.queries = Multimaps.synchronizedSetMultimap( HashMultimap.create() ); this.queryDatasources = Multimaps.synchronizedSetMultimap( HashMultimap.create() ); }
@Override protected SetMultimap<Long, LineMessage> allocateElement() { SetMultimap<Long, LineMessage> mm = HashMultimap.create(); return Multimaps.synchronizedSetMultimap(mm); }
public MgcpCall(int callId) { this.callId = callId; this.entries = Multimaps.synchronizedSetMultimap(HashMultimap.<String, Integer> create(3, 3)); }
public QueryManager() { this.queries = Multimaps.synchronizedSetMultimap( HashMultimap.<String, ListenableFuture>create() ); this.queryDatasources = Multimaps.synchronizedSetMultimap( HashMultimap.<String, String>create() ); }
public MgcpCall(int callId) { this.callId = callId; this.entries = Multimaps.synchronizedSetMultimap(HashMultimap.<String, Integer> create(3, 3)); }
public InMemoryAttachmentMapper() { attachmentsById = new ConcurrentHashMap<>(INITIAL_SIZE); messageIdsByAttachmentId = Multimaps.synchronizedSetMultimap(HashMultimap.create()); ownersByAttachmentId = Multimaps.synchronizedSetMultimap(HashMultimap.create()); }
@Inject public InVMEventBus(EventDelivery eventDelivery, RetryBackoffConfiguration retryBackoff, EventDeadLetters eventDeadLetters) { this.eventDelivery = eventDelivery; this.retryBackoff = retryBackoff; this.eventDeadLetters = eventDeadLetters; this.registrations = Multimaps.synchronizedSetMultimap(HashMultimap.create()); this.groups = new ConcurrentHashMap<>(); }
public Multimap<String, String> apply(final String indexName) { return synchronizedSetMultimap(newSetMultimap(new HashMap<String, Collection<String>>(), new Supplier<Set<String>>() { public Set<String> get() { return Sets.newHashSet(); } })); } });
public StateChangeNotifier(DAG dag) { this.dag = dag; this.vertexListeners = Multimaps.synchronizedSetMultimap( HashMultimap.<TezVertexID, ListenerContainer>create()); this.lastKnowStatesMap = LinkedListMultimap.create(); startThread(); }
/** * Creates concurrent readable, synchronized HashMultimap. * * @return SetMultimap */ private static <K, V> SetMultimap<K, V> createSynchronizedHashMultiMap() { return synchronizedSetMultimap( Multimaps.newSetMultimap(new ConcurrentHashMap<K, Collection<V>>(), () -> Sets.newConcurrentHashSet())); }
@GwtIncompatible // slow (~10s) public void testUnmodifiableSynchronizedHashMultimap() { checkUnmodifiableMultimap(Multimaps.synchronizedSetMultimap( HashMultimap.<String, Integer>create()), false); }