diff options
author | Sergei Krivonos <sergei.krivonos@mariadb.com> | 2021-11-04 17:32:05 +0200 |
---|---|---|
committer | Sergei Krivonos <sergei.krivonos@mariadb.com> | 2021-11-04 18:38:40 +0200 |
commit | 891d33da02062cb49a14be6d6f50fd5b1ee1ceab (patch) | |
tree | a3de8e388ee8d3bf015abc0093d1103f7258d39b | |
parent | ccb345e2a3616590ea741830ded1b7f645639de0 (diff) | |
download | mariadb-git-bb-10.8-MDEV-19308.tar.gz |
MDEV-19308: bloom filterbb-10.8-MDEV-19308
-rw-r--r-- | sql/bloom_rowid_filter.cc | 38 | ||||
-rw-r--r-- | sql/bloom_rowid_filter.h | 54 |
2 files changed, 92 insertions, 0 deletions
diff --git a/sql/bloom_rowid_filter.cc b/sql/bloom_rowid_filter.cc new file mode 100644 index 00000000000..bec900c7635 --- /dev/null +++ b/sql/bloom_rowid_filter.cc @@ -0,0 +1,38 @@ +/* + Copyright (c) 2021 MariaDB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include "bloom_rowid_filter.h" +#include "hash.h" + + +bool Bloom_filter_container::alloc() +{ + bool success= true; + return success; +} + +bool Bloom_filter_container::add(void *ctxt, char *elem) +{ + bool success= true; + return success; +} + +bool Bloom_filter_container::check(void *ctxt, char *elem) +{ + bool success= true; + return success; +} + diff --git a/sql/bloom_rowid_filter.h b/sql/bloom_rowid_filter.h new file mode 100644 index 00000000000..c880dc015bd --- /dev/null +++ b/sql/bloom_rowid_filter.h @@ -0,0 +1,54 @@ +/* + Copyright (c) 2021 MariaDB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#pragma once + + +#include "rowid_filter.h" + + +/** + @class Bloom_filter_container + + The bloom filter container implementation to store info on the set + of rowids / primary keys that defines a pk-filter. +*/ +class Bloom_filter_container : public Rowid_filter_container +{ +public: + + Rowid_filter_container_type get_type() override { return BLOOM_FILTER_CONTAINER; } + + /* Allocate memory for the container */ + bool alloc() override; + + /* + @brief Add info on a rowid / primary to the container + @param ctxt The context info (opaque) + @param elem The rowid / primary key to be added to the container + @retval true if elem is successfully added + */ + bool add(void *ctxt, char *elem) override; + + /* + @brief Check whether a rowid / primary key is in container + @param ctxt The context info (opaque) + @param elem The rowid / primary key to be checked against the container + @retval False if elem is definitely not in the container + */ + bool check(void *ctxt, char *elem) override; + +}; |