@Override public Boolean call() throws Exception { return isProcessRunning(baseDir) && isInstanceRunning(clusterName, client); } }
/** * Verify that the ES instance in the Elasticsearch base directory is not running * * @param httpPort * @throws IllegalStateException */ public void verifyInstanceNotRunning(String clusterName, int httpPort) throws IllegalStateException { String path = esBaseDir.getAbsolutePath(); if (Monitor.isProcessRunning(path)) { throw new IllegalStateException(String.format( "The ES process in %s appears to be running", path)); } if (Monitor.isInstanceRunning(clusterName, httpPort)) { throw new IllegalStateException(String.format( "ES responded with valid response to GET / request on port %d", httpPort)); } }
/** * Verify that the ES instance in the Elasticsearch base directory is running * * @param httpPort * @param clusterName * @throws IllegalStateException */ public void verifyInstanceRunning(String clusterName, int httpPort) throws IllegalStateException { String path = esBaseDir.getAbsolutePath(); if (Monitor.isProcessRunning(path) == false) { throw new IllegalStateException(String.format( "The ES process in %s is not running", path)); } if (Monitor.isInstanceRunning(clusterName, httpPort) == false) { throw new IllegalStateException(String.format( "ES did not respond as expected to GET / request on port %d", httpPort)); } }