diff --git a/tiledb/CMakeLists.txt b/tiledb/CMakeLists.txt index f61a95b17d5..2d59b59cd80 100644 --- a/tiledb/CMakeLists.txt +++ b/tiledb/CMakeLists.txt @@ -138,7 +138,6 @@ endif() set(TILEDB_CORE_SOURCES ${TILEDB_CORE_INCLUDE_DIR}/tiledb/common/memory.cc ${TILEDB_CORE_INCLUDE_DIR}/tiledb/common/stdx_string.cc - ${TILEDB_CORE_INCLUDE_DIR}/tiledb/common/indexed_list.cc ${TILEDB_CORE_INCLUDE_DIR}/tiledb/common/interval/interval.cc ${TILEDB_CORE_INCLUDE_DIR}/tiledb/common/types/dynamic_typed_datum.cc ${TILEDB_CORE_INCLUDE_DIR}/tiledb/platform/cert_file.cc diff --git a/tiledb/common/indexed_list.cc b/tiledb/common/indexed_list.cc deleted file mode 100644 index a3c31064002..00000000000 --- a/tiledb/common/indexed_list.cc +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file indexed_list.cc - * - * @section LICENSE - * - * The MIT License - * - * @copyright Copyright (c) 2024 TileDB, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * @section DESCRIPTION - * - * This file implements specializations for the `IndexedList` class. - */ - -#include "indexed_list.h" -#include "memory_tracker.h" -#include "tiledb/sm/query/readers/result_tile.h" -#include "tiledb/sm/tile/writer_tile_tuple.h" - -template <> -IndexedList::IndexedList( - shared_ptr memory_tracker) - : memory_tracker_(memory_tracker) - , list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) { -} - -template <> -IndexedList>:: - IndexedList(shared_ptr memory_tracker) - : memory_tracker_(memory_tracker) - , list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) { -} - -template <> -IndexedList::IndexedList( - shared_ptr memory_tracker) - : memory_tracker_(memory_tracker) - , list_(memory_tracker->get_resource(sm::MemoryType::TILE_DATA)) { -} diff --git a/tiledb/common/memory_tracker.cc b/tiledb/common/memory_tracker.cc index c7d9071bdc2..e1b669be084 100644 --- a/tiledb/common/memory_tracker.cc +++ b/tiledb/common/memory_tracker.cc @@ -94,6 +94,8 @@ std::string memory_type_to_str(MemoryType type) { return "TileWriterData"; case MemoryType::METADATA: return "Metadata"; + case MemoryType::WRITER_DATA: + return "WriterData"; } auto val = std::to_string(static_cast(type)); diff --git a/tiledb/common/memory_tracker.h b/tiledb/common/memory_tracker.h index 9a723be8f48..d95ba5d339b 100644 --- a/tiledb/common/memory_tracker.h +++ b/tiledb/common/memory_tracker.h @@ -122,7 +122,8 @@ enum class MemoryType { METADATA, DOMAINS, TILE_SUMS, - TILE_WRITER_DATA + TILE_WRITER_DATA, + WRITER_DATA }; /** diff --git a/tiledb/sm/query/readers/reader_base.cc b/tiledb/sm/query/readers/reader_base.cc index d5948d81170..387af075612 100644 --- a/tiledb/sm/query/readers/reader_base.cc +++ b/tiledb/sm/query/readers/reader_base.cc @@ -31,6 +31,7 @@ */ #include "tiledb/sm/query/readers/reader_base.h" +#include "tiledb/common/indexed_list.h" #include "tiledb/common/logger.h" #include "tiledb/sm/array/array.h" #include "tiledb/sm/array_schema/array_schema.h" @@ -1369,3 +1370,10 @@ template void ReaderBase::validate_attribute_order( std::vector&); } // namespace tiledb::sm + +template <> +IndexedList::IndexedList( + shared_ptr memory_tracker) + : memory_tracker_(memory_tracker) + , list_(memory_tracker->get_resource(sm::MemoryType::TILE_DATA)) { +} diff --git a/tiledb/sm/query/writers/global_order_writer.cc b/tiledb/sm/query/writers/global_order_writer.cc index 59de7d01255..1f7fe9e7499 100644 --- a/tiledb/sm/query/writers/global_order_writer.cc +++ b/tiledb/sm/query/writers/global_order_writer.cc @@ -115,8 +115,8 @@ GlobalOrderWriter::~GlobalOrderWriter() { GlobalOrderWriter::GlobalWriteState::GlobalWriteState( shared_ptr memory_tracker) : last_tiles_(memory_tracker->get_resource(MemoryType::TILE_WRITER_DATA)) - , last_var_offsets_(memory_tracker->get_resource(MemoryType::TILE_OFFSETS)) - , cells_written_(memory_tracker->get_resource(MemoryType::TILE_SUMS)) { + , last_var_offsets_(memory_tracker->get_resource(MemoryType::WRITER_DATA)) + , cells_written_(memory_tracker->get_resource(MemoryType::WRITER_DATA)) { } /* ****************************** */ diff --git a/tiledb/sm/query/writers/unordered_writer.cc b/tiledb/sm/query/writers/unordered_writer.cc index f6af441af35..6555e140021 100644 --- a/tiledb/sm/query/writers/unordered_writer.cc +++ b/tiledb/sm/query/writers/unordered_writer.cc @@ -89,8 +89,7 @@ UnorderedWriter::UnorderedWriter( remote_query, fragment_name) , frag_uri_(std::nullopt) - , cell_pos_( - query_memory_tracker_->get_resource(MemoryType::TILE_WRITER_DATA)) + , cell_pos_(query_memory_tracker_->get_resource(MemoryType::WRITER_DATA)) , written_buffers_(written_buffers) , is_coords_pass_(true) { // Check the layout is unordered. diff --git a/tiledb/sm/query/writers/writer_base.cc b/tiledb/sm/query/writers/writer_base.cc index af536be9336..68895d03e82 100644 --- a/tiledb/sm/query/writers/writer_base.cc +++ b/tiledb/sm/query/writers/writer_base.cc @@ -1203,3 +1203,17 @@ bool WriterBase::remote_query() const { } } // namespace tiledb::sm + +template <> +IndexedList::IndexedList( + shared_ptr memory_tracker) + : memory_tracker_(memory_tracker) + , list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) { +} + +template <> +IndexedList>:: + IndexedList(shared_ptr memory_tracker) + : memory_tracker_(memory_tracker) + , list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) { +}