diff --git a/pyvelox/serde.cpp b/pyvelox/serde.cpp index 19ffde942dd9..64f6ab0be102 100644 --- a/pyvelox/serde.cpp +++ b/pyvelox/serde.cpp @@ -24,7 +24,7 @@ namespace facebook::velox::py { namespace py = pybind11; namespace { -VectorPtr pyRestoreVectorFromFileHelper(const char* FOLLY_NONNULL filePath) { +VectorPtr pyRestoreVectorFromFileHelper(const char* filePath) { using namespace facebook::velox; memory::MemoryPool* pool = PyVeloxContext::getSingletonInstance().pool(); return restoreVectorFromFile(filePath, pool); diff --git a/velox/common/base/BloomFilter.h b/velox/common/base/BloomFilter.h index 0ad1b94f66c7..1d23e382834b 100644 --- a/velox/common/base/BloomFilter.h +++ b/velox/common/base/BloomFilter.h @@ -114,16 +114,14 @@ class BloomFilter { } inline static void - set(uint64_t* FOLLY_NONNULL bloom, int32_t bloomSize, uint64_t hashCode) { + set(uint64_t* bloom, int32_t bloomSize, uint64_t hashCode) { auto mask = bloomMask(hashCode); auto index = bloomIndex(bloomSize, hashCode); bloom[index] |= mask; } - inline static bool test( - const uint64_t* FOLLY_NONNULL bloom, - int32_t bloomSize, - uint64_t hashCode) { + inline static bool + test(const uint64_t* bloom, int32_t bloomSize, uint64_t hashCode) { auto mask = bloomMask(hashCode); auto index = bloomIndex(bloomSize, hashCode); return mask == (bloom[index] & mask); diff --git a/velox/common/base/tests/Memcpy.cpp b/velox/common/base/tests/Memcpy.cpp index bcca8960986a..2ab51f87815e 100644 --- a/velox/common/base/tests/Memcpy.cpp +++ b/velox/common/base/tests/Memcpy.cpp @@ -41,10 +41,10 @@ uint64_t sum(uint64_t* data, int32_t size) { } struct CopyCallable { - void* FOLLY_NULLABLE source; - void* FOLLY_NULLABLE destination; + void* source; + void* destination; int64_t size; - Semaphore* FOLLY_NULLABLE sem; + Semaphore* sem; void operator()() { if (FLAGS_system_memcpy) { diff --git a/velox/common/caching/ScanTracker.h b/velox/common/caching/ScanTracker.h index 8103339f7665..40242c89df2a 100644 --- a/velox/common/caching/ScanTracker.h +++ b/velox/common/caching/ScanTracker.h @@ -119,7 +119,7 @@ class ScanTracker { std::string_view id, std::function unregisterer, int32_t loadQuantum, - FileGroupStats* FOLLY_NULLABLE fileGroupStats = nullptr) + FileGroupStats* fileGroupStats = nullptr) : id_(id), unregisterer_(unregisterer), loadQuantum_(loadQuantum), @@ -172,7 +172,7 @@ class ScanTracker { return id_; } - FileGroupStats* FOLLY_NULLABLE fileGroupStats() const { + FileGroupStats* fileGroupStats() const { return fileGroupStats_; } @@ -190,7 +190,7 @@ class ScanTracker { // single 10MB reference for 'fileGroupStats_'. 0 means the read // size is unlimited. const int32_t loadQuantum_; - FileGroupStats* FOLLY_NULLABLE fileGroupStats_; + FileGroupStats* fileGroupStats_; }; } // namespace facebook::velox::cache diff --git a/velox/common/file/File.h b/velox/common/file/File.h index daf9fad061e3..acd1359f1e08 100644 --- a/velox/common/file/File.h +++ b/velox/common/file/File.h @@ -50,8 +50,8 @@ class ReadFile { // buffer 'buf'. The bytes are returned as a string_view pointing to 'buf'. // // This method should be thread safe. - virtual std::string_view - pread(uint64_t offset, uint64_t length, void* FOLLY_NONNULL buf) const = 0; + virtual std::string_view pread(uint64_t offset, uint64_t length, void* buf) + const = 0; // Same as above, but returns owned data directly. // @@ -174,10 +174,8 @@ class InMemoryReadFile : public ReadFile { explicit InMemoryReadFile(std::string file) : ownedFile_(std::move(file)), file_(ownedFile_) {} - std::string_view pread( - uint64_t offset, - uint64_t length, - void* FOLLY_NONNULL buf) const override; + std::string_view pread(uint64_t offset, uint64_t length, void* buf) + const override; std::string pread(uint64_t offset, uint64_t length) const override; @@ -213,7 +211,7 @@ class InMemoryReadFile : public ReadFile { class InMemoryWriteFile final : public WriteFile { public: - explicit InMemoryWriteFile(std::string* FOLLY_NONNULL file) : file_(file) {} + explicit InMemoryWriteFile(std::string* file) : file_(file) {} void append(std::string_view data) final; void append(std::unique_ptr data) final; @@ -222,7 +220,7 @@ class InMemoryWriteFile final : public WriteFile { uint64_t size() const final; private: - std::string* FOLLY_NONNULL file_; + std::string* file_; }; // Current implementation for the local version is quite simple (e.g. no @@ -237,8 +235,8 @@ class LocalReadFile final : public ReadFile { ~LocalReadFile(); - std::string_view - pread(uint64_t offset, uint64_t length, void* FOLLY_NONNULL buf) const final; + std::string_view pread(uint64_t offset, uint64_t length, void* buf) + const final; uint64_t size() const final; @@ -264,8 +262,7 @@ class LocalReadFile final : public ReadFile { } private: - void preadInternal(uint64_t offset, uint64_t length, char* FOLLY_NONNULL pos) - const; + void preadInternal(uint64_t offset, uint64_t length, char* pos) const; std::string path_; int32_t fd_; @@ -289,7 +286,7 @@ class LocalWriteFile final : public WriteFile { uint64_t size() const final; private: - FILE* FOLLY_NONNULL file_; + FILE* file_; mutable long size_; bool closed_{false}; }; diff --git a/velox/connectors/fuzzer/FuzzerConnector.cpp b/velox/connectors/fuzzer/FuzzerConnector.cpp index d2f44c6039db..7c75c956863a 100644 --- a/velox/connectors/fuzzer/FuzzerConnector.cpp +++ b/velox/connectors/fuzzer/FuzzerConnector.cpp @@ -22,7 +22,7 @@ namespace facebook::velox::connector::fuzzer { FuzzerDataSource::FuzzerDataSource( const std::shared_ptr& outputType, const std::shared_ptr& tableHandle, - velox::memory::MemoryPool* FOLLY_NONNULL pool) + velox::memory::MemoryPool* pool) : outputType_(outputType), pool_(pool) { auto fuzzerTableHandle = std::dynamic_pointer_cast(tableHandle); diff --git a/velox/connectors/fuzzer/FuzzerConnector.h b/velox/connectors/fuzzer/FuzzerConnector.h index e6d240e53679..d04797f65187 100644 --- a/velox/connectors/fuzzer/FuzzerConnector.h +++ b/velox/connectors/fuzzer/FuzzerConnector.h @@ -56,7 +56,7 @@ class FuzzerDataSource : public DataSource { FuzzerDataSource( const std::shared_ptr& outputType, const std::shared_ptr& tableHandle, - velox::memory::MemoryPool* FOLLY_NONNULL pool); + velox::memory::MemoryPool* pool); void addSplit(std::shared_ptr split) override; @@ -96,7 +96,7 @@ class FuzzerDataSource : public DataSource { size_t completedRows_{0}; size_t completedBytes_{0}; - memory::MemoryPool* FOLLY_NONNULL pool_; + memory::MemoryPool* pool_; }; class FuzzerConnector final : public Connector { @@ -104,7 +104,7 @@ class FuzzerConnector final : public Connector { FuzzerConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE /*executor*/) + folly::Executor* /*executor*/) : Connector(id) {} std::unique_ptr createDataSource( @@ -113,7 +113,7 @@ class FuzzerConnector final : public Connector { const std::unordered_map< std::string, std::shared_ptr>& /*columnHandles*/, - ConnectorQueryCtx* FOLLY_NONNULL connectorQueryCtx) override final { + ConnectorQueryCtx* connectorQueryCtx) override final { return std::make_unique( outputType, tableHandle, connectorQueryCtx->memoryPool()); } @@ -130,17 +130,17 @@ class FuzzerConnector final : public Connector { class FuzzerConnectorFactory : public ConnectorFactory { public: - static constexpr const char* FOLLY_NONNULL kFuzzerConnectorName{"fuzzer"}; + static constexpr const char* kFuzzerConnectorName{"fuzzer"}; FuzzerConnectorFactory() : ConnectorFactory(kFuzzerConnectorName) {} - explicit FuzzerConnectorFactory(const char* FOLLY_NONNULL connectorName) + explicit FuzzerConnectorFactory(const char* connectorName) : ConnectorFactory(connectorName) {} std::shared_ptr newConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE executor = nullptr) override { + folly::Executor* executor = nullptr) override { return std::make_shared(id, config, executor); } }; diff --git a/velox/connectors/hive/HiveConnector.cpp b/velox/connectors/hive/HiveConnector.cpp index 9b2af5d0793d..c693e8ee0922 100644 --- a/velox/connectors/hive/HiveConnector.cpp +++ b/velox/connectors/hive/HiveConnector.cpp @@ -54,7 +54,7 @@ namespace facebook::velox::connector::hive { HiveConnector::HiveConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE executor) + folly::Executor* executor) : Connector(id), hiveConfig_(std::make_shared(config)), fileHandleFactory_( diff --git a/velox/connectors/hive/HiveConnector.h b/velox/connectors/hive/HiveConnector.h index 6232e418465f..d3c59e36c2fc 100644 --- a/velox/connectors/hive/HiveConnector.h +++ b/velox/connectors/hive/HiveConnector.h @@ -32,7 +32,7 @@ class HiveConnector : public Connector { HiveConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE executor); + folly::Executor* executor); const std::shared_ptr& connectorConfig() const override { return hiveConfig_->config(); @@ -60,7 +60,7 @@ class HiveConnector : public Connector { ConnectorQueryCtx* connectorQueryCtx, CommitStrategy commitStrategy) override final; - folly::Executor* FOLLY_NULLABLE executor() const override { + folly::Executor* executor() const override { return executor_; } @@ -77,18 +77,17 @@ class HiveConnector : public Connector { protected: const std::shared_ptr hiveConfig_; FileHandleFactory fileHandleFactory_; - folly::Executor* FOLLY_NULLABLE executor_; + folly::Executor* executor_; }; class HiveConnectorFactory : public ConnectorFactory { public: - static constexpr const char* FOLLY_NONNULL kHiveConnectorName = "hive"; - static constexpr const char* FOLLY_NONNULL kHiveHadoop2ConnectorName = - "hive-hadoop2"; + static constexpr const char* kHiveConnectorName = "hive"; + static constexpr const char* kHiveHadoop2ConnectorName = "hive-hadoop2"; HiveConnectorFactory() : ConnectorFactory(kHiveConnectorName) {} - explicit HiveConnectorFactory(const char* FOLLY_NONNULL connectorName) + explicit HiveConnectorFactory(const char* connectorName) : ConnectorFactory(connectorName) {} /// Register HiveConnector components such as Dwrf, Parquet readers and @@ -98,7 +97,7 @@ class HiveConnectorFactory : public ConnectorFactory { std::shared_ptr newConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE executor = nullptr) override { + folly::Executor* executor = nullptr) override { return std::make_shared(id, config, executor); } }; diff --git a/velox/connectors/hive/SplitReader.h b/velox/connectors/hive/SplitReader.h index add987a0aef6..83cd6b3ae748 100644 --- a/velox/connectors/hive/SplitReader.h +++ b/velox/connectors/hive/SplitReader.h @@ -117,7 +117,7 @@ class SplitReader { const std::shared_ptr& tableSchema); void setPartitionValue( - common::ScanSpec* FOLLY_NONNULL spec, + common::ScanSpec* spec, const std::string& partitionKey, const std::optional& value) const; diff --git a/velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp b/velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp index 4382fabb84a6..6c3c44e53f71 100644 --- a/velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp +++ b/velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp @@ -44,7 +44,7 @@ class AbfsConfig { } private: - const Config* FOLLY_NONNULL config_; + const Config* config_; }; class AbfsReadFile::Impl { diff --git a/velox/connectors/tpch/TpchConnector.cpp b/velox/connectors/tpch/TpchConnector.cpp index 1bf4eac4c590..41df3e7251c2 100644 --- a/velox/connectors/tpch/TpchConnector.cpp +++ b/velox/connectors/tpch/TpchConnector.cpp @@ -63,7 +63,7 @@ TpchDataSource::TpchDataSource( const std::unordered_map< std::string, std::shared_ptr>& columnHandles, - velox::memory::MemoryPool* FOLLY_NONNULL pool) + velox::memory::MemoryPool* pool) : pool_(pool) { auto tpchTableHandle = std::dynamic_pointer_cast(tableHandle); diff --git a/velox/connectors/tpch/TpchConnector.h b/velox/connectors/tpch/TpchConnector.h index bfa6491dce0e..341b20254b85 100644 --- a/velox/connectors/tpch/TpchConnector.h +++ b/velox/connectors/tpch/TpchConnector.h @@ -75,7 +75,7 @@ class TpchDataSource : public DataSource { const std::unordered_map< std::string, std::shared_ptr>& columnHandles, - velox::memory::MemoryPool* FOLLY_NONNULL pool); + velox::memory::MemoryPool* pool); void addSplit(std::shared_ptr split) override; @@ -123,7 +123,7 @@ class TpchDataSource : public DataSource { size_t completedRows_{0}; size_t completedBytes_{0}; - memory::MemoryPool* FOLLY_NONNULL pool_; + memory::MemoryPool* pool_; }; class TpchConnector final : public Connector { @@ -131,7 +131,7 @@ class TpchConnector final : public Connector { TpchConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE /*executor*/) + folly::Executor* /*executor*/) : Connector(id) {} std::unique_ptr createDataSource( @@ -140,7 +140,7 @@ class TpchConnector final : public Connector { const std::unordered_map< std::string, std::shared_ptr>& columnHandles, - ConnectorQueryCtx* FOLLY_NONNULL connectorQueryCtx) override final { + ConnectorQueryCtx* connectorQueryCtx) override final { return std::make_unique( outputType, tableHandle, @@ -160,17 +160,17 @@ class TpchConnector final : public Connector { class TpchConnectorFactory : public ConnectorFactory { public: - static constexpr const char* FOLLY_NONNULL kTpchConnectorName{"tpch"}; + static constexpr const char* kTpchConnectorName{"tpch"}; TpchConnectorFactory() : ConnectorFactory(kTpchConnectorName) {} - explicit TpchConnectorFactory(const char* FOLLY_NONNULL connectorName) + explicit TpchConnectorFactory(const char* connectorName) : ConnectorFactory(connectorName) {} std::shared_ptr newConnector( const std::string& id, std::shared_ptr config, - folly::Executor* FOLLY_NULLABLE executor = nullptr) override { + folly::Executor* executor = nullptr) override { return std::make_shared(id, config, executor); } }; diff --git a/velox/docs/develop/arena.rst b/velox/docs/develop/arena.rst index 44c411dd2316..aabc79771d40 100644 --- a/velox/docs/develop/arena.rst +++ b/velox/docs/develop/arena.rst @@ -75,11 +75,11 @@ non-contiguous allocation, it frees all the blocks in that allocation. // Allocates 'size' contiguous bytes preceded by a Header. Returns // the address of Header. - Header* FOLLY_NONNULL allocate(int32_t size); + Header* allocate(int32_t size); // Adds the allocation of 'header' and any extensions (if header has // kContinued set) to the free list. - void free(Header* FOLLY_NONNULL header); + void free(Header* header); StlAllocator, an allocator backed by HashStringAllocator that can be used with STL containers, is implemented using the above allocate() and free() methods. @@ -116,7 +116,7 @@ The prepareRead() method allows deserializing the data using ByteInputStream. // Sets 'stream' to range over the data in the range of 'header' and // possible continuation ranges. static void prepareRead( - const Header* FOLLY_NONNULL header, + const Header* header, ByteInputStream& stream); Examples of Usage diff --git a/velox/dwio/common/BitConcatenation.cpp b/velox/dwio/common/BitConcatenation.cpp index 2a2e86a45ec9..5f37053f66a6 100644 --- a/velox/dwio/common/BitConcatenation.cpp +++ b/velox/dwio/common/BitConcatenation.cpp @@ -19,7 +19,7 @@ namespace facebook::velox::dwio::common { void BitConcatenation::append( - const uint64_t* FOLLY_NULLABLE bits, + const uint64_t* bits, int32_t begin, int32_t end) { int32_t numBits = end - begin; @@ -46,7 +46,7 @@ void BitConcatenation::appendOnes(int32_t numOnes) { } } -uint64_t* FOLLY_NONNULL BitConcatenation::ensureSpace(int32_t numBits) { +uint64_t* BitConcatenation::ensureSpace(int32_t numBits) { if (!*buffer_) { *buffer_ = AlignedBuffer::allocate(numBits_ + numBits, &pool_, true); } else if (numBits_ + numBits > (*buffer_)->capacity() * 8) { diff --git a/velox/dwio/common/BitConcatenation.h b/velox/dwio/common/BitConcatenation.h index cc812035d8b8..a8933936cf8c 100644 --- a/velox/dwio/common/BitConcatenation.h +++ b/velox/dwio/common/BitConcatenation.h @@ -38,7 +38,7 @@ class BitConcatenation { /// Appends 'bits' between bit offset 'begin' and 'end' to the result. /// A nullptr 'bits' is treated as a bit range with all bits set. - void append(const uint64_t* FOLLY_NULLABLE bits, int32_t begin, int32_t end); + void append(const uint64_t* bits, int32_t begin, int32_t end); /// Appends 'numOnes' ones. void appendOnes(int32_t numOnes); @@ -55,7 +55,7 @@ class BitConcatenation { private: // Allocates or reallocates '*buffer' to have space for 'numBits_ + newBits' // bits. Retuns a pointer to the first word of 'buffer_'. - uint64_t* FOLLY_NONNULL ensureSpace(int32_t newBits); + uint64_t* ensureSpace(int32_t newBits); void setSize() { if (*buffer_) { @@ -64,7 +64,7 @@ class BitConcatenation { } memory::MemoryPool& pool_; - BufferPtr* FOLLY_NULLABLE buffer_{nullptr}; + BufferPtr* buffer_{nullptr}; int32_t numBits_{0}; bool hasZeros_{false}; }; diff --git a/velox/dwio/common/BitPackDecoder.cpp b/velox/dwio/common/BitPackDecoder.cpp index 24fee5e59527..677963d995ec 100644 --- a/velox/dwio/common/BitPackDecoder.cpp +++ b/velox/dwio/common/BitPackDecoder.cpp @@ -35,7 +35,7 @@ auto as4x64(__m256i x) { } template -void store8Ints(__m256i eightInts, int32_t i, T* FOLLY_NONNULL result) { +void store8Ints(__m256i eightInts, int32_t i, T* result) { if (sizeof(T) == 4) { _mm256_storeu_si256(reinterpret_cast<__m256i*>(result + i), eightInts); } else { diff --git a/velox/dwio/common/BitPackDecoder.h b/velox/dwio/common/BitPackDecoder.h index fc87fc369e12..33e73e2bc753 100644 --- a/velox/dwio/common/BitPackDecoder.h +++ b/velox/dwio/common/BitPackDecoder.h @@ -90,13 +90,13 @@ static const uint32_t BITPACK_MASKS[] = { /// stay under 'bufferEnd'. template void unpack( - const uint64_t* FOLLY_NULLABLE bits, + const uint64_t* bits, int32_t bitOffset, RowSet rows, int32_t rowBias, uint8_t bitWidth, - const char* FOLLY_NULLABLE bufferEnd, - T* FOLLY_NONNULL result); + const char* bufferEnd, + T* result); /// Unpack numValues number of input values from inputBuffer. The results /// will be written to result. numValues must be a multiple of 8. The @@ -793,10 +793,10 @@ inline void unpack( // sure not to access bytes past lastSafeWord + 7. The definition is put here // because it's inlined. inline uint64_t safeLoadBits( - const char* FOLLY_NONNULL ptr, + const char* ptr, int32_t bitOffset, uint8_t bitWidth, - const char* FOLLY_NONNULL lastSafeWord) { + const char* lastSafeWord) { VELOX_DCHECK_GE(7, bitOffset); VELOX_DCHECK_GE(56, bitWidth); if (ptr < lastSafeWord) { diff --git a/velox/dwio/common/BufferedInput.h b/velox/dwio/common/BufferedInput.h index e07e23b58f5f..2e21a199c286 100644 --- a/velox/dwio/common/BufferedInput.h +++ b/velox/dwio/common/BufferedInput.h @@ -33,7 +33,7 @@ class BufferedInput { std::shared_ptr readFile, memory::MemoryPool& pool, const MetricsLogPtr& metricsLog = MetricsLog::voidLog(), - IoStatistics* FOLLY_NULLABLE stats = nullptr, + IoStatistics* stats = nullptr, uint64_t maxMergeDistance = kMaxMergeDistance, std::optional wsVRLoad = std::nullopt) : BufferedInput( @@ -75,7 +75,7 @@ class BufferedInput { // these. virtual std::unique_ptr enqueue( velox::common::Region region, - const StreamIdentifier* FOLLY_NULLABLE si = nullptr); + const StreamIdentifier* si = nullptr); // load all regions to be read in an optimized way (IO efficiency) virtual void load(const LogType); @@ -137,7 +137,7 @@ class BufferedInput { return input_; } - virtual folly::Executor* FOLLY_NULLABLE executor() const { + virtual folly::Executor* executor() const { return nullptr; } diff --git a/velox/dwio/common/CachedBufferedInput.cpp b/velox/dwio/common/CachedBufferedInput.cpp index ddd57f1e8ac2..b3414793b277 100644 --- a/velox/dwio/common/CachedBufferedInput.cpp +++ b/velox/dwio/common/CachedBufferedInput.cpp @@ -157,7 +157,7 @@ int32_t adjustedReadPct(const cache::TrackingData& trackingData) { void CachedBufferedInput::load(const LogType) { // 'requests_ is cleared on exit. auto requests = std::move(requests_); - cache::SsdFile* FOLLY_NULLABLE ssdFile = nullptr; + cache::SsdFile* ssdFile = nullptr; auto ssdCache = cache_->ssdCache(); if (ssdCache) { ssdFile = &ssdCache->file(fileNum_); diff --git a/velox/dwio/common/CachedBufferedInput.h b/velox/dwio/common/CachedBufferedInput.h index 5a8280e06fa8..ceaad5ca9c01 100644 --- a/velox/dwio/common/CachedBufferedInput.h +++ b/velox/dwio/common/CachedBufferedInput.h @@ -51,7 +51,7 @@ struct CacheRequest { // for sparsely accessed large columns where hitting one piece // should not load the adjacent pieces. bool coalesces{true}; - const SeekableInputStream* FOLLY_NONNULL stream; + const SeekableInputStream* stream; }; class CachedBufferedInput : public BufferedInput { @@ -60,11 +60,11 @@ class CachedBufferedInput : public BufferedInput { std::shared_ptr readFile, const MetricsLogPtr& metricsLog, uint64_t fileNum, - cache::AsyncDataCache* FOLLY_NONNULL cache, + cache::AsyncDataCache* cache, std::shared_ptr tracker, uint64_t groupId, std::shared_ptr ioStats, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, const io::ReaderOptions& readerOptions) : BufferedInput( std::move(readFile), @@ -82,11 +82,11 @@ class CachedBufferedInput : public BufferedInput { CachedBufferedInput( std::shared_ptr input, uint64_t fileNum, - cache::AsyncDataCache* FOLLY_NONNULL cache, + cache::AsyncDataCache* cache, std::shared_ptr tracker, uint64_t groupId, std::shared_ptr ioStats, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, const io::ReaderOptions& readerOptions) : BufferedInput(std::move(input), readerOptions.getMemoryPool()), cache_(cache), @@ -106,7 +106,7 @@ class CachedBufferedInput : public BufferedInput { std::unique_ptr enqueue( velox::common::Region region, - const StreamIdentifier* FOLLY_NULLABLE si) override; + const StreamIdentifier* si) override; void load(const LogType) override; @@ -144,7 +144,7 @@ class CachedBufferedInput : public BufferedInput { options_); } - cache::AsyncDataCache* FOLLY_NONNULL cache() const { + cache::AsyncDataCache* cache() const { return cache_; } @@ -153,9 +153,9 @@ class CachedBufferedInput : public BufferedInput { // call for 'stream' since the load is to be triggered by the first // access. std::shared_ptr coalescedLoad( - const SeekableInputStream* FOLLY_NONNULL stream); + const SeekableInputStream* stream); - folly::Executor* FOLLY_NULLABLE executor() const override { + folly::Executor* executor() const override { return executor_; } @@ -175,12 +175,12 @@ class CachedBufferedInput : public BufferedInput { void readRegion(std::vector requests, bool prefetch); - cache::AsyncDataCache* FOLLY_NONNULL cache_; + cache::AsyncDataCache* cache_; const uint64_t fileNum_; std::shared_ptr tracker_; const uint64_t groupId_; std::shared_ptr ioStats_; - folly::Executor* const FOLLY_NULLABLE executor_; + folly::Executor* const executor_; // Regions that are candidates for loading. std::vector requests_; diff --git a/velox/dwio/common/DirectDecoder.h b/velox/dwio/common/DirectDecoder.h index b966a31d70d9..4cd9396d0936 100644 --- a/velox/dwio/common/DirectDecoder.h +++ b/velox/dwio/common/DirectDecoder.h @@ -44,21 +44,15 @@ class DirectDecoder : public IntDecoder { } template - void nextValues( - T* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls); + void nextValues(T* data, uint64_t numValues, const uint64_t* nulls); - void next( - int64_t* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls) override { + void next(int64_t* data, uint64_t numValues, const uint64_t* nulls) override { nextValues(data, numValues, nulls); } template void readWithVisitor( - const uint64_t* FOLLY_NULLABLE nulls, + const uint64_t* nulls, Visitor visitor, bool useFastPath = true) { skipPending(); @@ -132,7 +126,7 @@ class DirectDecoder : public IntDecoder { // Returns a pointer to the next element of 'size' bytes in the // buffer. If the element would straddle buffers, it is copied to // *temp and temp is returned. - const void* FOLLY_NONNULL readFixed(int32_t size, void* FOLLY_NONNULL temp) { + const void* readFixed(int32_t size, void* temp) { skipPending(); auto ptr = super::bufferStart; if (ptr && ptr + size <= super::bufferEnd) { @@ -149,7 +143,7 @@ class DirectDecoder : public IntDecoder { } template - void fastPath(const uint64_t* FOLLY_NULLABLE nulls, Visitor& visitor) { + void fastPath(const uint64_t* nulls, Visitor& visitor) { using T = typename Visitor::DataType; constexpr bool hasFilter = !std:: diff --git a/velox/dwio/common/FormatData.h b/velox/dwio/common/FormatData.h index 369e899effcf..034860460646 100644 --- a/velox/dwio/common/FormatData.h +++ b/velox/dwio/common/FormatData.h @@ -51,7 +51,7 @@ class FormatData { /// of a column are of interest, e.g. is null filter. virtual void readNulls( vector_size_t numValues, - const uint64_t* FOLLY_NULLABLE incomingNulls, + const uint64_t* incomingNulls, BufferPtr& nulls, bool nullsOnly = false) = 0; diff --git a/velox/dwio/common/InputStream.h b/velox/dwio/common/InputStream.h index c8c1c7cada3b..16bb7300ec18 100644 --- a/velox/dwio/common/InputStream.h +++ b/velox/dwio/common/InputStream.h @@ -46,7 +46,7 @@ class InputStream { explicit InputStream( const std::string& path, const MetricsLogPtr& metricsLog = MetricsLog::voidLog(), - IoStatistics* FOLLY_NULLABLE stats = nullptr) + IoStatistics* stats = nullptr) : path_{path}, metricsLog_{metricsLog}, stats_(stats) {} virtual ~InputStream() = default; @@ -54,7 +54,7 @@ class InputStream { /** * Get the stats object */ - IoStatistics* FOLLY_NULLABLE getStats() const { + IoStatistics* getStats() const { return stats_; } @@ -131,7 +131,7 @@ class InputStream { protected: std::string path_; MetricsLogPtr metricsLog_; - IoStatistics* FOLLY_NULLABLE stats_; + IoStatistics* stats_; }; // An input stream that reads from an already opened ReadFile. @@ -141,7 +141,7 @@ class ReadFileInputStream final : public InputStream { explicit ReadFileInputStream( std::shared_ptr, const MetricsLogPtr& metricsLog = MetricsLog::voidLog(), - IoStatistics* FOLLY_NULLABLE stats = nullptr); + IoStatistics* stats = nullptr); ~ReadFileInputStream() override = default; diff --git a/velox/dwio/common/IntDecoder.h b/velox/dwio/common/IntDecoder.h index 1a6f6f597a26..e5e37b429663 100644 --- a/velox/dwio/common/IntDecoder.h +++ b/velox/dwio/common/IntDecoder.h @@ -47,7 +47,7 @@ class IntDecoder { bigEndian(bigEndian) {} // Constructs for use in Parquet /Alphawhere the buffer is always preloaded. - IntDecoder(const char* FOLLY_NONNULL start, const char* FOLLY_NONNULL end) + IntDecoder(const char* start, const char* end) : bufferStart(start), bufferEnd(end), useVInts(false), numBytes(0) {} virtual ~IntDecoder() = default; @@ -76,15 +76,10 @@ class IntDecoder { * @param nulls If the pointer is null, all values are read. If the * pointer is not null, positions that are true are skipped. */ - virtual void next( - int64_t* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls) = 0; - - virtual void next( - int32_t* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls) { + virtual void + next(int64_t* data, uint64_t numValues, const uint64_t* nulls) = 0; + + virtual void next(int32_t* data, uint64_t numValues, const uint64_t* nulls) { if (numValues <= 4) { int64_t temp[4]; next(temp, numValues, nulls); @@ -100,23 +95,17 @@ class IntDecoder { } } - virtual void nextInts( - int32_t* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls) { + virtual void + nextInts(int32_t* data, uint64_t numValues, const uint64_t* nulls) { narrow(data, numValues, nulls); } - virtual void nextShorts( - int16_t* FOLLY_NONNULL data, - uint64_t numValues, - const uint64_t* FOLLY_NULLABLE nulls) { + virtual void + nextShorts(int16_t* data, uint64_t numValues, const uint64_t* nulls) { narrow(data, numValues, nulls); } - virtual void nextLengths( - int32_t* FOLLY_NONNULL /*values*/, - int32_t /*numValues*/) { + virtual void nextLengths(int32_t* /*values*/, int32_t /*numValues*/) { VELOX_FAIL("A length decoder should be a RLEv1"); } @@ -130,15 +119,14 @@ class IntDecoder { // Reads 'size' consecutive T' and stores then in 'result'. template - void bulkRead(uint64_t size, T* FOLLY_NONNULL result); + void bulkRead(uint64_t size, T* result); // Reads data at positions 'rows' to 'result'. 'initialRow' is the // row number of the first unread element of 'this'. if rows is {10} // and 'initialRow' is 9, then this skips one element and reads the // next element into 'result'. template - void - bulkReadRows(RowSet rows, T* FOLLY_NONNULL result, int32_t initialRow = 0); + void bulkReadRows(RowSet rows, T* result, int32_t initialRow = 0); protected: // Actually skip the pending entries. @@ -158,11 +146,10 @@ class IntDecoder { void skipLongs(uint64_t numValues); template - void bulkReadFixed(uint64_t size, T* FOLLY_NONNULL result); + void bulkReadFixed(uint64_t size, T* result); template - void - bulkReadRowsFixed(RowSet rows, int32_t initialRow, T* FOLLY_NONNULL result); + void bulkReadRowsFixed(RowSet rows, int32_t initialRow, T* result); template T readInt(); @@ -188,10 +175,8 @@ class IntDecoder { // this by directly supporting deserialization into the correct // target data type template - void narrow( - T* FOLLY_NONNULL const data, - const uint64_t numValues, - const uint64_t* FOLLY_NULLABLE const nulls) { + void + narrow(T* const data, const uint64_t numValues, const uint64_t* const nulls) { DWIO_ENSURE_LE(numBytes, sizeof(T)) std::array buf; uint64_t remain = numValues; @@ -213,8 +198,8 @@ class IntDecoder { protected: const std::unique_ptr inputStream; - const char* FOLLY_NULLABLE bufferStart; - const char* FOLLY_NULLABLE bufferEnd; + const char* bufferStart; + const char* bufferEnd; const bool useVInts; const uint32_t numBytes; bool bigEndian; @@ -479,9 +464,7 @@ inline T IntDecoder::readVInt() { template <> template <> -inline void IntDecoder::bulkRead( - uint64_t /*size*/, - double* FOLLY_NONNULL /*result*/) { +inline void IntDecoder::bulkRead(uint64_t /*size*/, double* /*result*/) { VELOX_UNREACHABLE(); } @@ -489,16 +472,14 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - double* FOLLY_NONNULL /*result*/, + double* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } template <> template <> -inline void IntDecoder::bulkRead( - uint64_t /*size*/, - double* FOLLY_NONNULL /*result*/) { +inline void IntDecoder::bulkRead(uint64_t /*size*/, double* /*result*/) { VELOX_UNREACHABLE(); } @@ -506,16 +487,14 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - double* FOLLY_NONNULL /*result*/, + double* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } template <> template <> -inline void IntDecoder::bulkRead( - uint64_t /*size*/, - float* FOLLY_NONNULL /*result*/) { +inline void IntDecoder::bulkRead(uint64_t /*size*/, float* /*result*/) { VELOX_UNREACHABLE(); } @@ -523,16 +502,14 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - float* FOLLY_NONNULL /*result*/, + float* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } template <> template <> -inline void IntDecoder::bulkRead( - uint64_t /*size*/, - float* FOLLY_NONNULL /*result*/) { +inline void IntDecoder::bulkRead(uint64_t /*size*/, float* /*result*/) { VELOX_UNREACHABLE(); } @@ -540,7 +517,7 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - float* FOLLY_NONNULL /*result*/, + float* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } @@ -549,7 +526,7 @@ template <> template <> inline void IntDecoder::bulkRead( uint64_t /*size*/, - int128_t* FOLLY_NONNULL /*result*/) { + int128_t* /*result*/) { VELOX_UNREACHABLE(); } @@ -557,7 +534,7 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - int128_t* FOLLY_NONNULL /*result*/, + int128_t* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } @@ -566,7 +543,7 @@ template <> template <> inline void IntDecoder::bulkRead( uint64_t /*size*/, - int128_t* FOLLY_NONNULL /*result*/) { + int128_t* /*result*/) { VELOX_UNREACHABLE(); } @@ -574,7 +551,7 @@ template <> template <> inline void IntDecoder::bulkReadRows( RowSet /*rows*/, - int128_t* FOLLY_NONNULL /*result*/, + int128_t* /*result*/, int32_t /*initialRow*/) { VELOX_UNREACHABLE(); } diff --git a/velox/dwio/common/ParallelFor.h b/velox/dwio/common/ParallelFor.h index 90b4d796fb5f..f6debc9f14fd 100644 --- a/velox/dwio/common/ParallelFor.h +++ b/velox/dwio/common/ParallelFor.h @@ -36,7 +36,7 @@ namespace facebook::velox::dwio::common { class ParallelFor { public: ParallelFor( - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t from, // start index size_t to, // past end index // number of threads. diff --git a/velox/dwio/common/SelectiveColumnReader.h b/velox/dwio/common/SelectiveColumnReader.h index 4b26b0d4d60c..354c64185ee7 100644 --- a/velox/dwio/common/SelectiveColumnReader.h +++ b/velox/dwio/common/SelectiveColumnReader.h @@ -53,7 +53,7 @@ struct DictionaryValues { }; struct RawDictionaryState { - const void* FOLLY_NULLABLE values{nullptr}; + const void* values{nullptr}; int32_t numValues{0}; }; @@ -64,8 +64,8 @@ struct RawScanState { // See comment in ScanState below. RawDictionaryState dictionary2; - const uint64_t* __restrict FOLLY_NULLABLE inDictionary{nullptr}; - uint8_t* __restrict FOLLY_NULLABLE filterCache; + const uint64_t* __restrict inDictionary{nullptr}; + uint8_t* __restrict filterCache; }; // Maintains state for encoding between calls to readWithVisitor of @@ -158,10 +158,8 @@ class SelectiveColumnReader { // relative to 'offset', so that row 0 is the 'offset'th row from // start of stripe. 'rows' is expected to stay constant // between this and the next call to read. - virtual void read( - vector_size_t offset, - RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls) = 0; + virtual void + read(vector_size_t offset, RowSet rows, const uint64_t* incomingNulls) = 0; virtual uint64_t skip(uint64_t numValues) { return formatData_->skip(numValues); @@ -170,7 +168,7 @@ class SelectiveColumnReader { // Extracts the values at 'rows' into '*result'. May rewrite or // reallocate '*result'. 'rows' must be the same set or a subset of // 'rows' passed to the last 'read(). - virtual void getValues(RowSet rows, VectorPtr* FOLLY_NONNULL result) = 0; + virtual void getValues(RowSet rows, VectorPtr* result) = 0; // Returns the rows that were selected/visited by the last // read(). If 'this' has no filter, returns 'rows' passed to last @@ -210,14 +208,14 @@ class SelectiveColumnReader { } // Returns a pointer to output rows with at least 'size' elements available. - vector_size_t* FOLLY_NONNULL mutableOutputRows(int32_t size) { + vector_size_t* mutableOutputRows(int32_t size) { numOutConfirmed_ = outputRows_.size(); outputRows_.resize(numOutConfirmed_ + size); return outputRows_.data() + numOutConfirmed_; } template - T* FOLLY_NONNULL mutableValues(int32_t size) { + T* mutableValues(int32_t size) { DCHECK(values_->capacity() >= (numValues_ + size) * sizeof(T)); return reinterpret_cast(rawValues_) + numValues_; } @@ -226,7 +224,7 @@ class SelectiveColumnReader { // bitmap. Ensures that this has at least 'numValues_' + 'size' // capacity and is unique. If extending existing buffer, preserves // previous contents. - uint64_t* FOLLY_NONNULL mutableNulls(int32_t size) { + uint64_t* mutableNulls(int32_t size) { if (!resultNulls_->unique()) { resultNulls_ = AlignedBuffer::allocate( numValues_ + size, &memoryPool_, bits::kNotNull); @@ -327,7 +325,7 @@ class SelectiveColumnReader { numValues_ -= count; } - velox::common::ScanSpec* FOLLY_NONNULL scanSpec() const { + velox::common::ScanSpec* scanSpec() const { return scanSpec_; } @@ -419,10 +417,8 @@ class SelectiveColumnReader { // 'nulls'. 'nulls' is in terms of top level rows and represents all // null parents at any enclosing level. 'nulls' is nullptr if there are no // parent nulls. - void addParentNulls( - int32_t firstRowInNulls, - const uint64_t* FOLLY_NULLABLE nulls, - RowSet rows); + void + addParentNulls(int32_t firstRowInNulls, const uint64_t* nulls, RowSet rows); // When skipping rows in a struct, records how many parent nulls at // any level there are between top level row 'from' and 'to'. If @@ -453,10 +449,8 @@ class SelectiveColumnReader { void filterNulls(RowSet rows, bool isNull, bool extractValues); template - void prepareRead( - vector_size_t offset, - RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls); + void + prepareRead(vector_size_t offset, RowSet rows, const uint64_t* incomingNulls); void setOutputRows(RowSet rows) { outputRows_.resize(rows.size()); @@ -468,10 +462,8 @@ class SelectiveColumnReader { // Returns integer values for 'rows' cast to the width of // 'requestedType' in '*result'. - void getIntValues( - RowSet rows, - const TypePtr& requestedType, - VectorPtr* FOLLY_NONNULL result); + void + getIntValues(RowSet rows, const TypePtr& requestedType, VectorPtr* result); // Returns integer values for 'rows' cast to the width of // 'requestedType' in '*result', the related fileDataType is unsigned int @@ -479,7 +471,7 @@ class SelectiveColumnReader { void getUnsignedIntValues( RowSet rows, const TypePtr& requestedType, - VectorPtr* FOLLY_NONNULL result); + VectorPtr* result); // Returns read values for 'rows' in 'vector'. This can be called // multiple times for consecutive subsets of 'rows'. If 'isFinal' is @@ -488,7 +480,7 @@ class SelectiveColumnReader { template void getFlatValues( RowSet rows, - VectorPtr* FOLLY_NONNULL result, + VectorPtr* result, const TypePtr& type, bool isFinal = false); @@ -515,7 +507,7 @@ class SelectiveColumnReader { // Copies 'value' to buffers owned by 'this' and returns the start of the // copy. - char* FOLLY_NONNULL copyStringValue(folly::StringPiece value); + char* copyStringValue(folly::StringPiece value); virtual bool hasMutation() const { return false; @@ -560,7 +552,7 @@ class SelectiveColumnReader { // Specification of filters, value extraction, pruning etc. The // spec is assigned at construction and the contents may change at // run time based on adaptation. Owned by caller. - velox::common::ScanSpec* FOLLY_NONNULL scanSpec_; + velox::common::ScanSpec* scanSpec_; // Row number after last read row, relative to the ORC stripe or Parquet // Rowgroup start. @@ -594,11 +586,11 @@ class SelectiveColumnReader { // Nulls buffer for readWithVisitor. Not set if no nulls. 'numValues' // is the index of the first non-set bit. BufferPtr resultNulls_; - uint64_t* FOLLY_NULLABLE rawResultNulls_ = nullptr; + uint64_t* rawResultNulls_ = nullptr; // Buffer for gathering scalar values in readWithVisitor. BufferPtr values_; // Writable content in 'values' - void* FOLLY_NULLABLE rawValues_ = nullptr; + void* rawValues_ = nullptr; vector_size_t numValues_ = 0; // Size of fixed width value in 'rawValues'. For integers, values // are read at 64 bit width and can be compacted or extracted at a @@ -624,7 +616,7 @@ class SelectiveColumnReader { // Buffers backing the StringViews in 'values' when reading strings. std::vector stringBuffers_; // Writable contents of 'stringBuffers_.back()'. - char* FOLLY_NULLABLE rawStringBuffer_ = nullptr; + char* rawStringBuffer_ = nullptr; // True if a vector can acquire a pin to a stream's buffer and refer // to that as its values. bool mayUseStreamBuffer_ = false; @@ -672,8 +664,7 @@ namespace facebook::velox::dwio::common { // Template parameter to indicate no hook in fast scan path. This is // referenced in decoders, thus needs to be declared in a header. struct NoHook : public ValueHook { - void addValue(vector_size_t /*row*/, const void* FOLLY_NULLABLE /*value*/) - override {} + void addValue(vector_size_t /*row*/, const void* /*value*/) override {} }; } // namespace facebook::velox::dwio::common diff --git a/velox/dwio/common/SelectiveRepeatedColumnReader.h b/velox/dwio/common/SelectiveRepeatedColumnReader.h index 6292dedfb7bb..8da4ae956406 100644 --- a/velox/dwio/common/SelectiveRepeatedColumnReader.h +++ b/velox/dwio/common/SelectiveRepeatedColumnReader.h @@ -52,10 +52,8 @@ class SelectiveRepeatedColumnReader : public SelectiveColumnReader { /// be inserted at the corresponding position in the result. 'nulls' /// is expected to be null flags for 'numRows' next rows at the /// level of this reader. - virtual void readLengths( - int32_t* FOLLY_NONNULL lengths, - int32_t numLengths, - const uint64_t* FOLLY_NULLABLE nulls) = 0; + virtual void + readLengths(int32_t* lengths, int32_t numLengths, const uint64_t* nulls) = 0; // Create row set for child columns based on the row set of parent column. void makeNestedRowSet(RowSet rows, int32_t maxRow); @@ -65,9 +63,7 @@ class SelectiveRepeatedColumnReader : public SelectiveColumnReader { void makeOffsetsAndSizes(RowSet rows, ArrayVectorBase&); // Creates a struct if '*result' is empty and 'type' is a row. - void prepareStructResult( - const TypePtr& type, - VectorPtr* FOLLY_NULLABLE result) { + void prepareStructResult(const TypePtr& type, VectorPtr* result) { if (!*result && type->kind() == TypeKind::ROW) { *result = BaseVector::create(type, 0, &memoryPool_); } @@ -106,12 +102,10 @@ class SelectiveListColumnReader : public SelectiveRepeatedColumnReader { uint64_t skip(uint64_t numValues) override; - void read( - vector_size_t offset, - RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls) override; + void read(vector_size_t offset, RowSet rows, const uint64_t* incomingNulls) + override; - void getValues(RowSet rows, VectorPtr* FOLLY_NULLABLE result) override; + void getValues(RowSet rows, VectorPtr* result) override; protected: std::unique_ptr child_; @@ -133,12 +127,10 @@ class SelectiveMapColumnReader : public SelectiveRepeatedColumnReader { uint64_t skip(uint64_t numValues) override; - void read( - vector_size_t offset, - RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls) override; + void read(vector_size_t offset, RowSet rows, const uint64_t* incomingNulls) + override; - void getValues(RowSet rows, VectorPtr* FOLLY_NULLABLE result) override; + void getValues(RowSet rows, VectorPtr* result) override; std::unique_ptr keyReader_; std::unique_ptr elementReader_; diff --git a/velox/dwio/common/tests/BitPackDecoderBenchmark.cpp b/velox/dwio/common/tests/BitPackDecoderBenchmark.cpp index cbe9072cb01e..241d91117e06 100644 --- a/velox/dwio/common/tests/BitPackDecoderBenchmark.cpp +++ b/velox/dwio/common/tests/BitPackDecoderBenchmark.cpp @@ -245,13 +245,13 @@ std::vector buffer_u64; template void naiveDecodeBitsLE( - const uint64_t* FOLLY_NONNULL bits, + const uint64_t* bits, int32_t bitOffset, RowSet rows, int32_t rowBias, uint8_t bitWidth, const char* bufferEnd, - T* FOLLY_NONNULL result); + T* result); template void legacyUnpackNaive(RowSet rows, uint8_t bitWidth, T* result) { @@ -527,13 +527,13 @@ void populateBitPacked() { // Naive unpacking, original version of IntDecoder::unpack. template void naiveDecodeBitsLE( - const uint64_t* FOLLY_NONNULL bits, + const uint64_t* bits, int32_t bitOffset, RowSet rows, int32_t rowBias, uint8_t bitWidth, const char* bufferEnd, - T* FOLLY_NONNULL result) { + T* result) { uint64_t mask = bits::lowMask(bitWidth); auto numRows = rows.size(); if (bitWidth > 56) { @@ -543,7 +543,7 @@ void naiveDecodeBitsLE( } return; } - auto FOLLY_NONNULL lastSafe = bufferEnd - sizeof(uint64_t); + auto lastSafe = bufferEnd - sizeof(uint64_t); int32_t numSafeRows = numRows; bool anyUnsafe = false; if (bufferEnd) { diff --git a/velox/dwio/common/tests/TestBufferedInput.cpp b/velox/dwio/common/tests/TestBufferedInput.cpp index 6065523d14a3..38ce6efb3882 100644 --- a/velox/dwio/common/tests/TestBufferedInput.cpp +++ b/velox/dwio/common/tests/TestBufferedInput.cpp @@ -32,7 +32,7 @@ class ReadFileMock : public ::facebook::velox::ReadFile { MOCK_METHOD( std::string_view, pread, - (uint64_t offset, uint64_t length, void* FOLLY_NONNULL buf), + (uint64_t offset, uint64_t length, void* buf), (const, override)); MOCK_METHOD(bool, shouldCoalesce, (), (const, override)); diff --git a/velox/dwio/dwrf/reader/ColumnReader.cpp b/velox/dwio/dwrf/reader/ColumnReader.cpp index 303e32250769..935281726d4c 100644 --- a/velox/dwio/dwrf/reader/ColumnReader.cpp +++ b/velox/dwio/dwrf/reader/ColumnReader.cpp @@ -1753,7 +1753,7 @@ class StructColumnReader : public ColumnReader { private: const std::shared_ptr requestedType_; std::vector> children_; - folly::Executor* FOLLY_NULLABLE executor_; + folly::Executor* executor_; std::unique_ptr parallelForOnChildren_; public: @@ -1762,7 +1762,7 @@ class StructColumnReader : public ColumnReader { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext); ~StructColumnReader() override = default; @@ -1936,7 +1936,7 @@ class ListColumnReader : public ColumnReader { StripeStreams& stripe, const StreamLabels& streamLabels, FlatMapContext flatMapContext, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor); ~ListColumnReader() override = default; @@ -2107,7 +2107,7 @@ class MapColumnReader : public ColumnReader { StripeStreams& stripe, const StreamLabels& streamLabels, FlatMapContext flatMapContext, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor); ~MapColumnReader() override = default; diff --git a/velox/dwio/dwrf/reader/ColumnReader.h b/velox/dwio/dwrf/reader/ColumnReader.h index c4835fe99edb..c42b197517c5 100644 --- a/velox/dwio/dwrf/reader/ColumnReader.h +++ b/velox/dwio/dwrf/reader/ColumnReader.h @@ -119,7 +119,7 @@ class ColumnReader { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext = {}); }; @@ -132,7 +132,7 @@ class ColumnReaderFactory { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext = {}) { return ColumnReader::build( diff --git a/velox/dwio/dwrf/reader/DwrfData.cpp b/velox/dwio/dwrf/reader/DwrfData.cpp index d80d465a8f1c..1c42d741a9aa 100644 --- a/velox/dwio/dwrf/reader/DwrfData.cpp +++ b/velox/dwio/dwrf/reader/DwrfData.cpp @@ -107,7 +107,7 @@ dwio::common::PositionProvider DwrfData::seekToRowGroup(uint32_t index) { void DwrfData::readNulls( vector_size_t numValues, - const uint64_t* FOLLY_NULLABLE incomingNulls, + const uint64_t* incomingNulls, BufferPtr& nulls, bool /*nullsOnly*/) { if (!notNullDecoder_ && !flatMapContext_.inMapDecoder && !incomingNulls) { diff --git a/velox/dwio/dwrf/reader/DwrfData.h b/velox/dwio/dwrf/reader/DwrfData.h index d62cdeb8c4dd..f48aa1133675 100644 --- a/velox/dwio/dwrf/reader/DwrfData.h +++ b/velox/dwio/dwrf/reader/DwrfData.h @@ -41,7 +41,7 @@ class DwrfData : public dwio::common::FormatData { void readNulls( vector_size_t numValues, - const uint64_t* FOLLY_NULLABLE incomingNulls, + const uint64_t* incomingNulls, BufferPtr& nulls, bool nullsOnly = false) override; @@ -61,7 +61,7 @@ class DwrfData : public dwio::common::FormatData { return notNullDecoder_ != nullptr; } - auto* FOLLY_NULLABLE notNullDecoder() const { + auto* notNullDecoder() const { return notNullDecoder_.get(); } @@ -69,7 +69,7 @@ class DwrfData : public dwio::common::FormatData { return flatMapContext_; } - const uint64_t* FOLLY_NULLABLE inMap() const { + const uint64_t* inMap() const { return flatMapContext_.inMapDecoder ? inMap_->as() : nullptr; } diff --git a/velox/dwio/dwrf/reader/FlatMapColumnReader.cpp b/velox/dwio/dwrf/reader/FlatMapColumnReader.cpp index 2e52f05081b8..a981873eabbd 100644 --- a/velox/dwio/dwrf/reader/FlatMapColumnReader.cpp +++ b/velox/dwio/dwrf/reader/FlatMapColumnReader.cpp @@ -768,7 +768,7 @@ std::unique_ptr createFlatMapColumnReader( const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext) { if (isRequiringStructEncoding(requestedType, stripe.getRowReaderOptions())) { diff --git a/velox/dwio/dwrf/reader/FlatMapColumnReader.h b/velox/dwio/dwrf/reader/FlatMapColumnReader.h index a88a541c7929..1f11ebc1e064 100644 --- a/velox/dwio/dwrf/reader/FlatMapColumnReader.h +++ b/velox/dwio/dwrf/reader/FlatMapColumnReader.h @@ -79,20 +79,20 @@ class KeyNode { // try to load numValues from current position // return the items loaded - BaseVector* FOLLY_NULLABLE load(uint64_t numValues); + BaseVector* load(uint64_t numValues); void loadAsChild( VectorPtr& vec, uint64_t numValues, BufferPtr& mergedNulls, uint64_t nonNullMaps, - const uint64_t* FOLLY_NULLABLE nulls); + const uint64_t* nulls); - const uint64_t* FOLLY_NULLABLE mergeNulls( + const uint64_t* mergeNulls( uint64_t numValues, BufferPtr& mergedNulls, uint64_t nonNullMaps, - const uint64_t* FOLLY_NULLABLE nulls); + const uint64_t* nulls); const uint64_t* FOLLY_NULLABLE getAllNulls(uint64_t numValues, BufferPtr& mergedNulls); @@ -109,7 +109,7 @@ class KeyNode { void fillKeysVector( VectorPtr& vector, vector_size_t offset, - const StringKeyBuffer* FOLLY_NULLABLE /* unused */) { + const StringKeyBuffer* /* unused */) { // Ideally, this should be dynamic_cast, but we would like to avoid the // cost. We cannot make vector type template variable because for string // type, we will have two different vector representations @@ -149,17 +149,15 @@ class FlatMapColumnReader : public ColumnReader { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext); ~FlatMapColumnReader() override = default; uint64_t skip(uint64_t numValues) override; - void next( - uint64_t numValues, - VectorPtr& result, - const uint64_t* FOLLY_NULLABLE nulls) override; + void next(uint64_t numValues, VectorPtr& result, const uint64_t* nulls) + override; bool isFlatMap() const override { return true; @@ -170,7 +168,7 @@ class FlatMapColumnReader : public ColumnReader { std::vector>> keyNodes_; std::unique_ptr stringKeyBuffer_; bool returnFlatVector_; - folly::Executor* FOLLY_NULLABLE executor_; + folly::Executor* executor_; std::unique_ptr parallelForOnKeyNodes_; void initStringKeyBuffer() {} @@ -186,17 +184,15 @@ class FlatMapStructEncodingColumnReader : public ColumnReader { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext); ~FlatMapStructEncodingColumnReader() override = default; uint64_t skip(uint64_t numValues) override; - void next( - uint64_t numValues, - VectorPtr& result, - const uint64_t* FOLLY_NULLABLE nulls) override; + void next(uint64_t numValues, VectorPtr& result, const uint64_t* nulls) + override; bool isFlatMap() const override { return true; @@ -206,7 +202,7 @@ class FlatMapStructEncodingColumnReader : public ColumnReader { const std::shared_ptr requestedType_; std::vector>> keyNodes_; std::unique_ptr nullColumnReader_; - folly::Executor* FOLLY_NULLABLE executor_; + folly::Executor* executor_; dwio::common::ParallelFor parallelForOnKeyNodes_; BufferPtr mergedNulls_; }; @@ -218,7 +214,7 @@ class FlatMapColumnReaderFactory { const std::shared_ptr& fileType, StripeStreams& stripe, const StreamLabels& streamLabels, - folly::Executor* FOLLY_NULLABLE executor, + folly::Executor* executor, size_t decodingParallelismFactor, FlatMapContext flatMapContext); }; diff --git a/velox/dwio/dwrf/reader/SelectiveDwrfReader.h b/velox/dwio/dwrf/reader/SelectiveDwrfReader.h index ad649ede5827..555edc59b128 100644 --- a/velox/dwio/dwrf/reader/SelectiveDwrfReader.h +++ b/velox/dwio/dwrf/reader/SelectiveDwrfReader.h @@ -40,7 +40,7 @@ class SelectiveDwrfReader { StripeStreams& stripe, const StreamLabels& streamLabels, dwio::common::ColumnReaderStatistics& stats, - common::ScanSpec* FOLLY_NONNULL scanSpec, + common::ScanSpec* scanSpec, FlatMapContext flatMapContext = {}, bool isRoot = false) { auto params = DwrfParams(stripe, streamLabels, stats, flatMapContext); diff --git a/velox/dwio/dwrf/reader/SelectiveRepeatedColumnReader.h b/velox/dwio/dwrf/reader/SelectiveRepeatedColumnReader.h index bc8b0be9a889..9456917e43dd 100644 --- a/velox/dwio/dwrf/reader/SelectiveRepeatedColumnReader.h +++ b/velox/dwio/dwrf/reader/SelectiveRepeatedColumnReader.h @@ -49,10 +49,8 @@ class SelectiveListColumnReader childTargetReadOffset_ = 0; } - void readLengths( - int32_t* FOLLY_NONNULL lengths, - int32_t numLengths, - const uint64_t* FOLLY_NULLABLE nulls) override { + void readLengths(int32_t* lengths, int32_t numLengths, const uint64_t* nulls) + override { length_->next(lengths, numLengths, nulls); } @@ -88,10 +86,8 @@ class SelectiveMapColumnReader : public dwio::common::SelectiveMapColumnReader { childTargetReadOffset_ = 0; } - void readLengths( - int32_t* FOLLY_NONNULL lengths, - int32_t numLengths, - const uint64_t* FOLLY_NULLABLE nulls) override { + void readLengths(int32_t* lengths, int32_t numLengths, const uint64_t* nulls) + override { length_->next(lengths, numLengths, nulls); } diff --git a/velox/dwio/dwrf/test/CacheInputTest.cpp b/velox/dwio/dwrf/test/CacheInputTest.cpp index 455bf0b7903c..85e8663eb3a8 100644 --- a/velox/dwio/dwrf/test/CacheInputTest.cpp +++ b/velox/dwio/dwrf/test/CacheInputTest.cpp @@ -375,7 +375,7 @@ class CacheTest : public testing::Test { std::vector fileIds_; folly::F14FastMap> pathToInput_; std::shared_ptr tempDirectory_; - cache::FileGroupStats* FOLLY_NULLABLE groupStats_ = nullptr; + cache::FileGroupStats* groupStats_ = nullptr; std::shared_ptr allocator_; std::shared_ptr cache_; std::shared_ptr ioStats_; @@ -597,7 +597,7 @@ class FileWithReadAhead { static constexpr int64_t kLoadQuantum = 6 << 20; FileWithReadAhead( const std::string& name, - cache::AsyncDataCache* FOLLY_NONNULL cache, + cache::AsyncDataCache* cache, IoStatisticsPtr stats, memory::MemoryPool& pool, folly::Executor* executor) diff --git a/velox/dwio/parquet/reader/BooleanDecoder.h b/velox/dwio/parquet/reader/BooleanDecoder.h index aeb493f00c05..b22cfe7f60e4 100644 --- a/velox/dwio/parquet/reader/BooleanDecoder.h +++ b/velox/dwio/parquet/reader/BooleanDecoder.h @@ -20,7 +20,7 @@ namespace facebook::velox::parquet { class BooleanDecoder { public: - BooleanDecoder(const char* FOLLY_NONNULL start, const char* FOLLY_NONNULL end) + BooleanDecoder(const char* start, const char* end) : bufferStart_(start), bufferEnd_(end) {} void skip(uint64_t numValues) { @@ -28,10 +28,7 @@ class BooleanDecoder { } template - inline void skip( - int32_t numValues, - int32_t current, - const uint64_t* FOLLY_NULLABLE nulls) { + inline void skip(int32_t numValues, int32_t current, const uint64_t* nulls) { if (hasNulls) { numValues = bits::countNonNulls(nulls, current, current + numValues); } @@ -102,8 +99,8 @@ class BooleanDecoder { size_t remainingBits_{0}; uint8_t reversedLastByte_{0}; - const char* FOLLY_NONNULL bufferStart_{nullptr}; - const char* FOLLY_NONNULL bufferEnd_{nullptr}; + const char* bufferStart_{nullptr}; + const char* bufferEnd_{nullptr}; }; } // namespace facebook::velox::parquet diff --git a/velox/dwio/parquet/reader/PageReader.cpp b/velox/dwio/parquet/reader/PageReader.cpp index e6f44f42ecca..d7e094f79841 100644 --- a/velox/dwio/parquet/reader/PageReader.cpp +++ b/velox/dwio/parquet/reader/PageReader.cpp @@ -118,7 +118,7 @@ const char* PageReader::readBytes(int32_t size, BufferPtr& copy) { return copy->as(); } -const char* FOLLY_NONNULL PageReader::decompressData( +const char* PageReader::decompressData( const char* pageData, uint32_t compressedSize, uint32_t uncompressedSize) { diff --git a/velox/dwio/parquet/reader/PageReader.h b/velox/dwio/parquet/reader/PageReader.h index 4ef9c959b0db..a97e742c28f9 100644 --- a/velox/dwio/parquet/reader/PageReader.h +++ b/velox/dwio/parquet/reader/PageReader.h @@ -88,8 +88,8 @@ class PageReader { int32_t begin, int32_t end, int32_t maxItems, - int32_t* FOLLY_NULLABLE lengths, - uint64_t* FOLLY_NULLABLE nulls, + int32_t* lengths, + uint64_t* nulls, int32_t nullsStartIndex) const; /// Applies 'visitor' to values in the ColumnChunk of 'this'. The @@ -148,7 +148,7 @@ class PageReader { // If the current page has nulls, returns a nulls bitmap owned by 'this'. This // is filled for 'numRows' bits. - const uint64_t* FOLLY_NULLABLE readNulls(int32_t numRows, BufferPtr& buffer); + const uint64_t* readNulls(int32_t numRows, BufferPtr& buffer); // Skips the define decoder, if any, for 'numValues' top level // rows. Returns the number of non-nulls skipped. The range is the @@ -201,13 +201,13 @@ class PageReader { // Returns a pointer to contiguous space for the next 'size' bytes // from current position. Copies data into 'copy' if the range // straddles buffers. Allocates or resizes 'copy' as needed. - const char* FOLLY_NONNULL readBytes(int32_t size, BufferPtr& copy); + const char* readBytes(int32_t size, BufferPtr& copy); // Decompresses data starting at 'pageData_', consuming 'compressedsize' and // producing up to 'uncompressedSize' bytes. The start of the decoding // result is returned. an intermediate copy may be made in 'decompresseddata_' - const char* FOLLY_NONNULL decompressData( - const char* FOLLY_NONNULL pageData, + const char* decompressData( + const char* pageData, uint32_t compressedSize, uint32_t uncompressedSize); @@ -255,10 +255,8 @@ class PageReader { !std::is_same_v && !std::is_same_v, int>::type = 0> - void callDecoder( - const uint64_t* FOLLY_NULLABLE nulls, - bool& nullsFromFastPath, - Visitor visitor) { + void + callDecoder(const uint64_t* nulls, bool& nullsFromFastPath, Visitor visitor) { if (nulls) { nullsFromFastPath = dwio::common::useFastPath(visitor) && (!this->type_->type()->isLongDecimal()) && @@ -292,10 +290,8 @@ class PageReader { typename std::enable_if< std::is_same_v, int>::type = 0> - void callDecoder( - const uint64_t* FOLLY_NULLABLE nulls, - bool& nullsFromFastPath, - Visitor visitor) { + void + callDecoder(const uint64_t* nulls, bool& nullsFromFastPath, Visitor visitor) { if (nulls) { if (isDictionary()) { nullsFromFastPath = dwio::common::useFastPath(visitor); @@ -320,10 +316,8 @@ class PageReader { typename std::enable_if< std::is_same_v, int>::type = 0> - void callDecoder( - const uint64_t* FOLLY_NULLABLE nulls, - bool& nullsFromFastPath, - Visitor visitor) { + void + callDecoder(const uint64_t* nulls, bool& nullsFromFastPath, Visitor visitor) { VELOX_CHECK(!isDictionary(), "BOOLEAN types are never dictionary-encoded") if (nulls) { nullsFromFastPath = false; @@ -356,8 +350,8 @@ class PageReader { const common::CompressionKind codec_; const int64_t chunkSize_; - const char* FOLLY_NULLABLE bufferStart_{nullptr}; - const char* FOLLY_NULLABLE bufferEnd_{nullptr}; + const char* bufferStart_{nullptr}; + const char* bufferEnd_{nullptr}; BufferPtr tempNulls_; BufferPtr nullsInReadRange_; BufferPtr multiPageNulls_; @@ -422,7 +416,7 @@ class PageReader { // First byte of decompressed encoded data. Contains the encoded data as a // contiguous run of bytes. - const char* FOLLY_NULLABLE pageData_{nullptr}; + const char* pageData_{nullptr}; // Dictionary contents. dwio::common::DictionaryValues dictionary_; @@ -440,7 +434,7 @@ class PageReader { // Below members Keep state between calls to readWithVisitor(). // Original rows in Visitor. - const vector_size_t* FOLLY_NULLABLE visitorRows_{nullptr}; + const vector_size_t* visitorRows_{nullptr}; int32_t numVisitorRows_{0}; // 'rowOfPage_' at the start of readWithVisitor(). @@ -460,7 +454,7 @@ class PageReader { // Temporary for rewriting rows to access in readWithVisitor when moving // between pages. Initialized from the visitor. - raw_vector* FOLLY_NULLABLE rowsCopy_{nullptr}; + raw_vector* rowsCopy_{nullptr}; // If 'rowsCopy_' is used, this is the difference between the rows in // 'rowsCopy_' and the row numbers in 'rows' given to readWithVisitor(). diff --git a/velox/dwio/parquet/reader/ParquetData.cpp b/velox/dwio/parquet/reader/ParquetData.cpp index 0cd8cc3245f0..3df698f51ff0 100644 --- a/velox/dwio/parquet/reader/ParquetData.cpp +++ b/velox/dwio/parquet/reader/ParquetData.cpp @@ -61,9 +61,7 @@ void ParquetData::filterRowGroups( } } -bool ParquetData::rowGroupMatches( - uint32_t rowGroupId, - common::Filter* FOLLY_NULLABLE filter) { +bool ParquetData::rowGroupMatches(uint32_t rowGroupId, common::Filter* filter) { auto column = type_->column(); auto type = type_->type(); auto rowGroup = fileMetaDataPtr_.rowGroup(rowGroupId); diff --git a/velox/dwio/parquet/reader/ParquetData.h b/velox/dwio/parquet/reader/ParquetData.h index e75e69558b8e..1696316f202e 100644 --- a/velox/dwio/parquet/reader/ParquetData.h +++ b/velox/dwio/parquet/reader/ParquetData.h @@ -73,7 +73,7 @@ class ParquetData : public dwio::common::FormatData { const dwio::common::StatsContext& writerContext, FilterRowGroupsResult&) override; - PageReader* FOLLY_NONNULL reader() const { + PageReader* reader() const { return reader_.get(); } @@ -104,7 +104,7 @@ class ParquetData : public dwio::common::FormatData { void readNulls( vector_size_t numValues, - const uint64_t* FOLLY_NULLABLE incomingNulls, + const uint64_t* incomingNulls, BufferPtr& nulls, bool nullsOnly = false) override { // If the query accesses only nulls, read the nulls from the pages in range. diff --git a/velox/dwio/parquet/reader/ParquetReader.cpp b/velox/dwio/parquet/reader/ParquetReader.cpp index 72f36943896f..2c73cfdb7ed6 100644 --- a/velox/dwio/parquet/reader/ParquetReader.cpp +++ b/velox/dwio/parquet/reader/ParquetReader.cpp @@ -796,7 +796,7 @@ class ParquetRowReader::Impl { std::vector rowGroupIds_; std::vector firstRowOfRowGroup_; uint32_t nextRowGroupIdsIdx_; - const thrift::RowGroup* FOLLY_NULLABLE currentRowGroupPtr_{nullptr}; + const thrift::RowGroup* currentRowGroupPtr_{nullptr}; uint64_t rowsInCurrentRowGroup_; uint64_t currentRowInGroup_; diff --git a/velox/dwio/parquet/reader/ParquetTypeWithId.h b/velox/dwio/parquet/reader/ParquetTypeWithId.h index 4fc6b347f221..4ab6b77ad208 100644 --- a/velox/dwio/parquet/reader/ParquetTypeWithId.h +++ b/velox/dwio/parquet/reader/ParquetTypeWithId.h @@ -67,7 +67,7 @@ class ParquetTypeWithId : public dwio::common::TypeWithId { return *reinterpret_cast(childAt(index).get()); } - const ParquetTypeWithId* FOLLY_NULLABLE parquetParent() const { + const ParquetTypeWithId* parquetParent() const { return reinterpret_cast(parent()); } diff --git a/velox/dwio/parquet/reader/RepeatedColumnReader.cpp b/velox/dwio/parquet/reader/RepeatedColumnReader.cpp index 250bd204e083..9f8771d3225f 100644 --- a/velox/dwio/parquet/reader/RepeatedColumnReader.cpp +++ b/velox/dwio/parquet/reader/RepeatedColumnReader.cpp @@ -23,8 +23,8 @@ namespace facebook::velox::parquet { class ParquetTypeWithId; namespace { -PageReader* FOLLY_NULLABLE readLeafRepDefs( - dwio::common::SelectiveColumnReader* FOLLY_NONNULL reader, +PageReader* readLeafRepDefs( + dwio::common::SelectiveColumnReader* reader, int32_t numTop, bool mustRead) { auto children = reader->children(); diff --git a/velox/dwio/parquet/reader/RepeatedColumnReader.h b/velox/dwio/parquet/reader/RepeatedColumnReader.h index 3155e8d66478..538822b148e3 100644 --- a/velox/dwio/parquet/reader/RepeatedColumnReader.h +++ b/velox/dwio/parquet/reader/RepeatedColumnReader.h @@ -38,7 +38,7 @@ class RepeatedLengths { return nextLengthIndex_; } - void readLengths(int32_t* FOLLY_NONNULL lengths, int32_t numLengths) { + void readLengths(int32_t* lengths, int32_t numLengths) { VELOX_CHECK_LE( nextLengthIndex_ + numLengths, lengths_->size() / sizeof(int32_t)); memcpy( @@ -64,7 +64,7 @@ class MapColumnReader : public dwio::common::SelectiveMapColumnReader { void prepareRead( vector_size_t offset, RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls) { + const uint64_t* incomingNulls) { // The prepare is done by the topmost list/map/struct. } @@ -75,15 +75,15 @@ class MapColumnReader : public dwio::common::SelectiveMapColumnReader { void read( vector_size_t offset, RowSet rows, - const uint64_t* FOLLY_NULLABLE /*incomingNulls*/) override; + const uint64_t* /*incomingNulls*/) override; void setLengths(BufferPtr lengths) { lengths_.setLengths(lengths); } void readLengths( - int32_t* FOLLY_NONNULL lengths, + int32_t* lengths, int32_t numLengths, - const uint64_t* FOLLY_NULLABLE /*nulls*/) override { + const uint64_t* /*nulls*/) override { lengths_.readLengths(lengths, numLengths); } @@ -120,7 +120,7 @@ class ListColumnReader : public dwio::common::SelectiveListColumnReader { void prepareRead( vector_size_t offset, RowSet rows, - const uint64_t* FOLLY_NULLABLE incomingNulls) { + const uint64_t* incomingNulls) { // The prepare is done by the topmost list/struct. } @@ -131,15 +131,15 @@ class ListColumnReader : public dwio::common::SelectiveListColumnReader { void read( vector_size_t offset, RowSet rows, - const uint64_t* FOLLY_NULLABLE /*incomingNulls*/) override; + const uint64_t* /*incomingNulls*/) override; void setLengths(BufferPtr lengths) { lengths_.setLengths(lengths); } void readLengths( - int32_t* FOLLY_NONNULL lengths, + int32_t* lengths, int32_t numLengths, - const uint64_t* FOLLY_NULLABLE /*nulls*/) override { + const uint64_t* /*nulls*/) override { lengths_.readLengths(lengths, numLengths); } diff --git a/velox/dwio/parquet/reader/RleBpDataDecoder.h b/velox/dwio/parquet/reader/RleBpDataDecoder.h index 4b2ce3ae1427..71ef471cce4f 100644 --- a/velox/dwio/parquet/reader/RleBpDataDecoder.h +++ b/velox/dwio/parquet/reader/RleBpDataDecoder.h @@ -31,17 +31,11 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { public: using super = facebook::velox::parquet::RleBpDecoder; - RleBpDataDecoder( - const char* FOLLY_NONNULL start, - const char* FOLLY_NONNULL end, - uint8_t bitWidth) + RleBpDataDecoder(const char* start, const char* end, uint8_t bitWidth) : super::RleBpDecoder{start, end, bitWidth} {} template - inline void skip( - int32_t numValues, - int32_t current, - const uint64_t* FOLLY_NULLABLE nulls) { + inline void skip(int32_t numValues, int32_t current, const uint64_t* nulls) { if (hasNulls) { numValues = bits::countNonNulls(nulls, current, current + numValues); } @@ -54,7 +48,7 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { } template - void readWithVisitor(const uint64_t* FOLLY_NULLABLE nulls, Visitor visitor) { + void readWithVisitor(const uint64_t* nulls, Visitor visitor) { if (dwio::common::useFastPath(visitor)) { fastPath(nulls, visitor); return; @@ -103,7 +97,7 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { private: template - void fastPath(const uint64_t* FOLLY_NULLABLE nulls, Visitor& visitor) { + void fastPath(const uint64_t* nulls, Visitor& visitor) { constexpr bool hasFilter = !std::is_same_v; constexpr bool hasHook = @@ -155,13 +149,13 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { template void processRun( - const int32_t* FOLLY_NONNULL rows, + const int32_t* rows, int32_t rowIndex, int32_t currentRow, int32_t numRows, - const int32_t* FOLLY_NULLABLE scatterRows, - int32_t* FOLLY_NULLABLE filterHits, - typename Visitor::DataType* FOLLY_NONNULL values, + const int32_t* scatterRows, + int32_t* filterHits, + typename Visitor::DataType* values, int32_t& numValues, Visitor& visitor) { auto numBits = bitOffset_ + @@ -194,7 +188,7 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { // last in rows that falls in the current run. template std::pair findNumInRun( - const int32_t* FOLLY_NONNULL rows, + const int32_t* rows, int32_t rowIndex, int32_t numRows, int32_t currentRow) { @@ -220,7 +214,7 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { template void bulkScan( folly::Range nonNullRows, - const int32_t* FOLLY_NULLABLE scatterRows, + const int32_t* scatterRows, Visitor& visitor) { auto numAllRows = visitor.numRows(); visitor.setRows(nonNullRows); @@ -279,10 +273,10 @@ class RleBpDataDecoder : public facebook::velox::parquet::RleBpDecoder { // Loads a bit field from 'ptr' + bitOffset for up to 'bitWidth' bits. makes // sure not to access bytes past lastSafeWord + 7. static inline uint64_t safeLoadBits( - const char* FOLLY_NONNULL ptr, + const char* ptr, int32_t bitOffset, uint8_t bitWidth, - const char* FOLLY_NONNULL lastSafeWord) { + const char* lastSafeWord) { VELOX_DCHECK_GE(7, bitOffset); VELOX_DCHECK_GE(56, bitWidth); if (ptr < lastSafeWord) { diff --git a/velox/dwio/parquet/reader/RleBpDecoder.cpp b/velox/dwio/parquet/reader/RleBpDecoder.cpp index 2ab851aca716..4b044da9ac27 100644 --- a/velox/dwio/parquet/reader/RleBpDecoder.cpp +++ b/velox/dwio/parquet/reader/RleBpDecoder.cpp @@ -38,8 +38,8 @@ void RleBpDecoder::skip(uint64_t numValues) { void RleBpDecoder::readBits( int32_t numValues, - uint64_t* FOLLY_NONNULL outputBuffer, - bool* FOLLY_NULLABLE allOnes) { + uint64_t* outputBuffer, + bool* allOnes) { VELOX_CHECK_EQ(1, bitWidth_); auto toRead = numValues; int32_t numWritten = 0; diff --git a/velox/dwio/parquet/reader/RleBpDecoder.h b/velox/dwio/parquet/reader/RleBpDecoder.h index cbea57911a9a..2b9bbe58f864 100644 --- a/velox/dwio/parquet/reader/RleBpDecoder.h +++ b/velox/dwio/parquet/reader/RleBpDecoder.h @@ -24,10 +24,7 @@ namespace facebook::velox::parquet { class RleBpDecoder { public: - RleBpDecoder( - const char* FOLLY_NONNULL start, - const char* FOLLY_NONNULL end, - uint8_t bitWidth) + RleBpDecoder(const char* start, const char* end, uint8_t bitWidth) : bufferStart_(start), bufferEnd_(end), bitWidth_(bitWidth), @@ -98,10 +95,8 @@ class RleBpDecoder { /// not copy them into 'buffer' but instead may set '*allOnes' to /// true. If allOnes is non-nullptr and not all bits are ones, then /// '*allOnes' is set to false and the bits are copied to 'buffer'. - void readBits( - int32_t numValues, - uint64_t* FOLLY_NONNULL outputBuffer, - bool* FOLLY_NULLABLE allOnes = nullptr); + void + readBits(int32_t numValues, uint64_t* outputBuffer, bool* allOnes = nullptr); protected: void readHeader(); @@ -123,12 +118,12 @@ class RleBpDecoder { remainingUnpackedValuesOffset_ += numValues; } - const char* FOLLY_NULLABLE bufferStart_; - const char* FOLLY_NULLABLE bufferEnd_; + const char* bufferStart_; + const char* bufferEnd_; const int8_t bitWidth_; const int8_t byteWidth_; const uint64_t bitMask_; - const char* FOLLY_NONNULL const lastSafeWord_; + const char* const lastSafeWord_; uint64_t remainingValues_{0}; int64_t value_; int8_t bitOffset_{0}; diff --git a/velox/dwio/parquet/reader/StringDecoder.h b/velox/dwio/parquet/reader/StringDecoder.h index 09a250f8dd34..f85a1ba1e11f 100644 --- a/velox/dwio/parquet/reader/StringDecoder.h +++ b/velox/dwio/parquet/reader/StringDecoder.h @@ -20,7 +20,7 @@ namespace facebook::velox::parquet { class StringDecoder { public: - StringDecoder(const char* FOLLY_NONNULL start, const char* FOLLY_NONNULL end) + StringDecoder(const char* start, const char* end) : bufferStart_(start), bufferEnd_(end), @@ -31,10 +31,7 @@ class StringDecoder { } template - inline void skip( - int32_t numValues, - int32_t current, - const uint64_t* FOLLY_NULLABLE nulls) { + inline void skip(int32_t numValues, int32_t current, const uint64_t* nulls) { if (hasNulls) { numValues = bits::countNonNulls(nulls, current, current + numValues); } @@ -44,7 +41,7 @@ class StringDecoder { } template - void readWithVisitor(const uint64_t* FOLLY_NULLABLE nulls, Visitor visitor) { + void readWithVisitor(const uint64_t* nulls, Visitor visitor) { int32_t current = visitor.start(); skip(current, 0, nulls); int32_t toSkip; @@ -79,7 +76,7 @@ class StringDecoder { } private: - int32_t lengthAt(const char* FOLLY_NONNULL buffer) { + int32_t lengthAt(const char* buffer) { return *reinterpret_cast(buffer); } @@ -88,9 +85,9 @@ class StringDecoder { bufferStart_ += length + sizeof(int32_t); return folly::StringPiece(bufferStart_ - length, length); } - const char* FOLLY_NONNULL bufferStart_; - const char* FOLLY_NONNULL bufferEnd_; - const char* FOLLY_NONNULL const lastSafeWord_; + const char* bufferStart_; + const char* bufferEnd_; + const char* const lastSafeWord_; }; } // namespace facebook::velox::parquet diff --git a/velox/dwio/parquet/reader/StructColumnReader.h b/velox/dwio/parquet/reader/StructColumnReader.h index f38c9e849c73..8a6833a698ec 100644 --- a/velox/dwio/parquet/reader/StructColumnReader.h +++ b/velox/dwio/parquet/reader/StructColumnReader.h @@ -52,12 +52,12 @@ class StructColumnReader : public dwio::common::SelectiveStructColumnReader { // No-op in Parquet. All readers switch row groups at the same time, there is // no on-demand skipping to a new row group. void advanceFieldReader( - dwio::common::SelectiveColumnReader* FOLLY_NONNULL /*reader*/, + dwio::common::SelectiveColumnReader* /*reader*/, vector_size_t /*offset*/) override {} void setNullsFromRepDefs(PageReader& pageReader); - dwio::common::SelectiveColumnReader* FOLLY_NULLABLE childForRepDefs() const { + dwio::common::SelectiveColumnReader* childForRepDefs() const { return childForRepDefs_; } @@ -84,7 +84,7 @@ class StructColumnReader : public dwio::common::SelectiveStructColumnReader { // Leaf column reader used for getting nullability information for // 'this'. This is nullptr for the root of a table. - dwio::common::SelectiveColumnReader* FOLLY_NULLABLE childForRepDefs_{nullptr}; + dwio::common::SelectiveColumnReader* childForRepDefs_{nullptr}; // Mode for getting nulls from repdefs. kStructOverLists if 'this' // only has list children. diff --git a/velox/dwio/parquet/tests/thrift/ThriftTransportTest.cpp b/velox/dwio/parquet/tests/thrift/ThriftTransportTest.cpp index 68ddc6d9fced..489b721aff67 100644 --- a/velox/dwio/parquet/tests/thrift/ThriftTransportTest.cpp +++ b/velox/dwio/parquet/tests/thrift/ThriftTransportTest.cpp @@ -55,8 +55,8 @@ class ThriftTransportTest : public testing::Test { static constexpr uint32_t batchSize_ = 20; std::vector input_; std::vector output_; - const char* FOLLY_NULLABLE bufferStart_{nullptr}; - const char* FOLLY_NULLABLE bufferEnd_{nullptr}; + const char* bufferStart_{nullptr}; + const char* bufferEnd_{nullptr}; std::shared_ptr inputStream_; std::shared_ptr transport_; }; diff --git a/velox/exec/HashBuild.h b/velox/exec/HashBuild.h index 11691597278e..5f166efa99d0 100644 --- a/velox/exec/HashBuild.h +++ b/velox/exec/HashBuild.h @@ -60,7 +60,7 @@ class HashBuild final : public Operator { HashBuild( int32_t operatorId, - DriverCtx* FOLLY_NONNULL driverCtx, + DriverCtx* driverCtx, std::shared_ptr joinNode); void initialize() override; @@ -77,7 +77,7 @@ class HashBuild final : public Operator { void noMoreInput() override; - BlockingReason isBlocked(ContinueFuture* FOLLY_NONNULL future) override; + BlockingReason isBlocked(ContinueFuture* future) override; bool isFinished() override; diff --git a/velox/exec/OperatorUtils.h b/velox/exec/OperatorUtils.h index 6828cdf61d78..14806ae1450a 100644 --- a/velox/exec/OperatorUtils.h +++ b/velox/exec/OperatorUtils.h @@ -36,15 +36,13 @@ struct FilterEvalCtx { // Make sure selectedBits has enough capacity to hold 'size' bits and return // raw pointer to the underlying buffer. - uint64_t* FOLLY_NONNULL getRawSelectedBits( - vector_size_t size, - memory::MemoryPool* FOLLY_NONNULL pool); + uint64_t* getRawSelectedBits(vector_size_t size, memory::MemoryPool* pool); // Make sure selectedIndices buffer has enough capacity to hold 'size' // indices and return raw pointer to the underlying buffer. - vector_size_t* FOLLY_NONNULL getRawSelectedIndices( + vector_size_t* getRawSelectedIndices( vector_size_t size, - memory::MemoryPool* FOLLY_NONNULL pool); + memory::MemoryPool* pool); }; // Convert the results of filter evaluation as a vector of booleans into indices @@ -61,7 +59,7 @@ vector_size_t processFilterResults( const VectorPtr& filterResult, const SelectivityVector& rows, FilterEvalCtx& filterEvalCtx, - memory::MemoryPool* FOLLY_NONNULL pool); + memory::MemoryPool* pool); // Wraps the specified vector into a dictionary using the specified mapping. // Returns vector as-is if mapping is null. An optional nulls buffer can be @@ -86,7 +84,7 @@ RowVectorPtr wrap( BufferPtr mapping, const RowTypePtr& rowType, const std::vector& childVectors, - memory::MemoryPool* FOLLY_NONNULL pool); + memory::MemoryPool* pool); // Ensures that all LazyVectors reachable from 'input' are loaded for all rows. void loadColumns(const RowVectorPtr& input, core::ExecCtx& execCtx); @@ -99,7 +97,7 @@ void loadColumns(const RowVectorPtr& input, core::ExecCtx& execCtx); /// /// NOTE: all the source row vectors must have the same data type. void gatherCopy( - RowVector* FOLLY_NONNULL target, + RowVector* target, vector_size_t targetIndex, vector_size_t count, const std::vector& sources, diff --git a/velox/exec/OrderBy.h b/velox/exec/OrderBy.h index d75315094d9a..cbf6f1e57eac 100644 --- a/velox/exec/OrderBy.h +++ b/velox/exec/OrderBy.h @@ -36,7 +36,7 @@ class OrderBy : public Operator { public: OrderBy( int32_t operatorId, - DriverCtx* FOLLY_NONNULL driverCtx, + DriverCtx* driverCtx, const std::shared_ptr& orderByNode); bool needsInput() const override { @@ -49,7 +49,7 @@ class OrderBy : public Operator { RowVectorPtr getOutput() override; - BlockingReason isBlocked(ContinueFuture* FOLLY_NULLABLE /*future*/) override { + BlockingReason isBlocked(ContinueFuture* /*future*/) override { return BlockingReason::kNotBlocked; } diff --git a/velox/exec/tests/MultiFragmentTest.cpp b/velox/exec/tests/MultiFragmentTest.cpp index 8c2b62691396..1e9af9fc7f84 100644 --- a/velox/exec/tests/MultiFragmentTest.cpp +++ b/velox/exec/tests/MultiFragmentTest.cpp @@ -1367,7 +1367,7 @@ class TestCustomExchange : public exec::Exchange { public: TestCustomExchange( int32_t operatorId, - DriverCtx* FOLLY_NONNULL ctx, + DriverCtx* ctx, const std::shared_ptr& customExchangeNode, std::shared_ptr exchangeClient) : exec::Exchange( diff --git a/velox/expression/DecodedArgs.h b/velox/expression/DecodedArgs.h index e56a9555da72..cfe791293eef 100644 --- a/velox/expression/DecodedArgs.h +++ b/velox/expression/DecodedArgs.h @@ -41,7 +41,7 @@ class DecodedArgs { } } - DecodedVector* FOLLY_NONNULL at(int i) const { + DecodedVector* at(int i) const { return const_cast(&holders_[i])->get(); } diff --git a/velox/expression/EvalCtx.h b/velox/expression/EvalCtx.h index ff881833be2f..1f4d0de95cb4 100644 --- a/velox/expression/EvalCtx.h +++ b/velox/expression/EvalCtx.h @@ -36,15 +36,12 @@ class PeeledEncoding; // flags for Expr interpreter. class EvalCtx { public: - EvalCtx( - core::ExecCtx* FOLLY_NONNULL execCtx, - ExprSet* FOLLY_NULLABLE exprSet, - const RowVector* FOLLY_NULLABLE row); + EvalCtx(core::ExecCtx* execCtx, ExprSet* exprSet, const RowVector* row); /// For testing only. - explicit EvalCtx(core::ExecCtx* FOLLY_NONNULL execCtx); + explicit EvalCtx(core::ExecCtx* execCtx); - const RowVector* FOLLY_NONNULL row() const { + const RowVector* row() const { return row_; } @@ -54,7 +51,7 @@ class EvalCtx { return inputFlatNoNulls_; } - memory::MemoryPool* FOLLY_NONNULL pool() const { + memory::MemoryPool* pool() const { return execCtx_->pool(); } @@ -160,11 +157,11 @@ class EvalCtx { // Returns the vector of errors or nullptr if no errors. This is // intentionally a raw pointer to signify that the caller may not // retain references to this. - ErrorVector* FOLLY_NULLABLE errors() const { + ErrorVector* errors() const { return errors_.get(); } - ErrorVectorPtr* FOLLY_NONNULL errorsPtr() { + ErrorVectorPtr* errorsPtr() { return &errors_; } @@ -196,7 +193,7 @@ class EvalCtx { return throwOnError_; } - bool* FOLLY_NONNULL mutableThrowOnError() { + bool* mutableThrowOnError() { return &throwOnError_; } @@ -204,7 +201,7 @@ class EvalCtx { return nullsPruned_; } - bool* FOLLY_NONNULL mutableNullsPruned() { + bool* mutableNullsPruned() { return &nullsPruned_; } @@ -220,7 +217,7 @@ class EvalCtx { // current SelectivityVector. For example, true for top level // projections or conjuncts of a top level AND. False for then and // else of an IF. - bool* FOLLY_NONNULL mutableIsFinalSelection() { + bool* mutableIsFinalSelection() { return &isFinalSelection_; } @@ -229,15 +226,15 @@ class EvalCtx { return &finalSelection_; } - const SelectivityVector* FOLLY_NULLABLE finalSelection() const { + const SelectivityVector* finalSelection() const { return finalSelection_; } - core::ExecCtx* FOLLY_NONNULL execCtx() const { + core::ExecCtx* execCtx() const { return execCtx_; } - ExprSet* FOLLY_NULLABLE exprSet() const { + ExprSet* exprSet() const { return exprSet_; } @@ -279,7 +276,7 @@ class EvalCtx { /// appropriate. static void addNulls( const SelectivityVector& rows, - const uint64_t* FOLLY_NULLABLE rawNulls, + const uint64_t* rawNulls, EvalCtx& context, const TypePtr& type, VectorPtr& result); @@ -334,9 +331,9 @@ class EvalCtx { } private: - core::ExecCtx* const FOLLY_NONNULL execCtx_; - ExprSet* FOLLY_NULLABLE const exprSet_; - const RowVector* FOLLY_NULLABLE row_; + core::ExecCtx* const execCtx_; + ExprSet* const exprSet_; + const RowVector* row_; const bool cacheEnabled_; const uint32_t maxSharedSubexprResultsCached_; bool inputFlatNoNulls_; @@ -360,7 +357,7 @@ class EvalCtx { // If isFinalSelection_ is false, the set of rows for the upper-most IF or // OR. Used to determine the set of rows for loading lazy vectors. - const SelectivityVector* FOLLY_NULLABLE finalSelection_; + const SelectivityVector* finalSelection_; // Stores exception found during expression evaluation. Exceptions are stored // in a opaque flat vector, which will translate to a @@ -374,13 +371,13 @@ class EvalCtx { /// run or call EvalContext::restore to do it manually. struct ContextSaver { // The context to restore. nullptr if nothing to restore. - EvalCtx* FOLLY_NULLABLE context = nullptr; + EvalCtx* context = nullptr; std::vector peeled; std::shared_ptr peeledEncoding; bool nullsPruned = false; // The selection of the context being saved. - const SelectivityVector* FOLLY_NONNULL rows; - const SelectivityVector* FOLLY_NULLABLE finalSelection; + const SelectivityVector* rows; + const SelectivityVector* finalSelection; ErrorVectorPtr errors; }; @@ -439,28 +436,24 @@ class LocalSelectivityVector { : context_(*context.execCtx()), vector_(context_.getSelectivityVector(size)) {} - explicit LocalSelectivityVector( - EvalCtx* FOLLY_NONNULL context, - vector_size_t size) + explicit LocalSelectivityVector(EvalCtx* context, vector_size_t size) : LocalSelectivityVector(*context, size) {} explicit LocalSelectivityVector(core::ExecCtx& context) : context_(context), vector_(nullptr) {} - explicit LocalSelectivityVector(core::ExecCtx* FOLLY_NONNULL context) + explicit LocalSelectivityVector(core::ExecCtx* context) : context_(*context), vector_(nullptr) {} explicit LocalSelectivityVector(EvalCtx& context) : context_(*context.execCtx()), vector_(nullptr) {} - explicit LocalSelectivityVector(EvalCtx* FOLLY_NONNULL context) + explicit LocalSelectivityVector(EvalCtx* context) : LocalSelectivityVector(*context) {} LocalSelectivityVector(core::ExecCtx& context, vector_size_t size) : context_(context), vector_(context_.getSelectivityVector(size)) {} - LocalSelectivityVector( - core::ExecCtx* FOLLY_NONNULL context, - vector_size_t size) + LocalSelectivityVector(core::ExecCtx* context, vector_size_t size) : LocalSelectivityVector(*context, size) {} // Grab an instance of a SelectivityVector from the pool and initialize it to @@ -487,11 +480,11 @@ class LocalSelectivityVector { return *vector_; } - SelectivityVector* FOLLY_NULLABLE get() { + SelectivityVector* get() { return vector_.get(); } - SelectivityVector* FOLLY_NONNULL get(vector_size_t size) { + SelectivityVector* get(vector_size_t size) { if (!vector_) { vector_ = context_.getSelectivityVector(size); } @@ -499,7 +492,7 @@ class LocalSelectivityVector { } // Returns a recycled SelectivityVector with 'size' bits set to 'value'. - SelectivityVector* FOLLY_NONNULL get(vector_size_t size, bool value) { + SelectivityVector* get(vector_size_t size, bool value) { if (!vector_) { vector_ = context_.getSelectivityVector(); } @@ -508,7 +501,7 @@ class LocalSelectivityVector { } // Returns a recycled SelectivityVector initialized from 'other'. - SelectivityVector* FOLLY_NONNULL get(const SelectivityVector& other) { + SelectivityVector* get(const SelectivityVector& other) { if (!vector_) { vector_ = context_.getSelectivityVector(); } @@ -526,12 +519,12 @@ class LocalSelectivityVector { return *vector_; } - SelectivityVector* FOLLY_NULLABLE operator->() { + SelectivityVector* operator->() { VELOX_DCHECK_NOT_NULL(vector_, "get(size) must be called."); return vector_.get(); } - const SelectivityVector* FOLLY_NONNULL operator->() const { + const SelectivityVector* operator->() const { VELOX_DCHECK_NOT_NULL(vector_, "get(size) must be called."); return vector_.get(); } @@ -548,7 +541,7 @@ class LocalDecodedVector { explicit LocalDecodedVector(EvalCtx& context) : context_(*context.execCtx()) {} - explicit LocalDecodedVector(EvalCtx* FOLLY_NONNULL context) + explicit LocalDecodedVector(EvalCtx* context) : LocalDecodedVector(*context) {} LocalDecodedVector( @@ -574,7 +567,7 @@ class LocalDecodedVector { } } - DecodedVector* FOLLY_NONNULL get() { + DecodedVector* get() { if (!vector_) { vector_ = context_.get().getDecodedVector(); } @@ -592,12 +585,12 @@ class LocalDecodedVector { return *vector_; } - DecodedVector* FOLLY_NONNULL operator->() { + DecodedVector* operator->() { VELOX_DCHECK_NOT_NULL(vector_, "get() must be called."); return vector_.get(); } - const DecodedVector* FOLLY_NONNULL operator->() const { + const DecodedVector* operator->() const { VELOX_DCHECK_NOT_NULL(vector_, "get() must be called."); return vector_.get(); } @@ -616,14 +609,14 @@ class ScopedFinalSelectionSetter { public: ScopedFinalSelectionSetter( EvalCtx& evalCtx, - const SelectivityVector* FOLLY_NULLABLE finalSelection, + const SelectivityVector* finalSelection, bool checkCondition = true, bool override = false); ~ScopedFinalSelectionSetter(); private: EvalCtx& evalCtx_; - const SelectivityVector* FOLLY_NULLABLE oldFinalSelection_; + const SelectivityVector* oldFinalSelection_; bool oldIsFinalSelection_; }; diff --git a/velox/expression/Expr.cpp b/velox/expression/Expr.cpp index 89417d5584f1..7141588b9b28 100644 --- a/velox/expression/Expr.cpp +++ b/velox/expression/Expr.cpp @@ -554,14 +554,14 @@ namespace { class ExprExceptionContext { public: ExprExceptionContext( - const Expr* FOLLY_NONNULL expr, - const RowVector* FOLLY_NONNULL vector, - const ExprSet* FOLLY_NULLABLE parentExprSet) + const Expr* expr, + const RowVector* vector, + const ExprSet* parentExprSet) : expr_(expr), vector_(vector), parentExprSet_(parentExprSet) {} /// Persist data and sql on disk. Data will be persisted in $basePath/vector /// and sql will be persisted in $basePath/sql - void persistDataAndSql(const char* FOLLY_NONNULL basePath) { + void persistDataAndSql(const char* basePath) { // Exception already persisted or failed to persist. We don't persist again // in this situation. if (!dataPath_.empty()) { @@ -622,11 +622,11 @@ class ExprExceptionContext { } } - const Expr* FOLLY_NONNULL expr() const { + const Expr* expr() const { return expr_; } - const RowVector* FOLLY_NONNULL vector() const { + const RowVector* vector() const { return vector_; } @@ -644,15 +644,15 @@ class ExprExceptionContext { private: /// The expression. - const Expr* FOLLY_NONNULL expr_; + const Expr* expr_; /// The input vector, i.e. EvalCtx::row(). In some cases, input columns are /// re-used for results. Hence, 'vector' may no longer contain input data at /// the time of exception. - const RowVector* FOLLY_NONNULL vector_; + const RowVector* vector_; // The parent ExprSet that is executing this expression. - const ExprSet* FOLLY_NULLABLE parentExprSet_; + const ExprSet* parentExprSet_; /// Path of the file storing the serialized 'vector'. Used to avoid /// serializing vector repeatedly in cases when multiple rows generate @@ -1131,7 +1131,7 @@ bool Expr::removeSureNulls( void Expr::addNulls( const SelectivityVector& rows, - const uint64_t* FOLLY_NULLABLE rawNulls, + const uint64_t* rawNulls, EvalCtx& context, VectorPtr& result) const { EvalCtx::addNulls(rows, rawNulls, context, type(), result); diff --git a/velox/expression/Expr.h b/velox/expression/Expr.h index 77ef62751da8..e999a36caaa8 100644 --- a/velox/expression/Expr.h +++ b/velox/expression/Expr.h @@ -182,7 +182,7 @@ class Expr { const SelectivityVector& rows, EvalCtx& context, VectorPtr& result, - const ExprSet* FOLLY_NULLABLE parentExprSet = nullptr); + const ExprSet* parentExprSet = nullptr); /// Evaluates the expression using fast path that assumes all inputs and /// intermediate results are flat or constant and have no nulls. @@ -201,13 +201,13 @@ class Expr { const SelectivityVector& rows, EvalCtx& context, VectorPtr& result, - const ExprSet* FOLLY_NULLABLE parentExprSet = nullptr); + const ExprSet* parentExprSet = nullptr); void evalFlatNoNullsImpl( const SelectivityVector& rows, EvalCtx& context, VectorPtr& result, - const ExprSet* FOLLY_NULLABLE parentExprSet); + const ExprSet* parentExprSet); // Simplified path for expression evaluation (flattens all vectors). void evalSimplified( @@ -353,7 +353,7 @@ class Expr { /// expressable as sql. If not given, they will be converted to /// SQL-expressable simple constants. virtual std::string toSql( - std::vector* FOLLY_NULLABLE complexConstants = nullptr) const; + std::vector* complexConstants = nullptr) const; const ExprStats& stats() const { return stats_; @@ -361,7 +361,7 @@ class Expr { void addNulls( const SelectivityVector& rows, - const uint64_t* FOLLY_NULLABLE rawNulls, + const uint64_t* rawNulls, EvalCtx& context, VectorPtr& result) const; @@ -401,8 +401,8 @@ class Expr { private: struct PeelEncodingsResult { - SelectivityVector* FOLLY_NULLABLE newRows; - SelectivityVector* FOLLY_NULLABLE newFinalSelection; + SelectivityVector* newRows; + SelectivityVector* newFinalSelection; bool mayCache; static PeelEncodingsResult empty() { @@ -505,7 +505,7 @@ class Expr { void appendInputsSql( std::stringstream& stream, - std::vector* FOLLY_NULLABLE complexConstants) const; + std::vector* complexConstants) const; /// Release 'inputValues_' back to vector pool in 'evalCtx' so they can be /// reused. @@ -670,7 +670,7 @@ class ExprSet { public: explicit ExprSet( const std::vector& source, - core::ExecCtx* FOLLY_NONNULL execCtx, + core::ExecCtx* execCtx, bool enableConstantFolding = true); virtual ~ExprSet(); @@ -694,7 +694,7 @@ class ExprSet { void clear(); - core::ExecCtx* FOLLY_NULLABLE execCtx() const { + core::ExecCtx* execCtx() const { return execCtx_; } @@ -721,7 +721,7 @@ class ExprSet { } // Flags an expression that remembers the results for a dictionary. - void addToMemo(Expr* FOLLY_NONNULL expr) { + void addToMemo(Expr* expr) { memoizingExprs_.insert(expr); } @@ -754,14 +754,14 @@ class ExprSet { // Exprs which retain memoized state, e.g. from running over dictionaries. std::unordered_set memoizingExprs_; - core::ExecCtx* FOLLY_NONNULL const execCtx_; + core::ExecCtx* const execCtx_; }; class ExprSetSimplified : public ExprSet { public: ExprSetSimplified( const std::vector& source, - core::ExecCtx* FOLLY_NONNULL execCtx) + core::ExecCtx* execCtx) : ExprSet(source, execCtx, /*enableConstantFolding*/ false) {} virtual ~ExprSetSimplified() override {} @@ -787,7 +787,7 @@ class ExprSetSimplified : public ExprSet { // account and instantiates the correct ExprSet class. std::unique_ptr makeExprSetFromFlag( std::vector&& source, - core::ExecCtx* FOLLY_NONNULL execCtx); + core::ExecCtx* execCtx); /// Returns a string representation of the expression trees annotated with /// runtime statistics. Expected to be called after calling ExprSet::eval one or diff --git a/velox/expression/PeeledEncoding.h b/velox/expression/PeeledEncoding.h index 754d70270a04..dcfad547e7ba 100644 --- a/velox/expression/PeeledEncoding.h +++ b/velox/expression/PeeledEncoding.h @@ -151,7 +151,7 @@ class PeeledEncoding { /// selectivity vector. VectorPtr wrap( const TypePtr& outputType, - velox::memory::MemoryPool* FOLLY_NONNULL pool, + velox::memory::MemoryPool* pool, VectorPtr peeledResult, const SelectivityVector& rows) const; diff --git a/velox/expression/tests/ExpressionVerifier.h b/velox/expression/tests/ExpressionVerifier.h index 9d86daffa9d7..be7cb52e680c 100644 --- a/velox/expression/tests/ExpressionVerifier.h +++ b/velox/expression/tests/ExpressionVerifier.h @@ -46,9 +46,7 @@ class ExpressionVerifier { static constexpr const std::string_view kComplexConstantsFileName = "complex_constants"; - ExpressionVerifier( - core::ExecCtx* FOLLY_NONNULL execCtx, - ExpressionVerifierOptions options) + ExpressionVerifier(core::ExecCtx* execCtx, ExpressionVerifierOptions options) : execCtx_(execCtx), options_(options) {} // Executes expressions both using common path (all evaluation @@ -93,7 +91,7 @@ class ExpressionVerifier { const std::vector& complexConstants); private: - core::ExecCtx* FOLLY_NONNULL execCtx_; + core::ExecCtx* execCtx_; const ExpressionVerifierOptions options_; }; diff --git a/velox/functions/lib/KllSketch.h b/velox/functions/lib/KllSketch.h index 7d549ba81ee5..ca8bc79c2be1 100644 --- a/velox/functions/lib/KllSketch.h +++ b/velox/functions/lib/KllSketch.h @@ -95,9 +95,7 @@ struct KllSketch { /// @param out Pre-allocated memory to hold the result, must be at least as /// large as `quantiles` template - void estimateQuantiles( - const folly::Range& quantiles, - T* FOLLY_NONNULL out) const; + void estimateQuantiles(const folly::Range& quantiles, T* out) const; /// The total number of values being added to the sketch. size_t totalCount() const { @@ -109,11 +107,11 @@ struct KllSketch { /// Serialize the sketch into bytes. /// @param out Pre-allocated memory at least serializedByteSize() in size - void serialize(char* FOLLY_NONNULL out) const; + void serialize(char* out) const; /// Deserialize a sketch from bytes. static KllSketch deserialize( - const char* FOLLY_NONNULL data, + const char* data, const Allocator& = Allocator(), uint32_t seed = folly::Random::rand32()); @@ -135,7 +133,7 @@ struct KllSketch { /// Merge with another deserialized sketch. This is more efficient /// than deserialize then merge. - void mergeDeserialized(const char* FOLLY_NONNULL data); + void mergeDeserialized(const char* data); /// Get frequencies of items being tracked. The result is sorted by item. std::vector> getFrequencies() const; diff --git a/velox/serializers/CompactRowSerializer.cpp b/velox/serializers/CompactRowSerializer.cpp index b39e5e47cade..70407c0d4f47 100644 --- a/velox/serializers/CompactRowSerializer.cpp +++ b/velox/serializers/CompactRowSerializer.cpp @@ -92,7 +92,7 @@ class CompactRowVectorSerializer : public IterativeVectorSerializer { } private: - memory::MemoryPool* const FOLLY_NONNULL pool_; + memory::MemoryPool* const pool_; std::vector buffers_; }; diff --git a/velox/serializers/UnsafeRowSerializer.cpp b/velox/serializers/UnsafeRowSerializer.cpp index 3674e03e4b4d..2e5d6e3c8b22 100644 --- a/velox/serializers/UnsafeRowSerializer.cpp +++ b/velox/serializers/UnsafeRowSerializer.cpp @@ -94,7 +94,7 @@ class UnsafeRowVectorSerializer : public IterativeVectorSerializer { } private: - memory::MemoryPool* const FOLLY_NONNULL pool_; + memory::MemoryPool* const pool_; std::vector buffers_; }; diff --git a/velox/vector/BaseVector.h b/velox/vector/BaseVector.h index 9daf5ad82c18..e37faa977c8e 100644 --- a/velox/vector/BaseVector.h +++ b/velox/vector/BaseVector.h @@ -444,9 +444,7 @@ class BaseVector { // Sets null when 'nulls' has a null value for active rows in 'rows'. // Is a no-op 'nulls' is a nullptr or 'rows' has no selections. This API // throws if the vector is a ConstantVector. - virtual void addNulls( - const uint64_t* FOLLY_NULLABLE nulls, - const SelectivityVector& rows); + virtual void addNulls(const uint64_t* nulls, const SelectivityVector& rows); // Sets nulls for all active row in 'nullRows'. Is a no-op if nullRows has no // selections. This API throws if the vector is a ConstantVector. diff --git a/velox/vector/VectorSaver.cpp b/velox/vector/VectorSaver.cpp index 827e73ec64d3..48fe5bad26e0 100644 --- a/velox/vector/VectorSaver.cpp +++ b/velox/vector/VectorSaver.cpp @@ -628,17 +628,13 @@ void saveVector(const BaseVector& vector, std::ostream& out) { } } -void saveVectorToFile( - const BaseVector* FOLLY_NONNULL vector, - const char* FOLLY_NONNULL filePath) { +void saveVectorToFile(const BaseVector* vector, const char* filePath) { std::ofstream outputFile(filePath, std::ofstream::binary); saveVector(*vector, outputFile); outputFile.close(); } -void saveStringToFile( - const std::string& content, - const char* FOLLY_NONNULL filePath) { +void saveStringToFile(const std::string& content, const char* filePath) { std::ofstream outputFile(filePath, std::ofstream::binary); outputFile.write(content.data(), content.size()); outputFile.close(); @@ -676,8 +672,8 @@ VectorPtr restoreVector(std::istream& in, memory::MemoryPool* pool) { } VectorPtr restoreVectorFromFile( - const char* FOLLY_NONNULL filePath, - memory::MemoryPool* FOLLY_NONNULL pool) { + const char* filePath, + memory::MemoryPool* pool) { std::ifstream inputFile(filePath, std::ifstream::binary); VELOX_CHECK(!inputFile.fail(), "Cannot open file: {}", filePath); @@ -686,7 +682,7 @@ VectorPtr restoreVectorFromFile( return result; } -std::string restoreStringFromFile(const char* FOLLY_NONNULL filePath) { +std::string restoreStringFromFile(const char* filePath) { std::ifstream inputFile(filePath, std::ifstream::binary); VELOX_CHECK(!inputFile.fail(), "Cannot open file: {}", filePath); diff --git a/velox/vector/VectorSaver.h b/velox/vector/VectorSaver.h index b4b3c2adbd92..39a25c374cbe 100644 --- a/velox/vector/VectorSaver.h +++ b/velox/vector/VectorSaver.h @@ -37,40 +37,30 @@ void saveVector(const BaseVector& vector, std::ostream& out); /// Serializes the vector into binary format and writes it to a new file in /// 'filePath'. The serialization preserved encoding. Exceptions will be thrown /// if any error occurs while writing. -void saveVectorToFile( - const BaseVector* FOLLY_NONNULL vector, - const char* FOLLY_NONNULL filePath); +void saveVectorToFile(const BaseVector* vector, const char* filePath); /// Writes 'content' to a new file in 'filePath'. Exceptions will be thrown if /// any error occurs while writing. -void saveStringToFile( - const std::string& content, - const char* FOLLY_NONNULL filePath); +void saveStringToFile(const std::string& content, const char* filePath); /// Deserializes a vector serialized by 'save' from the provided input stream. -VectorPtr restoreVector( - std::istream& in, - memory::MemoryPool* FOLLY_NONNULL pool); +VectorPtr restoreVector(std::istream& in, memory::MemoryPool* pool); /// Reads and deserializes a vector from a file stored by saveVectorToFile() /// method call -VectorPtr restoreVectorFromFile( - const char* FOLLY_NONNULL filePath, - memory::MemoryPool* FOLLY_NONNULL pool); +VectorPtr restoreVectorFromFile(const char* filePath, memory::MemoryPool* pool); /// Reads a string from a file stored by saveStringToFile() method -std::string restoreStringFromFile(const char* FOLLY_NONNULL filePath); +std::string restoreStringFromFile(const char* filePath); // Write the vector to a file. Contents would include the size of the list // followed by all the values. template -void saveStdVectorToFile( - const std::vector& list, - const char* FOLLY_NONNULL filePath); +void saveStdVectorToFile(const std::vector& list, const char* filePath); // Reads a std::vector from a file stored by saveStdVectorToFile() method. template -std::vector restoreStdVectorFromFile(const char* FOLLY_NONNULL filePath); +std::vector restoreStdVectorFromFile(const char* filePath); /// Serializes a SelectivityVector into binary format and writes it to the /// provided output stream. diff --git a/velox/vector/VectorStream.h b/velox/vector/VectorStream.h index 3c8069d3652b..a54f60bded6b 100644 --- a/velox/vector/VectorStream.h +++ b/velox/vector/VectorStream.h @@ -257,7 +257,7 @@ class VectorStreamGroup : public StreamArena { public: /// If `serde` is not specified, fallback to the default registered. explicit VectorStreamGroup( - memory::MemoryPool* FOLLY_NONNULL pool, + memory::MemoryPool* pool, VectorSerde* serde = nullptr) : StreamArena(pool), serde_(serde != nullptr ? serde : getVectorSerde()) {}