类com.google.common.util.concurrent.Striped源码实例Demo

下面列出了怎么用com.google.common.util.concurrent.Striped的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: commafeed   文件: FeedRefreshUpdater.java
@Inject
public FeedRefreshUpdater(SessionFactory sessionFactory, FeedUpdateService feedUpdateService, PubSubService pubSubService,
		FeedQueues queues, CommaFeedConfiguration config, MetricRegistry metrics, FeedSubscriptionDAO feedSubscriptionDAO,
		CacheService cache) {
	this.sessionFactory = sessionFactory;
	this.feedUpdateService = feedUpdateService;
	this.pubSubService = pubSubService;
	this.queues = queues;
	this.config = config;
	this.feedSubscriptionDAO = feedSubscriptionDAO;
	this.cache = cache;

	ApplicationSettings settings = config.getApplicationSettings();
	int threads = Math.max(settings.getDatabaseUpdateThreads(), 1);
	pool = new FeedRefreshExecutor("feed-refresh-updater", threads, Math.min(50 * threads, 1000), metrics);
	locks = Striped.lazyWeakLock(threads * 100000);

	entryCacheMiss = metrics.meter(MetricRegistry.name(getClass(), "entryCacheMiss"));
	entryCacheHit = metrics.meter(MetricRegistry.name(getClass(), "entryCacheHit"));
	feedUpdated = metrics.meter(MetricRegistry.name(getClass(), "feedUpdated"));
	entryInserted = metrics.meter(MetricRegistry.name(getClass(), "entryInserted"));
}
 
源代码2 项目: hivemq-community-edition   文件: TopicTreeImpl.java
@Inject
public TopicTreeImpl(@NotNull final MetricsHolder metricsHolder) {

    this.subscriptionCounter = metricsHolder.getSubscriptionCounter();
    this.mapCreationThreshold = TOPIC_TREE_MAP_CREATION_THRESHOLD.get();

    segmentLocks = Striped.readWriteLock(64);
}
 
public HelixRetriggeringJobCallable(
    GobblinHelixJobScheduler jobScheduler,
    MutableJobCatalog jobCatalog,
    Properties sysProps,
    Properties jobProps,
    JobListener jobListener,
    GobblinHelixPlanningJobLauncherMetrics planningJobLauncherMetrics,
    GobblinHelixMetrics helixMetrics,
    Path appWorkDir,
    HelixManager jobHelixManager,
    Optional<HelixManager> taskDriverHelixManager,
    HelixJobsMapping jobsMapping,
    Striped<Lock> locks) {
  this.jobScheduler = jobScheduler;
  this.jobCatalog = jobCatalog;
  this.sysProps = sysProps;
  this.jobProps = jobProps;
  this.jobListener = jobListener;
  this.planningJobLauncherMetrics = planningJobLauncherMetrics;
  this.helixMetrics = helixMetrics;
  this.appWorkDir = appWorkDir;
  this.jobHelixManager = jobHelixManager;
  this.taskDriverHelixManager = taskDriverHelixManager;
  this.isDistributeJobEnabled = isDistributeJobEnabled();
  this.jobUri = jobProps.getProperty(GobblinClusterConfigurationKeys.JOB_SPEC_URI);
  this.jobsMapping = jobsMapping;
  this.locks = locks;
}
 
源代码4 项目: kareldb   文件: TxVersionedCache.java
public TxVersionedCache(VersionedCache cache, boolean conflictFree) {
    this.cache = cache;
    this.conflictFree = conflictFree;
    this.snapshotFilter = new SnapshotFilterImpl(cache);
    this.striped = Striped.readWriteLock(128);
}
 
源代码5 项目: hivemq-community-edition   文件: MessageIDPools.java
MessageIDPools() {
    //Do not instantiate manually
    lock = Striped.readWriteLock(InternalConfigurations.MESSAGE_ID_PRODUCER_LOCK_SIZE.get());
}
 
源代码6 项目: hugegraph-common   文件: KeyLock.java
public KeyLock(int size) {
    this.locks = Striped.lock(size);
}
 
源代码7 项目: kcache   文件: Caches.java
ConcurrentCache(Cache<K, V> m) {
    this.m = Objects.requireNonNull(m);
    striped = Striped.readWriteLock(128);
}
 
源代码8 项目: kcache   文件: Caches.java
ConcurrentCache(Cache<K, V> m, Striped<ReadWriteLock> striped) {
    this.m = m;
    this.striped = striped;
}
 
源代码9 项目: kcache   文件: Caches.java
ConcurrentCollection(Collection<E> c, Striped<ReadWriteLock> striped) {
    this.c = Objects.requireNonNull(c);
    this.striped = Objects.requireNonNull(striped);
}
 
源代码10 项目: kcache   文件: Caches.java
ConcurrentSet(Set<E> s, Striped<ReadWriteLock> striped) {
    super(s, striped);
}
 
源代码11 项目: che   文件: StripedLocks.java
public StripedLocks(int stripesCount) {
  striped = Striped.readWriteLock(stripesCount);
}
 
源代码12 项目: incubator-gobblin   文件: DefaultBrokerCache.java
public DefaultBrokerCache() {
  this.sharedResourceCache = CacheBuilder.newBuilder().build();
  this.autoScopeCache = CacheBuilder.newBuilder().build();
  this.invalidationLock = Striped.lazyWeakLock(20);
}
 
源代码13 项目: bazel   文件: StripedKeyedLocker.java
public StripedKeyedLocker(int stripes) {
  locks = Striped.readWriteLock(stripes);
}
 
源代码14 项目: tutorials   文件: StripedLock.java
public StripedLock(int buckets) {
    stripedLock = Striped.lock(buckets);
}
 
 类方法
 同包方法