public static void announceNewKeyspace(KSMetaData ksm, long timestamp, boolean announceLocally) throws ConfigurationException { ksm.validate(); if (Schema.instance.getKSMetaData(ksm.name) != null) throw new AlreadyExistsException(ksm.name); logger.info(String.format("Create new Keyspace: %s", ksm)); announce(ksm.toSchema(timestamp), announceLocally); }
public static void announceNewKeyspace(KeyspaceMetadata ksm, long timestamp, boolean announceLocally) throws ConfigurationException { ksm.validate(); if (Schema.instance.getKSMetaData(ksm.name) != null) throw new AlreadyExistsException(ksm.name); logger.info("Create new Keyspace: {}", ksm); announce(SchemaKeyspace.makeCreateKeyspaceMutation(ksm, timestamp), announceLocally); }
public static void announceNewKeyspace(KeyspaceMetadata ksm, long timestamp, boolean announceLocally) throws ConfigurationException { ksm.validate(); if (Schema.instance.getKSMetaData(ksm.name) != null) throw new AlreadyExistsException(ksm.name); logger.info("Create new Keyspace: {}", ksm); announce(SchemaKeyspace.makeCreateKeyspaceMutation(ksm, timestamp), announceLocally); }
public static void announceNewKeyspace(KeyspaceMetadata ksm, long timestamp, boolean announceLocally) throws ConfigurationException { ksm.validate(); if (Schema.instance.getKSMetaData(ksm.name) != null) throw new AlreadyExistsException(ksm.name); logger.info("Create new Keyspace: {}", ksm); announce(SchemaKeyspace.makeCreateKeyspaceMutation(ksm, timestamp), announceLocally); }
private static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally, boolean throwOnDuplicate, long timestamp) throws ConfigurationException { cfm.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(cfm.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", cfm.cfName, cfm.ksName)); // If we have a table or a view which has the same name, we can't add a new one else if (throwOnDuplicate && ksm.getTableOrViewNullable(cfm.cfName) != null) throw new AlreadyExistsException(cfm.ksName, cfm.cfName); logger.info("Create new table: {}", cfm); announce(SchemaKeyspace.makeCreateTableMutation(ksm, cfm, timestamp), announceLocally); }
private static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally, boolean throwOnDuplicate, long timestamp) throws ConfigurationException { cfm.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(cfm.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", cfm.cfName, cfm.ksName)); // If we have a table or a view which has the same name, we can't add a new one else if (throwOnDuplicate && ksm.getTableOrViewNullable(cfm.cfName) != null) throw new AlreadyExistsException(cfm.ksName, cfm.cfName); logger.info("Create new table: {}", cfm); announce(SchemaKeyspace.makeCreateTableMutation(ksm, cfm, timestamp), announceLocally); }
public static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally) throws ConfigurationException { cfm.validate(); KSMetaData ksm = Schema.instance.getKSMetaData(cfm.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add column family '%s' to non existing keyspace '%s'.", cfm.cfName, cfm.ksName)); else if (ksm.cfMetaData().containsKey(cfm.cfName)) throw new AlreadyExistsException(cfm.ksName, cfm.cfName); logger.info(String.format("Create new ColumnFamily: %s", cfm)); announce(addSerializedKeyspace(cfm.toSchema(FBUtilities.timestampMicros()), cfm.ksName), announceLocally); }
private static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally, boolean throwOnDuplicate, long timestamp) throws ConfigurationException { cfm.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(cfm.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", cfm.cfName, cfm.ksName)); // If we have a table or a view which has the same name, we can't add a new one else if (throwOnDuplicate && ksm.getTableOrViewNullable(cfm.cfName) != null) throw new AlreadyExistsException(cfm.ksName, cfm.cfName); logger.info("Create new table: {}", cfm); announce(SchemaKeyspace.makeCreateTableMutation(ksm, cfm, timestamp), announceLocally); }
public static void announceNewView(ViewDefinition view, boolean announceLocally) throws ConfigurationException { view.metadata.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(view.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", view.viewName, view.ksName)); else if (ksm.getTableOrViewNullable(view.viewName) != null) throw new AlreadyExistsException(view.ksName, view.viewName); logger.info("Create new view: {}", view); announce(SchemaKeyspace.makeCreateViewMutation(ksm, view, FBUtilities.timestampMicros()), announceLocally); }
public static void announceNewView(ViewDefinition view, boolean announceLocally) throws ConfigurationException { view.metadata.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(view.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", view.viewName, view.ksName)); else if (ksm.getTableOrViewNullable(view.viewName) != null) throw new AlreadyExistsException(view.ksName, view.viewName); logger.info("Create new view: {}", view); announce(SchemaKeyspace.makeCreateViewMutation(ksm, view, FBUtilities.timestampMicros()), announceLocally); }
public static void announceNewView(ViewDefinition view, boolean announceLocally) throws ConfigurationException { view.metadata.validate(); KeyspaceMetadata ksm = Schema.instance.getKSMetaData(view.ksName); if (ksm == null) throw new ConfigurationException(String.format("Cannot add table '%s' to non existing keyspace '%s'.", view.viewName, view.ksName)); else if (ksm.getTableOrViewNullable(view.viewName) != null) throw new AlreadyExistsException(view.ksName, view.viewName); logger.info("Create new view: {}", view); announce(SchemaKeyspace.makeCreateViewMutation(ksm, view, FBUtilities.timestampMicros()), announceLocally); }