maedhroz commented on code in PR #2267:
URL: https://github.com/apache/cassandra/pull/2267#discussion_r1185307931
##########
test/unit/org/apache/cassandra/schema/MockSchema.java:
##########
@@ -219,6 +233,55 @@ public static SSTableReader sstable(int generation, int
size, boolean keepRef, l
return reader;
}
}
+ else if (format == BtiFormat.instance)
+ {
+ Set<Component> components = ImmutableSet.of(Components.DATA,
BtiFormat.Components.PARTITION_INDEX, BtiFormat.Components.ROW_INDEX,
Components.FILTER, Components.TOC);
+ for (Component component : components)
+ {
+ File file = descriptor.fileFor(component);
+ file.createFileIfNotExists();
+ }
+ // .complete() with size to make sstable.onDiskLength work
+ try (FileHandle fileHandle = new
FileHandle.Builder(tempFile).bufferSize(size).withLengthOverride(size).complete())
+ {
+ if (size > 0)
+ {
+ try
+ {
+ File file = descriptor.fileFor(Components.DATA);
+ Util.setFileLength(file, size);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
Review Comment:
nit: This little chunk of code looks duplicated above, but not a huge deal...
--
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]