-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d14d942
commit b09c754
Showing
3 changed files
with
9 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...cheetah/exmaple/job/jsonToAvroMapper.java → ...cheetah/exmaple/job/JsonToAvroMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
package cheetah.exmaple.job; | ||
|
||
import cheetah.exmaple.model.avrorecord.InputEventAvro; | ||
import cheetah.exmaple.model.avrorecord.OutputEventAvro; | ||
import cheetah.exmaple.model.json.InputEvent; | ||
import org.apache.flink.api.common.functions.MapFunction; | ||
|
||
/** jsonToAvroMapper converts from InputEvent to OutputEvent. */ | ||
public class jsonToAvroMapper implements MapFunction<InputEvent, OutputEventAvro> { | ||
public class JsonToAvroMapper implements MapFunction<InputEvent, OutputEventAvro> { | ||
private final String extraField; | ||
|
||
public jsonToAvroMapper(final String extraField) { | ||
public JsonToAvroMapper(final String extraField) { | ||
this.extraField = extraField; | ||
} | ||
|
||
@Override | ||
public OutputEventAvro map(final InputEvent InputEvent) { | ||
return new OutputEventAvro(InputEvent.getDeviceId(), InputEvent.getValue(), InputEvent.getTimestamp(), extraField); | ||
public OutputEventAvro map(final InputEvent inputEvent) { | ||
return new OutputEventAvro(inputEvent.getDeviceId(), inputEvent.getValue(), inputEvent.getTimestamp(), extraField); | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
...tah/exmaple/job/jsonToAvroMapperTest.java → ...tah/exmaple/job/JsonToAvroMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters