You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hailin0 (via GitHub)" <gi...@apache.org> on 2023/08/31 14:39:28 UTC
[GitHub] [skywalking-banyandb-java-client] hailin0 opened a new pull request, #46: Add mod revision check to write requests(measure/stream)
hailin0 opened a new pull request, #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46
- Support cached mod revision when create/update schema
- Support auto-refresh mod revision when writing data
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hanahmily commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313713565
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
The server's unexpected errors will override these errors, which is reasonable. Don’t hesitate to return them through the future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#issuecomment-1713069154
PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311818977
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
These errors are already there, we have not discussed how to deal with these errors
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313174999
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -198,33 +204,75 @@ void connect(Channel channel) {
* Perform a single write with given entity.
*
* @param streamWrite the entity to be written
+ * @return a future of write result
*/
- public void write(StreamWrite streamWrite) {
+ public CompletableFuture<Void> write(StreamWrite streamWrite) {
checkState(this.streamServiceStub != null, "stream service is null");
+ CompletableFuture<Void> future = new CompletableFuture<>();
final StreamObserver<BanyandbStream.WriteRequest> writeRequestStreamObserver
= this.streamServiceStub
.withDeadlineAfter(this.getOptions().getDeadline(), TimeUnit.SECONDS)
.write(
new StreamObserver<BanyandbStream.WriteResponse>() {
+ private BanyanDBException responseException;
+
@Override
public void onNext(BanyandbStream.WriteResponse writeResponse) {
+ switch (writeResponse.getStatus()) {
+ case STATUS_RECEIVE_ERROR:
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#issuecomment-1720757813
I can see relative server commit is merged, do we need some update on this? As we have the server now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1318049267
##########
.github/workflows/deploy.yaml:
##########
@@ -17,9 +17,12 @@
name: Deploy Snapshot
on:
+ pull_request:
push:
branches:
- main
+ schedule:
+ - cron: '0 18 * * *' # TimeZone: UTC 0
Review Comment:
> Why this?
This was a misoperation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1318048763
##########
.github/workflows/deploy.yaml:
##########
@@ -17,9 +17,12 @@
name: Deploy Snapshot
on:
+ pull_request:
push:
branches:
- main
+ schedule:
+ - cron: '0 18 * * *' # TimeZone: UTC 0
Review Comment:
I opened new pr to build the test image, which will be closed when the test is done.
https://github.com/apache/skywalking-banyandb-java-client/pull/47
##########
.github/workflows/deploy.yaml:
##########
@@ -17,9 +17,12 @@
name: Deploy Snapshot
on:
+ pull_request:
push:
branches:
- main
+ schedule:
+ - cron: '0 18 * * *' # TimeZone: UTC 0
Review Comment:
https://github.com/apache/skywalking-banyandb-java-client/pull/47
I opened new pr to build the test image, which will be closed when the test is done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311781479
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
Why do we only need to check STATUS_EXPIRED_REVISION? But safe to ignore other response codes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311815116
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -198,33 +204,75 @@ void connect(Channel channel) {
* Perform a single write with given entity.
*
* @param streamWrite the entity to be written
+ * @return a future of write result
*/
- public void write(StreamWrite streamWrite) {
+ public CompletableFuture<Void> write(StreamWrite streamWrite) {
checkState(this.streamServiceStub != null, "stream service is null");
+ CompletableFuture<Void> future = new CompletableFuture<>();
final StreamObserver<BanyandbStream.WriteRequest> writeRequestStreamObserver
= this.streamServiceStub
.withDeadlineAfter(this.getOptions().getDeadline(), TimeUnit.SECONDS)
.write(
new StreamObserver<BanyandbStream.WriteResponse>() {
+ private BanyanDBException responseException;
+
@Override
public void onNext(BanyandbStream.WriteResponse writeResponse) {
+ switch (writeResponse.getStatus()) {
+ case STATUS_RECEIVE_ERROR:
Review Comment:
Is the codestyle checker not working?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hanahmily commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313713565
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
The server unexpected errors will override these errors, which is reasonable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311778812
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -198,33 +204,75 @@ void connect(Channel channel) {
* Perform a single write with given entity.
*
* @param streamWrite the entity to be written
+ * @return a future of write result
*/
- public void write(StreamWrite streamWrite) {
+ public CompletableFuture<Void> write(StreamWrite streamWrite) {
checkState(this.streamServiceStub != null, "stream service is null");
+ CompletableFuture<Void> future = new CompletableFuture<>();
final StreamObserver<BanyandbStream.WriteRequest> writeRequestStreamObserver
= this.streamServiceStub
.withDeadlineAfter(this.getOptions().getDeadline(), TimeUnit.SECONDS)
.write(
new StreamObserver<BanyandbStream.WriteResponse>() {
+ private BanyanDBException responseException;
+
@Override
public void onNext(BanyandbStream.WriteResponse writeResponse) {
+ switch (writeResponse.getStatus()) {
+ case STATUS_RECEIVE_ERROR:
Review Comment:
Is this the correct format? No indent for the case statement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313178194
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
But here it will set all requests to the same exception
https://github.com/apache/skywalking-banyandb-java-client/blob/main/src/main/java/org/apache/skywalking/banyandb/v1/client/AbstractBulkWriteProcessor.java#L94
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311827860
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
@hanahmily @lujiajing1126 Could you take a look at this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1311826767
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/BanyanDBClient.java:
##########
@@ -198,33 +204,75 @@ void connect(Channel channel) {
* Perform a single write with given entity.
*
* @param streamWrite the entity to be written
+ * @return a future of write result
*/
- public void write(StreamWrite streamWrite) {
+ public CompletableFuture<Void> write(StreamWrite streamWrite) {
checkState(this.streamServiceStub != null, "stream service is null");
+ CompletableFuture<Void> future = new CompletableFuture<>();
final StreamObserver<BanyandbStream.WriteRequest> writeRequestStreamObserver
= this.streamServiceStub
.withDeadlineAfter(this.getOptions().getDeadline(), TimeUnit.SECONDS)
.write(
new StreamObserver<BanyandbStream.WriteResponse>() {
+ private BanyanDBException responseException;
+
@Override
public void onNext(BanyandbStream.WriteResponse writeResponse) {
+ switch (writeResponse.getStatus()) {
+ case STATUS_RECEIVE_ERROR:
Review Comment:
I don't know how this happens. But it seems the main repo has the indent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1317964143
##########
.github/workflows/deploy.yaml:
##########
@@ -17,9 +17,12 @@
name: Deploy Snapshot
on:
+ pull_request:
push:
branches:
- main
+ schedule:
+ - cron: '0 18 * * *' # TimeZone: UTC 0
Review Comment:
You could manually push the version if you need to. But pull_request based is very dangerous.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] wu-sheng commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1317963778
##########
.github/workflows/deploy.yaml:
##########
@@ -17,9 +17,12 @@
name: Deploy Snapshot
on:
+ pull_request:
push:
branches:
- main
+ schedule:
+ - cron: '0 18 * * *' # TimeZone: UTC 0
Review Comment:
Why this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hanahmily commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1312379494
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
I prefer to handle them. BanyanDB batch writing services log these errors instead of returning them to the clients. In this round, I would like the Java client to return these errors through `CompletableFuture`. OAP module will have a chance to log them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on a diff in pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#discussion_r1313178194
##########
src/main/java/org/apache/skywalking/banyandb/v1/client/MeasureBulkWriteProcessor.java:
##########
@@ -33,30 +39,50 @@
@ThreadSafe
public class MeasureBulkWriteProcessor extends AbstractBulkWriteProcessor<BanyandbMeasure.WriteRequest,
MeasureServiceGrpc.MeasureServiceStub> {
+ private final BanyanDBClient client;
+
/**
* Create the processor.
*
- * @param measureServiceStub stub for gRPC call.
+ * @param client the client
* @param maxBulkSize the max bulk size for the flush operation
* @param flushInterval if given maxBulkSize is not reached in this period, the flush would be trigger
* automatically. Unit is second.
* @param concurrency the number of concurrency would run for the flush max.
*/
protected MeasureBulkWriteProcessor(
- final MeasureServiceGrpc.MeasureServiceStub measureServiceStub,
+ final BanyanDBClient client,
final int maxBulkSize,
final int flushInterval,
final int concurrency) {
- super(measureServiceStub, "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ super(client.getMeasureServiceStub(), "MeasureBulkWriteProcessor", maxBulkSize, flushInterval, concurrency);
+ this.client = client;
}
@Override
protected StreamObserver<BanyandbMeasure.WriteRequest> buildStreamObserver(MeasureServiceGrpc.MeasureServiceStub stub,
CompletableFuture<Void> batch) {
return stub.write(new StreamObserver<BanyandbMeasure.WriteResponse>() {
+ private final Set<String> schemaExpired = new HashSet<>();
+
@Override
public void onNext(BanyandbMeasure.WriteResponse writeResponse) {
-
+ switch (writeResponse.getStatus()) {
+ case STATUS_EXPIRED_REVISION:
Review Comment:
@hanahmily
But here it will set all requests to the same exception
https://github.com/apache/skywalking-banyandb-java-client/blob/main/src/main/java/org/apache/skywalking/banyandb/v1/client/AbstractBulkWriteProcessor.java#L94
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#issuecomment-1701185899
issue https://github.com/apache/skywalking/issues/10956
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hanahmily merged pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb-java-client] hailin0 commented on pull request #46: Add mod revision check to write requests(measure/stream)
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on PR #46:
URL: https://github.com/apache/skywalking-banyandb-java-client/pull/46#issuecomment-1720778548
> I can see relative server commit is merged, do we need some update on this? As we have the server now.
oap image has been updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org