public PortalDBPropertySource() { super("DBConfig", Maps.newConcurrentMap()); }
public BizDBPropertySource() { super("DBConfig", Maps.newConcurrentMap()); }
@Override public ConcurrentMap<JobId, Deque<TaskStatusEvent>> get() { return Maps.newConcurrentMap(); } });
/** * Create a new {@link DefaultMetricCollector}. * * Note that when this constructor is called, the reporter is also * automatically established. */ public MemcachedMetrics() { counters = Maps.newConcurrentMap(); meters = Maps.newConcurrentMap(); histograms = Maps.newConcurrentMap(); }
@Generates private static <K, V> ConcurrentMap<K, V> generateConcurrentMap(K key, V value) { ConcurrentMap<K, V> map = Maps.newConcurrentMap(); map.put(key, value); return map; }
@Empty private static <K, V> ConcurrentMap<K, V> generateConcurrentMap() { return Maps.newConcurrentMap(); }
@VisibleForTesting PortUtils(PortLocator locator) { this.portLocator = locator; this.assignedPorts = Maps.newConcurrentMap(); }
private void initialize() { maxIdScanned = 0; publicAppNamespaceCache = new CaseInsensitiveMapWrapper<>(Maps.newConcurrentMap()); appNamespaceCache = new CaseInsensitiveMapWrapper<>(Maps.newConcurrentMap()); appNamespaceIdCache = Maps.newConcurrentMap(); scheduledExecutorService = Executors.newScheduledThreadPool(1, ApolloThreadFactory .create("AppNamespaceServiceWithCache", true)); }
public AbstractConfig() { m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); m_configVersion = new AtomicLong(); m_arrayCache = Maps.newConcurrentMap(); allCaches = Lists.newArrayList(); }
private void initialize() { releaseMessageCache = Maps.newConcurrentMap(); doScan = new AtomicBoolean(true); executorService = Executors.newSingleThreadExecutor(ApolloThreadFactory .create("ReleaseMessageServiceWithCache", true)); }
@Inject public WidgetResultCache(MetricRegistry metricRegistry, WidgetStrategyFactory widgetStrategyFactory) { this.metricRegistry = metricRegistry; this.widgetStrategyFactory = widgetStrategyFactory; this.cache = Maps.newConcurrentMap(); this.counter = metricRegistry.counter(name(getClass(), "cacheEntries")); }
CommandStore( final CommandTopic commandTopic, final CommandIdAssigner commandIdAssigner, final SequenceNumberFutureStore sequenceNumberFutureStore ) { this.commandTopic = Objects.requireNonNull(commandTopic, "commandTopic"); this.commandIdAssigner = Objects.requireNonNull(commandIdAssigner, "commandIdAssigner"); this.commandStatusMap = Maps.newConcurrentMap(); this.sequenceNumberFutureStore = Objects.requireNonNull(sequenceNumberFutureStore, "sequenceNumberFutureStore"); }
@Override protected void setup() throws LibrecException { super.setup(); itemPops = Maps.newConcurrentMap(); }
public void addContext(int ctxId, String type, boolean ifCube) { ConcurrentMap<String, ConcurrentMap<String, CubeSegmentStatistics>> cubeSegmentStatisticsMap = null; if (ifCube) { cubeSegmentStatisticsMap = Maps.newConcurrentMap(); } cubeSegmentStatisticsResultMap.put(ctxId, new CubeSegmentStatisticsResult(type, cubeSegmentStatisticsMap)); }
final Iterable<Method> getInstanceMethods(Class<?> cls) { ConcurrentMap<Signature, Method> map = Maps.newConcurrentMap(); for (Method method : getVisibleMethods(cls)) { if (!Invokable.from(method).isStatic()) { map.putIfAbsent(new Signature(method), method); } } return map.values(); }
public void testConcurrentMap() { ConcurrentMap<Integer, Integer> map = Maps.newConcurrentMap(); assertEquals(Collections.emptyMap(), map); }
/** * 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()); }
public void testConcurrentMap() { assertFreshInstance(new TypeToken<ConcurrentMap<String, ?>>() {}); assertCanGenerateOnly( new TypeToken<ConcurrentMap<EmptyEnum, String>>() {}, Maps.newConcurrentMap()); }
/** * @param ignMsg IgniteMessaging. * @throws Exception If failed. */ private void sendOrderedMultiThreads( final IgniteMessaging ignMsg ) throws Exception { final ConcurrentMap<String, List<String>> expMsg = Maps.newConcurrentMap(); final ConcurrentMap<String, List<String>> actlMsg = Maps.newConcurrentMap(); final List<String> msgs = orderedMessages(); sendOrderedMultiThreads(ignMsg, expMsg, actlMsg, msgs); }
@Test public void testExecute() throws ExecuteException { UpdateSnapshotCacheForQueryServersStep step = new UpdateSnapshotCacheForQueryServersStep(); ExecuteResult result = step.doWork(new DefaultContext(Maps.<String, Executable>newConcurrentMap(), kylinConfig)); System.out.println(result.output()); assertTrue(result.succeed()); } }