code: public void scheduleIndexManagement(String indexPrefix, int optimizeAndMoveIndicesToColdNodesOlderThanDays, int deleteIndicesOlderThanDays) {
  		if (deleteIndicesOlderThanDays > 0) {
  			final TimerTask deleteIndicesTask = new DeleteIndicesTask(corePlugin.getIndexSelector(), indexPrefix,
  					deleteIndicesOlderThanDays, this);
  			timer.schedule(deleteIndicesTask, TimeUnit.SECONDS.toMillis(5), DateUtils.getDayInMillis());
  		}
  
  		if (optimizeAndMoveIndicesToColdNodesOlderThanDays > 0) {
  			final TimerTask shardAllocationTask = new ShardAllocationTask(corePlugin.getIndexSelector(), indexPrefix,
  					optimizeAndMoveIndicesToColdNodesOlderThanDays, this, "cold");
  			timer.schedule(shardAllocationTask, TimeUnit.SECONDS.toMillis(5), DateUtils.getDayInMillis());
  		}
  
  		if (optimizeAndMoveIndicesToColdNodesOlderThanDays > 0) {
  			final TimerTask optimizeIndicesTask = new ForceMergeIndicesTask(corePlugin.getIndexSelector(), indexPrefix,
  					optimizeAndMoveIndicesToColdNodesOlderThanDays, this);
  			timer.schedule(optimizeIndicesTask, DateUtils.getNextDateAtHour(3), DateUtils.getDayInMillis());
  		}
  
  	}
docs: Performs an optimize and delete on logstash-style index patterns [prefix]YYYY.MM.DD
  
  @param indexPrefix the prefix of the logstash-style index pattern