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

Update java-client to 3.5.2 #400

Closed
wants to merge 1 commit into from

Conversation

scala-steward-asf[bot]
Copy link
Contributor

About this PR

📦 Updates com.couchbase.client:java-client from 2.7.23 to 3.5.2

Usage

Please merge!

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Configure Scala Steward for your repository with a .scala-steward.conf file.

Have a fantastic day writing Scala!

⚙ Adjust future updates

Add this to your .scala-steward.conf file to ignore future updates of this dependency:

updates.ignore = [ { groupId = "com.couchbase.client", artifactId = "java-client" } ]

Or, add this to slow down future updates of this dependency:

dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "com.couchbase.client", artifactId = "java-client" }
}]
labels: library-update, early-semver-major, semver-spec-major, commit-count:1

@scala-steward-asf scala-steward-asf bot force-pushed the update/java-client-3.5.2 branch 2 times, most recently from 7bcaf01 to d450334 Compare January 30, 2024 19:47
@laglangyue
Copy link
Contributor

laglangyue commented Jan 31, 2024

I has checked website of couchHbase, 2.x is deprecated.
https://docs.couchbase.com/java-sdk/current/project-docs/sdk-release-notes.html
But Java client2. x and 3. x are not consistent. Should we continue to upgrade and modify the relevant implementation

@pjfanning
Copy link
Contributor

The problem is the build breaks. Some couchbase classes have moved to new jars or have been removed. I couldn't find good migration notes for couchbase 3.

@pjfanning
Copy link
Contributor

https://docs.couchbase.com/java-sdk/current/project-docs/migrating-sdk-code-to-3.n.html#installation-and-configuration is the official guide. If anyone has the time and interest to take this on, it would be great.

@pjfanning pjfanning added the help wanted Extra attention is needed label Jan 31, 2024
@He-Pin
Copy link
Member

He-Pin commented Jan 31, 2024

@laglangyue Would you like to give this a try, thanks.

@laglangyue
Copy link
Contributor

@laglangyue Would you like to give this a try

yes, I will take some time to learn the datasource and fix it

@laglangyue
Copy link
Contributor

I have read the official website documentation, and there are some changes to client3 and client2
Bucket ->document (client2)
Bucket ->scope ->collection (client3)
And document and collection are not completely equivalent
For this API, jsonDocument will be changed to jsonObject,so api will be change

  /**
   * Create a sink to update or insert a Couchbase [[com.couchbase.client.java.document.JsonDocument JsonDocument]].
   */
  def upsert(sessionSettings: CouchbaseSessionSettings,
      writeSettings: CouchbaseWriteSettings,
      bucketName: String): Sink[JsonDocument, Future[Done]] =
    CouchbaseFlow.upsert(sessionSettings, writeSettings, bucketName).toMat(Sink.ignore)(Keep.right)

And they provided scala sdk, my suggestion is to implement a connector based on scala sdk.
image

@pjfanning @He-Pin how about using scala-sdk?

@pjfanning
Copy link
Contributor

I am not against trying the new scala SDK

@He-Pin
Copy link
Member

He-Pin commented Feb 2, 2024

@laglangyue Nice, but I just back my hometown will not be able to review it on any soon, and happy Spring Festival

@laglangyue
Copy link
Contributor

Sorry, I retract my previous viewpoint. Couchbase's scala sdk does not support scala3. I wanted to submit a PR(use scala3), but found out that their project is not SBT. Scala on Maven is very painful, so I gave up on providing them with a PR.
I still use Java client development

@mdedetrich
Copy link
Contributor

Sorry, I retract my previous viewpoint. Couchbase's scala sdk does not support scala3. I wanted to submit a PR(use scala3), but found out that their project is not SBT. Scala on Maven is very painful, so I gave up on providing them with a PR. I still use Java client development

Indeed, Scala with Maven is painful especially ofr libraries which is why I don't recommend maven for people that use Scala. Afaik maven fundamentally doesn't even have a concept of matrix's for builds, so the only proper way to cross publish is to do hacks like modifying a hardcoded scala version in pom.xml. Using the java client may be a better option,

Also now is the time to do significant changes such as upgrading major versions of underlying libraries (in this case couchbase sdk). Pekko connectors doesn't subscribe to semver and for 1.1.x series of pekko connectors the goal specifically is to use the latest versions of all of the underlying sdk's, spi's etc etc

@laglangyue
Copy link
Contributor

I ended my the Spring Festival vacation and back today.It's a bit long,I will complete this PR. Report some progress to community.
I completed a version of API changes while studying. Except for JavaDSL have been completed.

api like this.
image

Due to the lack of a document/jsonDocument, it may lose document id and body. Through a function, it seems that the design is not general, and I am currently considering a more comprehensive design. Encapsulate a document interface and some case class. But unlike the document in client2, this is the encapsulation of client3, wrapper id, doc body and result.

trait Document[T, R] {
  def id: String
  // json / object
  def doc: T
  // getResult / mutationResult etc
  def result: R
}

Code had pushed to my repo, welcome any suggestions
https://github.com/laglangyue/incubator-pekko-connectors/tree/couchbase3

@raboof
Copy link
Member

raboof commented Mar 13, 2024

#565

@raboof raboof closed this Mar 13, 2024
@pjfanning pjfanning deleted the update/java-client-3.5.2 branch May 25, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants