Class InMemoryProjectDiskUsageImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.statistics.diskusage.impl.InMemoryProjectDiskUsageImpl
-
- All Implemented Interfaces:
InMemoryProjectDiskUsage
public class InMemoryProjectDiskUsageImpl extends Object implements InMemoryProjectDiskUsage
-
-
Constructor Summary
Constructors Constructor Description InMemoryProjectDiskUsageImpl(ProjectManager projectManager)
-
Method Summary
-
-
-
Constructor Detail
-
InMemoryProjectDiskUsageImpl
public InMemoryProjectDiskUsageImpl(@NotNull ProjectManager projectManager)
-
-
Method Detail
-
computeIfAbsent
@NotNull public CompositeDiskUsageData computeIfAbsent(@NotNull String projectId, @NotNull Function<SProject,CompositeDiskUsageData> dataFunction)
Description copied from interface:InMemoryProjectDiskUsageCalls the dataFunction with the project as an argument in case the project exists but no data still cached for this project- Specified by:
computeIfAbsentin interfaceInMemoryProjectDiskUsage- Returns:
- new value in cache
-
peek
@Nullable public CompositeDiskUsageData peek(@NotNull String projectId)
- Specified by:
peekin interfaceInMemoryProjectDiskUsage- Returns:
- CompositeDiskUsageData with summs of all build configurations and subprojects on a given project or null if cache is not initialized
-
compute
@Nullable public CompositeDiskUsageData compute(@NotNull String projectId, @NotNull Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Description copied from interface:InMemoryProjectDiskUsageModifies 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.- Specified by:
computein interfaceInMemoryProjectDiskUsage- Returns:
- new value in cache
-
computeIfPresent
@Nullable public CompositeDiskUsageData computeIfPresent(@NotNull String projectId, @NotNull Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Description copied from interface:InMemoryProjectDiskUsageSame asInMemoryProjectDiskUsage.compute(String, Function)but computeFunction is called only if there's a value in cache- Specified by:
computeIfPresentin interfaceInMemoryProjectDiskUsage- Returns:
- new value in cache
-
set
@Nullable public CompositeDiskUsageData set(@NotNull String projectId, @NotNull CompositeDiskUsageData currentCompositeDiskUsageData)
Description copied from interface:InMemoryProjectDiskUsageSets current value to the cache Parent projects are updated if cached value is changed.- Specified by:
setin interfaceInMemoryProjectDiskUsage- Returns:
- previously stored value
-
clear
@Nullable public CompositeDiskUsageData clear(@NotNull String projectId)
Description copied from interface:InMemoryProjectDiskUsageRemoves cached value- Specified by:
clearin interfaceInMemoryProjectDiskUsage- Returns:
- previously stored value
-
getArchivedProjectsDiskUsage
@Nullable public CompositeDiskUsageData getArchivedProjectsDiskUsage()
- Specified by:
getArchivedProjectsDiskUsagein interfaceInMemoryProjectDiskUsage
-
addArchivedProjectsDiskUsage
public CompositeDiskUsageData addArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
- Specified by:
addArchivedProjectsDiskUsagein interfaceInMemoryProjectDiskUsage
-
subtractArchivedProjectsDiskUsage
public CompositeDiskUsageData subtractArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
- Specified by:
subtractArchivedProjectsDiskUsagein interfaceInMemoryProjectDiskUsage
-
resetArchivedProjectsDiskUsage
@Nullable public CompositeDiskUsageData resetArchivedProjectsDiskUsage()
Description copied from interface:InMemoryProjectDiskUsageResets archived projects cache- Specified by:
resetArchivedProjectsDiskUsagein interfaceInMemoryProjectDiskUsage- Returns:
- previously stored value
-
setDirectly
public void setDirectly(@NotNull String projectId, @NotNull CompositeDiskUsageData data)Description copied from interface:InMemoryProjectDiskUsageSets current value to the cache. Doesn't update parent projects.- Specified by:
setDirectlyin interfaceInMemoryProjectDiskUsage
-
-