-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bridged --experimental_repository_cache value to HttpDownloader. Crea…
…ted HttpCache skeleton to implement caching logic of HttpDownloadValues as the first step (more types of caches will come later). Having RepositoryDelegatorFunction initialize the cache in the respective RepositoryFunction handlers decouples the cache implementation from itself. It delegates the choice of Cache classes to the respective RepositoryFunctions, and let them decide what to do with the PathFragment of the cache location. Continuation of commit 239d995. A follow up CL will contain the implementation of HttpCache. For now, it's the empty interface of com.google.common.cache.Cache. GITHUB: #1752 -- MOS_MIGRATED_REVID=135400724
- Loading branch information
Showing
7 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/com/google/devtools/build/lib/bazel/repository/cache/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package( | ||
default_visibility = ["//src:__subpackages__"], | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["*"]), | ||
) | ||
|
||
java_library( | ||
name = "cache", | ||
srcs = ["RepositoryCache.java"], | ||
deps = ["//src/main/java/com/google/devtools/build/lib:vfs"], | ||
) |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2016 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package com.google.devtools.build.lib.bazel.repository.cache; | ||
|
||
import com.google.devtools.build.lib.vfs.PathFragment; | ||
|
||
/** | ||
* The cache implementation of HttpDownloadValues. | ||
*/ | ||
public class RepositoryCache { | ||
|
||
/** | ||
* @param repositoryCachePath The base location of the repository cache. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public RepositoryCache(PathFragment repositoryCachePath) { | ||
// TODO(jingwen): Preload in-memory set of cached values here. | ||
// Create any cache subdirectories here as well. | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters