Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunrd0 committed Mar 12, 2024
1 parent 5240b1b commit dce3b7e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 63 deletions.
1 change: 0 additions & 1 deletion tiledb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 0 additions & 57 deletions tiledb/common/indexed_list.cc

This file was deleted.

2 changes: 2 additions & 0 deletions tiledb/common/memory_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(type));
Expand Down
3 changes: 2 additions & 1 deletion tiledb/common/memory_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ enum class MemoryType {
METADATA,
DOMAINS,
TILE_SUMS,
TILE_WRITER_DATA
TILE_WRITER_DATA,
WRITER_DATA
};

/**
Expand Down
8 changes: 8 additions & 0 deletions tiledb/sm/query/readers/reader_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1369,3 +1370,10 @@ template void ReaderBase::validate_attribute_order<uint64_t>(
std::vector<uint64_t>&);

} // namespace tiledb::sm

template <>
IndexedList<tiledb::sm::ResultTile>::IndexedList(
shared_ptr<tiledb::sm::MemoryTracker> memory_tracker)
: memory_tracker_(memory_tracker)
, list_(memory_tracker->get_resource(sm::MemoryType::TILE_DATA)) {
}
4 changes: 2 additions & 2 deletions tiledb/sm/query/writers/global_order_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ GlobalOrderWriter::~GlobalOrderWriter() {
GlobalOrderWriter::GlobalWriteState::GlobalWriteState(
shared_ptr<MemoryTracker> 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)) {
}

/* ****************************** */
Expand Down
3 changes: 1 addition & 2 deletions tiledb/sm/query/writers/unordered_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions tiledb/sm/query/writers/writer_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1203,3 +1203,17 @@ bool WriterBase::remote_query() const {
}

} // namespace tiledb::sm

template <>
IndexedList<tiledb::sm::WriterTileTuple>::IndexedList(
shared_ptr<tiledb::sm::MemoryTracker> memory_tracker)
: memory_tracker_(memory_tracker)
, list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) {
}

template <>
IndexedList<tiledb::common::IndexedList<tiledb::sm::WriterTileTuple>>::
IndexedList(shared_ptr<tiledb::sm::MemoryTracker> memory_tracker)
: memory_tracker_(memory_tracker)
, list_(memory_tracker->get_resource(sm::MemoryType::TILE_WRITER_DATA)) {
}

0 comments on commit dce3b7e

Please sign in to comment.