Examples of OperationResult


Examples of com.google.appengine.api.search.OperationResult

      List<OperationResult> results) {
    List<String> failedIds = new ArrayList<String>();
    Iterator<OperationResult> opIter = results.iterator();
    Iterator<String> idIter = docIdList.iterator();
    while (opIter.hasNext() && idIter.hasNext()) {
      OperationResult result = opIter.next();
      String docId = idIter.next();
      if (!StatusCode.OK.equals(result.getCode())) {
        failedIds.add(docId);
      }
    }
    return failedIds;
  }
View Full Code Here

Examples of com.netflix.astyanax.connectionpool.OperationResult

        }

        Rows<ByteBuffer, ByteBuffer> result;
        try {
            /* Note: we need to fetch columns for each row as well to remove "range ghosts" */
            OperationResult op = allRowsQuery.setRowLimit(storeManager.getPageSize()) // pre-fetch that many rows at a time
                    .setConcurrencyLevel(1) // one execution thread for fetching portion of rows
                    .setExceptionCallback(new ExceptionCallback() {
                        private int retries = 0;

                        @Override
View Full Code Here

Examples of net.sf.jmatchparser.template.engine.operation.Operation.OperationResult

    List<String> lastFailTemplatePositions = new ArrayList<String>();
    List<String> sideEffectBlockedTemplatePositions = new ArrayList<String>();
    ParserState finishedState = null;
    while (queuedStates.size() > 0) {
      ParserState current = queuedStates.remove(0);
      OperationResult opres = OperationResult.CONTINUE;
      while (opres == OperationResult.CONTINUE) {
        int ip = current.getNextInstructionAndIncrement();
        Operation op = template.getOperation(ip);
        try {
          opres = op.execute(current);
View Full Code Here

Examples of net.sf.katta.operation.node.OperationResult

    public void run() {
      try {
        while (_nodeContext.getNode().isRunning()) {
          try {
            NodeOperation operation = _queue.peek();
            OperationResult operationResult;
            try {
              LOG.info("executing " + operation);
              operationResult = operation.execute(_nodeContext);
            } catch (Exception e) {
              ExceptionUtil.rethrowInterruptedException(e);
              LOG.error(_nodeContext.getNode().getName() + ": failed to execute " + operation, e);
              operationResult = new OperationResult(_nodeContext.getNode().getName(), e);
            }
            _queue.complete(operationResult);// only remove after finish
          } catch (Throwable e) {
            ExceptionUtil.rethrowInterruptedException(e);
            LOG.fatal(_nodeContext.getNode().getName() + ": operation failure ", e);
View Full Code Here

Examples of org.apache.camel.component.zookeeper.operations.OperationResult

            if (isDelete) {
                if (log.isDebugEnabled()) {
                    log.debug(format("Deleting znode '%s', waiting for confirmation", context.node));
                }

                OperationResult result = synchronouslyDelete(context);
                if (configuration.isListChildren()) {
                    result = listChildren(context);
                }
                updateExchangeWithResult(context, result);
            } else {
                if (log.isDebugEnabled()) {
                    log.debug(format("Storing data to znode '%s', waiting for confirmation", context.node));
                }

                OperationResult result = synchronouslySetData(context);
                if (configuration.isListChildren()) {
                    result = listChildren(context);
                }
                updateExchangeWithResult(context, result);
            }
View Full Code Here

Examples of org.apache.camel.component.zookeeper.operations.OperationResult

    private OperationResult synchronouslySetData(ProductionContext ctx) throws Exception {

        SetDataOperation setData = new SetDataOperation(ctx.connection, ctx.node, ctx.payload);
        setData.setVersion(ctx.version);

        OperationResult result = setData.get();

        if (!result.isOk() && configuration.shouldCreate() && result.failedDueTo(Code.NONODE)) {
            log.warn(format("Node '%s' did not exist, creating it.", ctx.node));
            result = createNode(ctx);
        }
        return result;
    }
View Full Code Here

Examples of org.apache.camel.component.zookeeper.operations.OperationResult

    private OperationResult synchronouslyDelete(ProductionContext ctx) throws Exception {
        DeleteOperation setData = new DeleteOperation(ctx.connection, ctx.node);
        setData.setVersion(ctx.version);

        OperationResult result = setData.get();

        if (!result.isOk() && configuration.shouldCreate() && result.failedDueTo(Code.NONODE)) {
            log.warn(format("Node '%s' did not exist, creating it.", ctx.node));
            result = createNode(ctx);
        }
        return result;
    }
View Full Code Here

Examples of org.apache.camel.component.zookeeper.operations.OperationResult

                } catch (InterruptedException e) {
                    continue;
                }
                String node = current.getNode();
                try {
                    OperationResult result = current.get();
                    if (ZooKeeperUtils.hasWatchedEvent(current)) {
                        watchedEvent = ZooKeeperUtils.getWatchedEvent(current);
                    }
                    if (result != null && current.shouldProduceExchange()) {
                        getProcessor().process(createExchange(node, result, watchedEvent));
View Full Code Here

Examples of org.jboss.as.controller.OperationResult

     * {@link OperationHandler} reading a single attribute at the given operation address. The required request parameter "name" represents the attribute name.
     */
    public static class ReadAttributeHandler implements ModelQueryOperationHandler {
        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
            OperationResult handlerResult = new BasicOperationResult();

            final String attributeName = operation.require(NAME).asString();
            final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(address, attributeName);
            if (attributeAccess == null) {
View Full Code Here

Examples of org.jboss.as.controller.OperationResult

     * {@link OperationHandler} writing a single attribute. The required request parameter "name" represents the attribute name.
     */
    public static class WriteAttributeHandler implements ModelUpdateOperationHandler {
        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
            OperationResult handlerResult = null;

            final String attributeName = operation.require(NAME).asString();
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(PathAddress.pathAddress(operation.get(OP_ADDR)), attributeName);
            if (attributeAccess == null) {
                throw new OperationFailedException(new ModelNode().set("No known attribute called " + attributeName)); // TODO i18n
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.