public void execute() throws StartupException { long now = System.currentTimeMillis(); if (now < EARLIEST_LAUNCH_DATE) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, String.format("current machine time is %s, but that is seemingly incorrect. exiting now.", new Date(now).toString())); } };
exitOrFail(e.returnCode, e.getMessage(), e.getCause()); exitOrFail(e.returnCode, e.getMessage(), e.getCause());
exitOrFail(e.returnCode, e.getMessage(), e.getCause()); exitOrFail(e.returnCode, e.getMessage(), e.getCause());
public void execute() throws StartupException { long now = System.currentTimeMillis(); if (now < EARLIEST_LAUNCH_DATE) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, String.format("current machine time is %s, but that is seemingly incorrect. exiting now.", new Date(now).toString())); } };
exitOrFail(e.returnCode, e.getMessage(), e.getCause()); exitOrFail(e.returnCode, e.getMessage(), e.getCause());
public void execute() throws StartupException { long now = System.currentTimeMillis(); if (now < EARLIEST_LAUNCH_DATE) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, String.format("current machine time is %s, but that is seemingly incorrect. exiting now.", new Date(now).toString())); } };
public void execute() throws StartupException { // Fail-fast if the native library could not be linked. if (!NativeLibrary.isAvailable()) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, "The native library could not be initialized properly. "); } };
public void execute() throws StartupException { // Fail-fast if the native library could not be linked. if (!NativeLibrary.isAvailable()) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, "The native library could not be initialized properly. "); } };
public void execute() throws StartupException { // Fail-fast if the native library could not be linked. if (!NativeLibrary.isAvailable()) throw new StartupException(StartupException.ERR_WRONG_MACHINE_STATE, "The native library could not be initialized properly. "); } };
throw new StartupException( "We could not start the HTTPS Server because the '" + sslCert.getName() + "' (aka. SSL Cert) file does not exist. Please generate one and reload the server, or disable SSL in the configs." ); throw new StartupException( "We could not start the HTTPS Server because " + e.getMessage(), e ); throw new StartupException( "We could not start the HTTPS Server for an uncaught exception", e );
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_dc")) { String storedDc = SystemKeyspace.getDatacenter(); if (storedDc != null) { String currentDc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress()); if (!storedDc.equals(currentDc)) { String formatMessage = "Cannot start node if snitch's data center (%s) differs from previous data center (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentDc, storedDc)); } } } } };
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_dc")) { String storedDc = SystemKeyspace.getDatacenter(); if (storedDc != null) { String currentDc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress()); if (!storedDc.equals(currentDc)) { String formatMessage = "Cannot start node if snitch's data center (%s) differs from previous data center (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentDc, storedDc)); } } } } };
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_rack")) { String storedRack = SystemKeyspace.getRack(); if (storedRack != null) { String currentRack = DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress()); if (!storedRack.equals(currentRack)) { String formatMessage = "Cannot start node if snitch's rack (%s) differs from previous rack (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_rack=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentRack, storedRack)); } } } } };
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_rack")) { String storedRack = SystemKeyspace.getRack(); if (storedRack != null) { String currentRack = DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress()); if (!storedRack.equals(currentRack)) { String formatMessage = "Cannot start node if snitch's rack (%s) differs from previous rack (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_rack=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentRack, storedRack)); } } } } };
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_dc")) { String storedDc = SystemKeyspace.getDatacenter(); if (storedDc != null) { String currentDc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getBroadcastAddress()); if (!storedDc.equals(currentDc)) { String formatMessage = "Cannot start node if snitch's data center (%s) differs from previous data center (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_dc=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentDc, storedDc)); } } } } };
public void execute() throws StartupException { if (!Boolean.getBoolean("cassandra.ignore_rack")) { String storedRack = SystemKeyspace.getRack(); if (storedRack != null) { String currentRack = DatabaseDescriptor.getEndpointSnitch().getRack(FBUtilities.getBroadcastAddress()); if (!storedRack.equals(currentRack)) { String formatMessage = "Cannot start node if snitch's rack (%s) differs from previous rack (%s). " + "Please fix the snitch configuration, decommission and rebootstrap this node or use the flag -Dcassandra.ignore_rack=true."; throw new StartupException(StartupException.ERR_WRONG_CONFIG, String.format(formatMessage, currentRack, storedRack)); } } } } };
throw new StartupException(3, "Unable to verify sstable files on disk", e); throw new StartupException(StartupException.ERR_WRONG_DISK_STATE, String.format("Detected unreadable sstables %s, please check " + "NEWS.txt and ensure that you have upgraded through " +
public void execute() throws StartupException { // check the system keyspace to keep user from shooting self in foot by changing partitioner, cluster name, etc. // we do a one-off scrub of the system keyspace first; we can't load the list of the rest of the keyspaces, // until system keyspace is opened. for (CFMetaData cfm : Schema.instance.getTablesAndViews(SchemaConstants.SYSTEM_KEYSPACE_NAME)) ColumnFamilyStore.scrubDataDirectories(cfm); try { SystemKeyspace.checkHealth(); } catch (ConfigurationException e) { throw new StartupException(100, "Fatal exception during initialization", e); } } };
public void execute() throws StartupException { // check the system keyspace to keep user from shooting self in foot by changing partitioner, cluster name, etc. // we do a one-off scrub of the system keyspace first; we can't load the list of the rest of the keyspaces, // until system keyspace is opened. for (CFMetaData cfm : Schema.instance.getTablesAndViews(SchemaConstants.SYSTEM_KEYSPACE_NAME)) ColumnFamilyStore.scrubDataDirectories(cfm); try { SystemKeyspace.checkHealth(); } catch (ConfigurationException e) { throw new StartupException(100, "Fatal exception during initialization", e); } } };
public void execute() throws StartupException { // check the system keyspace to keep user from shooting self in foot by changing partitioner, cluster name, etc. // we do a one-off scrub of the system keyspace first; we can't load the list of the rest of the keyspaces, // until system keyspace is opened. for (CFMetaData cfm : Schema.instance.getTablesAndViews(SchemaConstants.SYSTEM_KEYSPACE_NAME)) ColumnFamilyStore.scrubDataDirectories(cfm); try { SystemKeyspace.checkHealth(); } catch (ConfigurationException e) { throw new StartupException(100, "Fatal exception during initialization", e); } } };