Skip to content

Commit a49806c

Browse files
Comment cleanup
1 parent ee3d57b commit a49806c

6 files changed

Lines changed: 1 addition & 27 deletions

File tree

src/java/org/apache/cassandra/config/DatabaseDescriptor.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,9 +3412,6 @@ public static void initializeCommitLogDiskAccessMode()
34123412
commitLogWriteDiskAccessMode = accessModeDirectIoPair.left;
34133413
}
34143414

3415-
/**
3416-
* Return background write disk access mode.
3417-
*/
34183415
public static DiskAccessMode getBackgroundWriteDiskAccessMode()
34193416
{
34203417
return backgroundWriteDiskAccessMode;
@@ -3437,13 +3434,11 @@ public static void initializeBackgroundWriteDiskAccessMode()
34373434
{
34383435
DiskAccessMode providedMode = conf.background_write_disk_access_mode;
34393436

3440-
// For 'auto', default to standard (conservative, safe default)
34413437
if (providedMode == DiskAccessMode.auto)
34423438
{
34433439
providedMode = DiskAccessMode.standard;
34443440
}
34453441

3446-
// Validate Direct IO is supported on ALL data directories if requested
34473442
if (providedMode == DiskAccessMode.direct)
34483443
{
34493444
// DataStorageSpec already rejects negatives at parse time; zero is the remaining
@@ -3453,7 +3448,6 @@ public static void initializeBackgroundWriteDiskAccessMode()
34533448
throw new ConfigurationException("direct_write_buffer_size must be > 0 when background_write_disk_access_mode is 'direct'. " +
34543449
"Got: " + conf.direct_write_buffer_size, false);
34553450

3456-
// Only check Direct IO support if not running as a tool
34573451
if (!toolInitialized)
34583452
{
34593453
List<String> unsupportedLocations = new ArrayList<>();

src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
public class CompressedSequentialWriter extends SequentialWriter
4949
{
50-
// Checksum writer for CRC per chunk and full file digest
5150
private final ChecksumWriter crcMetadata;
5251

5352
// holds offset in the file where current chunk should be written

src/java/org/apache/cassandra/io/compress/DirectCompressedSequentialWriter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public class DirectCompressedSequentialWriter extends CompressedSequentialWriter
6767
// per JVM so a misconfiguration is operator-visible without per-SSTable spam.
6868
private static final AtomicBoolean undersizedBufferWarned = new AtomicBoolean(false);
6969

70-
// Per-chunk CRC32 trailer width in bytes (CRC32.getValue() stored via putInt).
7170
private static final int CRC_LENGTH = Integer.BYTES;
7271

7372
// Sized to hold at least one full chunk + CRC + post-flush leftover:

src/java/org/apache/cassandra/io/util/SequentialWriter.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,6 @@ public SequentialWriter(File file, SequentialWriterOption option, boolean strict
185185
this(file, option.allocateBuffer(), option, strictFlushing);
186186
}
187187

188-
/**
189-
* Constructor that accepts a buffer and optional open options for the file channel.
190-
* This allows subclasses to provide custom buffers and specify options like O_DIRECT for Direct IO.
191-
*
192-
* @param file the file being written
193-
* @param buffer write buffer
194-
* @param option writer options
195-
* @param strictFlushing whether to enforce strict flushing
196-
* @param extraOpenOptions additional options to pass to FileChannel.open (e.g., ExtendedOpenOption.DIRECT)
197-
*/
198188
protected SequentialWriter(File file, ByteBuffer buffer, SequentialWriterOption option, boolean strictFlushing,
199189
OpenOption... extraOpenOptions)
200190
{

src/java/org/apache/cassandra/service/StartupChecks.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ public void execute(StartupChecksConfiguration configuration) throws StartupExce
260260
if (DatabaseDescriptor.getCommitLogWriteDiskAccessMode() == Config.DiskAccessMode.direct)
261261
directIOWritePaths.add(new File(DatabaseDescriptor.getCommitLogLocation()).toPath());
262262

263-
// Add data directories when Direct IO is enabled for background writes
264263
if (DatabaseDescriptor.getBackgroundWriteDiskAccessMode() == Config.DiskAccessMode.direct)
265264
{
266265
for (String dataDir : DatabaseDescriptor.getAllDataFileLocations())
@@ -739,7 +738,6 @@ public void execute(StartupChecksConfiguration configuration) throws StartupExce
739738
if (configuration.isDisabled(name()))
740739
return;
741740

742-
// Check if either compaction reads or writes use Direct IO
743741
boolean directReads = DatabaseDescriptor.getCompactionReadDiskAccessMode() == Config.DiskAccessMode.direct;
744742
boolean directWrites = DatabaseDescriptor.getBackgroundWriteDiskAccessMode() == Config.DiskAccessMode.direct;
745743

test/distributed/org/apache/cassandra/distributed/test/StreamingDirectWriteTest.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,12 @@
2929

3030
import static org.assertj.core.api.Assertions.assertThat;
3131

32-
/**
33-
* Verifies the chunked streaming receiver path (CassandraStreamReader / CassandraCompressedStreamReader →
34-
* BigTableWriter.openDataWriter → DataComponent.buildWriter with OperationType.STREAM) writes via
35-
* {@link org.apache.cassandra.io.compress.DirectCompressedSequentialWriter} when direct background writes
36-
* are enabled. Entire-SSTable (zero-copy) streaming bypasses DataComponent.buildWriter, so it must be
37-
* disabled here.
38-
*/
3932
public class StreamingDirectWriteTest extends TestBaseImpl
4033
{
4134
@Test
4235
public void testChunkedStreamReceiverWithDirectWrites() throws IOException
4336
{
37+
// ZCS streaming bypasses DataComponent.buildWriter; disable to exercise the chunked receiver path.
4438
try (Cluster cluster = init(Cluster.build(2)
4539
.withConfig(c -> c.with(Feature.NETWORK, Feature.GOSSIP)
4640
.set("stream_entire_sstables", false)

0 commit comments

Comments
 (0)