Run the operation, only throwing an unchecked exception on failure

@param operation
@param <T>

@return

@throws RuntimeException
501659
public <T> T runUnchecked(Retryable<T> operation) throws RuntimeException
	{
		try
		{
			return run(operation);
		}
		catch (RuntimeException e)
		{
			throw e;
		}
		catch (Exception e)
		{
			throw new RuntimeException("Retryable " + operation + " failed: " + e.getMessage(), e);
		}
	}
1221259
public void execute(Runnable task, long timeoutMillis) throws RejectedExecutionException {
        if (task == null) {
            throw new NullPointerException("Cannot accept null task");
        }
        synchronized (this) {
            if (mState != STATE_RUNNING && mState != STATE_NOT_STARTED) {
                throw new RejectedExecutionException("Task queue is shutdown");
            }
        }
        try {
            if (!mQueue.offer(task, timeoutMillis, TimeUnit.MILLISECONDS)) {
                throw new RejectedExecutionException("Unable to enqueue task after waiting " +
                                                     timeoutMillis + " milliseconds");
            }
        } catch (InterruptedException e) {
            throw new RejectedExecutionException(e);
        }
    }
1192489
private function runOperation(Operation $operation)
    {
        try {
            return $this->runner->run($operation);
        } catch (\Throwable $e) {
            // treated below
        } catch (\Exception $e) {
            // treated below
        }

        // @todo keep only inner if once ExceptionCatcher is gone
        if ($this->exceptionCatcherVoter instanceof ThrowableCatcherVoter) {
            if (!$this->exceptionCatcherVoter->shouldCatchThrowable($e)) {
                throw $e;
            }
        } elseif (!$this->exceptionCatcherVoter->shouldCatch($e)) {
            throw $e;
        }

        try {
            $this->waitStrategy->wait();
        } catch (WaiterException $waiterException) {
            throw $e;
        }

        return $this->runOperation($operation);
    }
293102
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSBoolean secure_access_only_validator = new MPSBoolean();
		secure_access_only_validator.validate(operationType, secure_access_only, "\"secure_access_only\"");
		
		MPSString svm_ns_comm_validator = new MPSString();
		svm_ns_comm_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);
		svm_ns_comm_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		svm_ns_comm_validator.validate(operationType, svm_ns_comm, "\"svm_ns_comm\"");
		
		MPSString ns_br_interface_validator = new MPSString();
		ns_br_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);
		ns_br_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		ns_br_interface_validator.validate(operationType, ns_br_interface, "\"ns_br_interface\"");
		
		MPSBoolean vm_auto_poweron_validator = new MPSBoolean();
		vm_auto_poweron_validator.validate(operationType, vm_auto_poweron, "\"vm_auto_poweron\"");
		
		MPSString ns_br_interface_2_validator = new MPSString();
		ns_br_interface_2_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);
		ns_br_interface_2_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		ns_br_interface_2_validator.validate(operationType, ns_br_interface_2, "\"ns_br_interface_2\"");
		
		MPSInt init_status_validator = new MPSInt();
		init_status_validator.validate(operationType, init_status, "\"init_status\"");
		
	}
152375
@SuppressWarnings("unchecked")
  public <T extends CoreExecution> void performOperation(CoreAtomicOperation<T> operation) {
    LOG.debugPerformingAtomicOperation(operation, this);
    operation.execute((T) this);
  }
922155
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSInternetHost server_validator = new MPSInternetHost();
		server_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		server_validator.validate(operationType, server, "\"server\"");
		
		MPSInt minpoll_validator = new MPSInt();
		minpoll_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
		minpoll_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 6);
		minpoll_validator.validate(operationType, minpoll, "\"minpoll\"");
		
		MPSInt maxpoll_validator = new MPSInt();
		maxpoll_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
		maxpoll_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 17);
		maxpoll_validator.validate(operationType, maxpoll, "\"maxpoll\"");
		
		MPSInt key_id_validator = new MPSInt();
		key_id_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 0);
		key_id_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 65534);
		key_id_validator.validate(operationType, key_id, "\"key_id\"");
		
		MPSBoolean autokey_validator = new MPSBoolean();
		autokey_validator.validate(operationType, autokey, "\"autokey\"");
		
		MPSBoolean preferred_server_validator = new MPSBoolean();
		preferred_server_validator.validate(operationType, preferred_server, "\"preferred_server\"");
		
	}
432110
public static RuntimeException asRuntime(Throwable e) {
		if (e instanceof RuntimeException) {
			return (RuntimeException) e;
		} else {
			return new WrappedAsRuntimeException(e);
		}
	}
1147969
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString response_validator = new MPSString();
		response_validator.validate(operationType, response, "\"response\"");
		
	}
1182323
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString uuid_validator = new MPSString();
		uuid_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		uuid_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		uuid_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		uuid_validator.validate(operationType, uuid, "\"uuid\"");
		
		MPSBoolean enabled_validator = new MPSBoolean();
		enabled_validator.validate(operationType, enabled, "\"enabled\"");
		
		MPSInt number_of_cpu_validator = new MPSInt();
		number_of_cpu_validator.validate(operationType, number_of_cpu, "\"number_of_cpu\"");
		
		MPSDouble cpu_usage_validator = new MPSDouble();
		cpu_usage_validator.validate(operationType, cpu_usage, "\"cpu_usage\"");
		
		MPSDoubleLong memory_total_validator = new MPSDoubleLong();
		memory_total_validator.validate(operationType, memory_total, "\"memory_total\"");
		
		MPSDoubleLong memory_free_validator = new MPSDoubleLong();
		memory_free_validator.validate(operationType, memory_free, "\"memory_free\"");
		
		MPSDouble memory_usage_validator = new MPSDouble();
		memory_usage_validator.validate(operationType, memory_usage, "\"memory_usage\"");
		
		MPSDouble tx_validator = new MPSDouble();
		tx_validator.validate(operationType, tx, "\"tx\"");
		
		MPSDouble rx_validator = new MPSDouble();
		rx_validator.validate(operationType, rx, "\"rx\"");
		
		MPSString uptime_validator = new MPSString();
		uptime_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		uptime_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		uptime_validator.validate(operationType, uptime, "\"uptime\"");
		
		MPSInt ssl_cores_total_validator = new MPSInt();
		ssl_cores_total_validator.validate(operationType, ssl_cores_total, "\"ssl_cores_total\"");
		
		MPSInt ssl_cores_free_validator = new MPSInt();
		ssl_cores_free_validator.validate(operationType, ssl_cores_free, "\"ssl_cores_free\"");
		
	}
1320444
public void execute(Runnable job)
   {
      try
      {       
         executor.execute(job);
      }
      catch (RejectedExecutionException e)
      {
         log.warnf(e, "Job rejected: %s", job);
      }
   }
706808
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSString task_id_validator = new MPSString();
		task_id_validator.validate(operationType, task_id, "\"task_id\"");
		
		MPSIPAddress ip_address_validator = new MPSIPAddress();
		ip_address_validator.validate(operationType, ip_address, "\"ip_address\"");
		
		MPSInt starttime_validator = new MPSInt();
		starttime_validator.validate(operationType, starttime, "\"starttime\"");
		
		MPSInt endtime_validator = new MPSInt();
		endtime_validator.validate(operationType, endtime, "\"endtime\"");
		
		MPSString status_validator = new MPSString();
		status_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		status_validator.validate(operationType, status, "\"status\"");
		
	}
1344825
public static OperationResult failed(long index, long eventIndex, Throwable error) {
    return new OperationResult(index, eventIndex, error, null);
  }
1003593
public void performOpsAction(final Connection c, final long clientHandle, final OpsSelector selector,
            final ParameterSet params) throws Exception
    {
        m_es.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    collectStatsImpl(c, clientHandle, selector, params);
                } catch (Exception e) {
                    hostLog.warn("Exception while attempting to collect stats", e);
                    // ENG-14639, prevent clients like sqlcmd from hanging on exception
                    sendErrorResponse(c, ClientResponse.OPERATIONAL_FAILURE,
                            "Failed to get statistics (" + e.getMessage() + ").",
                            clientHandle);
                }
            }
        });
    }
1199908
@Override
    public CompletableFuture<Void> add(Operation operation, Duration timeout) {
        ensureRunning();
        return this.operationProcessor.process(operation);
    }
102295
private void run(ReportOperation operation) throws ReportException {
        Set<String> executedPlugins = new HashSet<>();
        run(selectedReportPlugins, operation, executedPlugins);
        run(defaultReportPlugins, operation, executedPlugins);
    }
1355837
public int run(String[] args) throws Exception {
    List<FileOperation> ops = new ArrayList<FileOperation>();
    Path logpath = null;
    boolean isIgnoreFailures = false;

    try {
      for (int idx = 0; idx < args.length; idx++) {
        if ("-f".equals(args[idx])) {
          if (++idx ==  args.length) {
            System.out.println("urilist_uri not specified");
            System.out.println(USAGE);
            return -1;
          }
          ops.addAll(fetchList(jobconf, new Path(args[idx])));
        } else if (Option.IGNORE_FAILURES.cmd.equals(args[idx])) {
          isIgnoreFailures = true;
        } else if ("-log".equals(args[idx])) {
          if (++idx ==  args.length) {
            System.out.println("logdir not specified");
            System.out.println(USAGE);
            return -1;
          }
          logpath = new Path(args[idx]);
        } else if ('-' == args[idx].codePointAt(0)) {
          System.out.println("Invalid switch " + args[idx]);
          System.out.println(USAGE);
          ToolRunner.printGenericCommandUsage(System.out);
          return -1;
        } else {
          ops.add(new FileOperation(args[idx]));
        }
      }
      // mandatory command-line parameters
      if (ops.isEmpty()) {
        throw new IllegalStateException("Operation is empty");
      }
      LOG.info("ops=" + ops);
      LOG.info("isIgnoreFailures=" + isIgnoreFailures);
      jobconf.setBoolean(Option.IGNORE_FAILURES.propertyname, isIgnoreFailures);
      check(jobconf, ops);

      try {
        if (setup(ops, logpath)) {
          JobClient.runJob(jobconf);
        }
      } finally {
        try {
          if (logpath == null) {
            //delete log directory
            final Path logdir = FileOutputFormat.getOutputPath(jobconf);
            if (logdir != null) {
              logdir.getFileSystem(jobconf).delete(logdir, true);
            }
          }
        }
        finally {
          //delete job directory
          final String jobdir = jobconf.get(JOB_DIR_LABEL);
          if (jobdir != null) {
            final Path jobpath = new Path(jobdir);
            jobpath.getFileSystem(jobconf).delete(jobpath, true);
          }
        }
      }
    } catch(DuplicationException e) {
      LOG.error("Input error:", e);
      return DuplicationException.ERROR_CODE;
    } catch(Exception e) {
      LOG.error(NAME + " failed: ", e);
      System.out.println(USAGE);
      ToolRunner.printGenericCommandUsage(System.out);
      return -1;
    }
    return 0;
  }
1257728
Object runOp(Op op) {
        LOG.debug("Run: {}", op);
        recursive.set(Boolean.TRUE);
        try {
            if (op.type == Op.Type.PUT || op.type == Op.Type.ALLOC)
                return execOp(op, null);

            final long id = op.line;
            CacheLine line = getLine(id);
            if (line == null) {
                Object res = handleOpNoLine(op.type, op.line, op.getExtra());
                if (res != DIDNT_HANDLE)
                    return res;
                else
                    line = createNewCacheLine(op);
            }

            final Object res;
            synchronized (line) {
                res = execOp(op, line);
            }

            receiveShortCircuit();

            if (res instanceof Op)
                return runOp((Op) res);
            return res;
        } finally {
            recursive.remove();
        }
    }