FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Filter: fixup uses of #by and #byPredicate · beam-testing/DataflowJavaSDK@a8b19a6 · GitHub

Repository navigation

Commit a8b19a6

Browse files
authored andcommitted
Filter: fixup uses of #by and #byPredicate
Uses, tests, javadoc ----Release Notes---- [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=109150424
1 parent b6c4f8f commit a8b19a6

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎examples/src/main/java/com/google/cloud/dataflow/examples/complete/AutoComplete.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,13 @@ public PCollectionList<KV<String, List<CompletionCandidate>>> apply(
232232
.of(larger.get(1).apply(ParDo.of(new FlattenTops())))
233233
// ...together with those (previously excluded) candidates of length
234234
// exactly minPrefix...
235-
.and(input.apply(Filter.by(new SerializableFunction<CompletionCandidate, Boolean>() {
236-
@Override
237-
public Boolean apply(CompletionCandidate c) {
238-
return c.getValue().length() == minPrefix;
239-
}
240-
})))
235+
.and(input.apply(Filter.byPredicate(
236+
new SerializableFunction<CompletionCandidate, Boolean>() {
237+
@Override
238+
public Boolean apply(CompletionCandidate c) {
239+
return c.getValue().length() == minPrefix;
240+
}
241+
})))
241242
.apply("FlattenSmall", Flatten.<CompletionCandidate>pCollections())
242243
// ...set the key to be the minPrefix-length prefix...
243244
.apply(ParDo.of(new AllPrefixes(minPrefix, minPrefix)))
@@ -297,7 +298,6 @@ public String getValue() {
297298
}
298299

299300
// Empty constructor required for Avro decoding.
300-
@SuppressWarnings("unused")
301301
public CompletionCandidate() {}
302302

303303
@Override

‎examples/src/test/java/com/google/cloud/dataflow/examples/complete/AutoCompleteTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testAutoComplete() {
8484

8585
PCollection<KV<String, List<CompletionCandidate>>> output =
8686
input.apply(new ComputeTopCompletions(2, recursive))
87-
.apply(Filter.by(
87+
.apply(Filter.byPredicate(
8888
new SerializableFunction<KV<String, List<CompletionCandidate>>, Boolean>() {
8989
@Override
9090
public Boolean apply(KV<String, List<CompletionCandidate>> element) {

‎sdk/src/main/java/com/google/cloud/dataflow/sdk/transforms/Filter.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class Filter<T> extends PTransform<PCollection<T>, PCollection<T>> {
5353
}
5454

5555
/**
56-
* @deprecated use {@link byPredicate}, which returns a {@link Filter} transform instead of
56+
* @deprecated use {@link #byPredicate}, which returns a {@link Filter} transform instead of
5757
* a {@link ParDo.Bound}.
5858
*/
5959
@Deprecated

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL