Package com.netflix.genie.common.exceptions

Examples of com.netflix.genie.common.exceptions.GeniePreconditionException


     */
    @Override
    public void launch() throws GenieException {
        LOG.info("called");
        if (!this.isInitCalled()) {
            throw new GeniePreconditionException("Init wasn't called. Unable to continue.");
        }

        // Check the parameters
        final String prestoProtocol = ConfigurationManager
                .getConfigInstance().getString(PRESTO_PROTOCOL_KEY, null);
        if (prestoProtocol == null) {
            throw new GeniePreconditionException("Presto protocol not set. Please configure " + PRESTO_PROTOCOL_KEY);
        }
        final String prestoMasterDomain = ConfigurationManager
                .getConfigInstance().getString(PRESTO_MASTER_DOMAIN, null);
        if (prestoMasterDomain == null) {
            throw new GeniePreconditionException("Presto protocol not set. Please configure " + PRESTO_MASTER_DOMAIN);
        }


        // create the ProcessBuilder for this process
        final List<String> processArgs = this.createBaseProcessArguments();
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public void setJob(final Job job) throws GenieException {
        if (job == null || StringUtils.isBlank(job.getId())) {
            throw new GeniePreconditionException("No job entered.");
        }
        this.jobId = job.getId();
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void setProcess(final Process proc) throws GenieException {
        if (proc == null) {
            throw new GeniePreconditionException("No process entered.");
        }
        this.proc = proc;
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void setJobManager(final JobManager jobManager) throws GenieException {
        if (jobManager == null) {
            throw new GeniePreconditionException("No job manager entered.");
        }
        this.jobManager = jobManager;
    }
View Full Code Here

     */
    @Override
    public void launch() throws GenieException {
        LOG.info("called");
        if (!this.isInitCalled()) {
            throw new GeniePreconditionException("Init wasn't called. Unable to continue.");
        }

        // create the ProcessBuilder for this process
        final List<String> processArgs = this.createBaseProcessArguments();
        processArgs.addAll(Arrays.asList(StringUtil.splitCmdLine(this.getJob().getCommandArgs())));
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void init(final Job job, final Cluster cluster) throws GenieException {
        if (job == null) {
            throw new GeniePreconditionException("No job entered.");
        }
        if (cluster == null) {
            throw new GeniePreconditionException("No cluster entered.");
        }

        //TODO: Get rid of this circular dependency
        this.jobMonitor.setJobManager(this);
        this.job = job;
        this.cluster = cluster;
        this.attachments = this.job.getAttachments();

        // save the cluster name and id
        this.jobService.setClusterInfoForJob(this.job.getId(), this.cluster.getId(), this.cluster.getName());

        // Find the command for the job
        Command command = null;
        for (final Command cmd : this.cluster.getCommands()) {
            if (cmd.getTags().containsAll(this.job.getCommandCriteria())) {
                command = cmd;
                break;
            }
        }

        //Avoiding NPE
        if (command == null) {
            final String msg = "No command found for params. Unable to continue.";
            LOG.error(msg);
            throw new GeniePreconditionException(msg);
        }

        // save the command name, application id and application name
        this.jobService.setCommandInfoForJob(this.job.getId(), command.getId(), command.getName());

View Full Code Here

     */
    @Override
    public void launch() throws GenieException {
        LOG.info("called");
        if (!this.initCalled) {
            throw new GeniePreconditionException("Init wasn't called. Unable to continue.");
        }

        // create the ProcessBuilder for this process
        final List<String> processArgs = this.createBaseProcessArguments();
        processArgs.addAll(Arrays.asList(StringUtil.splitCmdLine(this.job.getCommandArgs())));
View Full Code Here

     */
    @Override
    public void kill() throws GenieException {
        LOG.info("called");
        if (!this.initCalled) {
            throw new GeniePreconditionException("Init wasn't called. Unable to continue.");
        }

        // check to ensure that the process id is actually set (which means job
        // was launched)
        final int processId = this.job.getProcessHandle();
View Full Code Here

            for (final FileAttachment attachment : this.attachments) {
                // basic error checking
                if (attachment.getName() == null || attachment.getName().isEmpty()) {
                    final String msg = "File attachment is missing required parameter name";
                    LOG.error(msg);
                    throw new GeniePreconditionException(msg);
                }
                if (attachment.getData() == null) {
                    final String msg = "File attachment is missing required parameter data";
                    LOG.error(msg);
                    throw new GeniePreconditionException(msg);
                }
                // good to go - copy attachments
                // not checking for 0-byte attachments - assuming they are legitimate
                try (final FileOutputStream output =
                             new FileOutputStream(this.jobDir + File.separator + attachment.getName())) {
View Full Code Here

     * @return updated jobInfo for submitted job, if there is no error
     * @throws GenieException For any other error.
     */
    public Job submitJob(final Job job) throws GenieException {
        if (job == null) {
            throw new GeniePreconditionException("No job entered to validate");
        }
        job.validate();
        final HttpRequest request = BaseGenieClient.buildRequest(
                Verb.POST,
                BASE_EXECUTION_REST_URL,
View Full Code Here

TOP

Related Classes of com.netflix.genie.common.exceptions.GeniePreconditionException

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.