/** * Gets status on the current task executing. */ public TaskStatus getTaskStatus(TaskState handle) throws RecordServiceException, IOException { validateIsConnected(); validateHandleIsActive(handle); LOG.debug("Calling getTaskStatus(): " + handle.handle_); TException firstException = null; boolean connected = true; for (int i = 0; i < maxAttempts_; ++i) { try { if (!connected) { connected = waitAndReconnect(); if (!connected) continue; } return new TaskStatus(workerClient_.GetTaskStatus(handle.handle_)); } catch (TException e) { if (firstException == null) firstException = e; connected = false; } } handleThriftException(firstException, "Could not call getTaskStatus."); throw new RuntimeException("Could not get task status."); }
try { if (!connected) { connected = waitAndReconnect(); if (!connected) continue;
try { if (!connected) { connected = waitAndReconnect(); if (!connected) continue;