Skip to content

Commit 337fccc

Browse files
authored
feat(btree): add btree global index reader/writer/factory (#89)
1 parent dca7183 commit 337fccc

12 files changed

Lines changed: 2973 additions & 0 deletions

src/paimon/common/global_index/btree/btree_compatibility_test.cpp

Lines changed: 931 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#include "paimon/common/global_index/btree/btree_global_index_factory.h"
21+
22+
#include <utility>
23+
24+
#include "paimon/common/global_index/btree/btree_global_indexer.h"
25+
namespace paimon {
26+
27+
const char BTreeGlobalIndexerFactory::IDENTIFIER[] = "btree-global";
28+
29+
Result<std::unique_ptr<GlobalIndexer>> BTreeGlobalIndexerFactory::Create(
30+
const std::map<std::string, std::string>& options) const {
31+
return BTreeGlobalIndexer::Create(options);
32+
}
33+
34+
REGISTER_PAIMON_FACTORY(BTreeGlobalIndexerFactory);
35+
36+
} // namespace paimon
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#pragma once
21+
22+
#include <map>
23+
#include <memory>
24+
#include <string>
25+
26+
#include "paimon/global_index/global_indexer_factory.h"
27+
28+
namespace paimon {
29+
/// Factory for creating btree global indexers.
30+
class BTreeGlobalIndexerFactory : public GlobalIndexerFactory {
31+
public:
32+
static const char IDENTIFIER[];
33+
34+
const char* Identifier() const override {
35+
return IDENTIFIER;
36+
}
37+
38+
Result<std::unique_ptr<GlobalIndexer>> Create(
39+
const std::map<std::string, std::string>& options) const override;
40+
};
41+
42+
} // namespace paimon

0 commit comments

Comments
 (0)