Interface DiskUsageStore
-
- All Superinterfaces:
DiskUsageReader
- All Known Implementing Classes:
DiskUsageStoreProviderImpl.DiskUsageStoreImpl
public interface DiskUsageStore extends DiskUsageReader
Allows to access DiskUsage data. Incapsulates disk usage holder (build type or project) and the storage (eg CustomDataStorage).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DiskUsageData
clear()
Removes all dataPair<DiskUsageData,DiskUsageData>
compute(Function<DiskUsageData,DiskUsageData> dataConverter)
Calls the function and passes current DiskUsageData or null if nothing is stored yet.Pair<DiskUsageData,DiskUsageData>
computeIfExists(Function<DiskUsageData,DiskUsageData> dataConverter)
Calls the function and passes current DiskUsageData there if data is currently stored.DiskUsageData
getCurrentOrStoreEmptyDiskUsage()
Creates and stores empty disk usageDiskUsageData
getOrCreateCurrentDiskUsage()
int
getPinnedBuildsNumber()
boolean
isUpdating()
boolean
removePinnedBuildIfExists(long buildId, long totalArtifactsDelta, long logsDelta)
Applies deltas to currently stored pinned builds data and removes the build from pinned - only if the build is currently storedDiskUsageData
setCurrentDiskUsage(DiskUsageData currentDiskUsageData)
Sets the current DiskUsageData regardless of currently stored datavoid
setIsUpdating(boolean isUpdating)
Marks that this data is currently updatedboolean
updatePinnedBuildIfNotExists(long buildId, long totalArtifactsDelta, long logsDelta)
Applies deltas to currently stored pinned builds data and adds the build to pinned - only if the build wasn't stored yet-
Methods inherited from interface jetbrains.buildServer.serverSide.statistics.diskusage.DiskUsageReader
getCurrentDiskUsage, getPinnedBuildsArtifactsSize, getPinnedBuildsLogsSize, hasData
-
-
-
-
Method Detail
-
getOrCreateCurrentDiskUsage
@NotNull DiskUsageData getOrCreateCurrentDiskUsage()
- Returns:
- current disk usage for current holder or new empty DiskUsageData
-
getCurrentOrStoreEmptyDiskUsage
@Nullable DiskUsageData getCurrentOrStoreEmptyDiskUsage()
Creates and stores empty disk usage- Returns:
- previously associated value
-
isUpdating
boolean isUpdating()
- Returns:
- true if data is currently updated
-
setIsUpdating
void setIsUpdating(boolean isUpdating)
Marks that this data is currently updated- Parameters:
isUpdating
-
-
computeIfExists
@NotNull Pair<DiskUsageData,DiskUsageData> computeIfExists(@NotNull Function<DiskUsageData,DiskUsageData> dataConverter)
Calls the function and passes current DiskUsageData there if data is currently stored. Function is not called if no data is currently stored. Object returned from the function will be stored back, data won't be changed otherwise. Update status is set during function call.- Parameters:
dataConverter
-
-
compute
@NotNull Pair<DiskUsageData,DiskUsageData> compute(@NotNull Function<DiskUsageData,DiskUsageData> dataConverter)
Calls the function and passes current DiskUsageData or null if nothing is stored yet. Object returned from the function will be stored back, data won't be changed otherwise. Update status is set during function call.- Parameters:
dataConverter
-
-
setCurrentDiskUsage
@Nullable DiskUsageData setCurrentDiskUsage(@NotNull DiskUsageData currentDiskUsageData)
Sets the current DiskUsageData regardless of currently stored data- Parameters:
currentDiskUsageData
-- Returns:
- previously associated value
-
updatePinnedBuildIfNotExists
boolean updatePinnedBuildIfNotExists(long buildId, long totalArtifactsDelta, long logsDelta)
Applies deltas to currently stored pinned builds data and adds the build to pinned - only if the build wasn't stored yet- Parameters:
buildId
-totalArtifactsDelta
-logsDelta
-
-
removePinnedBuildIfExists
boolean removePinnedBuildIfExists(long buildId, long totalArtifactsDelta, long logsDelta)
Applies deltas to currently stored pinned builds data and removes the build from pinned - only if the build is currently stored- Parameters:
buildId
-totalArtifactsDelta
-logsDelta
-
-
clear
DiskUsageData clear()
Removes all data
-
getPinnedBuildsNumber
int getPinnedBuildsNumber()
- Returns:
- the number of stored pinned builds
-
-