public PrefetchingBehavior(PrefetchingUser prefetchingUser, WorkContext context, BaseBatchSizeAutoTuner autoTuner) { this.context = context; this.autoTuner = autoTuner; PrefetchingUser = prefetchingUser; MemoryStatistics.RegisterLowMemoryHandler(this); }
public PrefetchingBehavior CreatePrefetchingBehavior( PrefetchingUser user, BaseBatchSizeAutoTuner autoTuner, string prefetchingUserDescription, HashSet <string> entityNames = null, bool isDefault = false) { lock (this) { var newPrefetcher = new PrefetchingBehavior(user, workContext, autoTuner ?? new IndependentBatchSizeAutoTuner(workContext, user), prefetchingUserDescription, entityNames, isDefault, GetPrefetchintBehavioursCount, GetPrefetchingBehaviourSummary); prefetchingBehaviors = new List <PrefetchingBehavior>(prefetchingBehaviors) { newPrefetcher }; return(newPrefetcher); } }
public PrefetchingBehavior CreatePrefetchingBehavior(PrefetchingUser user, BaseBatchSizeAutoTuner autoTuner, string prefetchingUserDescription) { lock (this) { var newPrefetcher = new PrefetchingBehavior(user, workContext, autoTuner ?? new IndependentBatchSizeAutoTuner(workContext, user), prefetchingUserDescription); prefetchingBehaviors = new List <PrefetchingBehavior>(prefetchingBehaviors) { newPrefetcher }; return(newPrefetcher); } }
public PrefetchingBehavior GetPrefetchingBehavior(PrefetchingUser user, BaseBatchSizeAutoTuner autoTuner) { PrefetchingBehavior value; if (prefetchingBehaviors.TryGetValue(user, out value)) { return(value); } lock (this) { if (prefetchingBehaviors.TryGetValue(user, out value)) { return(value); } value = new PrefetchingBehavior(workContext, autoTuner ?? new IndependentBatchSizeAutoTuner(workContext)); prefetchingBehaviors = new Dictionary <PrefetchingUser, PrefetchingBehavior>(prefetchingBehaviors) { { user, value } }; return(value); } }
public PrefetchingBehavior(PrefetchingUser prefetchingUser, WorkContext context, BaseBatchSizeAutoTuner autoTuner) { this.context = context; this.autoTuner = autoTuner; PrefetchingUser = prefetchingUser; }