Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-ma committed Dec 11, 2024
1 parent 6b3a419 commit 1aa55c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions velox/common/compression/Compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ bool Codec::isAvailable(CompressionKind kind) {
}

std::optional<uint64_t> Codec::getUncompressedLength(
uint64_t inputLength,
const uint8_t* input) const {
const uint8_t* input,
uint64_t inputLength) const {
return std::nullopt;
}

Expand All @@ -224,11 +224,11 @@ Codec::makeStreamingDecompressor() {
"Streaming decompression is unsupported with {} format.", name()));
}

std::string Codec::name() const {
return compressionKindToString(compressionKind());
}

int32_t Codec::compressionLevel() const {
return kUseDefaultCompressionLevel;
}

std::string Codec::name() const {
return compressionKindToString(compressionKind());
}
} // namespace facebook::velox::common
10 changes: 5 additions & 5 deletions velox/common/compression/Compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ class Codec {
/// Note: This functionality is not universally supported by all compression
/// libraries. If not supported, `std::nullopt` will be returned.
virtual std::optional<uint64_t> getUncompressedLength(
uint64_t inputLength,
const uint8_t* input) const;
const uint8_t* input,
uint64_t inputLength) const;

// Create a streaming compressor instance.
virtual Expected<std::shared_ptr<StreamingCompressor>>
Expand All @@ -232,12 +232,12 @@ class Codec {
// This Codec's compression type.
virtual CompressionKind compressionKind() const = 0;

// The name of this Codec's compression type.
std::string name() const;

// This Codec's compression level, if applicable.
virtual int32_t compressionLevel() const;

// The name of this Codec's compression type.
std::string name() const;

private:
// Initializes the codec's resources.
virtual Status init();
Expand Down
4 changes: 2 additions & 2 deletions velox/common/compression/tests/CompressionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@ TEST_P(CodecTest, getUncompressedLength) {

if (Codec::supportsGetUncompressedLength(getCompressionKind())) {
ASSERT_EQ(
codec->getUncompressedLength(compressedLength, compressed.data()),
codec->getUncompressedLength(compressed.data(), compressedLength),
inputLength);
} else {
ASSERT_EQ(
codec->getUncompressedLength(compressedLength, compressed.data()),
codec->getUncompressedLength(compressed.data(), compressedLength),
std::nullopt);
}
}
Expand Down

0 comments on commit 1aa55c1

Please sign in to comment.