mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 09:46:53 +00:00
SpatialDB change API
Summary: I changed SpatialDB API so that we only specify list of indexes when we create the database. That way, whoever is querying the DB doesn't need to know the full list of indexes and their options. Test Plan: spatial_db_test Reviewers: yinwang Reviewed By: yinwang Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D20571
This commit is contained in:
@@ -196,13 +196,15 @@ struct SpatialIndexOptions {
|
||||
|
||||
class SpatialDB : public StackableDB {
|
||||
public:
|
||||
// Open the SpatialDB. List of spatial_indexes need to include all indexes
|
||||
// that already exist in the DB (if the DB already exists). It can include new
|
||||
// indexes, which will be created and initialized as empty (data will not be
|
||||
// re-indexed). The resulting db object will be returned through db parameter.
|
||||
// TODO(icanadi) read_only = true doesn't yet work because of #4743185
|
||||
// Creates the SpatialDB with specified list of indexes.
|
||||
// REQUIRED: db doesn't exist
|
||||
static Status Create(const SpatialDBOptions& options, const std::string& name,
|
||||
const std::vector<SpatialIndexOptions>& spatial_indexes);
|
||||
|
||||
// Open the existing SpatialDB. The resulting db object will be returned
|
||||
// through db parameter.
|
||||
// REQUIRED: db was created using SpatialDB::Create
|
||||
static Status Open(const SpatialDBOptions& options, const std::string& name,
|
||||
const std::vector<SpatialIndexOptions>& spatial_indexes,
|
||||
SpatialDB** db, bool read_only = false);
|
||||
|
||||
explicit SpatialDB(DB* db) : StackableDB(db) {}
|
||||
|
||||
Reference in New Issue
Block a user