public static void loadSchema() { try { Schema.instance.load(schemaDefinition()); } catch (ConfigurationException e) { throw new RuntimeException(e); } }
public static void loadSchema() { try { Schema.instance.load(schemaDefinition()); } catch (ConfigurationException e) { throw new RuntimeException(e); } }
/** * Load specific keyspace into Schema * * @param keyspaceDef The keyspace to load up * * @return self to support chaining calls */ public Schema load(KSMetaData keyspaceDef) { for (CFMetaData cfm : keyspaceDef.cfMetaData().values()) load(cfm); setKeyspaceDefinition(keyspaceDef); return this; }
public static void loadSchema() { try { Schema.instance.load(schemaDefinition(), Schema.instance.getVersion()); } catch (ConfigurationException e) { throw new RuntimeException(e); } }
/** * Load schema definitions from disk. * * @param updateVersion true if schema version needs to be updated */ public Schema loadFromDisk(boolean updateVersion) { load(SchemaKeyspace.fetchNonSystemKeyspaces()); if (updateVersion) updateVersion(); return this; }
/** * Load schema definitions from disk. * * @param updateVersion true if schema version needs to be updated */ public Schema loadFromDisk(boolean updateVersion) { load(SchemaKeyspace.fetchNonSystemKeyspaces()); if (updateVersion) updateVersion(); return this; }
/** * Load schema definitions from disk. * * @param updateVersion true if schema version needs to be updated */ public Schema loadFromDisk(boolean updateVersion) { load(SchemaKeyspace.fetchNonSystemKeyspaces()); if (updateVersion) updateVersion(); return this; }
/** * Adds the specified column family to the specified keyspace. * * @param ksm the keyspace meta data * @param cfm the column family meta data */ private static void addTableToKeyspace(KSMetaData ksm, CFMetaData cfm) { ksm = KSMetaData.cloneWith(ksm, Iterables.concat(ksm.cfMetaData().values(), Collections.singleton(cfm))); Schema.instance.load(cfm); Schema.instance.setKeyspaceDefinition(ksm); }
public void addKeyspace(KeyspaceMetadata ksm) { assert getKSMetaData(ksm.name) == null; load(ksm); Keyspace.open(ksm.name); MigrationManager.instance.notifyCreateKeyspace(ksm); }
public void addKeyspace(KeyspaceMetadata ksm) { assert getKSMetaData(ksm.name) == null; load(ksm); Keyspace.open(ksm.name); MigrationManager.instance.notifyCreateKeyspace(ksm); }
public void addKeyspace(KeyspaceMetadata ksm) { assert getKSMetaData(ksm.name) == null; load(ksm); Keyspace.open(ksm.name); MigrationManager.instance.notifyCreateKeyspace(ksm); }
private static void addKeyspace(KSMetaData ksm) { assert Schema.instance.getKSMetaData(ksm.name) == null; Schema.instance.load(ksm); if (!StorageService.instance.isClientMode()) { Keyspace.open(ksm.name); MigrationManager.instance.notifyCreateKeyspace(ksm); } }
public void addTable(CFMetaData cfm) { assert getCFMetaData(cfm.ksName, cfm.cfName) == null; // Make sure the keyspace is initialized // and init the new CF before switching the KSM to the new one // to avoid races as in CASSANDRA-10761 Keyspace.open(cfm.ksName).initCf(cfm, true); // Update the keyspaces map with the updated metadata update(cfm.ksName, ks -> ks.withSwapped(ks.tables.with(cfm))); // Update the table ID <-> table name map (cfIdMap) load(cfm); MigrationManager.instance.notifyCreateColumnFamily(cfm); }
public void addTable(CFMetaData cfm) { assert getCFMetaData(cfm.ksName, cfm.cfName) == null; // Make sure the keyspace is initialized // and init the new CF before switching the KSM to the new one // to avoid races as in CASSANDRA-10761 Keyspace.open(cfm.ksName).initCf(cfm, true); // Update the keyspaces map with the updated metadata update(cfm.ksName, ks -> ks.withSwapped(ks.tables.with(cfm))); // Update the table ID <-> table name map (cfIdMap) load(cfm); MigrationManager.instance.notifyCreateColumnFamily(cfm); }
public void addView(ViewDefinition view) { assert getCFMetaData(view.ksName, view.viewName) == null; Keyspace keyspace = Keyspace.open(view.ksName); // Make sure the keyspace is initialized and initialize the table. keyspace.initCf(view.metadata, true); // Update the keyspaces map with the updated metadata update(view.ksName, ks -> ks.withSwapped(ks.views.with(view))); // Update the table ID <-> table name map (cfIdMap) load(view); keyspace.viewManager.reload(); MigrationManager.instance.notifyCreateView(view); }
public void addView(ViewDefinition view) { assert getCFMetaData(view.ksName, view.viewName) == null; Keyspace keyspace = Keyspace.open(view.ksName); // Make sure the keyspace is initialized and initialize the table. keyspace.initCf(view.metadata, true); // Update the keyspaces map with the updated metadata update(view.ksName, ks -> ks.withSwapped(ks.views.with(view))); // Update the table ID <-> table name map (cfIdMap) load(view); keyspace.viewManager.reload(); MigrationManager.instance.notifyCreateView(view); }
public void addView(ViewDefinition view) { assert getCFMetaData(view.ksName, view.viewName) == null; Keyspace keyspace = Keyspace.open(view.ksName); // Make sure the keyspace is initialized and initialize the table. keyspace.initCf(view.metadata, true); // Update the keyspaces map with the updated metadata update(view.ksName, ks -> ks.withSwapped(ks.views.with(view))); // Update the table ID <-> table name map (cfIdMap) load(view); keyspace.viewManager.reload(); MigrationManager.instance.notifyCreateView(view); }