Interface InMemoryProjectDiskUsage
-
- All Known Implementing Classes:
InMemoryProjectDiskUsageImpl
public interface InMemoryProjectDiskUsage
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompositeDiskUsageData
addArchivedProjectsDiskUsage(CompositeDiskUsageData compositeDiskUsageData)
CompositeDiskUsageData
clear(String projectId)
Removes cached valueCompositeDiskUsageData
compute(String projectId, Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Modifies the stored in cache value.CompositeDiskUsageData
computeIfAbsent(String projectId, Function<SProject,CompositeDiskUsageData> dataFunction)
Calls the dataFunction with the project as an argument in case the project exists but no data still cached for this projectCompositeDiskUsageData
computeIfPresent(String projectId, Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Same ascompute(String, Function)
but computeFunction is called only if there's a value in cacheCompositeDiskUsageData
getArchivedProjectsDiskUsage()
CompositeDiskUsageData
peek(String projectId)
CompositeDiskUsageData
resetArchivedProjectsDiskUsage()
Resets archived projects cacheCompositeDiskUsageData
set(String projectId, CompositeDiskUsageData currentCompositeDiskUsageData)
Sets current value to the cache Parent projects are updated if cached value is changed.void
setDirectly(String projectId, CompositeDiskUsageData data)
Sets current value to the cache.CompositeDiskUsageData
subtractArchivedProjectsDiskUsage(CompositeDiskUsageData compositeDiskUsageData)
-
-
-
Method Detail
-
computeIfAbsent
@NotNull CompositeDiskUsageData computeIfAbsent(@NotNull String projectId, @NotNull Function<SProject,CompositeDiskUsageData> dataFunction)
Calls the dataFunction with the project as an argument in case the project exists but no data still cached for this project- Parameters:
projectId
-dataFunction
-- Returns:
- new value in cache
-
peek
@Nullable CompositeDiskUsageData peek(@NotNull String projectId)
- Parameters:
projectId
-- Returns:
- CompositeDiskUsageData with summs of all build configurations and subprojects on a given project or null if cache is not initialized
-
compute
@Nullable CompositeDiskUsageData compute(@NotNull String projectId, @NotNull Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Modifies the stored in cache value. If no data currently stored then null is passed to computeFunction. If cache contains the data then a clone of stored data is passed to computeFunction. If computeFunction returns null then changes are not applied. Parent projects are updated if cached value is changed.- Parameters:
projectId
-computeFunction
-- Returns:
- new value in cache
-
computeIfPresent
@Nullable CompositeDiskUsageData computeIfPresent(@NotNull String projectId, @NotNull Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Same ascompute(String, Function)
but computeFunction is called only if there's a value in cache- Parameters:
projectId
-computeFunction
-- Returns:
- new value in cache
-
set
@Nullable CompositeDiskUsageData set(@NotNull String projectId, @NotNull CompositeDiskUsageData currentCompositeDiskUsageData)
Sets current value to the cache Parent projects are updated if cached value is changed.- Parameters:
projectId
-currentCompositeDiskUsageData
-- Returns:
- previously stored value
-
clear
@Nullable CompositeDiskUsageData clear(@NotNull String projectId)
Removes cached value- Parameters:
projectId
-- Returns:
- previously stored value
-
getArchivedProjectsDiskUsage
@Nullable CompositeDiskUsageData getArchivedProjectsDiskUsage()
-
addArchivedProjectsDiskUsage
CompositeDiskUsageData addArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
-
subtractArchivedProjectsDiskUsage
CompositeDiskUsageData subtractArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
-
resetArchivedProjectsDiskUsage
@Nullable CompositeDiskUsageData resetArchivedProjectsDiskUsage()
Resets archived projects cache- Returns:
- previously stored value
-
setDirectly
void setDirectly(@NotNull String projectId, @NotNull CompositeDiskUsageData data)
Sets current value to the cache. Doesn't update parent projects.- Parameters:
projectId
-data
-
-
-