@Autowired public PurgeServiceImpl(IncrementalPurger purger, InsightConfig config, CommandService cmdService, HibernateCachePurgeableRepo hibernateCache, NanoTimeService timeService) { this.incrementalPurger = purger; this.defaultMSAged = Time.inMillis(config.getDataExpiryMS()); this.defaultTraceBatchSize = config.getDataPurgeTraceBatchSize(); this.defaultTraceMemoryThreshold = config.getMaxTraceMemory(); this.defaultResourceBatchSize = config.getDataPurgeResourceBatchSize(); this.cmdSrv = cmdService; this.hiberCache = hibernateCache; this.timeSvc = timeService; executor = getExecutor(); }
@Override public boolean equals(Object obj) { if (obj == null) return false; if (this == obj) return true; if (getClass() != obj.getClass()) return false; InsightConfig other=(InsightConfig) obj; return (getDataExpiryMS() == other.getDataExpiryMS()) && (getDataPurgeInterval() == other.getDataPurgeInterval()) && (getMaxTraceMemory() == other.getMaxTraceMemory()) && (getDataPurgeResourceBatchSize() == other.getDataPurgeResourceBatchSize()) && (getDataPurgeTraceBatchSize() == other.getDataPurgeTraceBatchSize()) && (getMaxTracesReceivedPerMinute() == other.getMaxTracesReceivedPerMinute()) && ObjectUtil.typedEquals(getMetricMaxGranularity(), getMetricMaxGranularity()) && ObjectUtil.typedEquals(getThisServer(), other.getThisServer()) && ObjectUtil.typedEquals(getDataPurgeIntervalTime(), other.getDataPurgeIntervalTime()) && ListUtil.compareCollections(getExcludeTraceByPath(), other.getExcludeTraceByPath()) && (FileUtil.compareByAbsolutePath(getConfigDir(), other.getConfigDir()) == 0) && (FileUtil.compareByAbsolutePath(getDataDir(), other.getDataDir()) == 0) ; }
@Override public int hashCode() { return MathUtil.hashValue(getDataExpiryMS()) + MathUtil.hashValue(getDataPurgeInterval()) + MathUtil.hashValue(getMaxTraceMemory()) + getDataPurgeResourceBatchSize() + getDataPurgeTraceBatchSize() + getMaxTracesReceivedPerMinute() + ObjectUtil.hashCode(getMetricMaxGranularity()) + ObjectUtil.hashCode(getThisServer()) + ObjectUtil.hashCode(getDataPurgeIntervalTime()) + ListUtil.size(getExcludeTraceByPath()) // NOT using the hash since order may vary // NOT included in hash since absolute name may vary ... getConfigDir().hashCode() // NOT included in hash since absolute name may vary ... getDataDir().hashCode() ; }