Skip to content

[Issue 3966] [pulsar-io] Specify the RedisSink type as Bytes by default#3972

Merged
merlimat merged 2 commits intoapache:masterfrom
murong00:branch-3972
Apr 4, 2019
Merged

[Issue 3966] [pulsar-io] Specify the RedisSink type as Bytes by default#3972
merlimat merged 2 commits intoapache:masterfrom
murong00:branch-3972

Conversation

@murong00
Copy link
Contributor

@murong00 murong00 commented Apr 3, 2019

Motivation

Fixes #3966

Modifications

Modify RedisSink to use Bytes instead of no specific type.

)
@Slf4j
public class RedisSink<T> implements Sink<T> {
public class RedisSink<T> implements Sink<byte[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it then be RedisSink instead of RedisSink<T> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

for (Record<byte[]> record: recordsToFlush) {
try {
// records with null keys or values will be ignored
byte[] key = toBytes("key", record.getKey().orElse(null));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get rid of toBytes here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's redundant in this case. Changed.

@merlimat merlimat merged commit b7903fa into apache:master Apr 4, 2019
@merlimat merlimat added this to the 2.4.0 milestone Apr 4, 2019
@sijie sijie added the type/bug The PR fixed a bug or issue reported a bug label Apr 8, 2019
@sijie sijie modified the milestones: 2.4.0, 2.3.2 Apr 8, 2019
@merlimat merlimat modified the milestones: 2.3.2, 2.4.0 May 19, 2019
@murong00 murong00 deleted the branch-3972 branch March 8, 2020 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connector type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UNAVAILABLE: io exception in a Sink which accepts pulsar messages as bytes

3 participants