Skip to content

Commit

Permalink
[Kernel] Add table feature manipulation utilities in the Protocol (#4157
Browse files Browse the repository at this point in the history
)

## Description
Utilities for
* finding the implicitly and explicitly enabled table features
* adding a feature to the protocol and creating an upgraded protocol

## How was this patch tested?
Unittests.
  • Loading branch information
vkorukanti authored Feb 20, 2025
1 parent e621c5d commit c612006
Show file tree
Hide file tree
Showing 7 changed files with 830 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ public Transaction build(Engine engine) {
if (!newWriterFeatures.isEmpty()) {
logger.info("Automatically enabling writer features: {}", newWriterFeatures);
shouldUpdateProtocol = true;
List<String> oldWriterFeatures = protocol.getWriterFeatures();
Set<String> oldWriterFeatures = protocol.getWriterFeatures();
protocol = protocol.withNewWriterFeatures(newWriterFeatures);
List<String> curWriterFeatures = protocol.getWriterFeatures();
Set<String> curWriterFeatures = protocol.getWriterFeatures();
checkArgument(!Objects.equals(oldWriterFeatures, curWriterFeatures));
TableFeatures.validateWriteSupportedTable(protocol, metadata, table.getPath(engine));
}
Expand Down Expand Up @@ -287,10 +287,6 @@ private Metadata getInitialMetadata() {
}

private Protocol getInitialProtocol() {
return new Protocol(
DEFAULT_READ_VERSION,
DEFAULT_WRITE_VERSION,
null /* readerFeatures */,
null /* writerFeatures */);
return new Protocol(DEFAULT_READ_VERSION, DEFAULT_WRITE_VERSION);
}
}
Loading

0 comments on commit c612006

Please sign in to comment.