/** * Returns the names of all counter classes. * @return Set of counter names. */ public synchronized Iterable<String> getGroupNames() { HashSet<String> deprecated = new HashSet<String>(); for(Map.Entry<String, String> entry : legacyMap.entrySet()) { String newGroup = entry.getValue(); boolean isFGroup = isFrameworkGroup(newGroup); if(isFGroup ? fgroups.containsKey(newGroup) : groups.containsKey(newGroup)) { deprecated.add(entry.getKey()); } } return Iterables.concat(fgroups.keySet(), groups.keySet(), deprecated); }
/** * Returns the names of all counter classes. * @return Set of counter names. */ public synchronized Iterable<String> getGroupNames() { HashSet<String> deprecated = new HashSet<String>(); for(Map.Entry<String, String> entry : legacyMap.entrySet()) { String newGroup = entry.getValue(); boolean isFGroup = isFrameworkGroup(newGroup); if(isFGroup ? fgroups.containsKey(newGroup) : groups.containsKey(newGroup)) { deprecated.add(entry.getKey()); } } return Iterables.concat(fgroups.keySet(), groups.keySet(), deprecated); }
/** * Returns the names of all counter classes. * @return Set of counter names. */ public synchronized Iterable<String> getGroupNames() { HashSet<String> deprecated = new HashSet<String>(); for(Map.Entry<String, String> entry : legacyMap.entrySet()) { String newGroup = entry.getValue(); boolean isFGroup = isFrameworkGroup(newGroup); if(isFGroup ? fgroups.containsKey(newGroup) : groups.containsKey(newGroup)) { deprecated.add(entry.getKey()); } } return Iterables.concat(fgroups.keySet(), groups.keySet(), deprecated); }
/** * Returns the names of all counter classes. * @return Set of counter names. */ public synchronized Iterable<String> getGroupNames() { HashSet<String> deprecated = new HashSet<String>(); for(Map.Entry<String, String> entry : legacyMap.entrySet()) { String newGroup = entry.getValue(); boolean isFGroup = isFrameworkGroup(newGroup); if(isFGroup ? fgroups.containsKey(newGroup) : groups.containsKey(newGroup)) { deprecated.add(entry.getKey()); } } return Iterables.concat(fgroups.keySet(), groups.keySet(), deprecated); }
/** Add a group. * @param group object to add * @return the group */ @InterfaceAudience.Private public synchronized G addGroup(G group) { String name = group.getName(); if (isFrameworkGroup(name)) { fgroups.put(name, group); } else { limits.checkGroups(groups.size() + 1); groups.put(name, group); } return group; }
/** Add a group. * @param group object to add * @return the group */ @InterfaceAudience.Private public synchronized G addGroup(G group) { String name = group.getName(); if (isFrameworkGroup(name)) { fgroups.put(name, group); } else { limits.checkGroups(groups.size() + 1); groups.put(name, group); } return group; }
/** Add a group. * @param group object to add * @return the group */ @InterfaceAudience.Private public synchronized G addGroup(G group) { String name = group.getName(); if (isFrameworkGroup(name)) { fgroups.put(name, group); } else { limits.checkGroups(groups.size() + 1); groups.put(name, group); } return group; }
/** Add a group. * @param group object to add * @return the group */ @InterfaceAudience.Private public synchronized G addGroup(G group) { String name = group.getName(); if (isFrameworkGroup(name)) { fgroups.put(name, group); } else { limits.checkGroups(groups.size() + 1); groups.put(name, group); } return group; }
boolean isFGroup = isFrameworkGroup(newGroupName); G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName); if (group == null) {
boolean isFGroup = isFrameworkGroup(newGroupName); G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName); if (group == null) {
boolean isFGroup = isFrameworkGroup(newGroupName); G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName); if (group == null) {
boolean isFGroup = isFrameworkGroup(newGroupName); G group = isFGroup ? fgroups.get(newGroupName) : groups.get(newGroupName); if (group == null) {
/** * Increments multiple counters by their amounts in another Counters * instance. * @param other the other Counters instance */ public synchronized void incrAllCounters(AbstractCounters<C, G> other) { for(G right : other) { String groupName = right.getName(); G left = (isFrameworkGroup(groupName) ? fgroups : groups).get(groupName); if (left == null) { left = addGroup(groupName, right.getDisplayName()); } left.incrAllCounters(right); } }
/** * Increments multiple counters by their amounts in another Counters * instance. * @param other the other Counters instance */ public synchronized void incrAllCounters(AbstractCounters<C, G> other) { for(G right : other) { String groupName = right.getName(); G left = (isFrameworkGroup(groupName) ? fgroups : groups).get(groupName); if (left == null) { left = addGroup(groupName, right.getDisplayName()); } left.incrAllCounters(right); } }
/** * Increments multiple counters by their amounts in another Counters * instance. * @param other the other Counters instance */ public synchronized void incrAllCounters(AbstractCounters<C, G> other) { for(G right : other) { String groupName = right.getName(); G left = (isFrameworkGroup(groupName) ? fgroups : groups).get(groupName); if (left == null) { left = addGroup(groupName, right.getDisplayName()); } left.incrAllCounters(right); } }
/** * Increments multiple counters by their amounts in another Counters * instance. * @param other the other Counters instance */ public synchronized void incrAllCounters(AbstractCounters<C, G> other) { for(G right : other) { String groupName = right.getName(); G left = (isFrameworkGroup(groupName) ? fgroups : groups).get(groupName); if (left == null) { left = addGroup(groupName, right.getDisplayName()); } left.incrAllCounters(right); } }
/** * Construct from another counters object. * @param <C1> type of the other counter * @param <G1> type of the other counter group * @param counters the counters object to copy * @param groupFactory the factory for new groups */ @InterfaceAudience.Private public <C1 extends Counter, G1 extends CounterGroupBase<C1>> AbstractCounters(AbstractCounters<C1, G1> counters, CounterGroupFactory<C, G> groupFactory) { this.groupFactory = groupFactory; for(G1 group: counters) { String name = group.getName(); G newGroup = groupFactory.newGroup(name, group.getDisplayName(), limits); (isFrameworkGroup(name) ? fgroups : groups).put(name, newGroup); for(Counter counter: group) { newGroup.addCounter(counter.getName(), counter.getDisplayName(), counter.getValue()); } } }
/** * Construct from another counters object. * @param <C1> type of the other counter * @param <G1> type of the other counter group * @param counters the counters object to copy * @param groupFactory the factory for new groups */ @InterfaceAudience.Private public <C1 extends Counter, G1 extends CounterGroupBase<C1>> AbstractCounters(AbstractCounters<C1, G1> counters, CounterGroupFactory<C, G> groupFactory) { this.groupFactory = groupFactory; for(G1 group: counters) { String name = group.getName(); G newGroup = groupFactory.newGroup(name, group.getDisplayName(), limits); (isFrameworkGroup(name) ? fgroups : groups).put(name, newGroup); for(Counter counter: group) { newGroup.addCounter(counter.getName(), counter.getDisplayName(), counter.getValue()); } } }
/** * Construct from another counters object. * @param <C1> type of the other counter * @param <G1> type of the other counter group * @param counters the counters object to copy * @param groupFactory the factory for new groups */ @InterfaceAudience.Private public <C1 extends Counter, G1 extends CounterGroupBase<C1>> AbstractCounters(AbstractCounters<C1, G1> counters, CounterGroupFactory<C, G> groupFactory) { this.groupFactory = groupFactory; for(G1 group: counters) { String name = group.getName(); G newGroup = groupFactory.newGroup(name, group.getDisplayName(), limits); (isFrameworkGroup(name) ? fgroups : groups).put(name, newGroup); for(Counter counter: group) { newGroup.addCounter(counter.getName(), counter.getDisplayName(), counter.getValue()); } } }
/** * Construct from another counters object. * @param <C1> type of the other counter * @param <G1> type of the other counter group * @param counters the counters object to copy * @param groupFactory the factory for new groups */ @InterfaceAudience.Private public <C1 extends Counter, G1 extends CounterGroupBase<C1>> AbstractCounters(AbstractCounters<C1, G1> counters, CounterGroupFactory<C, G> groupFactory) { this.groupFactory = groupFactory; for(G1 group: counters) { String name = group.getName(); G newGroup = groupFactory.newGroup(name, group.getDisplayName(), limits); (isFrameworkGroup(name) ? fgroups : groups).put(name, newGroup); for(Counter counter: group) { newGroup.addCounter(counter.getName(), counter.getDisplayName(), counter.getValue()); } } }