CandidateCrawlAction pollActionOrNull(StateVertex state) {
		LOG.debug("Polling action for state {}", state.getName());
		Lock lock = locks.get(state.getId());
		try {
			lock.lock();
			Queue<CandidateCrawlAction> queue = cache.get(state.getId());
			if (queue == null) {
				return null;
			} else {
				CandidateCrawlAction action = queue.poll();
				if (queue.isEmpty()) {
					LOG.debug("All actions polled for state {}", state.getName());
					cache.remove(state.getId());
					removeStateFromQueue(state.getId());
					LOG.debug("There are now {} states with unfinished actions", cache.size());
				}
				return action;
			}
		} finally {
			lock.unlock();
		}

	}
CandidateCrawlAction pollActionOrNull ( StateVertex state ) { LOG . debug ( "Polling action for state {}" , state . getName ( ) ) ; Lock lock = locks . get ( state . getId ( ) ) ; try { lock . lock ( ) ; Queue < CandidateCrawlAction > queue = cache . get ( state . getId ( ) ) ; if ( queue == null ) { return null ; } else { CandidateCrawlAction action = queue . poll ( ) ; if ( queue . isEmpty ( ) ) { LOG . debug ( "All actions polled for state {}" , state . getName ( ) ) ; cache . remove ( state . getId ( ) ) ; removeStateFromQueue ( state . getId ( ) ) ; LOG . debug ( "There are now {} states with unfinished actions" , cache . size ( ) ) ; } return action ; } } finally { lock . unlock ( ) ; } }
@param state The state you want to poll an {@link CandidateCrawlAction} for.
@return The next to-be-crawled action or <code>null</code> if none available.