This is an automated email from the ASF dual-hosted git repository.
weihu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 48109440b Update SubscribeTask.java
new d6e3d356c Merge pull request #3799 from harshithasudhakar/patch-24
48109440b is described below
commit 48109440b8502f27d72270bfad9729398b06d27a
Author: Harshitha Sudhakar
<[email protected]>
AuthorDate: Sat Apr 22 13:10:12 2023 +0530
Update SubscribeTask.java
At line 50
a. Extracted common part
b. Reduced the total number of continue statements in this loop to use at
most one.
---
.../apache/eventmesh/storage/pravega/client/SubscribeTask.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git
a/eventmesh-storage-plugin/eventmesh-storage-pravega/src/main/java/org/apache/eventmesh/storage/pravega/client/SubscribeTask.java
b/eventmesh-storage-plugin/eventmesh-storage-pravega/src/main/java/org/apache/eventmesh/storage/pravega/client/SubscribeTask.java
index 34ea6661b..4f26ff85e 100644
---
a/eventmesh-storage-plugin/eventmesh-storage-pravega/src/main/java/org/apache/eventmesh/storage/pravega/client/SubscribeTask.java
+++
b/eventmesh-storage-plugin/eventmesh-storage-pravega/src/main/java/org/apache/eventmesh/storage/pravega/client/SubscribeTask.java
@@ -49,9 +49,7 @@ public class SubscribeTask extends Thread {
while (running.get()) {
if (continueRead.get()) {
EventRead<byte[]> event = reader.readNextEvent(2000);
- if (event == null) {
- continue;
- }
+
byte[] eventByteArray = event.getEvent();
if (eventByteArray == null) {
continue;
@@ -59,10 +57,8 @@ public class SubscribeTask extends Thread {
PravegaEvent pravegaEvent =
PravegaEvent.getFromByteArray(eventByteArray);
cloudEvent = pravegaEvent.convertToCloudEvent();
- listener.consume(cloudEvent, new
PravegaEventMeshAsyncConsumeContext());
- } else {
- listener.consume(cloudEvent, new
PravegaEventMeshAsyncConsumeContext());
}
+ listener.consume(cloudEvent, new
PravegaEventMeshAsyncConsumeContext());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]