Interface InMemoryProjectDiskUsage

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