ljyss9 commented on code in PR #483:
URL: https://github.com/apache/paimon-cpp/pull/483#discussion_r4548561048
##########
src/paimon/core/operation/raw_file_split_read_test.cpp:
##########
@@ -60,10 +64,60 @@
#include "paimon/table/source/data_split.h"
#include "paimon/testing/mock/mock_search_file_index.h"
#include "paimon/testing/utils/binary_row_generator.h"
+#include "paimon/testing/utils/counting_cache_test_utils.h"
#include "paimon/testing/utils/read_result_collector.h"
#include "paimon/testing/utils/testharness.h"
namespace paimon::test {
+namespace {
+
+class CacheTrackingFileIndexer : public FileIndexer {
+ public:
+ explicit CacheTrackingFileIndexer(std::shared_ptr<int32_t> open_count)
+ : open_count_(std::move(open_count)),
delegate_(SearchIndexType::VECTOR, nullptr) {}
+
+ std::shared_ptr<FileIndexReader> CreateEmptyReader() const override {
+ return delegate_.CreateEmptyReader();
+ }
+
+ Result<std::shared_ptr<FileIndexReader>> CreateReader(
+ ::ArrowSchema* schema, int64_t start, int64_t length,
+ const std::shared_ptr<InputStream>& input,
+ const std::shared_ptr<MemoryPool>& pool) const override {
+ ++*open_count_;
+ return delegate_.CreateReader(schema, start, length, input, pool);
+ }
+
+ Result<std::shared_ptr<FileIndexWriter>> CreateWriter(
+ ::ArrowSchema* schema, const std::shared_ptr<MemoryPool>& pool) const
override {
+ return delegate_.CreateWriter(schema, pool);
+ }
+
+ private:
+ std::shared_ptr<int32_t> open_count_;
+ MockSearchFileIndexer delegate_;
+};
+
+class CacheTrackingFileIndexFactory : public FileIndexerFactory {
+ public:
+ explicit CacheTrackingFileIndexFactory(std::shared_ptr<int32_t> open_count)
+ : open_count_(std::move(open_count)) {}
+
+ const char* Identifier() const override {
+ return "lumina";
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]