/*
(non-Javadoc)

@see
org.duracloud.mill.workman.TaskProcessorFactory#isSupported(org.duracloud
.common.queue.task.Task)
970849
@Override
    public boolean isSupported(Task task) {
        return task.getType().equals(Task.Type.BIT_REPORT);
    }
1180822
protected boolean hasOngoingTransaction() {
		if(!isSupervisedMode()) {
			return false;
		} else {
			if(ongoingTransactions != null) {
				for (Transaction transaction : ongoingTransactions) {
					if(TransactionState.CALLING.equals(transaction.getState()) ||
						TransactionState.TRYING.equals(transaction.getState()) ||
						TransactionState.PROCEEDING.equals(transaction.getState()) ||
						TransactionState.COMPLETED.equals(transaction.getState()) ||
						TransactionState.CONFIRMED.equals(transaction.getState())) {
							return true;
					}
				}
			}
			return false;
		}
	}
762309
public boolean isSupportedByServer()
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(NAMESPACE);
    }
180773
@SuppressWarnings("deprecation")
  private boolean completedTaskUnprotected(TaskInProgress tip, TaskStatus status,
      TaskTrackerInfo ttStatus) {
    int oldNumAttempts = tip.getActiveTasks().size();
    // Metering
    meterTaskAttemptUnprotected(tip, status);

    // It _is_ safe to not decrement running{Map|Reduce}Tasks and
    // finished{Map|Reduce}Tasks variables here because one and only
    // one task-attempt of a TIP gets to completedTask. This is because
    // the TaskCommitThread in the JobTracker marks other, completed,
    // speculative tasks as _complete_.
    TaskAttemptID taskId = status.getTaskID();
    if (tip.isComplete()) {
      // Mark this task as KILLED
      tip.alreadyCompletedTask(taskId);
      return false;
    }

    LOG.info("Task '" + taskId + "' has completed " + tip.getTIPId() +
           " successfully.");
    // Mark the TIP as complete
    tip.completed(taskId);

    // Update jobhistory
    String taskType = getTaskType(tip);
    if (status.getIsMap()){
      jobHistory.logMapTaskStarted(status.getTaskID(), status.getStartTime(),
                                       status.getTaskTracker(),
                                       ttStatus.getHttpPort(),
                                       taskType);
      jobHistory.logMapTaskFinished(status.getTaskID(), status.getFinishTime(),
                                        ttStatus.getHost(), taskType,
                                        status.getStateString(),
                                        status.getCounters());
    }else{
      jobHistory.logReduceTaskStarted( status.getTaskID(), status.getStartTime(),
                                          status.getTaskTracker(),
                                          ttStatus.getHttpPort(),
                                          taskType);
      jobHistory.logReduceTaskFinished(status.getTaskID(), status.getShuffleFinishTime(),
                                           status.getSortFinishTime(), status.getFinishTime(),
                                           ttStatus.getHost(),
                                           taskType,
                                           status.getStateString(),
                                           status.getCounters());
    }
    jobHistory.logTaskFinished(tip.getTIPId(),
                                taskType,
                                tip.getExecFinishTime(),
                                status.getCounters());

    int newNumAttempts = tip.getActiveTasks().size();
    if (tip.isJobSetupTask()) {
      // setup task has finished. kill the extra setup tip
      killSetupTipUnprotected(!tip.isMapTask());
      setupCompleteUnprotected();
    } else if (tip.isJobCleanupTask()) {
      // cleanup task has finished. Kill the extra cleanup tip
      if (tip.isMapTask()) {
        // kill the reduce tip
        cleanup[1].kill();
      } else {
        cleanup[0].kill();
      }

      if (jobFailed) {
        terminateJob(JobStatus.FAILED);
      } else if (jobKilled) {
        terminateJob(JobStatus.KILLED);
      } else {
        jobCompleteUnprotected();
      }
    } else if (tip.isMapTask()) {
      runningMapTasks--;
      // Update locality counters.
      long inputBytes = tip.getCounters()
                .getGroup("org.apache.hadoop.mapred.Task$Counter")
                .getCounter("Map input bytes");
      jobStats.incTotalMapInputBytes(inputBytes);
      localityStats.record(tip, ttStatus.getHost(), inputBytes);
      // check if this was a speculative task.
      if (oldNumAttempts > 1) {
        speculativeMapTasks -= (oldNumAttempts - newNumAttempts);
        jobStats.incNumSpeculativeSucceededMaps();
      }
      finishedMapTasks += 1;
      jobStats.incNumMapTasksCompleted();
      if (!tip.isJobSetupTask() && hasSpeculativeMaps) {
        updateTaskTrackerStats(tip,ttStatus,trackerMapStats,mapTaskStats);
      }
      // remove the completed map from the resp running caches
      retireMapUnprotected(tip);
      if ((finishedMapTasks + failedMapTIPs) == (numMapTasks)) {
        this.status.setMapProgress(1.0f);
      }
    } else {
      runningReduceTasks -= 1;
      if (oldNumAttempts > 1) {
        speculativeReduceTasks -= (oldNumAttempts - newNumAttempts);
        jobStats.incNumSpeculativeSucceededReduces();
      }
      finishedReduceTasks += 1;
      jobStats.incNumReduceTasksCompleted();
      if (!tip.isJobSetupTask() && hasSpeculativeReduces) {
        updateTaskTrackerStats(tip,ttStatus,trackerReduceStats,reduceTaskStats);
      }
      // remove the completed reduces from the running reducers set
      retireReduceUnprotected(tip);
      if ((finishedReduceTasks + failedReduceTIPs) == (numReduceTasks)) {
        this.status.setReduceProgress(1.0f);
      }
    }

    // is job complete?
    if (!jobSetupCleanupNeeded && canLaunchJobCleanupTaskUnprotected()) {
      jobCompleteUnprotected();
    }

    return true;
  }
812980
protected boolean checkSupportedMessageTypes(Message msg) {
        if (msg instanceof TextMessage) {
            return true;
        } else {
            try {
                log.error("Unsupported message type: " + msg.getJMSType());
            } catch (JMSException ignore) {
            }
            sendToInvalidMessageQueue(msg);
            return false;
        }
    }
1096064
@Override
    public boolean isPresent(int accessor) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.entry(this, tc, "isPresent", new Object[] { Integer.valueOf(accessor) });

        boolean result;
        checkIndex(accessor);

        synchronized (getMessageLockArtefact()) {
            if (cache[accessor] != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    JmfTr.exit(this, tc, "isPresent", Boolean.TRUE);
                return true;
            }

            // If it's not in the cache and the message isn't assembled it can't be present
            if (contents == null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    JmfTr.exit(this, tc, "isPresent", Boolean.FALSE);
                return false;
            }

            // For an assembled message, the subclass's getFieldDef method should answer the question.
            result = getFieldDef(accessor, true) != null;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.exit(this, tc, "isPresent", Boolean.valueOf(result));
        return result;
    }
5986
public function isSupported($zVersion, $comparator)
    {
        if (version_compare($zVersion, Version::VERSION, $comparator) === true) {
            return true;
        }

        return false;
    }
594694
private void setAsyncSupported(AsyncSupportedDescriptor asyncSupportedDescriptor, TrueFalseType asyncSupported) {
        if (asyncSupported != null) {
            asyncSupportedDescriptor.setAsyncSupported(asyncSupported.isValue());
        }
    }
613440
public boolean isPushSupported() {
    String version = android.os.Build.VERSION.RELEASE.substring(0, 3);
    return (Double.valueOf(version) >= MIN_SUPPORTED_ANDRIOD_VERSION);
  }
1039185
public static final void assertTaskUncompleted(final String taskId) {
        Validate.notNull(taskId);

        apiCallback.debug(LogMessage.TASK_2, taskId);
        try {
            getTaskInstanceAssertable().taskIsUncompleted(taskId);
        } catch (final AssertionError ae) {
            apiCallback.fail(ae, LogMessage.ERROR_TASK_2, taskId);
        }
    }
748547
public boolean isSupported(Jid jid) throws SmackException, XMPPException, InterruptedException {
        return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(jid,
                        DeliveryReceipt.NAMESPACE);
    }
804006
func IsSupported(sv *hcsschema.Version) error {
	if IsV10(sv) {
		return nil
	}
	if IsV21(sv) {
		if osversion.Get().Build < osversion.RS5 {
			return fmt.Errorf("unsupported on this Windows build")
		}
		return nil
	}
	return fmt.Errorf("unknown schema version %s", String(sv))
}
158138
public static boolean isSupportedRasterExtension( String name ) {
        for( String ext : supportedRasters ) {
            if (name.toLowerCase().endsWith(ext)) {
                return true;
            }
        }
        return false;
    }
999249
private boolean isServiceSupportedInRegion(String serviceName) {
        return partition.getServices().get(serviceName) != null
                && partition.getServices().get(serviceName).getEndpoints()
                .containsKey(region);
    }
1328030
public static boolean isFixedDelay(final Object task) {

        if (task instanceof Task) {
            final Task ltask = (Task) task;

            return (!ltask.relative && ltask.period > 0);
        } else {
            return false;
        }
    }
1063218
private boolean isTaskRunning(TaskStatus taskStatus) {
    TaskStatus.State state = taskStatus.getRunState();
    return (state == State.RUNNING || state == State.UNASSIGNED || 
            taskStatus.inTaskCleanupPhase());
  }
473665
private boolean isRelated(Task task, List<Relation> list)
   {
      boolean result = false;
      for (Relation relation : list)
      {
         if (relation.getTargetTask().getUniqueID().intValue() == task.getUniqueID().intValue())
         {
            result = true;
            break;
         }
      }
      return result;
   }