docs: @SuppressWarnings("unchecked")
  	private Operation detection(Session session,String[] clusterJobInstanceNames,String currentInstanceName) {
  		Query query=session.createQuery("from "+Heartbeat.class.getName()+" b order by b.date desc");
  		List<Heartbeat> heartbeats=query.setMaxResults(1).list();
  		int currentPos=getPosition(clusterJobInstanceNames, currentInstanceName)+1;
  		if(heartbeats.size()>0){
  			Date now=new Date();
  			Heartbeat heartbeat=heartbeats.get(0);
  			Date beatDate=heartbeat.getDate();
  			Calendar beatCalendar=Calendar.getInstance();
  			beatCalendar.setTime(beatDate);
  			String beatInstanceName=heartbeat.getInstanceName();
  			int secondUnit=40;
  			int beatPos=getPosition(clusterJobInstanceNames, beatInstanceName)+1;
  			if(!currentInstanceName.equals(beatInstanceName)){
  				int currentSecond=currentPos*secondUnit;
  				if(currentPos>beatPos){
  					beatCalendar.add(Calendar.SECOND,currentSecond);
  				}else if(currentPos<beatPos){
  					currentSecond=(currentPos+(clusterJobInstanceNames.length-beatPos))*secondUnit;
  					beatCalendar.add(Calendar.SECOND,currentSecond);
  				}
  			}else{
  				beatCalendar.add(Calendar.SECOND,secondUnit*clusterJobInstanceNames.length);				
  			}
  			if(now.compareTo(beatCalendar.getTime())>0){
  				//当前时间大于心跳时间+currentSecond,说明当前运行JOB的实例挂了
  				return Operation.reset;
  			}
  		}else{
  			if(currentPos==1)return Operation.reset;
  		}
  		return Operation.donothing;
  	}