Package com.netflix.genie.common.exceptions

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


        try {
            final BaseGenieClient client = new BaseGenieClient(null);
            final HttpRequest request = BaseGenieClient.buildRequest(Verb.DELETE, killURI, null, null);
            return (Job) client.executeRequest(request, null, Job.class);
        } catch (final IOException ioe) {
            throw new GenieServerException(ioe.getMessage(), ioe);
        }
    }
View Full Code Here


        try {
            final BaseGenieClient client = new BaseGenieClient(null);
            final HttpRequest request = BaseGenieClient.buildRequest(Verb.POST, hostURI, null, job);
            return (Job) client.executeRequest(request, null, Job.class);
        } catch (final IOException ioe) {
            throw new GenieServerException(ioe.getMessage(), ioe);
        }
    }
View Full Code Here

    /**
     * Test 500.
     */
    @Test
    public void testGenieServerException() {
        final GenieException ge = new GenieServerException(ERROR_MESSAGE);
        final Response response = this.mapper.toResponse(ge);
        Assert.assertEquals(HttpURLConnection.HTTP_INTERNAL_ERROR, response.getStatus());
        Assert.assertNotNull(response.getEntity());
        Assert.assertEquals(ERROR_MESSAGE, response.getEntity());
    }
View Full Code Here

            this.stats.incrGenieJobSubmissions();
            return persistedJob;
        } catch (final RuntimeException e) {
            //This will catch runtime as well
            LOG.error("Can't create entity in the database", e);
            throw new GenieServerException(e);
        }
    }
View Full Code Here

            output = input.trim().split("[" + ARG_DELIMITER
                    + "]+(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
        } catch (final Exception e) {
            final String msg = "Invalid argument: " + input;
            LOG.error(msg, e);
            throw new GenieServerException(msg, e);
        }

        // "cleanse" inputs - get rid of enclosing quotes
        for (int i = 0; i < output.length; i++) {
            // double quotes
View Full Code Here

        }

        if (hostName == null || hostName.isEmpty()) {
            String msg = "Can't figure out host name for instance";
            LOG.error(msg);
            throw new GenieServerException(msg);
        }

        return hostName;
    }
View Full Code Here

        try {
            cloudHostName = httpGet(PUBLIC_HOSTNAME_URI);
        } catch (IOException ioe) {
            String msg = "Unable to get public hostname from instance metadata";
            LOG.error(msg, ioe);
            throw new GenieServerException(msg, ioe);
        }
        if (cloudHostName == null || cloudHostName.isEmpty()) {
            try {
                cloudHostName = httpGet(LOCAL_IPV4_URI);
            } catch (final IOException ioe) {
                String msg = "Unable to get local IP from instance metadata";
                LOG.error(msg, ioe);
                throw new GenieServerException(msg, ioe);
            }
        }
        LOG.info("cloudHostName=" + cloudHostName);

        return cloudHostName;
View Full Code Here

            InetAddress addr = InetAddress.getLocalHost();
            dcHostName = addr.getCanonicalHostName();
        } catch (final UnknownHostException e) {
            String msg = "Unable to get the hostname";
            LOG.error(msg, e);
            throw new GenieServerException(msg, e);
        }

        return dcHostName;
    }
View Full Code Here

        } catch (final Exception e) {
            if (e instanceof GenieException) {
                throw (GenieException) e;
            } else {
                LOG.error(e.getMessage(), e);
                throw new GenieServerException(e);
            }
        }
    }
View Full Code Here

TOP

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

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.