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

Fix override vertex/edge on some backends #820

Merged
merged 4 commits into from
Feb 13, 2020
Merged

Fix override vertex/edge on some backends #820

merged 4 commits into from
Feb 13, 2020

Conversation

Linary
Copy link
Contributor

@Linary Linary commented Jan 8, 2020

Fix #792

Change-Id: Iad461c6742773bd001a1768f83479e1ab429e272

@codecov
Copy link

codecov bot commented Jan 9, 2020

Codecov Report

Merging #820 into master will increase coverage by 2.09%.
The diff coverage is 86.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #820      +/-   ##
============================================
+ Coverage     69.07%   71.17%   +2.09%     
- Complexity     4276     4366      +90     
============================================
  Files           286      286              
  Lines         21085    21084       -1     
  Branches       2967     2967              
============================================
+ Hits          14565    15006     +441     
+ Misses         5086     4592     -494     
- Partials       1434     1486      +52
Impacted Files Coverage Δ Complexity Δ
...graph/backend/store/cassandra/CassandraTables.java 87.83% <ø> (+0.65%) 1 <0> (ø) ⬇️
...aph/backend/store/cassandra/CassandraFeatures.java 78.94% <100%> (ø) 15 <1> (ø) ⬇️
...hugegraph/backend/store/rocksdb/RocksDBTables.java 67.52% <100%> (-0.82%) 0 <0> (ø)
.../backend/store/memory/InMemoryDBStoreProvider.java 100% <100%> (ø) 11 <1> (ø) ⬇️
...gegraph/backend/store/rocksdb/RocksDBFeatures.java 84.21% <100%> (ø) 16 <2> (ø) ⬇️
...egraph/backend/store/hbase/HbaseStoreProvider.java 100% <100%> (+100%) 6 <1> (+6) ⬆️
...ugegraph/backend/serializer/SerializerFactory.java 89.65% <100%> (ø) 10 <0> (ø) ⬇️
...ugegraph/backend/store/memory/InMemoryDBStore.java 87.59% <100%> (ø) 31 <0> (ø) ⬇️
.../hugegraph/backend/store/rocksdb/RocksDBTable.java 77.31% <100%> (-0.95%) 33 <2> (+1)
...u/hugegraph/backend/store/hbase/HbaseFeatures.java 84.21% <100%> (+84.21%) 16 <2> (+16) ⬆️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5952dc3...8b5615e. Read the comment docs.

@Linary Linary force-pushed the override-vertex branch 3 times, most recently from ed99f47 to e180cd1 Compare January 9, 2020 13:23
Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also upgrade rocksdb/hbase/memory backend version

// Parse vertex properties
assert entry.columnsSize() == 1 : entry.columnsSize();
this.parseVertex(col.value, vertex);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/BinaryInlineSerializer.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/BinaryInlineSerializer.java
index b94d0608..b2481aa6 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/BinaryInlineSerializer.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/serializer/BinaryInlineSerializer.java
@@ -72,11 +72,13 @@ public class BinaryInlineSerializer extends BinarySerializer {
 
         // Parse all properties and edges of a Vertex
         for (BackendColumn col : entry.columns()) {
-            if (id.edge()) {
+            // NOTE: the entry id type is vertex even if entry type is edge
+            if (entry.type().isEdge()) {
                 // Parse vertex edges
                 this.parseColumn(col, vertex);
             } else {
                 // Parse vertex properties
+                assert entry.type().isVertex();
                 assert entry.columnsSize() == 1 : entry.columnsSize();
                 this.parseVertex(col.value, vertex);
             }


// Parse all properties and edges of a Vertex
for (BackendColumn col : entry.columns()) {
this.parseColumn(col, vertex);
if (entry.type().isEdge()) {
// NOTE: the id is vertex type even if query edge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// NOTE: the entry id type is vertex even if entry type is edge

// Parse vertex edges
this.parseColumn(col, vertex);
} else {
// Parse vertex properties
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert entry.type().isVertex();


// Parse all properties and edges of a Vertex
for (BackendColumn col : entry.columns()) {
this.parseColumn(col, vertex);
if (entry.type().isEdge()) {
// NOTE: the id is vertex type even if query edge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// NOTE: the entry id type is vertex even if entry type is edge

Fix #792

Change-Id: Iad461c6742773bd001a1768f83479e1ab429e272
Change-Id: I7458be4ad22bcbd178ed25ecd6805b6b4c2c0ada
Change-Id: I16dfd36d8eddedd6ca6abf9199cf32723ad7e268
Change-Id: I4c374d557947187f3469d802f8f0d363541fa70a
@zhoney zhoney merged commit 5692844 into master Feb 13, 2020
@zhoney zhoney deleted the override-vertex branch February 13, 2020 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hugegraph-load重复导入顶点,如何移除旧数据中不要的顶点属性
3 participants