-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dvc] Decompress/assemble record before transformation (#818)
Events consumed from the version topic may be compressed/chunked. So we need to reassemble them before they're transformed.
- Loading branch information
Showing
7 changed files
with
169 additions
and
47 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
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
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
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
25 changes: 25 additions & 0 deletions
25
...ci-client/src/test/java/com/linkedin/davinci/transformer/TestStringRecordTransformer.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.davinci.transformer; | ||
|
||
import com.linkedin.davinci.client.DaVinciRecordTransformer; | ||
import com.linkedin.davinci.client.TransformedRecord; | ||
import com.linkedin.venice.utils.lazy.Lazy; | ||
import org.apache.avro.Schema; | ||
|
||
|
||
public class TestStringRecordTransformer | ||
implements DaVinciRecordTransformer<Integer, Object, TransformedRecord<Integer, Object>> { | ||
public Schema getKeyOutputSchema() { | ||
return Schema.create(Schema.Type.INT); | ||
} | ||
|
||
public Schema getValueOutputSchema() { | ||
return Schema.create(Schema.Type.STRING); | ||
} | ||
|
||
public TransformedRecord<Integer, Object> put(Lazy<Integer> key, Lazy<Object> value) { | ||
TransformedRecord<Integer, Object> transformedRecord = new TransformedRecord<>(); | ||
transformedRecord.setKey(key.get()); | ||
transformedRecord.setValue(value.get() + "Transformed"); | ||
return transformedRecord; | ||
} | ||
} |
Oops, something went wrong.