Commit 2239c08 1 parent 69696fc commit 2239c08 Copy full SHA for 2239c08
File tree 4 files changed +11
-11
lines changed
google-cloud-pubsublite/src
main/java/com/google/cloud/pubsublite
test/java/com/google/cloud/pubsublite/internal/wire
4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 17
17
package com .google .cloud .pubsublite ;
18
18
19
19
import com .google .api .gax .retrying .RetrySettings ;
20
- import org . threeten . bp .Duration ;
20
+ import java . time .Duration ;
21
21
22
22
/** Useful general constants for Pub/Sub Lite. */
23
23
public class Constants {
24
24
public static final RetrySettings DEFAULT_RETRY_SETTINGS =
25
25
RetrySettings .newBuilder ()
26
- .setInitialRetryDelay (Duration .ofMillis (100 ))
26
+ .setInitialRetryDelayDuration (Duration .ofMillis (100 ))
27
27
.setRetryDelayMultiplier (1.3 )
28
- .setMaxRetryDelay (Duration .ofSeconds (60 ))
28
+ .setMaxRetryDelayDuration (Duration .ofSeconds (60 ))
29
29
.setJittered (true )
30
- .setTotalTimeout (Duration .ofMinutes (10 ))
30
+ .setTotalTimeoutDuration (Duration .ofMinutes (10 ))
31
31
.build ();
32
32
33
33
public static final long MAX_PUBLISH_BATCH_COUNT = 1_000 ;
Original file line number Diff line number Diff line change 51
51
import com .google .protobuf .ByteString ;
52
52
import com .google .pubsub .v1 .PubsubMessage ;
53
53
import io .grpc .CallOptions ;
54
+ import java .time .Duration ;
54
55
import java .util .Optional ;
55
- import org .threeten .bp .Duration ;
56
56
57
57
/**
58
58
* Settings for instantiating a Pub/Sub Lite publisher emulating the Cloud Pub/Sub Publisher API.
@@ -64,7 +64,7 @@ public abstract class PublisherSettings {
64
64
.setIsEnabled (true )
65
65
.setElementCountThreshold (1000L )
66
66
.setRequestByteThreshold (Constants .MAX_PUBLISH_BATCH_BYTES )
67
- .setDelayThreshold (Duration .ofMillis (50 ))
67
+ .setDelayThresholdDuration (Duration .ofMillis (50 ))
68
68
.build ();
69
69
70
70
// Required parameters.
Original file line number Diff line number Diff line change 30
30
import com .google .cloud .pubsublite .internal .Lazy ;
31
31
import com .google .common .collect .ImmutableListMultimap ;
32
32
import com .google .common .collect .Multimaps ;
33
+ import java .time .Duration ;
33
34
import java .util .concurrent .ScheduledExecutorService ;
34
- import org .threeten .bp .Duration ;
35
35
36
36
public final class ServiceClients {
37
37
private static final Lazy <ScheduledExecutorService > GRPC_EXECUTOR =
@@ -42,9 +42,9 @@ private ServiceClients() {}
42
42
private static TransportChannelProvider getTransportChannelProvider () {
43
43
return InstantiatingGrpcChannelProvider .newBuilder ()
44
44
.setMaxInboundMessageSize (Integer .MAX_VALUE )
45
- .setKeepAliveTime (Duration .ofMinutes (1 ))
45
+ .setKeepAliveTimeDuration (Duration .ofMinutes (1 ))
46
46
.setKeepAliveWithoutCalls (true )
47
- .setKeepAliveTimeout (Duration .ofMinutes (1 ))
47
+ .setKeepAliveTimeoutDuration (Duration .ofMinutes (1 ))
48
48
.setChannelPoolSettings (
49
49
ChannelPoolSettings .builder ()
50
50
.setInitialChannelCount (25 )
Original file line number Diff line number Diff line change 57
57
import com .google .common .collect .ImmutableList ;
58
58
import com .google .common .collect .Iterables ;
59
59
import com .google .protobuf .ByteString ;
60
+ import java .time .Duration ;
60
61
import java .util .ArrayList ;
61
62
import java .util .Collection ;
62
63
import java .util .Collections ;
75
76
import org .mockito .InOrder ;
76
77
import org .mockito .Mock ;
77
78
import org .mockito .stubbing .Answer ;
78
- import org .threeten .bp .Duration ;
79
79
80
80
@ RunWith (JUnit4 .class )
81
81
public class PublisherImplTest {
@@ -86,7 +86,7 @@ public class PublisherImplTest {
86
86
private static final BatchingSettings BATCHING_SETTINGS_THAT_NEVER_FIRE =
87
87
BatchingSettings .newBuilder ()
88
88
.setIsEnabled (true )
89
- .setDelayThreshold (Duration .ofDays (10 ))
89
+ .setDelayThresholdDuration (Duration .ofDays (10 ))
90
90
.setRequestByteThreshold (1000000L )
91
91
.setElementCountThreshold (1000000L )
92
92
.build ();
You can’t perform that action at this time.
0 commit comments