diff options
author | buchgr <buchgr@google.com> | 2018-01-26 10:42:13 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-26 10:44:26 -0800 |
commit | 55f89dee5e2e8dd6f72c823b62a5fcd61446939f (patch) | |
tree | 2ea17881de81d46ea36cfba00d39f17c7686b5bc /src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java | |
parent | 69f483977c6565f28ed8d507c66feca84dedebad (diff) |
remote: Rewrite the HTTP caching client in Netty. Fixes #4481
* This puts in the foundation of HTTP/2 support for remote caching.
* Allows us to remove the Apache HTTP library as a dependency, reducing
the Bazel binary size by 1MiB.
On fast networks (i.e. GCE to GCS) we can see a >2x speed improvement for TLS
throughput. Even from my workstation to GCS I get significant build time
improvements when using Netty's TLS 18s vs 12s.
Closes #4481.
PiperOrigin-RevId: 183411787
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java b/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java index ea7b81003e..70a323ffeb 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java +++ b/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreFactory.java @@ -18,10 +18,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.auth.Credentials; import com.google.devtools.build.lib.remote.blobstore.OnDiskBlobStore; -import com.google.devtools.build.lib.remote.blobstore.RestBlobStore; import com.google.devtools.build.lib.remote.blobstore.SimpleBlobStore; +import com.google.devtools.build.lib.remote.blobstore.http.HttpBlobStore; import com.google.devtools.build.lib.vfs.Path; import java.io.IOException; +import java.net.URI; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; @@ -35,8 +36,14 @@ public final class SimpleBlobStoreFactory { public static SimpleBlobStore createRest(RemoteOptions options, Credentials creds) throws IOException { - return new RestBlobStore( - options.remoteHttpCache, (int) TimeUnit.SECONDS.toMillis(options.remoteTimeout), creds); + try { + return new HttpBlobStore( + URI.create(options.remoteHttpCache), + (int) TimeUnit.SECONDS.toMillis(options.remoteTimeout), + creds); + } catch (Exception e) { + throw new RuntimeException(e); + } } public static SimpleBlobStore createLocalDisk(RemoteOptions options, Path workingDirectory) |