Package org.apache.tez.dag.api

Examples of org.apache.tez.dag.api.TezUncheckedException


    T instance;
    try {
      Constructor<T> constructor = clazz.getConstructor(parameterTypes);
      instance = constructor.newInstance(parameters);
    } catch (InstantiationException e) {
      throw new TezUncheckedException(
          "Unable to instantiate class with " + parameters.length + " arguments: " + clazz.getName(), e);
    } catch (IllegalAccessException e) {
      throw new TezUncheckedException(
          "Unable to instantiate class with " + parameters.length + " arguments: " + clazz.getName(), e);
    } catch (NoSuchMethodException e) {
      throw new TezUncheckedException(
          "Unable to instantiate class with " + parameters.length + " arguments: " + clazz.getName(), e);
    } catch (InvocationTargetException e) {
      throw new TezUncheckedException(
          "Unable to instantiate class with " + parameters.length + " arguments: " + clazz.getName(), e);
    }
    return instance;
  }
View Full Code Here


      Class<?> sysClass = URLClassLoader.class;
      Method method;
      try {
        method = sysClass.getDeclaredMethod("addURL", parameters);
      } catch (SecurityException e) {
        throw new TezUncheckedException("Failed to get handle on method addURL", e);
      } catch (NoSuchMethodException e) {
        throw new TezUncheckedException("Failed to get handle on method addURL", e);
      }
      method.setAccessible(true);
      sysClassLoaderMethod = method;
    }
    for (URL url : urls) {
      try {
        sysClassLoaderMethod.invoke(sysLoader, new Object[] { url });
      } catch (IllegalArgumentException e) {
        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
      } catch (IllegalAccessException e) {
        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
      } catch (InvocationTargetException e) {
        throw new TezUncheckedException("Failed to invoke addURL for rsrc: " + url, e);
      }
    }
  }
View Full Code Here

      case VERTEX_ERROR:
        return VertexStatus.State.ERROR;
      case VERTEX_TERMINATING:
        return VertexStatus.State.TERMINATING;
      default:
        throw new TezUncheckedException(
            "Unsupported value for VertexStatus.State : " + stateProto);
    }
  }
View Full Code Here

    case DAG_KILLED:
      return DAGStatus.State.KILLED;
    case DAG_ERROR:
      return DAGStatus.State.ERROR;
    default:
      throw new TezUncheckedException("Unsupported value for DAGStatus.State : " +
                              proxy.getState());
    }
  }
View Full Code Here

  private void processDataMovementEvent(DataMovementEvent dmEvent) throws IOException {
    DataMovementEventPayloadProto shufflePayload;
    try {
      shufflePayload = DataMovementEventPayloadProto.parseFrom(ByteString.copyFrom(dmEvent.getUserPayload()));
    } catch (InvalidProtocolBufferException e) {
      throw new TezUncheckedException("Unable to parse DataMovementEvent payload", e);
    }
    int partitionId = dmEvent.getSourceIndex();
    LOG.info("DataMovementEvent partitionId:" + partitionId + ", targetIndex: " + dmEvent.getTargetIndex()
        + ", attemptNum: " + dmEvent.getVersion() + ", payload: " + ShuffleUtils.stringify(shufflePayload));
    // TODO NEWTEZ See if this duration hack can be removed.
    int duration = shufflePayload.getRunDuration();
    if (duration > maxMapRuntime) {
      maxMapRuntime = duration;
      scheduler.informMaxMapRunTime(maxMapRuntime);
    }
    if (shufflePayload.hasEmptyPartitions()) {
      try {
        byte[] emptyPartitions = TezCommonUtils.decompressByteStringToByteArray(shufflePayload.getEmptyPartitions());
        BitSet emptyPartitionsBitSet = TezUtilsInternal.fromByteArray(emptyPartitions);
        if (emptyPartitionsBitSet.get(partitionId)) {
          InputAttemptIdentifier srcAttemptIdentifier =
              new InputAttemptIdentifier(dmEvent.getTargetIndex(), dmEvent.getVersion());
          LOG.info("Source partition: " + partitionId + " did not generate any data. SrcAttempt: ["
              + srcAttemptIdentifier + "]. Not fetching.");
          scheduler.copySucceeded(srcAttemptIdentifier, null, 0, 0, 0, null);
          return;
        }
      } catch (IOException e) {
        throw new TezUncheckedException("Unable to set " +
                "the empty partition to succeeded", e);
      }
    }

    InputAttemptIdentifier srcAttemptIdentifier =
View Full Code Here

    this.credentials = dagCredentials;
    if (this.credentials == null) {
      try {
        dagUGI = UserGroupInformation.getCurrentUser();
      } catch (IOException e) {
        throw new TezUncheckedException("Failed to set UGI for dag based on currentUser", e);
      }
    } else {
      dagUGI = UserGroupInformation.createRemoteUser(this.userName);
      dagUGI.addCredentials(this.credentials);
    }
View Full Code Here

        }
        for (Map.Entry<String, OutputCommitter> entry : outputCommitters.entrySet()) {
          LOG.info("Committing output: " + entry.getKey() + " for vertex: "
              + vertex.getVertexId());
          if (vertex.getState() != VertexState.SUCCEEDED) {
            throw new TezUncheckedException("Vertex: " + vertex.getName() +
                " not in SUCCEEDED state. State= " + vertex.getState());
          }
          if (!commitOutput(entry.getKey(), entry.getValue())) {
            failedWhileCommitting = true;
            break;
View Full Code Here

      case ERROR:
        return DAGStatus.State.ERROR;
      case TERMINATING:
        return DAGStatus.State.KILLED;
      default:
        throw new TezUncheckedException("Unknown DAGState: " + finalState);
    }
  }
View Full Code Here

        Math.min(inputContext.getTotalMemoryAvailableToTask(), Integer.MAX_VALUE)) * maxInMemCopyUse);

    float maxRedPer = conf.getFloat(TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_POST_MERGE_BUFFER_PERCENT,
        TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_BUFFER_PERCENT_DEFAULT);
    if (maxRedPer > 1.0 || maxRedPer < 0.0) {
      throw new TezUncheckedException(TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_POST_MERGE_BUFFER_PERCENT + maxRedPer);
    }
    // TODO maxRedBuffer should be a long.
    int maxRedBuffer = (int) Math.min(inputContext.getTotalMemoryAvailableToTask() * maxRedPer,
        Integer.MAX_VALUE);
    // Figure out initial memory req end
View Full Code Here

      LOG.info("Initial Shuffle Memory Required: " + memLimit + ", based on INPUT_BUFFER_factor: " + maxInMemCopyUse);

      float maxRedPer = conf.getFloat(TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_POST_MERGE_BUFFER_PERCENT,
          TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_BUFFER_PERCENT_DEFAULT);
      if (maxRedPer > 1.0 || maxRedPer < 0.0) {
        throw new TezUncheckedException(TezRuntimeConfiguration.TEZ_RUNTIME_INPUT_POST_MERGE_BUFFER_PERCENT + maxRedPer);
      }
      // TODO maxRedBuffer should be a long.
      int maxRedBuffer = (int) Math.min(maxAvailableTaskMemory * maxRedPer,
          Integer.MAX_VALUE);
      LOG.info("Initial Memory required for final merged output: " + maxRedBuffer + ", using factor: " + maxRedPer);
View Full Code Here

TOP

Related Classes of org.apache.tez.dag.api.TezUncheckedException

Copyright © 2018 www.massapicom. 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.