DecayRpcScheduler implements RpcScheduler,
    DecayRpcSchedulerMXBean, MetricsSource { @VisibleForTesting public double getDecayFactor() { return decayFactor; } DecayRpcScheduler(int numLevels, String ns, Configuration conf); @Override int getPriorityLevel(Schedulable obj); @Override boolean shouldBackOff(Schedulable obj); @Override void addResponseTime(String name, int priorityLevel, int queueTime,
      int processingTime); @VisibleForTesting double getDecayFactor(); @VisibleForTesting long getDecayPeriodMillis(); @VisibleForTesting double[] getThresholds(); @VisibleForTesting void forceDecay(); @VisibleForTesting Map<Object, Long> getCallCountSnapshot(); @VisibleForTesting long getTotalCallSnapshot(); int getUniqueIdentityCount(); long getTotalCallVolume(); long getTotalRawCallVolume(); long[] getResponseTimeCountInLastWindow(); @Override double[] getAverageResponseTime(); @Override void getMetrics(MetricsCollector collector, boolean all); String getSchedulingDecisionSummary(); String getCallVolumeSummary(); @Override void stop(); static final String IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY; static final long IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_DEFAULT; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY; static final String IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY; static final double IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_DEFAULT; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY; static final String IPC_DECAYSCHEDULER_THRESHOLDS_KEY; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_THRESHOLDS_KEY; static final String DECAYSCHEDULER_UNKNOWN_IDENTITY; static final String IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_ENABLE_KEY; static final Boolean IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_ENABLE_DEFAULT; static final String IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_THRESHOLDS_KEY; static final String DECAYSCHEDULER_METRICS_TOP_USER_COUNT; static final int DECAYSCHEDULER_METRICS_TOP_USER_COUNT_DEFAULT; static final Logger LOG; }
@Test @SuppressWarnings("deprecation") public void testParseFactor() { scheduler = new DecayRpcScheduler(1, "", new Configuration()); assertEquals(DecayRpcScheduler.IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_DEFAULT, scheduler.getDecayFactor(), 0.00001); Configuration conf = new Configuration(); conf.set("prefix." + DecayRpcScheduler.IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY, "0.125"); scheduler = new DecayRpcScheduler(1, "prefix", conf); assertEquals(0.125, scheduler.getDecayFactor(), 0.00001); }