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
0bd6372c
Commit
0bd6372c
authored
5 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add repositories for missing sources
parent
6bc5224e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#368
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
uc4-application/build.gradle
+12
-0
12 additions, 0 deletions
uc4-application/build.gradle
uc4-application/src/main/java/uc4/streamprocessing/Serdes.java
+22
-15
22 additions, 15 deletions
...pplication/src/main/java/uc4/streamprocessing/Serdes.java
with
34 additions
and
15 deletions
uc4-application/build.gradle
+
12
−
0
View file @
0bd6372c
...
...
@@ -12,6 +12,18 @@ buildscript {
sourceCompatibility
=
"1.11"
targetCompatibility
=
"1.11"
allprojects
{
repositories
{
jcenter
()
maven
{
url
"https://oss.sonatype.org/content/repositories/snapshots/"
}
maven
{
url
'https://packages.confluent.io/maven/'
}
}
}
dependencies
{
compile
project
(
':'
)
...
...
This diff is collapsed.
Click to expand it.
uc4-application/src/main/java/uc4/streamprocessing/Serdes.java
+
22
−
15
View file @
0bd6372c
package
uc4.streamprocessing
;
import
com.google.common.math.Stats
;
import
org.apache.avro.specific.SpecificRecord
;
import
org.apache.kafka.common.serialization.Serde
;
import
titan.ccp.common.kafka.GenericSerde
;
import
titan.ccp.common.kafka.avro.SchemaRegistryAvroSerdeFactory
;
import
titan.ccp.model.records.ActivePowerRecord
;
import
titan.ccp.model.records.AggregatedActivePowerRecord
;
import
titan.ccp.model.records.WindowedActivePowerRecord
;
final
class
Serdes
{
//
private final SchemaRegistryAvroSerdeFactory avroSerdeFactory;
private
final
SchemaRegistryAvroSerdeFactory
avroSerdeFactory
;
public
Serdes
(
final
String
schemaRegistryUrl
)
{
//
this.avroSerdeFactory = new SchemaRegistryAvroSerdeFactory(schemaRegistryUrl);
this
.
avroSerdeFactory
=
new
SchemaRegistryAvroSerdeFactory
(
schemaRegistryUrl
);
}
public
Serde
<
String
>
string
()
{
return
org
.
apache
.
kafka
.
common
.
serialization
.
Serdes
.
String
();
}
/*
* public Serde<WindowedActivePowerRecord> windowedActivePowerValues() { return
* this.avroSerdeFactory.forKeys(); }
*
* public Serde<ActivePowerRecord> activePowerRecordValues() { return
* this.avroSerdeFactory.forValues(); }
*
* public Serde<AggregatedActivePowerRecord> aggregatedActivePowerRecordValues() { return
* this.avroSerdeFactory.forValues(); }
*
* public <T extends SpecificRecord> Serde<T> avroValues() { return
* this.avroSerdeFactory.forValues(); }
*/
public
Serde
<
WindowedActivePowerRecord
>
windowedActivePowerValues
()
{
return
this
.
avroSerdeFactory
.
forKeys
();
}
public
Serde
<
ActivePowerRecord
>
activePowerRecordValues
()
{
return
this
.
avroSerdeFactory
.
forValues
();
}
public
Serde
<
AggregatedActivePowerRecord
>
aggregatedActivePowerRecordValues
()
{
return
this
.
avroSerdeFactory
.
forValues
();
}
public
<
T
extends
SpecificRecord
>
Serde
<
T
>
avroValues
()
{
return
this
.
avroSerdeFactory
.
forValues
();
}
public
Serde
<
Stats
>
stats
()
{
return
GenericSerde
.
from
(
Stats:
:
toByteArray
,
Stats:
:
fromByteArray
);
...
...
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