public static synchronized void startupClient() throws IOException { if (cassandraStarted) return; cassandraStarted = true; try { System.setProperty("cassandra-foreground", "1"); StorageService.instance.initClient(); logger.info("Started Solandra in client mode... waiting for gossip information"); Thread.sleep(10000); // createCassandraSchema(); } catch (IOException e2) { e2.printStackTrace(); System.exit(2); } catch (ConfigurationException e2) { e2.printStackTrace(); System.exit(2); } catch (InterruptedException e) { e.printStackTrace(); System.exit(2); } return; }
private static void startClient() throws Exception { try { if (!System.getProperties().contains("cassandra.config")) { String url = "file:///" + new File("cassandra.yaml").getAbsolutePath(); System.getProperties().setProperty("cassandra.config", url); } StorageService.instance.initClient(); // sleep for a bit so that gossip can do its thing. Thread.sleep(10000L); } catch (Exception ex) { logger.error("Couldnt Start the client because of:", ex); throw new AssertionError(ex); } catch (Throwable ex) { logger.error("Couldnt Start the client because of:", ex); throw new AssertionError(ex); } }
public synchronized void initClient() throws ConfigurationException { // We don't wait, because we're going to actually try to work on initClient(0); // sleep a while to allow gossip to warm up (the other nodes need to know about this one before they can reply). outer: while (true) { Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); for (InetAddress address : Gossiper.instance.getLiveMembers()) { if (!Gossiper.instance.isFatClient(address)) break outer; } } // sleep until any schema migrations have finished while (!MigrationManager.isReadyForBootstrap()) { Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); } }