Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
0b5b4a26
Commit
0b5b4a26
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Read configuration topic from beginning
parent
47ec6dbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#6381
passed
3 years ago
Stage: build
Stage: test
Stage: check
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite-benchmarks/uc4-flink/src/main/java/theodolite/uc4/application/AggregationServiceFlinkJob.java
+9
-5
9 additions, 5 deletions
...heodolite/uc4/application/AggregationServiceFlinkJob.java
with
9 additions
and
5 deletions
theodolite-benchmarks/uc4-flink/src/main/java/theodolite/uc4/application/AggregationServiceFlinkJob.java
+
9
−
5
View file @
0b5b4a26
...
...
@@ -15,6 +15,7 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import
org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows
;
import
org.apache.flink.streaming.api.windowing.time.Time
;
import
org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer
;
import
org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase
;
import
org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer
;
import
org.apache.kafka.common.serialization.Serdes
;
import
org.slf4j.Logger
;
...
...
@@ -103,9 +104,11 @@ public final class AggregationServiceFlinkJob {
this
.
env
.
getConfig
().
registerTypeWithKryoSerializer
(
Set
.
of
(
1
,
2
,
3
,
4
).
getClass
(),
// NOCS
new
ImmutableSetSerializer
());
this
.
env
.
getConfig
().
getRegisteredTypesWithKryoSerializers
()
.
forEach
((
c
,
s
)
->
LOGGER
.
info
(
"Class "
+
c
.
getName
()
+
" registered with serializer "
+
s
.
getSerializer
().
getClass
().
getName
()));
this
.
env
.
getConfig
()
.
getRegisteredTypesWithKryoSerializers
()
.
forEach
((
c
,
s
)
->
LOGGER
.
info
(
"Class '{}' registered with serializer '{}'."
,
c
.
getName
(),
s
.
getSerializer
().
getClass
().
getName
()));
}
private
void
buildPipeline
()
{
...
...
@@ -134,12 +137,13 @@ public final class AggregationServiceFlinkJob {
final
FlinkKafkaConsumer
<
AggregatedActivePowerRecord
>
kafkaOutputSource
=
kafkaConnector
.
createConsumer
(
outputTopic
,
AggregatedActivePowerRecord
.
class
);
final
FlinkKafkaConsumer
<
Tuple2
<
Event
,
String
>>
kafkaConfigSource
=
final
FlinkKafkaConsumer
Base
<
Tuple2
<
Event
,
String
>>
kafkaConfigSource
=
kafkaConnector
.
createConsumer
(
configurationTopic
,
EventSerde:
:
serde
,
Serdes:
:
String
,
TupleType
.
of
(
TypeInformation
.
of
(
Event
.
class
),
Types
.
STRING
));
TupleType
.
of
(
TypeInformation
.
of
(
Event
.
class
),
Types
.
STRING
))
.
setStartFromEarliest
();
// Sink to output topic with SensorId, AggregatedActivePowerRecord
final
FlinkKafkaProducer
<
Tuple2
<
String
,
AggregatedActivePowerRecord
>>
kafkaAggregationSink
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment