-
Notifications
You must be signed in to change notification settings - Fork 7
[#1013] Implement the Database Adapter #1035
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
Open
marcocapozzoli
wants to merge
63
commits into
master
Choose a base branch
from
masc/1013-database-adapter-cpp-3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
2abe834
WIP
marcocapozzoli 5b5bbbf
WIP - Add a simple test
marcocapozzoli e6f4e2b
WIP
marcocapozzoli e1ef57a
WIP
marcocapozzoli a29786d
WIP
marcocapozzoli db82fd8
WIP
marcocapozzoli 8d82723
WIP
marcocapozzoli 889167e
WIP
marcocapozzoli 125c0b2
WIP
marcocapozzoli 479638f
WIP
marcocapozzoli 09dface
WIP
marcocapozzoli f00ec73
WIP
marcocapozzoli 95292fb
WIP
marcocapozzoli d559a32
WIP
marcocapozzoli 76ca880
WIP - doc
marcocapozzoli 38906cb
WIP
marcocapozzoli 73376df
WIP-tests
marcocapozzoli 052de67
change log level
marcocapozzoli 6cf4df6
add exists() in HandleTrie
marcocapozzoli 4530a64
Merge branch 'master' into masc/1013-database-adapter-cpp
marcocapozzoli c7df9f1
Add ContextLoader
marcocapozzoli edf7523
adjust .json file
marcocapozzoli 2050040
Add Processor
marcocapozzoli e9a695e
remove comments
marcocapozzoli 769f70e
Add mutex
marcocapozzoli 65f25ca
WIP - draft to pipeline
marcocapozzoli f84d677
WIP
marcocapozzoli 2ee0457
WIP
marcocapozzoli 3b40e65
WIP
marcocapozzoli 19c1cdf
add ContextLoad class
marcocapozzoli 6e52df8
Organize the code
marcocapozzoli 68579f3
WIP
marcocapozzoli 09f74db
WIP
marcocapozzoli 0b6f184
Change the owner of the connection.
marcocapozzoli ebceb97
Wip Pipepline
marcocapozzoli 92b222c
WIP
marcocapozzoli fa2617e
wip
marcocapozzoli 50c3b78
WIP
marcocapozzoli 2b76c30
wip
marcocapozzoli 526fa55
WIP
marcocapozzoli 8e24561
wip
marcocapozzoli 7445f56
WIP - format_all
marcocapozzoli c42996c
remove logs
marcocapozzoli 58acbb5
refactor: update logging levels and improve is_finished method implem…
marcocapozzoli e1d2cab
refactor: change log level from INFO to DEBUG in DatabaseMappingJob a…
marcocapozzoli 28eb884
Merge branch 'masc/1013-database-adapter-cpp-2' into masc/1013-databa…
marcocapozzoli 6e40de7
Add main file
marcocapozzoli a14eefd
Add log progress
marcocapozzoli 49fdb81
refactor DatabaseConnection and Pipeline
marcocapozzoli 85cefd0
Add database adapter functionality and refactor related components
marcocapozzoli 8729772
Refactor AtomPersistenceJob to manage atom processing and logging mor…
marcocapozzoli cf0136d
Merge branch 'master' into masc/1013-database-adapter-cpp-3
marcocapozzoli 234ac9a
apply lint
marcocapozzoli 84a989f
fixed all bazel build/scripts, DAS docker image
levisingularity dbe3331
fix pipeline setup
levisingularity c561fce
Merge pull request #1053 from singnet/1013-build-scripts
marcocapozzoli 2354876
Refactor PostgresWrapper to implement cursor-based fetching and updat…
marcocapozzoli 1ddd36c
Add Postgres server setup to unit test workflow and improve resource …
marcocapozzoli 39a15d6
Refactor DatabaseMappingJob destructor for improved readability
marcocapozzoli 3a1a0af
Refactor DatabaseConnection destructor to avoid stopping connection o…
marcocapozzoli 4741683
add waiting loop
marcocapozzoli 28e4f2f
Merge branch 'master' into masc/1013-database-adapter-cpp-3
marcocapozzoli 8ae296f
Refactor DataMapper to initialize empty_trie_value
marcocapozzoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,11 @@ HandleTrie::TrieNode::~TrieNode() { | |
| delete children[i]; | ||
| } | ||
| delete[] children; | ||
| delete value; | ||
| // TODO: Remove this check once improve insert() | ||
| if (value != NULL) { | ||
| delete value; | ||
| value = NULL; | ||
| } | ||
| } | ||
|
|
||
| string HandleTrie::TrieValue::to_string() { return ""; } | ||
|
|
@@ -269,3 +273,8 @@ void HandleTrie::traverse(bool keep_root_locked, | |
| root->trie_node_mutex.unlock(); | ||
| } | ||
| } | ||
|
|
||
| bool HandleTrie::exists(const string& key) { | ||
| TrieNode* node = lookup_node(key); | ||
| return node != NULL ? true : false; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| load("@rules_cc//cc:cc_library.bzl", "cc_library") | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| cc_library( | ||
| name = "db_adapter_lib", | ||
| includes = ["."], | ||
| deps = [ | ||
| ":context_loader", | ||
| ":data_mapper", | ||
| ":data_types", | ||
| ":database_connection", | ||
| ":database_wrapper", | ||
| ":pipeline", | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| "//db_adapter/postgres:postgres_lib", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "data_types", | ||
| hdrs = ["DataTypes.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "data_mapper", | ||
| srcs = ["DataMapper.cc"], | ||
| hdrs = ["DataMapper.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| ":data_types", | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "database_wrapper", | ||
| srcs = ["DatabaseWrapper.cc"], | ||
| hdrs = ["DatabaseWrapper.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| ":data_mapper", | ||
| ":data_types", | ||
| ":database_connection", | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "context_loader", | ||
| srcs = ["ContextLoader.cc"], | ||
| hdrs = ["ContextLoader.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| ":data_types", | ||
| "//commons:commons_lib", | ||
| "@nlohmann_json//:json", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "database_connection", | ||
| srcs = ["DatabaseConnection.cc"], | ||
| hdrs = ["DatabaseConnection.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| ":data_types", | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| "//commons/processor:processor_lib", | ||
| ], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "pipeline", | ||
| srcs = ["Pipeline.cc"], | ||
| hdrs = ["Pipeline.h"], | ||
| includes = ["."], | ||
| deps = [ | ||
| ":data_types", | ||
| ":database_wrapper", | ||
| "//atomdb", | ||
| "//atomdb:atomdb_singleton", | ||
| "//commons:commons_lib", | ||
| "//commons/atoms:atoms_lib", | ||
| "//db_adapter/postgres:postgres_lib", | ||
| ], | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a
TODOhere so we can remove this check once we improveHandleTrie::insert()to not acceptNULLasvalue