afedulov commented on code in PR #23079:
URL: https://github.com/apache/flink/pull/23079#discussion_r1286201832
##########
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/StateMachineExample.java:
##########
@@ -135,7 +135,7 @@ public static void main(String[] args) throws Exception {
generatorFunction,
Long.MAX_VALUE,
RateLimiterStrategy.perSecond(recordsPerSecond),
- Types.POJO(Event.class));
+ TypeInformation.of(Event.class));
Review Comment:
Sure. Since we are OK with shading the datagen, I was planning to roll this
commit up into one of the above anyway (marked as [tmp])
##########
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/gpu/MatrixVectorMul.java:
##########
@@ -95,9 +98,22 @@ public static void main(String[] args) throws Exception {
final int dataSize = params.getInt("data-size", DEFAULT_DATA_SIZE);
final String resourceName = params.get("resource-name",
DEFAULT_RESOURCE_NAME);
- DataStream<List<Float>> result =
- env.addSource(new RandomVectorSource(dimension, dataSize))
- .map(new Multiplier(dimension, resourceName));
+ GeneratorFunction<Long, List<Float>> generatorFunction =
+ index -> {
+ List<Float> randomRecord = new ArrayList<>();
+ for (int i = 0; i < dimension; ++i) {
+ randomRecord.add((float) Math.random());
+ }
+ return randomRecord;
+ };
+
+ DataGeneratorSource<List<Float>> generatorSource =
+ new DataGeneratorSource<>(generatorFunction, dataSize,
Types.LIST(Types.FLOAT));
+
+ DataStreamSource<List<Float>> result =
+ env.fromSource(generatorSource,
WatermarkStrategy.noWatermarks(), "Vectors Source");
+
+ result.print();
Review Comment:
Thanks for noticing. I cannot test with CUDA and had to resort to
"print"-testing. Fixed.
##########
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/StateMachineExample.java:
##########
@@ -62,7 +66,7 @@ public static void main(String[] args) throws Exception {
// ---- print some usage help ----
System.out.println(
- "Usage with built-in data generator: StateMachineExample
[--error-rate <probability-of-invalid-transition>] [--sleep
<sleep-per-record-in-ms>]");
+ "Usage with built-in data generator: StateMachineExample
[--error-rate <probability-of-invalid-transition>] [--sleep
<sleep-per-record-in-ms> | --rps <records-per-second>]");
Review Comment:
It's probably better to keep backwards compatibility for users' sake, it
does not actually "cost" us anything.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]