Skip to content

Commit d6d4ba5

Browse files
committed
#4211 Prevent stream status in processing filters
1 parent 0b000c0 commit d6d4ba5

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorEditPresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void show(final ProcessorType processorType,
127127

128128
final boolean existingFilter = filter != null && filter.getId() != null;
129129
final QueryData queryData = getOrCreateQueryData(filter, defaultExpression);
130-
final List<QueryField> fields = MetaFields.getAllFields();
130+
final List<QueryField> fields = MetaFields.getProcessorFilterFields();
131131
read(
132132
queryData.getExpression(),
133133
MetaFields.STREAM_STORE_DOC_REF,

stroom-core-shared/src/main/java/stroom/meta/shared/MetaFields.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class MetaFields {
2828
private static final Map<String, QueryField> FIELD_MAP;
2929
private static final List<QueryField> EXTENDED_FIELDS = new ArrayList<>();
3030
private static final List<QueryField> ALL_FIELDS = new ArrayList<>();
31+
private static final List<QueryField> PROCESSOR_FILTER_FIELDS = new ArrayList<>();
3132
private static final Map<String, QueryField> ALL_FIELD_MAP;
3233

3334
// Non grouped fields
@@ -116,6 +117,11 @@ public class MetaFields {
116117

117118
ALL_FIELDS.addAll(FIELDS);
118119
ALL_FIELDS.addAll(EXTENDED_FIELDS);
120+
121+
// Create a subset of fields for use in processor tasks.
122+
PROCESSOR_FILTER_FIELDS.addAll(ALL_FIELDS);
123+
PROCESSOR_FILTER_FIELDS.remove(STATUS);
124+
119125
ALL_FIELD_MAP = ALL_FIELDS.stream()
120126
.collect(Collectors.toMap(QueryField::getFldName, Function.identity()));
121127
}
@@ -132,6 +138,10 @@ public static List<QueryField> getAllFields() {
132138
return ALL_FIELDS;
133139
}
134140

141+
public static List<QueryField> getProcessorFilterFields() {
142+
return PROCESSOR_FILTER_FIELDS;
143+
}
144+
135145
public static Map<String, QueryField> getAllFieldMap() {
136146
return ALL_FIELD_MAP;
137147
}

stroom-processor/stroom-processor-impl/src/main/java/stroom/processor/impl/ProcessorTaskCreatorImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ List<Meta> runSelectMetaQuery(final ExpressionOperator expression,
667667
final boolean reprocess,
668668
final int length) {
669669
// Validate expression.
670-
final ExpressionValidator expressionValidator = new ExpressionValidator(MetaFields.getAllFields());
670+
final ExpressionValidator expressionValidator = new ExpressionValidator(MetaFields.getProcessorFilterFields());
671671
expressionValidator.validate(expression);
672672

673673
if (reprocess) {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* Issue **#4211** : Prevent stream status in processing filters.
2+
3+
4+
```sh
5+
# ********************************************************************************
6+
# Issue title: Should we allow Proc Filters that use `Status`
7+
# Issue link: https://github.com/gchq/stroom/issues/4211
8+
# ********************************************************************************
9+
10+
# ONLY the top line will be included as a change entry in the CHANGELOG.
11+
# The entry should be in GitHub flavour markdown and should be written on a SINGLE
12+
# line with no hard breaks. You can have multiple change files for a single GitHub issue.
13+
# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than
14+
# 'Fixed nasty bug'.
15+
#
16+
# Examples of acceptable entries are:
17+
#
18+
#
19+
# * Issue **123** : Fix bug with an associated GitHub issue in this repository
20+
#
21+
# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository
22+
#
23+
# * Fix bug with no associated GitHub issue.
24+
```

0 commit comments

Comments
 (0)