public void update(String viewName) { View view = viewsByName.get(viewName); assert view != null : "When updating a view, it should already be in the ViewManager"; view.build(); // We provide the new definition from the base metadata Optional<ViewDefinition> viewDefinition = keyspace.getMetadata().views.get(viewName); assert viewDefinition.isPresent() : "When updating a view, it should still be in the Keyspaces views"; view.updateDefinition(viewDefinition.get()); }
public void update(String viewName) { View view = viewsByName.get(viewName); assert view != null : "When updating a view, it should already be in the ViewManager"; view.build(); // We provide the new definition from the base metadata Optional<ViewDefinition> viewDefinition = keyspace.getMetadata().views.get(viewName); assert viewDefinition.isPresent() : "When updating a view, it should still be in the Keyspaces views"; view.updateDefinition(viewDefinition.get()); }
public void update(String viewName) { View view = viewsByName.get(viewName); assert view != null : "When updating a view, it should already be in the ViewManager"; view.build(); // We provide the new definition from the base metadata Optional<ViewDefinition> viewDefinition = keyspace.getMetadata().views.get(viewName); assert viewDefinition.isPresent() : "When updating a view, it should still be in the Keyspaces views"; view.updateDefinition(viewDefinition.get()); }
public void apply() { apply(Keyspace.open(keyspaceName).getMetadata().params.durableWrites); }
public void apply() { Keyspace ks = Keyspace.open(keyspaceName); ks.apply(this, ks.getMetadata().durableWrites); }
public void apply() { apply(Keyspace.open(keyspaceName).getMetadata().params.durableWrites); }
public void apply() { apply(Keyspace.open(keyspaceName).getMetadata().params.durableWrites); }
public CompletableFuture<?> applyFuture() { Keyspace ks = Keyspace.open(keyspaceName); return ks.applyFuture(this, Keyspace.open(keyspaceName).getMetadata().params.durableWrites, true); }
public CompletableFuture<?> applyFuture() { Keyspace ks = Keyspace.open(keyspaceName); return ks.applyFuture(this, Keyspace.open(keyspaceName).getMetadata().params.durableWrites, true); }
public CompletableFuture<?> applyFuture() { Keyspace ks = Keyspace.open(keyspaceName); return ks.applyFuture(this, Keyspace.open(keyspaceName).getMetadata().params.durableWrites, true); }
public void reload() for (ViewDefinition definition : keyspace.getMetadata().views)
public void reload() for (ViewDefinition definition : keyspace.getMetadata().views)
public void reload() for (ViewDefinition definition : keyspace.getMetadata().views)
if (keyspace.getMetadata().durableWrites || DatabaseDescriptor.isAutoSnapshot())
public void updateTable(CFMetaData table) { CFMetaData current = getCFMetaData(table.ksName, table.cfName); assert current != null; boolean changeAffectsStatements = current.apply(table); Keyspace keyspace = Keyspace.open(current.ksName); keyspace.getColumnFamilyStore(current.cfName).reload(); MigrationManager.instance.notifyUpdateColumnFamily(keyspace.getMetadata(), current, changeAffectsStatements); }
final CommitLogPosition replayAfter; if (keyspace.getMetadata().params.durableWrites || DatabaseDescriptor.isAutoSnapshot())
final CommitLogPosition replayAfter; if (keyspace.getMetadata().params.durableWrites || DatabaseDescriptor.isAutoSnapshot())
final CommitLogPosition replayAfter; if (keyspace.getMetadata().params.durableWrites || DatabaseDescriptor.isAutoSnapshot())
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 keyspace = Keyspace.open(cfm.ksName); keyspace.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(keyspace.getMetadata(), cfm); }
public void dropTable(String ksName, String tableName) { KeyspaceMetadata oldKsm = getKSMetaData(ksName); assert oldKsm != null; ColumnFamilyStore cfs = Keyspace.open(ksName).getColumnFamilyStore(tableName); assert cfs != null; // make sure all the indexes are dropped, or else. cfs.indexManager.markAllIndexesRemoved(); // reinitialize the keyspace. CFMetaData cfm = oldKsm.tables.get(tableName).get(); KeyspaceMetadata newKsm = oldKsm.withSwapped(oldKsm.tables.without(tableName)); unload(cfm); setKeyspaceMetadata(newKsm); CompactionManager.instance.interruptCompactionFor(Collections.singleton(cfm), true); if (DatabaseDescriptor.isAutoSnapshot()) cfs.snapshot(Keyspace.getTimestampedSnapshotNameWithPrefix(cfs.name, ColumnFamilyStore.SNAPSHOT_DROP_PREFIX)); Keyspace keyspace = Keyspace.open(ksName); keyspace.dropCf(cfm.cfId); MigrationManager.instance.notifyDropColumnFamily(keyspace.getMetadata(), cfm); CommitLog.instance.forceRecycleAllSegments(Collections.singleton(cfm.cfId)); }