maedhroz commented on code in PR #2420:
URL: https://github.com/apache/cassandra/pull/2420#discussion_r1235790135
##########
src/java/org/apache/cassandra/io/sstable/SSTableZeroCopyWriter.java:
##########
@@ -61,12 +58,8 @@ public SSTableZeroCopyWriter(Builder<?, ?> builder,
lifecycleNewTracker.trackNew(this);
this.componentWriters = new HashMap<>();
- if
(!descriptor.getFormat().streamingComponents().containsAll(components))
- throw new AssertionError(format("Unsupported streaming component
detected %s",
-
Sets.difference(ImmutableSet.copyOf(components),
descriptor.getFormat().streamingComponents())));
-
Review Comment:
@pkolaczk @mike-tr-adamson I'm not sure we want to just remove this
validation, but checking SAI components raises some other questions. The
simplest way around this for now might be...
```
Set<Component> unsupported = components.stream()
.filter(c ->
!descriptor.getFormat().streamingComponents().contains(c))
.filter(c-> c.type !=
SSTableFormat.Components.Types.CUSTOM)
.collect(Collectors.toSet());
if (!unsupported.isEmpty())
throw new AssertionError(format("Unsupported streaming component
detected %s", unsupported));
```
However, it might also be worth looking at why we use `CUSTOM` for SAI
components in the first place. Is now the time to simply create a new
first-class type in `Types`?
```
public static final Component.Type SAI = Component.Type.create("SAI",
"SAI\+.*.db", null);
```
(The regex could be stricter, but details...)
If we do this, we the `CUSTOM` in the check above becomes `SAI`, we replace
`CUSTOM` w/ `SAI` in a few places in the SAI code, like `Version`, and things
should just work, right?
--
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]