public Func1<Row, Boolean> typeFilter(MetricType<?> type, int index) { return row -> { MetricType<?> metricType = MetricType.fromCode(row.getByte(index)); return (type == null && metricType.isUserType()) || metricType == type; }; }
public Func1<Row, Boolean> typeFilter(MetricType<?> type, int index) { return row -> { MetricType<?> metricType = MetricType.fromCode(row.getByte(index)); return (type == null && metricType.isUserType()) || metricType == type; }; }
public Func1<MetricId<?>, Boolean> metricTypeFilter(MetricType<?> type) { return tMetricId -> (type == null && tMetricId.getType().isUserType()) || tMetricId.getType() == type; } }
public Func1<MetricId<?>, Boolean> metricTypeFilter(MetricType<?> type) { return tMetricId -> (type == null && tMetricId.getType().isUserType()) || tMetricId.getType() == type; } }
@Override public Observable<MetricId<T>> call(Observable<Row> rows) { return rows.filter(row -> { MetricType<?> metricType = MetricType.fromCode(row.getByte(1)); return (type == null && metricType.isUserType()) || metricType == type; }).map(row1 -> { @SuppressWarnings("unchecked") MetricType<T> metricType = (MetricType<T>) MetricType.fromCode(row1.getByte(1)); return new MetricId<>(row1.getString(0), metricType, row1.getString(2)); }); } }
@Override public Observable<MetricId<T>> call(Observable<Row> rows) { return rows.filter(row -> { MetricType<?> metricType = MetricType.fromCode(row.getByte(1)); return (type == null && metricType.isUserType()) || metricType == type; }).map(row1 -> { @SuppressWarnings("unchecked") MetricType<T> metricType = (MetricType<T>) MetricType.fromCode(row1.getByte(1)); return new MetricId<>(row1.getString(0), metricType, row1.getString(2)); }); } }
@Override public Observable<Void> createMetric(Metric<?> metric, boolean overwrite) { MetricType<?> metricType = metric.getMetricId().getType(); if (!metricType.isUserType()) { throw new IllegalArgumentException(metric + " cannot be created. " + metricType + " metrics are " + "internally generated metrics and cannot be created by clients.");
@Override public Observable<Void> createMetric(Metric<?> metric, boolean overwrite) { MetricType<?> metricType = metric.getMetricId().getType(); if (!metricType.isUserType()) { throw new IllegalArgumentException(metric + " cannot be created. " + metricType + " metrics are " + "internally generated metrics and cannot be created by clients.");