/** * Create a GroupName from this NamedResolverMap. * * @param prefixPath Additional path elements to put in front of the * returned path. * @return A group name derived from this NamedResolverMap and the supplied * arguments. */ public GroupName getGroupName(@NonNull SimpleGroupPath prefixPath) { return getGroupName(prefixPath.getPath()); }
/** * Create a GroupName from this NamedResolverMap. * * @param prefixPath Additional path elements to put in front of the * returned path. * @return A group name derived from this NamedResolverMap and the supplied * arguments. */ public GroupName getGroupName(@NonNull SimpleGroupPath prefixPath) { return getGroupName(prefixPath.getPath()); }
/** * Create a GroupName from this NamedResolverMap. * * @param prefixPath Additional path elements to put in front of the * returned path. * @param extraTags Additional tags to put in the tag set. The extraTags * argument will override any values present in the NamedResolverMap. * @return A group name derived from this NamedResolverMap and the supplied * arguments. */ public GroupName getGroupName(@NonNull SimpleGroupPath prefixPath, @NonNull Map<String, MetricValue> extraTags) { return getGroupName(prefixPath.getPath(), extraTags); }
/** * Create a GroupName from this NamedResolverMap. * * @param prefixPath Additional path elements to put in front of the * returned path. * @param extraTags Additional tags to put in the tag set. The extraTags * argument will override any values present in the NamedResolverMap. * @return A group name derived from this NamedResolverMap and the supplied * arguments. */ public GroupName getGroupName(@NonNull SimpleGroupPath prefixPath, @NonNull Map<String, MetricValue> extraTags) { return getGroupName(prefixPath.getPath(), extraTags); }
public boolean match(SimpleGroupPath grp) { return groups.match(grp.getPath()); }
@Override public Stream<Consumer<MutableContext>> map(Stream<Consumer<MutableContext>> in, Context ctx) { final Map<String, TimeSeriesValueSet> pathMapping = paths.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, pmEntry -> { return ctx.getTSData() .getCurrentCollection() .get(p -> pmEntry.getValue().match(p.getPath()), x -> true); })); for (final Map.Entry<String, TimeSeriesValueSet> pm : pathMapping.entrySet()) { final String identifier = pm.getKey(); final List<Consumer<MutableContext>> applications = pm.getValue().stream() .map(group -> { Consumer<MutableContext> application = (nestedCtx) -> nestedCtx.putGroupAliasByName(identifier, group::getGroup); return application; }) .collect(Collectors.toList()); in = in.flatMap(inApplication -> applications.stream().map(inApplication::andThen)); } return in; } };