Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for opting in to string-columns-as-byte-arrays #131

Closed
wants to merge 1 commit into from

Conversation

osheroff
Copy link
Collaborator

allow code using the 0.5.X series opt-into the future behavior without having to use custom deserializers.

It's kludgy, it's true, but Maxwell definitely needs its string data as byte arrays, and I'd prefer to not add in a bunch of custom deserializers just to throw them away in 1.0.

allow code using the 0.5.X series opt-into the future behavior without
having to use custom deserializers.
@shyiko
Copy link
Owner

shyiko commented Nov 28, 2016

Ben, how about I introduce 1.0.0 compatibility flag (something like binaryLogClient.setEventDeserializer(new EventDeserializer().setReleaseCompatibility("1.0.0")); that would enable

  • DATETIME/DATETIME_V2/TIMESTAMP/TIMESTAMP_V2/DATE/TIME/TIME_V2 deserialization to longs (Unix timestamp).
    This is BACKWARD-INCOMPATIBLE change.
  • BINARY/VARBINARY deserialization (#56).
    This is BACKWARD-INCOMPATIBLE change as CHAR/VARCHAR/BINARY/VARBINARY are now returned as byte[] (which you can obviously convert to String with new String(byte[], Charset) if needed).

This way you won't have to bother with date/time when 1.0.0 is released (in fact, these are the only changes that affect the data types in 1.0.0).

What do you think? Would this work for you?

@osheroff
Copy link
Collaborator Author

sure, good by me.

@shyiko
Copy link
Owner

shyiko commented Nov 28, 2016

Alright, 0.6.0 should become available within ~20 minutes or so (Maven Central).

Here is the snippet to activate 1.0.0 compatibility mode:

EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(CompatibilityMode.DATE_AND_TIME_AS_LONG,
    CompatibilityMode.CHAR_AND_BINARY_AS_BYTE_ARRAY);
binaryLogClient.setEventDeserializer(eventDeserializer);

@shyiko shyiko closed this Nov 28, 2016
@osheroff
Copy link
Collaborator Author

awesome, thanks @shyiko. My WIP is surprisingly close to passing tests n stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants