Examples of AiravataMonitorException


Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                } catch (InterruptedException e1) {
                    e1.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }
            }
            logger.error("Error handling the job with Job ID:" + currentMonitorID.getJobID());
            throw new AiravataMonitorException(e);
        } catch (SSHApiException e) {
            logger.error(e.getMessage());
            if (e.getMessage().contains("Unknown Job Id Error")) {
                // in this case job is finished or may be the given job ID is wrong
                jobStatus.setState(JobState.UNKNOWN);
                publisher.publish(jobStatus);
            } else if (e.getMessage().contains("illegally formed job identifier")) {
                logger.error("Wrong job ID is given so dropping the job from monitoring system");
            } else if (!this.queue.contains(take)) {   // we put the job back to the queue only if its state is not unknown
                if (currentMonitorID == null) {
                    logger.error("Monitoring the jobs failed, for user: " + take.getUserName()
                            + " in Host: " + currentHostDescription.getType().getHostAddress());
                } else {
                    if (currentMonitorID != null) {
                        if (currentMonitorID.getFailedCount() < 2) {
                            try {
                                currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
                                this.queue.put(take);
                            } catch (InterruptedException e1) {
                                e1.printStackTrace();
                            }
                        } else {
                            logger.error(e.getMessage());
                            logger.error("Tried to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
                        }
                    }
                }
            }
            throw new AiravataMonitorException("Error retrieving the job status", e);
        } catch (Exception e) {
            if (currentMonitorID != null) {
                if (currentMonitorID.getFailedCount() < 3) {
                    try {
                        currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
                        this.queue.put(take);
                        // if we get a wrong status we wait for a while and request again
                        Thread.sleep(10000);
                    } catch (InterruptedException e1) {
                        e1.printStackTrace();
                    }
                } else {
                    logger.error(e.getMessage());
                    logger.error("Tryied to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
                }
            }
            throw new AiravataMonitorException("Error retrieving the job status", e);
        }


        return true;
    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

        UserMonitorData userMonitorData = new UserMonitorData(monitorID.getUserName());
        userMonitorData.addHostMonitorData(hostMonitorData);
        try {
            queue.put(userMonitorData);
        } catch (InterruptedException e) {
            throw new AiravataMonitorException(e);
        }
    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                        }
                    }
                }
            }
        }
        throw new AiravataMonitorException("Cannot find the given MonitorID in the queue with userName " +
                monitorID.getUserName() + "  and jobID " + monitorID.getJobID());

    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

        UserMonitorData userMonitorData = new UserMonitorData(monitorID.getUserName());
        userMonitorData.addHostMonitorData(hostMonitorData);
        try {
            queue.put(userMonitorData);
        } catch (InterruptedException e) {
            throw new AiravataMonitorException(e);
        }
    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                        }
                    }
                }
            }
        }
        throw new AiravataMonitorException("Cannot find the given MonitorID in the queue with userName " +
                monitorID.getUserName() + "  and jobID " + monitorID.getJobID());

    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                logger.info("There are no jobs to monitor for common ChannelID:" + channelID + " , so we unsubscribe it" +
                        ", incase new job created we do subscribe again");
                Channel channel = availableChannels.get(channelID);
                if (channel == null) {
                    logger.error("Already Unregistered the listener");
                    throw new AiravataMonitorException("Already Unregistered the listener");
                } else {
                    try {
                        channel.queueUnbind(channel.queueDeclare().getQueue(), "glue2.computing_activity", CommonUtils.getRoutingKey(next));
                        channel.close();
                        channel.getConnection().close();
                        availableChannels.remove(channelID);
                    } catch (IOException e) {
                        logger.error("Error unregistering the listener");
                        throw new AiravataMonitorException("Error unregistering the listener");
                    }
                }
            }
        }
        next.setStatus(monitorID.getStatus());
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                } catch (InterruptedException e1) {
                    e1.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }
            }
            logger.error("Error handling the job with Job ID:" + currentMonitorID.getJobID());
            throw new AiravataMonitorException(e);
        } catch (SSHApiException e) {
            logger.error(e.getMessage());
            if (e.getMessage().contains("Unknown Job Id Error")) {
                // in this case job is finished or may be the given job ID is wrong
                jobStatus.setState(JobState.UNKNOWN);
                publisher.publish(jobStatus);
            } else if (e.getMessage().contains("illegally formed job identifier")) {
                logger.error("Wrong job ID is given so dropping the job from monitoring system");
            } else if (!this.queue.contains(take)) {   // we put the job back to the queue only if its state is not unknown
                if (currentMonitorID == null) {
                    logger.error("Monitoring the jobs failed, for user: " + take.getUserName()
                            + " in Host: " + currentHostDescription.getType().getHostAddress());
                } else {
                    if (currentMonitorID != null) {
                        if (currentMonitorID.getFailedCount() < 2) {
                            try {
                                currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
                                this.queue.put(take);
                            } catch (InterruptedException e1) {
                                e1.printStackTrace();
                            }
                        } else {
                            logger.error(e.getMessage());
                            logger.error("Tried to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
                        }
                    }
                }
            }
            throw new AiravataMonitorException("Error retrieving the job status", e);
        } catch (Exception e) {
            if (currentMonitorID != null) {
                if (currentMonitorID.getFailedCount() < 3) {
                    try {
                        currentMonitorID.setFailedCount(currentMonitorID.getFailedCount() + 1);
                        this.queue.put(take);
                        // if we get a wrong status we wait for a while and request again
                        Thread.sleep(10000);
                    } catch (InterruptedException e1) {
                        e1.printStackTrace();
                    }
                } else {
                    logger.error(e.getMessage());
                    logger.error("Tryied to monitor the job 3 times, so dropping of the the Job with ID: " + currentMonitorID.getJobID());
                }
            }
            throw new AiravataMonitorException("Error retrieving the job status", e);
        }


        return true;
    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

                jobState = getStatusFromString(aState);
            }
            // we get the last value of the state array
            return jobState;
        } catch (IOException e) {
            throw new AiravataMonitorException(e);
        }
    }
View Full Code Here

Examples of org.apache.airavata.gfac.monitor.exception.AiravataMonitorException

        String channelID = CommonUtils.getChannelID(monitorID);
        if (JobState.FAILED.equals(jobStatus.getState()) || JobState.COMPLETE.equals(jobStatus.getState())){
            Channel channel = availableChannels.get(channelID);
            if (channel == null) {
                logger.error("Already Unregistered the listener");
                throw new AiravataMonitorException("Already Unregistered the listener");
            } else {
                try {
                    channel.queueUnbind(channel.queueDeclare().getQueue(), "glue2.computing_activity", CommonUtils.getRoutingKey(monitorID));
                    channel.close();
                    channel.getConnection().close();
                    availableChannels.remove(channelID);
                } catch (IOException e) {
                    logger.error("Error unregistering the listener");
                    throw new AiravataMonitorException("Error unregistering the listener");
                }
            }
        }
        return true;
    }
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.