/** * Reads the class and field annotations to populate the meta-data. */ public FilterMetaData(Class<? extends Filter> type) { Preconditions.checkNotNull(type, "type argument"); FilterInfo info = type.getAnnotation(FilterInfo.class); Preconditions.checkState(info != null, "Filters must be annotated with FilterInfo."); canonicalName = type.getCanonicalName(); name = info.name(); description = info.description(); backend = info.backend(); parameters = Lists.newArrayList(); for(Field field : type.getDeclaredFields()) { FilterParam filterParam = field.getAnnotation(FilterParam.class); if (filterParam == null) { // Skip fields that are not annotated continue; } parameters.add(new FilterParamMetaData(field, filterParam)); } }
@FilterInfo(name="JEXL", description="Generic JEXL expression filter") public class JEXL implements Filter {
@Override public Filter getFilter(FilterDef filterDef) { if (!info.name().equalsIgnoreCase(filterDef.getName()) && !type.getCanonicalName().equals(filterDef.getName())) { return null;
@Override public Filter getFilter(FilterDef filterDef) { if (!info.name().equalsIgnoreCase(filterDef.getName()) && !type.getCanonicalName().equals(filterDef.getName())) { return null;
/** * Reads the class and field annotations to populate the meta-data. */ public FilterMetaData(Class<? extends Filter> type) { Preconditions.checkNotNull(type, "type argument"); FilterInfo info = type.getAnnotation(FilterInfo.class); Preconditions.checkState(info != null, "Filters must be annotated with FilterInfo."); canonicalName = type.getCanonicalName(); name = info.name(); description = info.description(); backend = info.backend(); parameters = Lists.newArrayList(); for(Field field : type.getDeclaredFields()) { FilterParam filterParam = field.getAnnotation(FilterParam.class); if (filterParam == null) { // Skip fields that are not annotated continue; } parameters.add(new FilterParamMetaData(field, filterParam)); } }
@FilterInfo(name="JEXL", description="Generic JEXL expression filter") public class JEXL implements Filter {
@FilterInfo(name="Derivative", description="Calculates the derivative (rate of change) between rows.") public class Derivative implements Filter {
@FilterInfo(name="Derivative", description="Calculates the derivative (rate of change) between rows.") public class Derivative implements Filter {
@FilterInfo(name="Outlier", description="Removes outliers and replaces them with interpolated values.") public class OutlierFilter implements Filter {
@FilterInfo(name="Outlier", description="Removes outliers and replaces them with interpolated values.") public class OutlierFilter implements Filter {
@FilterInfo(name="Chomp", description="Strips leading and trailing rows that contain nothing but NaNs/null values.") public class Chomp implements Filter {
@FilterInfo(name="Chomp", description="Strips leading and trailing rows that contain nothing but NaNs/null values.") public class Chomp implements Filter {
@FilterInfo(name="Percentile", description="Calculates percentiles") public class Percentile implements Filter {
@FilterInfo(name="Percentile", description="Calculates percentiles") public class Percentile implements Filter {
@FilterInfo(name="Trend", description="Fits a trend line or polynomial to a given column.", backend="R") public class TrendLine implements Filter { private static final Logger LOG = LoggerFactory.getLogger(TrendLine.class);
@FilterInfo(name="Trend", description="Fits a trend line or polynomial to a given column.", backend="R") public class TrendLine implements Filter { private static final Logger LOG = LoggerFactory.getLogger(TrendLine.class);
@FilterInfo(name="HoltWinters", description="Performs Holt-Winters forecasting.", backend="R") public class HWForecast implements Filter { private static final Logger LOG = LoggerFactory.getLogger(HWForecast.class);
@FilterInfo(name="HoltWinters", description="Performs Holt-Winters forecasting.", backend="R") public class HWForecast implements Filter { private static final Logger LOG = LoggerFactory.getLogger(HWForecast.class);