diff --git a/velox/common/memory/ByteStream.cpp b/velox/common/memory/ByteStream.cpp index 119a60beb6f6..9b7a10b077c8 100644 --- a/velox/common/memory/ByteStream.cpp +++ b/velox/common/memory/ByteStream.cpp @@ -177,37 +177,6 @@ size_t ByteStream::size() const { return total + std::max(ranges_.back().position, lastRangeEnd_); } -size_t ByteStream::remainingSize() const { - if (ranges_.empty()) { - return 0; - } - const auto* lastRange = &ranges_[ranges_.size() - 1]; - auto cur = current_; - size_t total{0}; - if (cur == lastRange) { - total += (std::max(cur->position, lastRangeEnd_) - cur->position); - } else { - total += cur->size - cur->position; - } - - while (++cur <= lastRange) { - total += (cur == lastRange) ? lastRangeEnd_ : cur->size; - } - return total; -} - -bool ByteStream::atEnd() const { - if (!current_) { - return false; - } - if (current_->position < current_->size) { - return false; - } - - VELOX_CHECK(current_ >= ranges_.data() && current_ <= &ranges_.back()); - return current_ == &ranges_.back(); -} - void ByteStream::appendBool(bool value, int32_t count) { if (count == 1 && current_->size > current_->position) { bits::setBit( diff --git a/velox/common/memory/ByteStream.h b/velox/common/memory/ByteStream.h index 98fc61b3bed1..fe445801f42c 100644 --- a/velox/common/memory/ByteStream.h +++ b/velox/common/memory/ByteStream.h @@ -214,33 +214,6 @@ class ByteInputStream { /// seeking back to start to write a length header. class ByteStream { public: -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - /// For input. - ByteStream() : isBits_(false), isReverseBitOrder_(false) {} - - void resetInput(std::vector&& ranges) { - ranges_ = std::move(ranges); - current_ = &ranges_[0]; - } - - template - void readBytes(Char* data, int32_t size) { - ByteInputStream inputStream(ranges_); - inputStream.seekp(tellp()); - inputStream.readBytes(data, size); - seekp(inputStream.tellp()); - } - - template - T read() { - ByteInputStream inputStream(ranges_); - inputStream.seekp(tellp()); - auto value = inputStream.read(); - seekp(inputStream.tellp()); - return value; - } -#endif - /// For output. ByteStream( StreamArena* arena, @@ -281,12 +254,6 @@ class ByteStream { /// the last range. size_t size() const; - /// Returns the remaining size left from current reading position. - size_t remainingSize() const; - - /// For input. Returns true if all input has been read. - bool atEnd() const; - int32_t lastRangeEnd() { updateEnd(); return lastRangeEnd_; diff --git a/velox/dwio/common/FileSink.h b/velox/dwio/common/FileSink.h index f37120a284d5..58c88ee3bffc 100644 --- a/velox/dwio/common/FileSink.h +++ b/velox/dwio/common/FileSink.h @@ -152,10 +152,6 @@ class WriteFileSink final : public FileSink { class LocalFileSink : public FileSink { public: LocalFileSink(const std::string& name, const Options& options); -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - LocalFileSink(const std::string& name, MetricsLogPtr metricLogger) - : LocalFileSink(name, {.metricLogger = std::move(metricLogger)}) {} -#endif ~LocalFileSink() override { destroy(); diff --git a/velox/exec/ExchangeQueue.h b/velox/exec/ExchangeQueue.h index 17bc23b3e1fe..c1b398708c97 100644 --- a/velox/exec/ExchangeQueue.h +++ b/velox/exec/ExchangeQueue.h @@ -39,12 +39,6 @@ class SerializedPage { // VectorStreamGroup::read(). ByteInputStream prepareStreamForDeserialize(); -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - void prepareStreamForDeserialize(ByteStream* stream) { - stream->resetInput(std::move(ranges_)); - } -#endif - std::unique_ptr getIOBuf() const { return iobuf_->clone(); } @@ -114,16 +108,6 @@ class ExchangeQueue { std::vector> dequeueLocked(uint32_t maxBytes, bool* atEnd, ContinueFuture* future); -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - std::unique_ptr dequeueLocked( - bool* atEnd, - ContinueFuture* future) { - auto pages = dequeueLocked(1, atEnd, future); - VELOX_CHECK_LE(pages.size(), 1); - return pages.empty() ? nullptr : std::move(pages.front()); - } -#endif - /// Returns the total bytes held by SerializedPages in 'this'. uint64_t totalBytes() const { return totalBytes_; diff --git a/velox/exec/Task.h b/velox/exec/Task.h index 75e5b64afbe9..aad4d469c5a3 100644 --- a/velox/exec/Task.h +++ b/velox/exec/Task.h @@ -127,15 +127,6 @@ class Task : public std::enable_shared_from_this { /// nodes require splits and there are not enough of these. /// @param concurrentSplitGroups In grouped execution, maximum number of /// splits groups processed concurrently. -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - static void start( - std::shared_ptr self, - uint32_t maxDrivers, - uint32_t concurrentSplitGroups = 1) { - self->start(maxDrivers, concurrentSplitGroups); - } -#endif - void start(uint32_t maxDrivers, uint32_t concurrentSplitGroups = 1); /// If this returns true, this Task supports the single-threaded execution API diff --git a/velox/exec/tests/utils/PlanBuilder.cpp b/velox/exec/tests/utils/PlanBuilder.cpp index dd3b871feea2..00162b8046fb 100644 --- a/velox/exec/tests/utils/PlanBuilder.cpp +++ b/velox/exec/tests/utils/PlanBuilder.cpp @@ -16,6 +16,7 @@ #include "velox/exec/tests/utils/PlanBuilder.h" #include "velox/connectors/hive/HiveConnector.h" +#include "velox/connectors/hive/TableHandle.h" #include "velox/connectors/tpch/TpchConnector.h" #include "velox/duckdb/conversion/DuckParser.h" #include "velox/exec/Aggregate.h" @@ -24,21 +25,13 @@ #include "velox/exec/TableWriter.h" #include "velox/exec/WindowFunction.h" #include "velox/exec/tests/utils/TempDirectoryPath.h" +#include "velox/expression/Expr.h" #include "velox/expression/ExprToSubfieldFilter.h" #include "velox/expression/FunctionCallToSpecialForm.h" #include "velox/expression/SignatureBinder.h" #include "velox/parse/Expressions.h" #include "velox/parse/TypeResolver.h" -#ifndef VELOX_ENABLE_BACKWARD_COMPATIBILITY -#include "velox/connectors/hive/TableHandle.h" -#include "velox/expression/Expr.h" -#else -#include -#include "velox/common/memory/Memory.h" -#include "velox/parse/ExpressionsParser.h" -#endif - using namespace facebook::velox; using namespace facebook::velox::connector; using namespace facebook::velox::connector::hive; diff --git a/velox/vector/VectorStream.h b/velox/vector/VectorStream.h index 537c1b552d55..e79af35aaa8e 100644 --- a/velox/vector/VectorStream.h +++ b/velox/vector/VectorStream.h @@ -175,21 +175,6 @@ class VectorStreamGroup : public StreamArena { RowVectorPtr* result, const VectorSerde::Options* options = nullptr); -#ifdef VELOX_ENABLE_BACKWARD_COMPATIBILITY - static void read( - ByteStream* source, - velox::memory::MemoryPool* pool, - RowTypePtr type, - RowVectorPtr* result) { - VELOX_CHECK(!source->ranges().empty()); - ByteInputStream inputStream(source->ranges()); - inputStream.seekp(source->tellp()); - read(&inputStream, pool, type, result); - - source->seekp(inputStream.tellp()); - } -#endif - private: std::unique_ptr serializer_; VectorSerde* serde_{nullptr};