File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1717package com .google .cloud .pubsublite ;
1818
1919import com .google .api .gax .retrying .RetrySettings ;
20- import org . threeten . bp .Duration ;
20+ import java . time .Duration ;
2121
2222/** Useful general constants for Pub/Sub Lite. */
2323public class Constants {
2424 public static final RetrySettings DEFAULT_RETRY_SETTINGS =
2525 RetrySettings .newBuilder ()
26- .setInitialRetryDelay (Duration .ofMillis (100 ))
26+ .setInitialRetryDelayDuration (Duration .ofMillis (100 ))
2727 .setRetryDelayMultiplier (1.3 )
28- .setMaxRetryDelay (Duration .ofSeconds (60 ))
28+ .setMaxRetryDelayDuration (Duration .ofSeconds (60 ))
2929 .setJittered (true )
30- .setTotalTimeout (Duration .ofMinutes (10 ))
30+ .setTotalTimeoutDuration (Duration .ofMinutes (10 ))
3131 .build ();
3232
3333 public static final long MAX_PUBLISH_BATCH_COUNT = 1_000 ;
Original file line number Diff line number Diff line change 5151import com .google .protobuf .ByteString ;
5252import com .google .pubsub .v1 .PubsubMessage ;
5353import io .grpc .CallOptions ;
54+ import java .time .Duration ;
5455import java .util .Optional ;
55- import org .threeten .bp .Duration ;
5656
5757/**
5858 * Settings for instantiating a Pub/Sub Lite publisher emulating the Cloud Pub/Sub Publisher API.
@@ -64,7 +64,7 @@ public abstract class PublisherSettings {
6464 .setIsEnabled (true )
6565 .setElementCountThreshold (1000L )
6666 .setRequestByteThreshold (Constants .MAX_PUBLISH_BATCH_BYTES )
67- .setDelayThreshold (Duration .ofMillis (50 ))
67+ .setDelayThresholdDuration (Duration .ofMillis (50 ))
6868 .build ();
6969
7070 // Required parameters.
Original file line number Diff line number Diff line change 3030import com .google .cloud .pubsublite .internal .Lazy ;
3131import com .google .common .collect .ImmutableListMultimap ;
3232import com .google .common .collect .Multimaps ;
33+ import java .time .Duration ;
3334import java .util .concurrent .ScheduledExecutorService ;
34- import org .threeten .bp .Duration ;
3535
3636public final class ServiceClients {
3737 private static final Lazy <ScheduledExecutorService > GRPC_EXECUTOR =
@@ -42,9 +42,9 @@ private ServiceClients() {}
4242 private static TransportChannelProvider getTransportChannelProvider () {
4343 return InstantiatingGrpcChannelProvider .newBuilder ()
4444 .setMaxInboundMessageSize (Integer .MAX_VALUE )
45- .setKeepAliveTime (Duration .ofMinutes (1 ))
45+ .setKeepAliveTimeDuration (Duration .ofMinutes (1 ))
4646 .setKeepAliveWithoutCalls (true )
47- .setKeepAliveTimeout (Duration .ofMinutes (1 ))
47+ .setKeepAliveTimeoutDuration (Duration .ofMinutes (1 ))
4848 .setChannelPoolSettings (
4949 ChannelPoolSettings .builder ()
5050 .setInitialChannelCount (25 )
Original file line number Diff line number Diff line change 5757import com .google .common .collect .ImmutableList ;
5858import com .google .common .collect .Iterables ;
5959import com .google .protobuf .ByteString ;
60+ import java .time .Duration ;
6061import java .util .ArrayList ;
6162import java .util .Collection ;
6263import java .util .Collections ;
7576import org .mockito .InOrder ;
7677import org .mockito .Mock ;
7778import org .mockito .stubbing .Answer ;
78- import org .threeten .bp .Duration ;
7979
8080@ RunWith (JUnit4 .class )
8181public class PublisherImplTest {
@@ -86,7 +86,7 @@ public class PublisherImplTest {
8686 private static final BatchingSettings BATCHING_SETTINGS_THAT_NEVER_FIRE =
8787 BatchingSettings .newBuilder ()
8888 .setIsEnabled (true )
89- .setDelayThreshold (Duration .ofDays (10 ))
89+ .setDelayThresholdDuration (Duration .ofDays (10 ))
9090 .setRequestByteThreshold (1000000L )
9191 .setElementCountThreshold (1000000L )
9292 .build ();
You can’t perform that action at this time.
0 commit comments