| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b6c4f8f commit a8b19a6
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,12 +232,13 @@ public PCollectionList<KV<String, List<CompletionCandidate>>> apply( | |||
| 232 | 232 | .of(larger.get(1).apply(ParDo.of(new FlattenTops()))) | |
| 233 | 233 | // ...together with those (previously excluded) candidates of length | |
| 234 | 234 | // 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 | + }))) | ||
| 241 | 242 | .apply("FlattenSmall", Flatten.<CompletionCandidate>pCollections()) | |
| 242 | 243 | // ...set the key to be the minPrefix-length prefix... | |
| 243 | 244 | .apply(ParDo.of(new AllPrefixes(minPrefix, minPrefix))) | |
@@ -297,7 +298,6 @@ public String getValue() { | |||
| 297 | 298 | } | |
| 298 | 299 | ||
| 299 | 300 | // Empty constructor required for Avro decoding. | |
| 300 | - @SuppressWarnings("unused") | ||
| 301 | 301 | public CompletionCandidate() {} | |
| 302 | 302 | ||
| 303 | 303 | @Override | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ public void testAutoComplete() { | |||
| 84 | 84 | ||
| 85 | 85 | PCollection<KV<String, List<CompletionCandidate>>> output = | |
| 86 | 86 | input.apply(new ComputeTopCompletions(2, recursive)) | |
| 87 | - .apply(Filter.by( | ||
| 87 | + .apply(Filter.byPredicate( | ||
| 88 | 88 | new SerializableFunction<KV<String, List<CompletionCandidate>>, Boolean>() { | |
| 89 | 89 | @Override | |
| 90 | 90 | public Boolean apply(KV<String, List<CompletionCandidate>> element) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ public class Filter<T> extends PTransform<PCollection<T>, PCollection<T>> { | |||
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | 55 | /** | |
| 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 | ||
| 57 | 57 | * a {@link ParDo.Bound}. | |
| 58 | 58 | */ | |
| 59 | 59 | @Deprecated | |
| Back | FazBrowse Home | New Git URL |
0 commit comments