@Internal
public interface ImmutablePlanCacheService
ImmutableChain. This Service does not
check for permissions currently. Only works for Chain.
Cache is disabled by default and should be explicitly enabled by application (preferably by calling initialiseCache())
CachedPlanManager instead.| Modifier and Type | Interface and Description |
|---|---|
static interface |
ImmutablePlanCacheService.CacheInvalidator |
| Modifier and Type | Method and Description |
|---|---|
void |
cascadeInvalidate(@NotNull PlanKey planKey)
Removes the cached reference for the passed plan and its children.
|
void |
disableCache()
Disable cache.
|
void |
enableCache()
Enable cache.
|
void |
enterDeletionCodeSection()
Marks the current thread as being able to see deleted plans.
|
<T extends ImmutableChainStage> |
filterOutDeletedIfNeeded(@NotNull List<T> stages)
Returns a list with deleted stages removed.
|
<T extends ImmutableJob> |
filterOutDeletedIfNeeded(@NotNull Set<T> jobs)
Returns a set with deleted jobs removed.
|
Optional<ImmutableChain> |
getAnyPlan(Predicate<? super ImmutableChain> predicate)
Returns a plan matching the supplied predicate
|
@NotNull Range<Integer> |
getBuildNumbersRange(PlanKey planKey)
Deprecated.
since 5.10
|
BambooCacheStats |
getCacheStats()
Retrieve cache statistics
|
void |
getChainsToInvalidateAndReindex(ImmutablePlanCacheService.CacheInvalidator invalidator,
Set<PlanKey> chainsToInvalidate,
Set<PlanKey> chainsToReindex)
Internal.
|
@Nullable ImmutableChain |
getImmutableChainByKeyIfInCache(@NotNull PlanKey planKey) |
@Nullable ImmutableChain |
getImmutablePlanByKey(@NotNull PlanKey planKey)
Returns a plan if one exists with the key.
|
@NotNull PlanCacheIndices |
getIndices()
Returns the indices created for plan cache content.
|
<T extends ImmutablePlan> |
getPlans(Class<T> planType,
@NotNull com.google.common.base.Predicate<? super T> filter)
|
Stream<ImmutablePlan> |
getPlans(Predicate<ImmutablePlan> predicate)
Returns a stream of plans (chains+jobs) matching the supplied predicate.
|
void |
hideDeletedPlan(PlanKey planKey)
Hides the plan.
|
void |
hideDeletedStage(Long stageId)
Hides the stage.
|
void |
indexPlan(@NotNull ImmutableChain plan)
Updates plan indexes in cache
|
void |
initialiseCache()
Clear the cache and attempt to read all Chains from DB in order to cache them.
|
void |
invalidate(@NotNull PlanKey planKey)
Removes the cached Plan.
|
void |
invalidateAllLatestResultSummaries()
Invalidates all latest result summaries currently cached.
|
void |
invalidateBuildNumbersRange(PlanKey planKey,
int buildNumber,
boolean trueForSaveFalseForDelete)
Deprecated.
since 5.10
|
void |
invalidateLatestResultSummary(PlanResultKey key,
boolean resetAverageBuildDuration)
Resets the latest build summary of a plan.
|
void |
invalidateSpecsStateForPlan(@NotNull PlanKey planKey,
@Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource)
Invalidate specs state.
|
boolean |
isCacheEnabled() |
boolean |
isPlanBeingDeleted(PlanKey planKey) |
void |
leaveDeletionCodeSection()
Marks the current thread as no longer being able to see deleted plans.
|
void |
onStageDeleted(long stageId) |
void |
remove(@NotNull PlanKey planKey)
Removes the cached Plan and its metadata.
|
<V> V |
withHiddenPlans(Collection<PlanKey> planKeys,
Supplier<V> supplier)
Invokes supplier while marking the specified plan keys as unavailable.
|
@Nullable @Nullable ImmutableChain getImmutablePlanByKey(@NotNull @NotNull PlanKey planKey)
withHiddenPlans(Collection, Supplier)@NotNull <T extends ImmutablePlan> @NotNull Stream<T> getPlans(Class<T> planType, @NotNull @NotNull com.google.common.base.Predicate<? super T> filter)
planType - - the type of the plan to retrieveDescriptionProvider.getName()<V> V withHiddenPlans(Collection<PlanKey> planKeys, Supplier<V> supplier)
@Nullable @Nullable ImmutableChain getImmutableChainByKeyIfInCache(@NotNull @NotNull PlanKey planKey)
void invalidate(@NotNull
@NotNull PlanKey planKey)
planKey - key of the Plan to be removed from cachevoid cascadeInvalidate(@NotNull
@NotNull PlanKey planKey)
planKey - key of the Plan to be removed from cachevoid remove(@NotNull
@NotNull PlanKey planKey)
planKey - key of the Plan to be removed from cachevoid initialiseCache()
void disableCache()
void enableCache()
initialiseCache() instead if you expect plans to be loaded.boolean isCacheEnabled()
BambooCacheStats getCacheStats()
@Internal void getChainsToInvalidateAndReindex(ImmutablePlanCacheService.CacheInvalidator invalidator, Set<PlanKey> chainsToInvalidate, Set<PlanKey> chainsToReindex)
@NotNull @NotNull PlanCacheIndices getIndices()
@Deprecated @Internal @NotNull @NotNull Range<Integer> getBuildNumbersRange(PlanKey planKey)
@Deprecated @Internal void invalidateBuildNumbersRange(PlanKey planKey, int buildNumber, boolean trueForSaveFalseForDelete)
Stream<ImmutablePlan> getPlans(Predicate<ImmutablePlan> predicate)
Optional<ImmutableChain> getAnyPlan(Predicate<? super ImmutableChain> predicate)
predicate - void invalidateLatestResultSummary(PlanResultKey key, boolean resetAverageBuildDuration)
void invalidateAllLatestResultSummaries()
void invalidateSpecsStateForPlan(@NotNull
@NotNull PlanKey planKey,
@Nullable
@Nullable ImmutableVcsBambooSpecsSource immutableVcsBambooSpecsSource)
planKey - plan keyimmutableVcsBambooSpecsSource - new state@Internal
void indexPlan(@NotNull
@NotNull ImmutableChain plan)
void hideDeletedPlan(PlanKey planKey)
void hideDeletedStage(Long stageId)
boolean isPlanBeingDeleted(PlanKey planKey)
void enterDeletionCodeSection()
void leaveDeletionCodeSection()
@NotNull <T extends ImmutableJob> @NotNull Set<T> filterOutDeletedIfNeeded(@NotNull @NotNull Set<T> jobs)
@NotNull <T extends ImmutableChainStage> @NotNull List<T> filterOutDeletedIfNeeded(@NotNull @NotNull List<T> stages)
void onStageDeleted(long stageId)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.