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:InMemoryProjectDiskUsage
Calls the dataFunction with the project as an argument in case the project exists but no data still cached for this project- Specified by:
computeIfAbsent
in interfaceInMemoryProjectDiskUsage
- Returns:
- new value in cache
-
peek
@Nullable public CompositeDiskUsageData peek(@NotNull String projectId)
- Specified by:
peek
in 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:InMemoryProjectDiskUsage
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.- Specified by:
compute
in interfaceInMemoryProjectDiskUsage
- Returns:
- new value in cache
-
computeIfPresent
@Nullable public CompositeDiskUsageData computeIfPresent(@NotNull String projectId, @NotNull Function<CompositeDiskUsageData,CompositeDiskUsageData> computeFunction)
Description copied from interface:InMemoryProjectDiskUsage
Same asInMemoryProjectDiskUsage.compute(String, Function)
but computeFunction is called only if there's a value in cache- Specified by:
computeIfPresent
in interfaceInMemoryProjectDiskUsage
- Returns:
- new value in cache
-
set
@Nullable public CompositeDiskUsageData set(@NotNull String projectId, @NotNull CompositeDiskUsageData currentCompositeDiskUsageData)
Description copied from interface:InMemoryProjectDiskUsage
Sets current value to the cache Parent projects are updated if cached value is changed.- Specified by:
set
in interfaceInMemoryProjectDiskUsage
- Returns:
- previously stored value
-
clear
@Nullable public CompositeDiskUsageData clear(@NotNull String projectId)
Description copied from interface:InMemoryProjectDiskUsage
Removes cached value- Specified by:
clear
in interfaceInMemoryProjectDiskUsage
- Returns:
- previously stored value
-
getArchivedProjectsDiskUsage
@Nullable public CompositeDiskUsageData getArchivedProjectsDiskUsage()
- Specified by:
getArchivedProjectsDiskUsage
in interfaceInMemoryProjectDiskUsage
-
addArchivedProjectsDiskUsage
public CompositeDiskUsageData addArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
- Specified by:
addArchivedProjectsDiskUsage
in interfaceInMemoryProjectDiskUsage
-
subtractArchivedProjectsDiskUsage
public CompositeDiskUsageData subtractArchivedProjectsDiskUsage(@NotNull CompositeDiskUsageData compositeDiskUsageData)
- Specified by:
subtractArchivedProjectsDiskUsage
in interfaceInMemoryProjectDiskUsage
-
resetArchivedProjectsDiskUsage
@Nullable public CompositeDiskUsageData resetArchivedProjectsDiskUsage()
Description copied from interface:InMemoryProjectDiskUsage
Resets archived projects cache- Specified by:
resetArchivedProjectsDiskUsage
in interfaceInMemoryProjectDiskUsage
- Returns:
- previously stored value
-
setDirectly
public void setDirectly(@NotNull String projectId, @NotNull CompositeDiskUsageData data)
Description copied from interface:InMemoryProjectDiskUsage
Sets current value to the cache. Doesn't update parent projects.- Specified by:
setDirectly
in interfaceInMemoryProjectDiskUsage
-
-