Skip to content

Commit

Permalink
RemoteCache: replace getCacheCapabilities with getServerCapabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Sep 11, 2024
1 parent 4602931 commit 2d9e163
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,6 @@ private ListenableFuture<CachedActionResult> handleStatus(
MoreExecutors.directExecutor());
}

@Override
public CacheCapabilities getCacheCapabilities() throws IOException {
return channel.getServerCapabilities().getCacheCapabilities();
}

@Override
public ServerCapabilities getServerCapabilities() throws IOException {
return channel.getServerCapabilities();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ public RemoteCache(
}

public CacheCapabilities getRemoteCacheCapabilities() throws IOException {
if (remoteCacheClient == null) {
return CacheCapabilities.getDefaultInstance();
}
return remoteCacheClient.getCacheCapabilities();
return getServerCapabilities().getCacheCapabilities();
}

public ListenableFuture<String> getRemoteAuthority() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* <p>Implementations must be thread-safe.
*/
public interface RemoteCacheClient extends MissingDigestsFinder {
CacheCapabilities getCacheCapabilities() throws IOException;

ServerCapabilities getServerCapabilities() throws IOException;

ListenableFuture<String> getAuthority();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,13 @@ private void checkActionResult(ActionResult actionResult) throws IOException {
}

@Override
public CacheCapabilities getCacheCapabilities() {
return CacheCapabilities.newBuilder()
public ServerCapabilities getServerCapabilities() {
var cacheCapabilities = CacheCapabilities.newBuilder()
.setActionCacheUpdateCapabilities(
ActionCacheUpdateCapabilities.newBuilder().setUpdateEnabled(true).build())
.setSymlinkAbsolutePathStrategy(SymlinkAbsolutePathStrategy.Value.ALLOWED)
.build();
}

@Override
public ServerCapabilities getServerCapabilities() {
return ServerCapabilities.newBuilder().setCacheCapabilities(getCacheCapabilities()).build();
return ServerCapabilities.newBuilder().setCacheCapabilities(cacheCapabilities).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,17 +607,13 @@ private void getAfterCredentialRefresh(DownloadCommand cmd, SettableFuture<Void>
}

@Override
public CacheCapabilities getCacheCapabilities() {
return CacheCapabilities.newBuilder()
public ServerCapabilities getServerCapabilities() {
var cacheCapabilities = CacheCapabilities.newBuilder()
.setActionCacheUpdateCapabilities(
ActionCacheUpdateCapabilities.newBuilder().setUpdateEnabled(true).build())
.setSymlinkAbsolutePathStrategy(SymlinkAbsolutePathStrategy.Value.ALLOWED)
.build();
}

@Override
public ServerCapabilities getServerCapabilities() {
return ServerCapabilities.newBuilder().setCacheCapabilities(getCacheCapabilities()).build();
return ServerCapabilities.newBuilder().setCacheCapabilities(cacheCapabilities).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,13 @@ public ListenableFuture<Void> downloadBlob(
}

@Override
public CacheCapabilities getCacheCapabilities() {
return CacheCapabilities.newBuilder()
public ServerCapabilities getServerCapabilities() {
var cacheCapabilities = CacheCapabilities.newBuilder()
.setActionCacheUpdateCapabilities(
ActionCacheUpdateCapabilities.newBuilder().setUpdateEnabled(true).build())
.setSymlinkAbsolutePathStrategy(SymlinkAbsolutePathStrategy.Value.ALLOWED)
.build();
}

@Override
public ServerCapabilities getServerCapabilities() {
return ServerCapabilities.getDefaultInstance();
return ServerCapabilities.newBuilder().setCacheCapabilities(cacheCapabilities).build();
}

@Override
Expand Down

0 comments on commit 2d9e163

Please sign in to comment.