Package org.apache.uima.ducc.common

Examples of org.apache.uima.ducc.common.NodeIdentity


    String methodName = "startService";
    logger.trace(methodName, null, messages.fetch("enter"));
    try {
      OrchestratorHelper.assignDefaults(duccEvent);
      JobRequestProperties properties = (JobRequestProperties) duccEvent.getProperties();
      NodeIdentity nodeIdentity = hostManager.getNode();
      if(!isSignatureValid(properties)) {
        String error_message = messages.fetch(" type=authentication error, text=signature not valid.");
        logger.error(methodName, null, error_message);
        submitError(properties, error_message);
      }
      else if(nodeIdentity == null) {
        String error_message = messages.fetch(" type=system error, text=job driver node unavailable.");
        logger.error(methodName, null, error_message);
        submitError(properties, error_message);
      }
      else if(!SystemState.getInstance().isAcceptJobs()) {
        String error_message = messages.fetch(" type=system error, text=system is not accepting new work at this time.");
        logger.error(methodName, null, error_message);
        submitError(properties, error_message);
      }
      else {
        logger.debug(methodName, null, messages.fetch("job driver host")+" "+messages.fetchLabel("IP")+nodeIdentity.getIp()+" "+messages.fetchLabel("name")+nodeIdentity.getName());
        if(Validate.request(duccEvent)) {
          DuccWorkJob duccWorkJob = jobFactory.create(common,properties);
          long t0 = System.currentTimeMillis();
          workMap.addDuccWork(duccWorkJob);
          long t1 = System.currentTimeMillis();
View Full Code Here


    if(map != null) {
      Iterator<Entry<DuccId, IDuccProcess>> iterator = map.entrySet().iterator();
      if(iterator.hasNext()) {
        Entry<DuccId, IDuccProcess> entry = iterator.next();
        IDuccProcess jp = entry.getValue();
        NodeIdentity nodeIdentity = jp.getNodeIdentity();
        String ip = nodeIdentity.getIp();
        String name = nodeIdentity.getName();
        String details = "ip:"+ip+" "+"name:"+name+" "+"jp-count:"+map.size();
        log(exchange, defaultLogType, exchId, event, details);
        timex(exchange, exchId, event);
      }
      else {
View Full Code Here

        System.out.println("Unable to Launch Ducc Service - DUCC_HOME not defined. Add it to your environment or provide it with -DDUCC_HOME=<path>");
        System.exit(-1);
      }

            if ( System.getenv("IP") == null ) {
                NodeIdentity ni = new NodeIdentity();
                System.setProperty("IP", ni.getIp());
            System.setProperty("NodeName", ni.getName());

            } else {
                System.setProperty("IP", System.getenv("IP"));
            System.setProperty("NodeName", System.getenv("NodeName"));
            }
View Full Code Here

            ProcessState processState = jp.getProcessState();
            switch(processState) {
            case Starting:
            case Initializing:
            case Running:
              NodeIdentity nodeIdentity = jp.getNodeIdentity();
              String key = nodeIdentity.getIp().trim();
              Integer value = new Integer(0);
              if(!properties.containsKey(key)) {
                properties.put(key, value);
              }
              value = (Integer)properties.get(key) + (int)pShareSize;
View Full Code Here

            ProcessState processState = jp.getProcessState();
            switch(processState) {
            case Starting:
            case Initializing:
            case Running:
              NodeIdentity nodeIdentity = jp.getNodeIdentity();
              String key = nodeIdentity.getIp().trim();
              Integer value = new Integer(0);
              if(!properties.containsKey(key)) {
                properties.put(key, value);
              }
              value = (Integer)properties.get(key) + (int)pShareSize;
View Full Code Here

          IDuccReservationMap reservationMap = reservation.getReservationMap();
          Iterator<DuccId> iteratorS = reservationMap.keySet().iterator();
          while(iteratorS.hasNext()) {
            DuccId spid = iteratorS.next();
            IDuccReservation rs = reservationMap.get(spid);
            NodeIdentity nodeIdentity = rs.getNodeIdentity();
            String key = nodeIdentity.getIp().trim();
            Integer value = new Integer(0);
            if(!properties.containsKey(key)) {
              properties.put(key, value);
            }
            int shares = rs.getShares();
View Full Code Here

   * excludedProcesses ) { if ( excludedProcess.equals(process)) { return true; } } } return false;
   * }
   */
  public static void main(String[] args) {
    try {
      NodeIdentity node = new NodeIdentity(InetAddress.getLocalHost().getHostAddress(), InetAddress
              .getLocalHost().getHostName());
      NodeAgent agent = new NodeAgent(node);

      List<DuccUserReservation> reserves = new ArrayList<DuccUserReservation>();

      IDuccReservationMap reserveMap = new DuccReservationMap();
      IDuccReservationMap reserveMap2 = new DuccReservationMap();

      NodeIdentity ni1 = node;
      // new NodeIdentity(, name);
      NodeIdentity ni2 = new NodeIdentity("111.111.111.111", "node100");
      NodeIdentity ni3 = node;
      NodeIdentity ni4 = new NodeIdentity("222.222.222.222", "node102");

      DuccId id1 = new DuccId(100);
      DuccId id2 = new DuccId(101);
      DuccId id3 = new DuccId(102);
      DuccId id4 = new DuccId(103);
View Full Code Here

      if (!exclusionFile.exists()) {
        return;
      }
      BufferedReader br = new BufferedReader(new FileReader(exclusionFile));
      String line;
      NodeIdentity node = getIdentity();
      String nodeName = node.getName();
      if (nodeName.indexOf(".") > -1) {
        nodeName = nodeName.substring(0, nodeName.indexOf("."));
      }

      while ((line = br.readLine()) != null) {
View Full Code Here

    }
    return nodeMap.size();
  }
 
  public NodeIdentity getNode() {
    NodeIdentity retVal = null;
    if(!assigned.get()) {
      tryAssignment();
    }
    synchronized(nodeMap) {
      if(!nodeMap.isEmpty()) {
View Full Code Here

            if(!map.isEmpty()) {
              keyList = new ArrayList<String>();
              nodeMap = new TreeMap<String,NodeIdentity>();
              for (DuccId key : map.keySet()) {
                IDuccReservation value = duccWorkReservation.getReservationMap().get(key);
                NodeIdentity node = value.getNodeIdentity();
                addNode(node);
                logger.info(methodName, null, messages.fetchLabel("assigned")+node.getName()+" "+node.getIp());
              }
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.NodeIdentity

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.