/** */ public void stopUnsafe(boolean deleteSegments) { executor.shutdown(); try { executor.awaitTermination(); } catch (InterruptedException e) { throw new RuntimeException(e); } segmentManager.stopUnsafe(deleteSegments); CommitLogSegment.resetReplayLimit(); if (DatabaseDescriptor.isCDCEnabled() && deleteSegments) for (File f : new File(DatabaseDescriptor.getCDCLogLocation()).listFiles()) FileUtils.deleteWithConfirm(f); }
/** */ public void stopUnsafe(boolean deleteSegments) { executor.shutdown(); try { executor.awaitTermination(); } catch (InterruptedException e) { throw new RuntimeException(e); } segmentManager.stopUnsafe(deleteSegments); CommitLogSegment.resetReplayLimit(); if (DatabaseDescriptor.isCDCEnabled() && deleteSegments) for (File f : new File(DatabaseDescriptor.getCDCLogLocation()).listFiles()) FileUtils.deleteWithConfirm(f); }
/** */ public void stopUnsafe(boolean deleteSegments) { executor.shutdown(); try { executor.awaitTermination(); } catch (InterruptedException e) { throw new RuntimeException(e); } segmentManager.stopUnsafe(deleteSegments); CommitLogSegment.resetReplayLimit(); if (DatabaseDescriptor.isCDCEnabled() && deleteSegments) for (File f : new File(DatabaseDescriptor.getCDCLogLocation()).listFiles()) FileUtils.deleteWithConfirm(f); }
/** * Creates a PartitionUpdate from a partition containing some schema table content. * This is mainly calling {@code PartitionUpdate.fromIterator} except for the fact that it deals with * the problem described in #12236. */ private static PartitionUpdate makeUpdateForSchema(UnfilteredRowIterator partition, ColumnFilter filter) { // This method is used during schema migration tasks, and if cdc is disabled, we want to force excluding the // 'cdc' column from the TABLES/VIEWS schema table because it is problematic if received by older nodes (see #12236 // and #12697). Otherwise though, we just simply "buffer" the content of the partition into a PartitionUpdate. if (DatabaseDescriptor.isCDCEnabled() || !TABLES_WITH_CDC_ADDED.contains(partition.metadata().cfName)) return PartitionUpdate.fromIterator(partition, filter); // We want to skip the 'cdc' column. A simple solution for that is based on the fact that // 'PartitionUpdate.fromIterator()' will ignore any columns that are marked as 'fetched' but not 'queried'. ColumnFilter.Builder builder = ColumnFilter.allColumnsBuilder(partition.metadata()); for (ColumnDefinition column : filter.fetchedColumns()) { if (!column.name.toString().equals("cdc")) builder.add(column); } return PartitionUpdate.fromIterator(partition, builder.build()); }
/** * Creates a PartitionUpdate from a partition containing some schema table content. * This is mainly calling {@code PartitionUpdate.fromIterator} except for the fact that it deals with * the problem described in #12236. */ private static PartitionUpdate makeUpdateForSchema(UnfilteredRowIterator partition, ColumnFilter filter) { // This method is used during schema migration tasks, and if cdc is disabled, we want to force excluding the // 'cdc' column from the TABLES/VIEWS schema table because it is problematic if received by older nodes (see #12236 // and #12697). Otherwise though, we just simply "buffer" the content of the partition into a PartitionUpdate. if (DatabaseDescriptor.isCDCEnabled() || !TABLES_WITH_CDC_ADDED.contains(partition.metadata().cfName)) return PartitionUpdate.fromIterator(partition, filter); // We want to skip the 'cdc' column. A simple solution for that is based on the fact that // 'PartitionUpdate.fromIterator()' will ignore any columns that are marked as 'fetched' but not 'queried'. ColumnFilter.Builder builder = ColumnFilter.allColumnsBuilder(partition.metadata()); for (ColumnDefinition column : filter.fetchedColumns()) { if (!column.name.toString().equals("cdc")) builder.add(column); } return PartitionUpdate.fromIterator(partition, builder.build()); }
/** * Creates a PartitionUpdate from a partition containing some schema table content. * This is mainly calling {@code PartitionUpdate.fromIterator} except for the fact that it deals with * the problem described in #12236. */ private static PartitionUpdate makeUpdateForSchema(UnfilteredRowIterator partition, ColumnFilter filter) { // This method is used during schema migration tasks, and if cdc is disabled, we want to force excluding the // 'cdc' column from the TABLES/VIEWS schema table because it is problematic if received by older nodes (see #12236 // and #12697). Otherwise though, we just simply "buffer" the content of the partition into a PartitionUpdate. if (DatabaseDescriptor.isCDCEnabled() || !TABLES_WITH_CDC_ADDED.contains(partition.metadata().cfName)) return PartitionUpdate.fromIterator(partition, filter); // We want to skip the 'cdc' column. A simple solution for that is based on the fact that // 'PartitionUpdate.fromIterator()' will ignore any columns that are marked as 'fetched' but not 'queried'. ColumnFilter.Builder builder = ColumnFilter.allColumnsBuilder(partition.metadata()); for (ColumnDefinition column : filter.fetchedColumns()) { if (!column.name.toString().equals("cdc")) builder.add(column); } return PartitionUpdate.fromIterator(partition, builder.build()); }
@VisibleForTesting CommitLog(CommitLogArchiver archiver) { this.configuration = new Configuration(DatabaseDescriptor.getCommitLogCompression(), DatabaseDescriptor.getEncryptionContext()); DatabaseDescriptor.createAllDirectories(); this.archiver = archiver; metrics = new CommitLogMetrics(); executor = DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.batch ? new BatchCommitLogService(this) : new PeriodicCommitLogService(this); segmentManager = DatabaseDescriptor.isCDCEnabled() ? new CommitLogSegmentManagerCDC(this, DatabaseDescriptor.getCommitLogLocation()) : new CommitLogSegmentManagerStandard(this, DatabaseDescriptor.getCommitLogLocation()); // register metrics metrics.attach(executor, segmentManager); }
@VisibleForTesting CommitLog(CommitLogArchiver archiver) { this.configuration = new Configuration(DatabaseDescriptor.getCommitLogCompression(), DatabaseDescriptor.getEncryptionContext()); DatabaseDescriptor.createAllDirectories(); this.archiver = archiver; metrics = new CommitLogMetrics(); executor = DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.batch ? new BatchCommitLogService(this) : new PeriodicCommitLogService(this); segmentManager = DatabaseDescriptor.isCDCEnabled() ? new CommitLogSegmentManagerCDC(this, DatabaseDescriptor.getCommitLogLocation()) : new CommitLogSegmentManagerStandard(this, DatabaseDescriptor.getCommitLogLocation()); // register metrics metrics.attach(executor, segmentManager); }
@VisibleForTesting CommitLog(CommitLogArchiver archiver) { this.configuration = new Configuration(DatabaseDescriptor.getCommitLogCompression(), DatabaseDescriptor.getEncryptionContext()); DatabaseDescriptor.createAllDirectories(); this.archiver = archiver; metrics = new CommitLogMetrics(); executor = DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.batch ? new BatchCommitLogService(this) : new PeriodicCommitLogService(this); segmentManager = DatabaseDescriptor.isCDCEnabled() ? new CommitLogSegmentManagerCDC(this, DatabaseDescriptor.getCommitLogLocation()) : new CommitLogSegmentManagerStandard(this, DatabaseDescriptor.getCommitLogLocation()); // register metrics metrics.attach(executor, segmentManager); }
private static void addTableParamsToRowBuilder(TableParams params, Row.SimpleBuilder builder) { builder.add("bloom_filter_fp_chance", params.bloomFilterFpChance) .add("comment", params.comment) .add("dclocal_read_repair_chance", params.dcLocalReadRepairChance) .add("default_time_to_live", params.defaultTimeToLive) .add("gc_grace_seconds", params.gcGraceSeconds) .add("max_index_interval", params.maxIndexInterval) .add("memtable_flush_period_in_ms", params.memtableFlushPeriodInMs) .add("min_index_interval", params.minIndexInterval) .add("read_repair_chance", params.readRepairChance) .add("speculative_retry", params.speculativeRetry.toString()) .add("crc_check_chance", params.crcCheckChance) .add("caching", params.caching.asMap()) .add("compaction", params.compaction.asMap()) .add("compression", params.compression.asMap()) .add("extensions", params.extensions); // Only add CDC-enabled flag to schema if it's enabled on the node. This is to work around RTE's post-8099 if a 3.8+ // node sends table schema to a < 3.8 versioned node with an unknown column. if (DatabaseDescriptor.isCDCEnabled()) builder.add("cdc", params.cdc); }
private static void addTableParamsToRowBuilder(TableParams params, Row.SimpleBuilder builder) { builder.add("bloom_filter_fp_chance", params.bloomFilterFpChance) .add("comment", params.comment) .add("dclocal_read_repair_chance", params.dcLocalReadRepairChance) .add("default_time_to_live", params.defaultTimeToLive) .add("gc_grace_seconds", params.gcGraceSeconds) .add("max_index_interval", params.maxIndexInterval) .add("memtable_flush_period_in_ms", params.memtableFlushPeriodInMs) .add("min_index_interval", params.minIndexInterval) .add("read_repair_chance", params.readRepairChance) .add("speculative_retry", params.speculativeRetry.toString()) .add("crc_check_chance", params.crcCheckChance) .add("caching", params.caching.asMap()) .add("compaction", params.compaction.asMap()) .add("compression", params.compression.asMap()) .add("extensions", params.extensions); // Only add CDC-enabled flag to schema if it's enabled on the node. This is to work around RTE's post-8099 if a 3.8+ // node sends table schema to a < 3.8 versioned node with an unknown column. if (DatabaseDescriptor.isCDCEnabled()) builder.add("cdc", params.cdc); }
private static void addTableParamsToRowBuilder(TableParams params, Row.SimpleBuilder builder) { builder.add("bloom_filter_fp_chance", params.bloomFilterFpChance) .add("comment", params.comment) .add("dclocal_read_repair_chance", params.dcLocalReadRepairChance) .add("default_time_to_live", params.defaultTimeToLive) .add("gc_grace_seconds", params.gcGraceSeconds) .add("max_index_interval", params.maxIndexInterval) .add("memtable_flush_period_in_ms", params.memtableFlushPeriodInMs) .add("min_index_interval", params.minIndexInterval) .add("read_repair_chance", params.readRepairChance) .add("speculative_retry", params.speculativeRetry.toString()) .add("crc_check_chance", params.crcCheckChance) .add("caching", params.caching.asMap()) .add("compaction", params.compaction.asMap()) .add("compression", params.compression.asMap()) .add("extensions", params.extensions); // Only add CDC-enabled flag to schema if it's enabled on the node. This is to work around RTE's post-8099 if a 3.8+ // node sends table schema to a < 3.8 versioned node with an unknown column. if (DatabaseDescriptor.isCDCEnabled()) builder.add("cdc", params.cdc); }