Class BuildDataStorageImpl

    • Method Detail

      • setBuildsManager

        public void setBuildsManager​(@NotNull
                                     BuildsManager buildsManager)
      • setBuildTypeIdentifiersManager

        public void setBuildTypeIdentifiersManager​(BuildTypeIdentifiersManager buildTypeIdentifiersManager)
      • getAvailableMetricsForBuildType

        @NotNull
        public List<String> getAvailableMetricsForBuildType​(@NotNull
                                                            String buildTypeExtId)
        Description copied from interface: BuildDataStorage
        Returns collection of available value type keys for specified build configuration
        Specified by:
        getAvailableMetricsForBuildType in interface BuildDataStorage
        Parameters:
        buildTypeExtId - external id of build configuration
        Returns:
        see above
      • publishValue

        public void publishValue​(@NotNull
                                 String valueTypeKey,
                                 long promotionId,
                                 @NotNull
                                 BigDecimal value)
        Description copied from interface: BuildDataStorage
        Store single build statistic value for a build with specified id
        Specified by:
        publishValue in interface BuildDataStorage
        Parameters:
        valueTypeKey - statistic value key
        promotionId - id of the build promotion (same as build ID)
        value - value
      • publishValues

        public void publishValues​(long promotionId,
                                  @NotNull
                                  Map<String,​BigDecimal> statValues)
        Description copied from interface: BuildDataStorage
        Publishes several values at once.
        Specified by:
        publishValues in interface BuildDataStorage
        Parameters:
        promotionId - id of the build promotion (same as build ID)
        statValues - map of statistic values to publish
      • publishValuesNoEvents

        public void publishValuesNoEvents​(@NotNull
                                          Map<Long,​Map<String,​BigDecimal>> promoId2statisticValues)
        Description copied from interface: BuildDataStorage
        Publishes several statistic values at once for multiple promotions, but without sending events.
        Specified by:
        publishValuesNoEvents in interface BuildDataStorage
        Parameters:
        promoId2statisticValues - map of statistic values to publish
      • deleteValues

        public void deleteValues​(long promotionId,
                                 @NotNull
                                 Collection<String> valueTypeKeys)
        Description copied from interface: BuildDataStorage
        Delete published statistic values with the specified keys for the given promotion
        Specified by:
        deleteValues in interface BuildDataStorage
        Parameters:
        promotionId - id of the build promotion
        valueTypeKeys - collection of the keys to be removed from the DB
      • getValueTypeKeys

        @NotNull
        public Set<String> getValueTypeKeys​(@NotNull
                                            String prefix,
                                            @NotNull
                                            String buildTypeExternalId)
        Description copied from interface: BuildDataStorage

        Get all available ValueType keys for a build configuration filtering by prefix

        Specified by:
        getValueTypeKeys in interface BuildDataStorage
        Parameters:
        prefix - Prefix to search keys. Could be empty.
        buildTypeExternalId - external ID of a build type
        Returns:
        Set of all available keys starting with provided prefix.
      • getData

        @Nullable
        public BuildValue getData​(@NotNull
                                  String valueTypeKey,
                                  BuildValueTransformer buildValueTransformer,
                                  long finishedBuildId,
                                  String externalBuildTypeId)
        Description copied from interface: BuildDataStorage
        Get individual statistic value for given value type and finished build
        Specified by:
        getData in interface BuildDataStorage
        Parameters:
        valueTypeKey - metric key
        buildValueTransformer - optional transformer to be applied to the value
        finishedBuildId - identifier of the finished build
        externalBuildTypeId - external identifier of the build configuration
        Returns:
        metric value for given parameters, null if not available
      • getData

        @Nullable
        public BuildValue getData​(@NotNull
                                  String valueTypeKey,
                                  @Nullable
                                  BuildValueTransformer buildValueTransformer,
                                  @NotNull
                                  SBuild build)
        Description copied from interface: BuildDataStorage
        Get individual statistic value for given value type and build (finished or running)
        Specified by:
        getData in interface BuildDataStorage
        Parameters:
        valueTypeKey - metric key
        buildValueTransformer - optional transformer to be applied to the value
        build - finished or running build
        Returns:
        metric value for given parameters, null if not available
      • getDataSet

        @NotNull
        public List<BuildValue> getDataSet​(@NotNull
                                           String valueTypeKey,
                                           @NotNull
                                           BuildChartSettings chartSettings,
                                           @Nullable
                                           BuildValueTransformer buildValueTransformer)
        Description copied from interface: BuildDataStorage
        Retrieve sorted list of values for given metric, filtered according to given settings. There will be BuildValue object for each build, even if there is no metric value for the given build.
        Specified by:
        getDataSet in interface BuildDataStorage
        Parameters:
        valueTypeKey - metric key
        chartSettings - build chart settings
        buildValueTransformer - optional transformer to be applied to each value
        Returns:
        list of metric values combined with its build data
      • hasDataFor

        public boolean hasDataFor​(@NotNull
                                  String valueTypeKey,
                                  String externalBuildTypeId)
        Description copied from interface: BuildDataStorage
        Flags whether any data was stored for given metric & buildTypeId pair
        Specified by:
        hasDataFor in interface BuildDataStorage
        Parameters:
        valueTypeKey - metric key
        externalBuildTypeId - build configuration external identifier
        Returns:
        true if there is some data for given metric and given buildTypeId
      • hasDataFor

        public boolean hasDataFor​(@NotNull
                                  String valueTypeKey,
                                  @NotNull
                                  SBuild build)
        Description copied from interface: BuildDataStorage
        Flags whether any data was stored for given metric & build pair
        Specified by:
        hasDataFor in interface BuildDataStorage
        Parameters:
        valueTypeKey - metric key
        build - build to check
        Returns:
        true if there is some data for given metric and given buildTypeId
      • normalizeAgentName

        public static String normalizeAgentName​(String string)
      • afterCleanup

        public void afterCleanup​(@NotNull
                                 CleanupProcessState cleanupState)
                          throws CleanupInterruptedException
        Description copied from interface: AfterBuildsCleanupExtension
        Invoked upon finishing of the main cleanup process. At this point all data for specific builds is deleted.
        Note: This extension might not be called for every cleanup run as cleanup process can be interrupted earlier. Extension must check cleanup process state and if it is interrupted, complete its operations and return as quick as possible.
        Specified by:
        afterCleanup in interface AfterBuildsCleanupExtension
        Parameters:
        cleanupState - cleanup process state
        Throws:
        CleanupInterruptedException - if the cleanup process was interrupted
      • clearCaches

        public void clearCaches()