Skip to content

Commit

Permalink
feat(QTDI-653): Immprove a readme of @lastgroup sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
ypiel-talend committed Jan 17, 2025
1 parent 049200b commit 2903748
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sample-parent/sample-features/aftergroup-lastgroup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ java -jar sample-parent/sample-features/aftergroup-lastgroup/target/lastGroup-<v
Now, methods with annotated with `@AfterGroup` in a `@Processor` connector, can have a boolean parameter annotated `@LastGroup`. If this parameter is defined in the `@AfterGroup` method, it will be set to `true` for the last group, and only for it.

# LastGroupProcessor Sample explanation
This sample is a simple `@Processor` that uses the `@AfterGroup` annotation with a `@LastGroup` parameter, [as you can see here](./src/main/java/org/talend/sdk/component/feature/lastgroup/processor/LastGroupProcessor.java#L41).
This sample is a simple `@Processor` that uses the `@AfterGroup` annotation with a `@LastGroup` parameter, [as you can see here](./src/main/java/org/talend/sdk/component/feature/lastgroup/processor/LastGroupProcessor.java#L41).

This processor just buffers records, and, in the last call of `@AfterGroup` [method](./src/main/java/org/talend/sdk/component/feature/lastgroup/processor/LastGroupProcessor.java#L62), it will send all the records to the output. It also checks that the number of bufferized records is the same as the expected number set in its configuration [Config.java](./src/main/java/org/talend/sdk/component/feature/lastgroup/config/Config.java#L36).

0 comments on commit 2903748

Please sign in to comment.