/** * Set the namespace filter regex * @param regex the namespace filter * @return the quota filter object */ public QuotaFilter setNamespaceFilter(final String regex) { this.namespaceRegex = regex; hasFilters |= !Strings.isEmpty(regex); return this; }
/** * Set the user filter regex * @param regex the user filter * @return the quota filter object */ public QuotaFilter setUserFilter(final String regex) { this.userRegex = regex; hasFilters |= !Strings.isEmpty(regex); return this; }
/** * Set the table filter regex * @param regex the table filter * @return the quota filter object */ public QuotaFilter setTableFilter(final String regex) { this.tableRegex = regex; hasFilters |= !Strings.isEmpty(regex); return this; }
@Override public PDone expand(PCollection<FeatureRowExtended> input) { Write write; if (Strings.isEmpty(errorsStoreType)) { write = new NoOpIO.Write(); } else { write = getErrorStore().create(this.errorsStoreSpec, specs); } input.apply("errors to " + String.valueOf(errorsStoreType), write); return PDone.in(input.getPipeline()); }
@Inject public ErrorsStoreTransform( ImportJobOptions options, Specs specs, List<ErrorsStore> errorsStores) { this.specs = specs; this.errorsStores = errorsStores; this.errorsStoreType = options.getErrorsStoreType(); if (!Strings.isEmpty(errorsStoreType)) { this.errorsStoreSpec = StorageSpec.newBuilder() .setType(errorsStoreType) .putAllOptions(convertJsonStringToMap(options.getErrorsStoreOptions())) .build(); } }
if (!Strings.isEmpty(filter.getUserFilter())) { FilterList userFilters = new FilterList(FilterList.Operator.MUST_PASS_ONE); boolean hasFilter = false; if (!Strings.isEmpty(filter.getNamespaceFilter())) { FilterList nsFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL); nsFilters.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator( hasFilter = true; if (!Strings.isEmpty(filter.getTableFilter())) { FilterList tableFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL); tableFilters.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL, } else if (!Strings.isEmpty(filter.getTableFilter())) { filterList.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator( getTableRowKeyRegex(filter.getTableFilter()), 0))); } else if (!Strings.isEmpty(filter.getNamespaceFilter())) { filterList.addFilter(new RowFilter(CompareFilter.CompareOp.EQUAL, new RegexStringComparator( getNamespaceRowKeyRegex(filter.getNamespaceFilter()), 0)));