private StandardOperationStatistic(boolean required, Class<? extends Enum> type, String name, String ... tags) { this(required, descendants(), type, name, tags); }
@Override public Set<Statistic<Number>> passthru(String name, Set<String> tags) { ArrayList<String> key = new ArrayList<String>(tags.size() + 1); key.addAll(tags); Collections.sort(key); key.add(name); if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } // lets make sure we don't get it twice. synchronized (customPassthrus) { if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } Set<ValueStatistic<?>> interim = findPassThroughStatistic(manager, EhcacheQueryBuilder.cache().descendants(), name, tags); if (interim.isEmpty()) { return Collections.EMPTY_SET; } Set<Statistic<Number>> ret = new HashSet<Statistic<Number>>(interim.size()); for (ValueStatistic<?> vs : interim) { SemiExpiringStatistic stat = new SemiExpiringStatistic(vs, executor, defaultHistorySize, SECONDS.toNanos(defaultIntervalSeconds)); ret.add(stat); } customPassthrus.put(key, ret); return ret; } }
@Override public Set<Statistic<Number>> passthru(String name, Set<String> tags) { ArrayList<String> key = new ArrayList<String>(tags.size() + 1); key.addAll(tags); Collections.sort(key); key.add(name); if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } // lets make sure we don't get it twice. synchronized (customPassthrus) { if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } Set<ValueStatistic<?>> interim = findPassThroughStatistic(manager, EhcacheQueryBuilder.cache().descendants(), name, tags); if (interim.isEmpty()) { return Collections.EMPTY_SET; } Set<Statistic<Number>> ret = new HashSet<Statistic<Number>>(interim.size()); for (ValueStatistic<?> vs : interim) { SemiExpiringStatistic stat = new SemiExpiringStatistic(vs, executor, defaultHistorySize, SECONDS.toNanos(defaultIntervalSeconds)); ret.add(stat); } customPassthrus.put(key, ret); return ret; } }
private StandardOperationStatistic(boolean required, Class<? extends Enum> type, String name, String ... tags) { this(required, descendants(), type, name, tags); }
@Override public Set<Statistic<Number>> passthru(String name, Set<String> tags) { ArrayList<String> key = new ArrayList<String>(tags.size() + 1); key.addAll(tags); Collections.sort(key); key.add(name); if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } // lets make sure we don't get it twice. synchronized (customPassthrus) { if (customPassthrus.containsKey(key)) { return customPassthrus.get(key); } Set<ValueStatistic<?>> interim = findPassThroughStatistic(manager, EhcacheQueryBuilder.cache().descendants(), name, tags); if (interim.isEmpty()) { return Collections.EMPTY_SET; } Set<Statistic<Number>> ret = new HashSet<Statistic<Number>>(interim.size()); for (ValueStatistic<?> vs : interim) { SemiExpiringStatistic stat = new SemiExpiringStatistic(vs, executor, defaultHistorySize, SECONDS.toNanos(defaultIntervalSeconds)); ret.add(stat); } customPassthrus.put(key, ret); return ret; } }
private StandardOperationStatistic(boolean required, Class<? extends Enum> type, String name, String ... tags) { this(required, descendants(), type, name, tags); }