Skip to content

Commit

Permalink
Correct some accidental renames
Browse files Browse the repository at this point in the history
IDE over-eagerly replaced some occurrences of createAggregator with
createAggregatorForDoFn. This corrects that.
  • Loading branch information
bchambers committed Aug 17, 2016
1 parent d93ef2e commit 153e053
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* to be combined across all bundles.
*
* <p>Aggregators are created by calling
* {@link OldDoFn#createAggregator OldDoFn.createAggregatorForDoFn},
* {@link OldDoFn#createAggregator OldDoFn.createAggregator},
* typically from the {@link OldDoFn} constructor. Elements can be added to the
* {@code Aggregator} by calling {@link Aggregator#addValue}.
*
Expand All @@ -41,7 +41,7 @@
* private Aggregator<Integer, Integer> myAggregator;
*
* public MyDoFn() {
* myAggregator = createAggregatorForDoFn("myAggregator", new Sum.SumIntegerFn());
* myAggregator = createAggregator("myAggregator", new Sum.SumIntegerFn());
* }
*
* @Override
Expand Down Expand Up @@ -83,15 +83,15 @@ interface AggregatorFactory {
* class of the {@link OldDoFn} being executed and the context of the step it is being
* executed in.
*/
<InputT, AccumT, OutputT> Aggregator<InputT, OutputT> createAggregatorForDoFn(
<InputT, AccumT, OutputT> Aggregator<InputT, OutputT> createAggregator(
Class<?> fnClass, ExecutionContext.StepContext stepContext,
String aggregatorName, CombineFn<InputT, AccumT, OutputT> combine);
}

// TODO: Consider the following additional API conveniences:
// - In addition to createAggregatorForDoFn(), consider adding getAggregator() to
// - In addition to createAggregator(), consider adding getAggregator() to
// avoid the need to store the aggregator locally in a OldDoFn, i.e., create
// if not already present.
// - Add a shortcut for the most common aggregator:
// c.createAggregatorForDoFn("name", new Sum.SumIntegerFn()).
// c.createAggregator("name", new Sum.SumIntegerFn()).
}
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ protected <AggInputT, AggOutputT> Aggregator<AggInputT, AggOutputT> createAggreg
String name, CombineFn<AggInputT, ?, AggOutputT> combiner) {
throw new IllegalStateException("Aggregators should not be created within ProcessContext. "
+ "Instead, create an aggregator at OldDoFn construction time with"
+ " createAggregatorForDoFn, and ensure they are set up by the time startBundle is"
+ " createAggregator, and ensure they are set up by the time startBundle is"
+ " called with setupDelegateAggregators.");
}
}
Expand Down

0 comments on commit 153e053

Please sign in to comment.