Skip to content

Commit

Permalink
use template for match_info
Browse files Browse the repository at this point in the history
  • Loading branch information
kuron99 committed Nov 14, 2024
1 parent ca4ffad commit 0cf9766
Show file tree
Hide file tree
Showing 8 changed files with 683 additions and 830 deletions.
578 changes: 0 additions & 578 deletions src/jogasaki/executor/process/impl/ops/index_join.cpp

Large diffs are not rendered by default.

483 changes: 303 additions & 180 deletions src/jogasaki/executor/process/impl/ops/index_join.h

Large diffs are not rendered by default.

40 changes: 0 additions & 40 deletions src/jogasaki/executor/process/impl/ops/index_join_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,3 @@
*/
#include "index_join_context.h"

#include <utility>

#include "context_base.h"
#include "index_join.h"

namespace jogasaki::executor::process::impl::ops {

index_join_context::index_join_context(
class abstract::task_context* ctx,
variable_table& input_variables,
variable_table& output_variables,
std::unique_ptr<kvs::storage> primary_stg,
std::unique_ptr<kvs::storage> secondary_stg,
transaction_context* tx,
std::unique_ptr<details::matcher> matcher,
context_base::memory_resource* resource,
context_base::memory_resource* varlen_resource
) :
context_base(ctx, input_variables, output_variables, resource, varlen_resource),
primary_stg_(std::move(primary_stg)),
secondary_stg_(std::move(secondary_stg)),
tx_(tx),
matcher_(std::move(matcher))
{}

operator_kind index_join_context::kind() const noexcept {
return operator_kind::join_find;
}

void index_join_context::release() {
//TODO
}

transaction_context* index_join_context::transaction() const noexcept {
return tx_;
}

}


45 changes: 33 additions & 12 deletions src/jogasaki/executor/process/impl/ops/index_join_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,29 @@
#include <jogasaki/transaction_context.h>

#include "context_base.h"
#include "index_matcher.h"

namespace jogasaki::executor::process::impl::ops {

namespace details {

template<class MatchInfo>
class matcher;
}

} // namespace details

template<class MatchInfo>
class index_join;

/**
* @brief index_join_context context
* @brief context object for index_join
*/
template <class MatchInfo>
class index_join_context : public context_base {
public:
friend class index_join;

friend class index_join<MatchInfo>;

/**
* @brief create empty object
*/
Expand All @@ -57,24 +67,35 @@ class index_join_context : public context_base {
std::unique_ptr<kvs::storage> primary_stg,
std::unique_ptr<kvs::storage> secondary_stg,
transaction_context* tx,
std::unique_ptr<details::matcher> matcher,
std::unique_ptr<details::matcher<MatchInfo>> matcher,
memory_resource* resource,
memory_resource* varlen_resource
);
) :
context_base(ctx, input_variables, output_variables, resource, varlen_resource),
primary_stg_(std::move(primary_stg)),
secondary_stg_(std::move(secondary_stg)),
tx_(tx),
matcher_(std::move(matcher))
{}

[[nodiscard]] operator_kind kind() const noexcept override;
[[nodiscard]] operator_kind kind() const noexcept override {
return std::is_same_v<MatchInfo, details::match_info_find> ? operator_kind::join_find
: operator_kind::join_scan;
}

void release() override;
void release() override {
//TODO
}

[[nodiscard]] transaction_context* transaction() const noexcept;
[[nodiscard]] transaction_context* transaction() const noexcept {
return tx_;
}

private:
std::unique_ptr<kvs::storage> primary_stg_{};
std::unique_ptr<kvs::storage> secondary_stg_{};
transaction_context* tx_{};
std::unique_ptr<details::matcher> matcher_{};
std::unique_ptr<details::matcher<MatchInfo>> matcher_{};
};

}


} // namespace jogasaki::executor::process::impl::ops
Loading

0 comments on commit 0cf9766

Please sign in to comment.