aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/buildeventservice
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2017-09-04 22:23:30 +0200
committerGravatar Yun Peng <pcloudy@google.com>2017-09-05 09:54:51 +0200
commitfd4f5ac67942c0a29e75903d04c403edb6ce4d7d (patch)
tree2bd3836daf989d70927e59c08c91c983e6ea828f /src/main/java/com/google/devtools/build/lib/buildeventservice
parent97abb524bacc6d8527744657642f79c25c843c59 (diff)
Rewrite all code to use the new Java 8 java.time classes.
This removes our dependency on third_party/joda_time, which can be removed in the next commit. Change-Id: Ibda131d34d0abdc2d675db4bfbd2e99480c055ee PiperOrigin-RevId: 167515260
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventservice')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventservice/client/BUILD1
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BUILD b/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BUILD
index 91c8e523b4..940c62d023 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BUILD
@@ -19,7 +19,6 @@ java_library(
"//third_party:auth",
"//third_party:gson",
"//third_party:guava",
- "//third_party:joda_time",
"//third_party:jsr305",
"//third_party:netty",
"//third_party/grpc:grpc-jar",
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java
index 6a32ddef90..7fd3cc20ff 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java
+++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceGrpcClient.java
@@ -34,15 +34,15 @@ import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.stub.AbstractStub;
import io.grpc.stub.StreamObserver;
+import java.time.Duration;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nullable;
-import org.joda.time.Duration;
/** Implementation of BuildEventServiceClient that uploads data using gRPC. */
public class BuildEventServiceGrpcClient implements BuildEventServiceClient {
/** Max wait time for a single non-streaming RPC to finish */
- private static final Duration RPC_TIMEOUT = Duration.standardSeconds(15);
+ private static final Duration RPC_TIMEOUT = Duration.ofSeconds(15);
private final PublishBuildEventStub besAsync;
private final PublishBuildEventBlockingStub besBlocking;
@@ -69,7 +69,7 @@ public class BuildEventServiceGrpcClient implements BuildEventServiceClient {
@Override
public Status publish(PublishLifecycleEventRequest lifecycleEvent) throws Exception {
besBlocking
- .withDeadlineAfter(RPC_TIMEOUT.getMillis(), MILLISECONDS)
+ .withDeadlineAfter(RPC_TIMEOUT.toMillis(), MILLISECONDS)
.publishLifecycleEvent(lifecycleEvent);
return Status.OK;
}