Interface DiskUsageStore

    • 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 -
      • getPinnedBuildsNumber

        int getPinnedBuildsNumber()
        Returns:
        the number of stored pinned builds