Skip to content

Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api#1462

Merged
dmikurube merged 5 commits intomasterfrom
add-JsonValue
Jan 18, 2023
Merged

Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api#1462
dmikurube merged 5 commits intomasterfrom
add-JsonValue

Conversation

@dmikurube
Copy link
Copy Markdown
Member

@dmikurube dmikurube commented May 20, 2021

Embulk's "JSON"-type values have been represented by msgpack-java's org.msgpack.value.(Immutable)Value since Embulk v0.7. The msgpack-java has set its roots deep inside Embulk, including its plugin SPI method signatures.

It has brought a heavy dependency hell between Embulk and msgpack-java. We have hesitated even just upgrading msgpack-core which can potentially cause a compatibility issue. As a result, a couple of plugins that use msgpack-core (such as embulk-parser-msgpack) had to stay with older msgpack-core.

We upgraded msgpack-core to 0.8.24 in #1459, in the Embulk v0.10 "development" series.

However, indeed, the Embulk core has never used MessagePacker nor MessageUnpacker from msgpack-core. Embulk has used only org.msgpack.value.(Immutable)Value just as a JSON-like data container. It's nonsense!


Then, we plan to drop msgpack-core from the Embulk API/SPI in a long term. The plan would be:

  1. We upgrade msgpack-core to v0.8.24 in Embulk v0.10.42 in the pull request Upgrade msgpack-core to 0.8.24 #1459.
  2. We introduce another set of classes for "JSON" type (expected to be org.embulk.spi.json.JsonValue) in v0.10.42 in this pull request Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api #1462.
    • We'll keep SPI methods for both (org.msgpack.value.Value and org.embulk.spi.json.JsonValue) for a long time -- even after Embulk v1.0.
    • It'd be similar to "TIMESTAMP" type -- org.embulk.spi.time.Timestamp and java.time.Instant.
    • Plugins are expected to migrate to use org.embulk.spi.json.JsonValue through Embulk v0.11 - v1.0.
  3. Tentatively also in Embulk v0.10.42, we modify those org.embulk.spi.json.* classes to represent their internal values by msgpack-core classes again. It will allow to keep backward-compatible API/SPI methods for a while.
  4. We add new API/SPI methods to handle "JSON" type values with org.embulk.spi.json.Json* also in Embulk v0.10.42. In a long term, plugins will have to migrate to use the new methods, instead of msgpack-core-based methods.
  5. At some point in the future, after Embulk v1.0, msgpack-core and API/SPI methods using msgpack-core will be removed.

We'll also write up an EEP for this.

@dmikurube dmikurube added this to the v0.10.35 milestone May 20, 2021
@dmikurube dmikurube changed the title [WIP] Add JsonValue [WIP] Add org.embulk.spi.json.JsonValue in embulk-api May 20, 2021
@dmikurube dmikurube force-pushed the add-JsonValue branch 4 times, most recently from 1c3878d to 8838d56 Compare May 20, 2021 08:35
@dmikurube dmikurube changed the title [WIP] Add org.embulk.spi.json.JsonValue in embulk-api Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api May 20, 2021
@dmikurube dmikurube changed the title Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api [WIP] Add org.embulk.spi.json.JsonValue to deprecate use of msgpack-core in embulk-api May 20, 2021
@dmikurube dmikurube modified the milestones: v0.10.35, v0.10.36, v0.10.37 Oct 8, 2021
@dmikurube dmikurube force-pushed the add-JsonValue branch 2 times, most recently from 964c80a to 5744d02 Compare December 17, 2021 08:09
@dmikurube dmikurube modified the milestones: v0.10.37, v0.10.38 May 19, 2022
@dmikurube dmikurube modified the milestones: v0.10.38, v0.10.39 Oct 28, 2022
@dmikurube dmikurube modified the milestones: v0.10.39, v0.10.40, v0.10.41, v0.10.42 Dec 5, 2022
@dmikurube dmikurube force-pushed the update-msgpack-core-0.8.24 branch from 529548a to 022a0cf Compare December 15, 2022 09:07
Base automatically changed from update-msgpack-core-0.8.24 to master December 16, 2022 05:39
@dmikurube dmikurube requested a review from a team as a code owner January 13, 2023 08:43
@dmikurube dmikurube force-pushed the add-JsonValue branch 3 times, most recently from 3d4bfca to bbc5a16 Compare January 16, 2023 02:56
Copy link
Copy Markdown
Member

@hiroyuki-sato hiroyuki-sato left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I left minor comments.

Comment thread embulk-api/src/test/java/org/embulk/spi/json/TestJsonArray.java
Comment thread embulk-api/src/test/java/org/embulk/spi/json/TestJsonArray.java
@dmikurube
Copy link
Copy Markdown
Member Author

dmikurube commented Jan 18, 2023

It's corresponding EEP is underway: #1538

This pull request is just adding new classes, which does not affect any existing things yet. Ket me merge this for further work although we'll still need to discuss the design with the forthcoming EEP.

We may revert it or modify it later if we get some different conclusion from the EEP discussions.

@dmikurube
Copy link
Copy Markdown
Member Author

Thanks for reviewing, @hiroyuki-sato. Merging this.

(Cc: @vietnguyen-td)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants