Skip to content

Deprecate Guava Multimap and Function in favor of JDK & Remove Guava collections#217

Merged
exoego merged 6 commits intomasterfrom
135-no-guava-collection
Mar 1, 2023
Merged

Deprecate Guava Multimap and Function in favor of JDK & Remove Guava collections#217
exoego merged 6 commits intomasterfrom
135-no-guava-collection

Conversation

@exoego
Copy link
Contributor

@exoego exoego commented Jan 25, 2023

Part of #135

This is the final Guava deprecation and removal.
After this PR and a new minor version cut, I think we could delete the deprecated one and guava dependency.

The problem is Multimap<K, V>. How should we remove it?
Possible directions:

  1. Just replace it with Map<K, Collection<V>> and introduce breaking change aggressively.
  2. Add new overloads with Map<K, Col<V>> and deprecate the old methods with Muiltimap.
    • In this direction, some classes require new members to avoid conflict with TDClientConfig#headers and TDApiRequest#getHeaderParams(). See new members ~V2.

I propose picking 2nd since it helps users to migrate.
WDYT?

@exoego exoego force-pushed the 135-no-guava-collection branch 2 times, most recently from e7a307e to 92a3dc3 Compare January 25, 2023 14:14
@exoego exoego changed the title Remove guava collections Remove guava collections except Multimap for compatiblity Jan 25, 2023
@exoego exoego marked this pull request as ready for review January 25, 2023 14:40
@exoego exoego added the dependencies Pull requests that update a dependency file label Jan 25, 2023
@xerial
Copy link
Member

xerial commented Jan 26, 2023

I've searched our internal repo and found a lot of setHeader(Multimap) usage. So 2 looks better.

@exoego exoego force-pushed the 135-no-guava-collection branch from 40d7eef to 56ae642 Compare January 27, 2023 09:19
@exoego exoego added chore internal changes (not user-facing) deprecation and removed dependencies Pull requests that update a dependency file chore internal changes (not user-facing) labels Jan 28, 2023
@exoego exoego changed the title Remove guava collections except Multimap for compatiblity Deprecate Guava Multimap in favor of JDK Map & Remove Guava collections Jan 28, 2023
@exoego exoego force-pushed the 135-no-guava-collection branch from 74ca255 to b31fe3a Compare January 31, 2023 12:22
@exoego exoego requested a review from yuokada January 31, 2023 12:27
@exoego exoego force-pushed the 135-no-guava-collection branch from b31fe3a to a10823c Compare February 3, 2023 10:13
@exoego exoego changed the title Deprecate Guava Multimap in favor of JDK Map & Remove Guava collections Deprecate Guava Multimap and Function in favor of JDK & Remove Guava collections Feb 3, 2023
@exoego exoego requested a review from xerial February 4, 2023 10:37
@xerial
Copy link
Member

xerial commented Feb 6, 2023

Thanks. I'll take a look

return builder.build();
}

public Map<String, Collection<String>> getHeaderParamsV2()
Copy link
Member

@xerial xerial Feb 27, 2023

Choose a reason for hiding this comment

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

This will be the default method after deprecating getHeaderParams(). How about using a more regular method name like getAllHeaders() but a different name from getHeaderParams()?

@xerial
Copy link
Member

xerial commented Feb 27, 2023

ok. Basically LGTM. @exoego Only one suggestion to use a normal method name without any version suffix https://github.com/treasure-data/td-client-java/pull/217/files#r1119311242

@exoego exoego merged commit 57e203b into master Mar 1, 2023
@exoego exoego deleted the 135-no-guava-collection branch March 1, 2023 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants