jacek-lewandowski commented on code in PR #2689:
URL: https://github.com/apache/cassandra/pull/2689#discussion_r1328826849
##########
src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableWriter.java:
##########
@@ -358,25 +315,52 @@ public MmappedRegionsCache getMmappedRegionsCache()
}
@Override
- public SequentialWriter getDataWriter()
+ protected SequentialWriter openDataWriter(OperationType operationType)
+ {
+ checkState(dataWriter == null, "Data writer has been already
opened.");
+ dataWriter = DataComponent.buildWriter(descriptor,
+
getTableMetadataRef().getLocal(),
+
getIOOptions().writerOptions,
+ getMetadataCollector(),
+ operationType,
+
getIOOptions().flushCompression);
+ return dataWriter;
+ }
+
+ SequentialWriter getDataWriter()
{
return ensuringInBuildInternalContext(dataWriter);
}
@Override
- public BtiFormatPartitionWriter getPartitionWriter()
+ protected BtiFormatPartitionWriter openPartitionWriter()
{
+ checkState(partitionWriter == null, "Partition writer has been
already opened.");
+ partitionWriter = new
BtiFormatPartitionWriter(getSerializationHeader(),
Review Comment:
no, not only that - it is also to close the resources if the constructor
fails. And, also to access the already opened resource.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]