Skip to content

Use software.amazon.eventstream:eventstream #1220

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

Merged
merged 1 commit into from
May 2, 2019
Merged

Conversation

rschmitt
Copy link
Contributor

The eventstream code has been extracted into a separate library. This change removes the SDK's copy of that code and replaces it with a dependency on the Maven artifact.

I confirm that this pull request can be released under the Apache 2 license.

@dagnir
Copy link
Contributor

dagnir commented May 1, 2019

The compiled eventsream library appears to be incompatible with JDK 8 due to breaking changes made to the ByteBuffer interface beginning with Java 9.

@rschmitt
Copy link
Contributor Author

rschmitt commented May 1, 2019

Thanks for responding.

JDK9 added return type covariance to the java.nio.Buffer class hierarchy, so that method calls can be chained, such as byteBuffer.duplicate().slice(...).asReadOnlyBuffer(). However, the compiled eventstream library should be targeting JDK8, and not relying on return type covariance of Buffer methods. Can you show me the specific error you're seeing?

@dagnir
Copy link
Contributor

dagnir commented May 1, 2019

Hey @rschmitt, here one error from running Aws4EventStreamSignerTest using JDK8:

java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;

	at software.amazon.eventstream.MessageDecoder.updateReadView(MessageDecoder.java:153)
	at software.amazon.eventstream.MessageDecoder.feed(MessageDecoder.java:103)
	at software.amazon.eventstream.MessageDecoder.feed(MessageDecoder.java:85)
	at software.amazon.awssdk.auth.signer.Aws4EventStreamSignerTest$4.apply(Aws4EventStreamSignerTest.java:250)
	at software.amazon.awssdk.auth.signer.Aws4EventStreamSignerTest$4.apply(Aws4EventStreamSignerTest.java:244)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:132)
	at software.amazon.awssdk.core.async.SdkPublisher$1.onNext(SdkPublisher.java:85)
	at software.amazon.awssdk.auth.signer.internal.AsyncSigV4SubscriberAdapter.onNext(AsyncSigV4SubscriberAdapter.java:74)
	at software.amazon.awssdk.auth.signer.internal.AsyncSigV4SubscriberAdapter.onNext(AsyncSigV4SubscriberAdapter.java:33)
	at io.reactivex.internal.util.HalfSerializer.onNext(HalfSerializer.java:45)
	at io.reactivex.internal.subscribers.StrictSubscriber.onNext(StrictSubscriber.java:97)
	at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:69)
	at io.reactivex.internal.operators.flowable.FlowableFromIterable$IteratorSubscription.slowPath(FlowableFromIterable.java:240)
	at io.reactivex.internal.operators.flowable.FlowableFromIterable$BaseRangeSubscription.request(FlowableFromIterable.java:125)
	at io.reactivex.internal.subscribers.BasicFuseableSubscriber.request(BasicFuseableSubscriber.java:153)
	at io.reactivex.internal.subscriptions.SubscriptionHelper.deferredSetOnce(SubscriptionHelper.java:210)
	at io.reactivex.internal.subscribers.StrictSubscriber.onSubscribe(StrictSubscriber.java:87)
	at io.reactivex.internal.subscribers.BasicFuseableSubscriber.onSubscribe(BasicFuseableSubscriber.java:67)
	at io.reactivex.internal.operators.flowable.FlowableFromIterable.subscribe(FlowableFromIterable.java:69)
	at io.reactivex.internal.operators.flowable.FlowableFromIterable.subscribeActual(FlowableFromIterable.java:47)
	at io.reactivex.Flowable.subscribe(Flowable.java:13234)
	at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:38)
	at io.reactivex.Flowable.subscribe(Flowable.java:13234)
	at io.reactivex.Flowable.subscribe(Flowable.java:13183)
	at software.amazon.awssdk.auth.signer.Aws4EventStreamSignerTest$1$1.subscribe(Aws4EventStreamSignerTest.java:126)
	at software.amazon.awssdk.auth.signer.internal.BaseEventStreamAsyncAws4Signer.lambda$appendEmptyFrame$0(BaseEventStreamAsyncAws4Signer.java:103)
	at software.amazon.awssdk.core.async.SdkPublisher.lambda$map$1(SdkPublisher.java:82)
	at software.amazon.awssdk.core.async.AsyncRequestBody$1.subscribe(AsyncRequestBody.java:81)
	at software.amazon.awssdk.auth.signer.internal.BaseEventStreamAsyncAws4Signer$SigningRequestBodyProvider.subscribe(BaseEventStreamAsyncAws4Signer.java:241)
	at io.reactivex.internal.operators.flowable.FlowableFromPublisher.subscribeActual(FlowableFromPublisher.java:29)
	at io.reactivex.Flowable.subscribe(Flowable.java:13234)
	at io.reactivex.internal.operators.flowable.FlowableFlatMap.subscribeActual(FlowableFlatMap.java:53)
	at io.reactivex.Flowable.subscribe(Flowable.java:13234)
	at io.reactivex.Flowable.subscribe(Flowable.java:13183)
	at software.amazon.awssdk.auth.signer.Aws4EventStreamSignerTest.testBackPressure(Aws4EventStreamSignerTest.java:258)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
	at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

@rschmitt
Copy link
Contributor Author

rschmitt commented May 1, 2019

I may have made the amateur mistake of targeting JDK8 while still compiling against the JDK11 standard library. I'll fix the build and submit a revised PR.

@dagnir
Copy link
Contributor

dagnir commented May 2, 2019

@rschmitt Thanks!

@codecov-io
Copy link

Codecov Report

Merging #1220 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1220   +/-   ##
=========================================
  Coverage     59.21%   59.21%           
  Complexity     4662     4662           
=========================================
  Files           750      750           
  Lines         23288    23288           
  Branches       1744     1744           
=========================================
  Hits          13789    13789           
  Misses         8803     8803           
  Partials        696      696

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af60e6f...0d55b87. Read the comment docs.

@dagnir
Copy link
Contributor

dagnir commented May 2, 2019

LGTM. Thanks for the quick turnaround!

@dagnir dagnir merged commit 0e8bbee into aws:master May 2, 2019
aws-sdk-java-automation added a commit that referenced this pull request Mar 11, 2021
…0d82714e8

Pull request: release <- staging/8955d88d-d6dc-4238-930c-7e30d82714e8
This was referenced Mar 11, 2021
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.

3 participants