@SuppressWarnings("deprecation") public static void handleLegacyMutation(Mutation mutation) { PartitionUpdate update = mutation.getPartitionUpdate(SystemKeyspace.LegacyBatchlog.cfId); logger.trace("Applying legacy batchlog mutation {}", update); update.forEach(row -> apply(UntypedResultSet.Row.fromInternalRow(update.metadata(), update.partitionKey(), row), -1)); }
@SuppressWarnings("deprecation") public static void handleLegacyMutation(Mutation mutation) { PartitionUpdate update = mutation.getPartitionUpdate(SystemKeyspace.LegacyBatchlog.cfId); logger.trace("Applying legacy batchlog mutation {}", update); update.forEach(row -> apply(UntypedResultSet.Row.fromInternalRow(update.metadata(), update.partitionKey(), row), -1)); }
@SuppressWarnings("deprecation") public static void handleLegacyMutation(Mutation mutation) { PartitionUpdate update = mutation.getPartitionUpdate(SystemKeyspace.LegacyBatchlog.cfId); logger.trace("Applying legacy batchlog mutation {}", update); update.forEach(row -> apply(UntypedResultSet.Row.fromInternalRow(update.metadata(), update.partitionKey(), row), -1)); }
@SuppressWarnings("deprecation") public static void migrate() { ColumnFamilyStore store = Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME).getColumnFamilyStore(SystemKeyspace.LEGACY_BATCHLOG); // nothing to migrate if (store.isEmpty()) return; logger.info("Migrating legacy batchlog to new storage"); int convertedBatches = 0; String query = String.format("SELECT id, data, written_at, version FROM %s.%s", SchemaConstants.SYSTEM_KEYSPACE_NAME, SystemKeyspace.LEGACY_BATCHLOG); int pageSize = BatchlogManager.calculatePageSize(store); UntypedResultSet rows = QueryProcessor.executeInternalWithPaging(query, pageSize); for (UntypedResultSet.Row row : rows) { if (apply(row, convertedBatches)) convertedBatches++; } if (convertedBatches > 0) Keyspace.openAndGetStore(SystemKeyspace.LegacyBatchlog).truncateBlocking(); }
@SuppressWarnings("deprecation") public static void migrate() { ColumnFamilyStore store = Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME).getColumnFamilyStore(SystemKeyspace.LEGACY_BATCHLOG); // nothing to migrate if (store.isEmpty()) return; logger.info("Migrating legacy batchlog to new storage"); int convertedBatches = 0; String query = String.format("SELECT id, data, written_at, version FROM %s.%s", SchemaConstants.SYSTEM_KEYSPACE_NAME, SystemKeyspace.LEGACY_BATCHLOG); int pageSize = BatchlogManager.calculatePageSize(store); UntypedResultSet rows = QueryProcessor.executeInternalWithPaging(query, pageSize); for (UntypedResultSet.Row row : rows) { if (apply(row, convertedBatches)) convertedBatches++; } if (convertedBatches > 0) Keyspace.openAndGetStore(SystemKeyspace.LegacyBatchlog).truncateBlocking(); }
@SuppressWarnings("deprecation") public static void migrate() { ColumnFamilyStore store = Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME).getColumnFamilyStore(SystemKeyspace.LEGACY_BATCHLOG); // nothing to migrate if (store.isEmpty()) return; logger.info("Migrating legacy batchlog to new storage"); int convertedBatches = 0; String query = String.format("SELECT id, data, written_at, version FROM %s.%s", SchemaConstants.SYSTEM_KEYSPACE_NAME, SystemKeyspace.LEGACY_BATCHLOG); int pageSize = BatchlogManager.calculatePageSize(store); UntypedResultSet rows = QueryProcessor.executeInternalWithPaging(query, pageSize); for (UntypedResultSet.Row row : rows) { if (apply(row, convertedBatches)) convertedBatches++; } if (convertedBatches > 0) Keyspace.openAndGetStore(SystemKeyspace.LegacyBatchlog).truncateBlocking(); }