|
21 | 21 | import tech.ydb.core.Issue;
|
22 | 22 | import tech.ydb.core.Status;
|
23 | 23 | import tech.ydb.core.StatusCode;
|
| 24 | +import tech.ydb.core.utils.ProtobufUtils; |
24 | 25 | import tech.ydb.proto.StatusCodesProtos;
|
25 | 26 | import tech.ydb.proto.topic.YdbTopic;
|
26 | 27 | import tech.ydb.topic.TopicRpc;
|
@@ -321,13 +322,6 @@ protected void onShutdown(String reason) {
|
321 | 322 | }
|
322 | 323 | }
|
323 | 324 |
|
324 |
| - private static Duration convertDuration(com.google.protobuf.Duration d) { |
325 |
| - if (d == null) { |
326 |
| - return Duration.ZERO; |
327 |
| - } |
328 |
| - return Duration.ofSeconds(d.getSeconds(), d.getNanos()); |
329 |
| - } |
330 |
| - |
331 | 325 | private class WriteSessionImpl extends WriteSession {
|
332 | 326 | protected String sessionId;
|
333 | 327 | private final MessageSender messageSender;
|
@@ -433,11 +427,11 @@ private void onWriteResponse(YdbTopic.StreamWriteMessage.WriteResponse response)
|
433 | 427 | if (response.getWriteStatistics() != null) {
|
434 | 428 | YdbTopic.StreamWriteMessage.WriteResponse.WriteStatistics src = response.getWriteStatistics();
|
435 | 429 | statistics = new WriteAck.Statistics(
|
436 |
| - convertDuration(src.getPersistingTime()), |
437 |
| - convertDuration(src.getPartitionQuotaWaitTime()), |
438 |
| - convertDuration(src.getTopicQuotaWaitTime()), |
439 |
| - convertDuration(src.getMaxQueueWaitTime()), |
440 |
| - convertDuration(src.getMinQueueWaitTime()) |
| 430 | + ProtobufUtils.protoToDuration(src.getPersistingTime()), |
| 431 | + ProtobufUtils.protoToDuration(src.getPartitionQuotaWaitTime()), |
| 432 | + ProtobufUtils.protoToDuration(src.getTopicQuotaWaitTime()), |
| 433 | + ProtobufUtils.protoToDuration(src.getMaxQueueWaitTime()), |
| 434 | + ProtobufUtils.protoToDuration(src.getMinQueueWaitTime()) |
441 | 435 | );
|
442 | 436 | }
|
443 | 437 | int inFlightFreed = 0;
|
|
0 commit comments