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

feat: bidirectional streaming source #138

Merged
merged 7 commits into from
Sep 22, 2024
Merged

feat: bidirectional streaming source #138

merged 7 commits into from
Sep 22, 2024

Conversation

yhl25
Copy link
Contributor

@yhl25 yhl25 commented Sep 13, 2024

No description provided.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 61 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@8aa30e9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...a/io/numaproj/numaflow/sourcer/SourcerTestKit.java 0.00% 35 Missing ⚠️
...ain/java/io/numaproj/numaflow/sourcer/Service.java 84.61% 6 Missing and 2 partials ⚠️
...ava/io/numaproj/numaflow/sinker/SinkerTestKit.java 0.00% 2 Missing ⚠️
...n/java/io/numaproj/numaflow/mapper/GRPCConfig.java 0.00% 0 Missing and 1 partial ⚠️
.../main/java/io/numaproj/numaflow/mapper/Server.java 50.00% 0 Missing and 1 partial ⚠️
...a/io/numaproj/numaflow/mapstreamer/GRPCConfig.java 0.00% 0 Missing and 1 partial ⚠️
.../java/io/numaproj/numaflow/reducer/GRPCConfig.java 0.00% 0 Missing and 1 partial ⚠️
...main/java/io/numaproj/numaflow/reducer/Server.java 50.00% 0 Missing and 1 partial ⚠️
...o/numaproj/numaflow/reducestreamer/GRPCConfig.java 0.00% 0 Missing and 1 partial ⚠️
...va/io/numaproj/numaflow/reducestreamer/Server.java 50.00% 0 Missing and 1 partial ⚠️
... and 9 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #138   +/-   ##
=======================================
  Coverage        ?   60.05%           
  Complexity      ?      361           
=======================================
  Files           ?      120           
  Lines           ?     2426           
  Branches        ?      169           
=======================================
  Hits            ?     1457           
  Misses          ?      840           
  Partials        ?      129           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
@vigith vigith marked this pull request as ready for review September 21, 2024 02:37
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Assertions.fail("Failed to stop server");
}
}
// FIXME: once tester kit changes are done for bidirectional streaming source
Copy link
Member

Choose a reason for hiding this comment

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

Can you open an issue in numaflow repo to track this?

for (Offset offset : request.getOffsets()) {
messages.remove(Longs.fromByteArray(offset.getValue()));
}
messages.remove(offset);
}

@Override
public long getPending() {
// pending messages will be zero for a simple source
Copy link
Member

Choose a reason for hiding this comment

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

Please update the comment as well.

Comment on lines 66 to 74
@Test
public void testLong() {
Long l = 1L;
byte[] bytes = Longs.toByteArray(l);

Long x = Longs.fromByteArray(bytes);
Assertions.assertEquals(l, x);
}

Copy link
Member

Choose a reason for hiding this comment

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

We don't need to unit test a library. Please remove it.

import io.numaproj.numaflow.sourcer.Message;
import io.numaproj.numaflow.sourcer.Offset;
import io.numaproj.numaflow.sourcer.SourcerTestKit;
import org.junit.Ignore;
Copy link
Member

Choose a reason for hiding this comment

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

is this import being used?

.offsets(offsets).build();
simpleSource.ack(ackRequest);

for (Offset offset : offsets) {
Copy link
Member

Choose a reason for hiding this comment

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

please also update the testPending case.

/**
* AckRequest request for acknowledging messages.
*/
public interface AckRequest {
/**
* @return the list of offsets to be acknowledged
* @return the offsets to be acknowledged
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return the offsets to be acknowledged
* @return the offset to be acknowledged

@Override
public void onNext(SourceOuterClass.ReadRequest request) {
// if the request is a handshake, send handshake response.
if (request.hasHandshake() && request.getHandshake().getSot()) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we unit test this branch? Same for ack func below.

future.complete(true);
}
});
StreamObserver<SourceOuterClass.ReadRequest> readRequestStreamObserver = sourceStub.readFn(
Copy link
Member

Choose a reason for hiding this comment

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

we can exclude SourceTestKit from codcov.

Signed-off-by: Yashash H L <[email protected]>
@vigith vigith merged commit 11e70d4 into main Sep 22, 2024
5 checks passed
@vigith vigith deleted the bidi-source branch September 22, 2024 14:14
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