Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatbuffer for baseline resync #170

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomeObjectConan(ConanFile):
name = "homeobject"
version = "1.0.16"
version = "1.2.1"
homepage = "https://github.com/eBay/HomeObject"
description = "Blob Store built on HomeReplication"
topics = ("ebay")
Expand Down Expand Up @@ -40,7 +40,7 @@ def build_requirements(self):
self.build_requires("gtest/1.14.0")

def requirements(self):
self.requires("homestore/[>=6.2, include_prerelease=True]@oss/master")
self.requires("homestore/[>=6.3, include_prerelease=True]@oss/master")
self.requires("sisl/[>=12.1, include_prerelease=True]@oss/master")
self.requires("lz4/1.9.4", override=True)

Expand Down
9 changes: 9 additions & 0 deletions src/lib/homestore_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ if(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
endif()

#list(APPEND SCHEMA_FLAGS "--scoped-enums" "--gen-name-strings" "--cpp-std=c++17" "--cpp-static-reflection" "--reflect-names")
yamingk marked this conversation as resolved.
Show resolved Hide resolved
#flatbuffers_generate_headers(
# TARGET ho_replication_fb
# SCHEMAS resync_pg_shard.fbs resync_blob_data.fbs
# FLAGS ${SCHEMA_FLAGS}
#)

add_library ("${PROJECT_NAME}_homestore")
target_sources("${PROJECT_NAME}_homestore" PRIVATE
hs_homeobject.cpp
Expand All @@ -28,6 +35,8 @@ settings_gen_cpp(
${CMAKE_CURRENT_BINARY_DIR}/generated/
"${PROJECT_NAME}_homestore"
hs_backend_config.fbs
resync_pg_shard.fbs
resync_blob_data.fbs
)

if(BUILD_TESTING)
Expand Down
6 changes: 6 additions & 0 deletions src/lib/homestore_backend/replication_state_machine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ class ReplicationStateMachine : public homestore::ReplDevListener {
/// @brief Called when the replica set is being stopped
void on_replica_stop() override;

/// @brief Called when the snapshot is being created.
/// @param snapshot - The snapshot object which contains the lsn and term;
void create_snapshot(homestore::repl_snapshot&) override {
yamingk marked this conversation as resolved.
Show resolved Hide resolved
// To be implemented;
}

private:
HSHomeObject* home_object_{nullptr};
};
Expand Down
14 changes: 14 additions & 0 deletions src/lib/homestore_backend/resync_blob_data.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace homeobject;

table BlobData {
shard_id : uint64;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
key : [ubyte];
yamingk marked this conversation as resolved.
Show resolved Hide resolved
size : uint32;
data : [ubyte];
yamingk marked this conversation as resolved.
Show resolved Hide resolved
}

table ResyncBlobDataBatch {
data_array : [BlobData];
}

root_type ResyncBlobDataBatch;
25 changes: 25 additions & 0 deletions src/lib/homestore_backend/resync_pg_shard.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace homeobject;

table Member {
uuid : [ubyte];
name : [ubyte];
}
yamingk marked this conversation as resolved.
Show resolved Hide resolved

table PGInfoEntry {
yamingk marked this conversation as resolved.
Show resolved Hide resolved
pg_id : uint32; // only low 16 bit is used for pg_id;
replica_set_uuid : [ubyte]; // uuid of replica set
members : [Member]; // peers;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
}

table ShardInfoEntry {
pg_id : uint32; // pg id which this shard belongs to;
yamingk marked this conversation as resolved.
Show resolved Hide resolved
shard_id : uint64; // shard id to be created with;
shard_size : uint64; // shard size;
}

table ResyncPGShardInfo {
pg : PGInfoEntry;
shards : [ShardInfoEntry];
}

root_type ResyncPGShardInfo;