Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f16c8fa
Mark StringEncodingTest.java as text
jsoref Mar 28, 2022
53d1fb9
spelling: backend
jsoref Mar 27, 2022
cc74a5b
spelling: bodies
jsoref Mar 27, 2022
2d1ba36
spelling: caching
jsoref Mar 28, 2022
855fe72
spelling: capacity
jsoref Mar 28, 2022
46d9d1f
spelling: clause
jsoref Mar 28, 2022
07dcbb1
spelling: cockroach
jsoref Mar 28, 2022
f79acf6
spelling: committed
jsoref Mar 27, 2022
d5b1682
spelling: datacenter
jsoref Mar 28, 2022
324617e
spelling: decompress
jsoref Mar 28, 2022
efecaee
spelling: destroy
jsoref Mar 28, 2022
0ca5d70
spelling: each
jsoref Mar 28, 2022
ec1637e
spelling: github
jsoref Mar 28, 2022
462e800
spelling: http
jsoref Mar 28, 2022
7d1bd9b
spelling: implementation
jsoref Mar 28, 2022
a3c0b80
spelling: indexable
jsoref Mar 28, 2022
9aab4d1
spelling: mergeable
jsoref Mar 28, 2022
dd702b3
spelling: nameable
jsoref Mar 28, 2022
2b798b0
spelling: occurred
jsoref Mar 28, 2022
2a23736
spelling: performance
jsoref Mar 28, 2022
e1a2f0e
spelling: period
jsoref Mar 28, 2022
fe3524a
spelling: prefixes
jsoref Mar 28, 2022
8ac2136
spelling: projects
jsoref Mar 28, 2022
e4fc294
spelling: propertiable
jsoref Mar 28, 2022
4ccfab3
spelling: properties
jsoref Mar 28, 2022
2cde9f7
spelling: property
jsoref Mar 27, 2022
fdd0734
spelling: query
jsoref Mar 27, 2022
43e1725
spelling: replica
jsoref Mar 28, 2022
70f81d5
spelling: retrieve
jsoref Mar 28, 2022
319526d
spelling: running
jsoref Mar 28, 2022
94cf54e
spelling: scanning
jsoref Mar 28, 2022
3d87c17
spelling: separate
jsoref Mar 28, 2022
d7d2a6b
spelling: set
jsoref Mar 28, 2022
9ac2556
spelling: shouldn't
jsoref Mar 27, 2022
a832c3c
spelling: single
jsoref Mar 28, 2022
8858e35
spelling: splitter
jsoref Mar 27, 2022
4e4357c
spelling: timestamp
jsoref Mar 28, 2022
79f44fb
spelling: transfer
jsoref Mar 28, 2022
4d5635e
spelling: transferred
jsoref Mar 28, 2022
8f4bd86
spelling: typeable
jsoref Mar 28, 2022
2e8efe8
spelling: vertex
jsoref Mar 28, 2022
f6e267c
spelling: vertices
jsoref Mar 28, 2022
f09909c
spelling: with
jsoref Mar 28, 2022
ce29cd5
spelling: wrapped
jsoref Mar 28, 2022
922d3d3
spelling: write
jsoref Mar 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To find the Java binary in your environment, run the appropriate command for you
To build without executing tests:

1. Click on "File" -> "Open", choose your project location.
2. Open maven view by click "View" -> "Tool Windows" -> "Maven Porjects".
2. Open maven view by click "View" -> "Tool Windows" -> "Maven Projects".
3. Choose root module "hugegraph: Distributed Graph Database", unfold the
menu of "Lifecycle".
4. Click the "Toggle 'Skip Tests' Mode" button which is located on the top
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Before submitting the code, we need to do some preparation:

5. Sign the HugeGraph CLA: [https://cla-assistant.io/hugegraph/hugegraph](https://cla-assistant.io/hugegraph/hugegraph)

Optional: You can use [Github desktop](https://desktop.github.com/) to greatly simplify the commit and update process.
Optional: You can use [GitHub desktop](https://desktop.github.com/) to greatly simplify the commit and update process.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Brand


## 2. Create an Issue on GitHub

Expand Down Expand Up @@ -150,7 +150,7 @@ And push it to GitHub fork repo again:
git push -f origin bugfix-branch:bugfix-branch
```

Github will automatically update the Pull Request after we push it, just wait for code review.
GitHub will automatically update the Pull Request after we push it, just wait for code review.

Any question please contact to us through [hugegraph@googlegroups.com](mailto:hugegraph@googlegroups.com) or [other contact information](https://hugegraph.github.io/hugegraph-doc/).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![License](https://img.shields.io/badge/license-Apache%202-0E78BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://github.com/hugegraph/hugegraph/actions/workflows/ci.yml/badge.svg)](https://github.com/hugegraph/hugegraph/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/hugegraph/hugegraph/branch/master/graph/badge.svg)](https://codecov.io/gh/hugegraph/hugegraph)
[![Github Releases Downloads](https://img.shields.io/github/downloads/hugegraph/hugegraph/total.svg)](https://github.com/hugegraph/hugegraph/releases)
[![GitHub Releases Downloads](https://img.shields.io/github/downloads/hugegraph/hugegraph/total.svg)](https://github.com/hugegraph/hugegraph/releases)

HugeGraph is a fast-speed and highly-scalable [graph database](https://en.wikipedia.org/wiki/Graph_database). Billions of vertices and edges can be easily stored into and queried from HugeGraph due to its excellent OLTP ability. As compliance to [Apache TinkerPop 3](https://tinkerpop.apache.org/) framework, various complicated graph queries can be accomplished through [Gremlin](https://tinkerpop.apache.org/gremlin.html)(a powerful graph traversal language).

Expand Down
12 changes: 6 additions & 6 deletions hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,19 @@ protected static void checkUpdatingBody(Checkable body) {
}

protected static void checkCreatingBody(
Collection<? extends Checkable> bodys) {
E.checkArgumentNotNull(bodys, "The request body can't be empty");
for (Checkable body : bodys) {
Collection<? extends Checkable> bodies) {
E.checkArgumentNotNull(bodies, "The request body can't be empty");
for (Checkable body : bodies) {
E.checkArgument(body != null,
"The batch body can't contain null record");
body.checkCreate(true);
}
}

protected static void checkUpdatingBody(
Collection<? extends Checkable> bodys) {
E.checkArgumentNotNull(bodys, "The request body can't be empty");
for (Checkable body : bodys) {
Collection<? extends Checkable> bodies) {
E.checkArgumentNotNull(bodies, "The request body can't be empty");
for (Checkable body : bodies) {
E.checkArgumentNotNull(body,
"The batch body can't contain null record");
body.checkUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.baidu.hugegraph.config.HugeConfig;
import com.baidu.hugegraph.config.OptionSpace;
import com.baidu.hugegraph.config.ServerOptions;
import com.baidu.hugegraph.type.Namifiable;
import com.baidu.hugegraph.type.Nameable;
import com.baidu.hugegraph.util.E;
import com.baidu.hugegraph.util.JsonUtil;

Expand Down Expand Up @@ -432,7 +432,7 @@ public ResourceType resource() {
}

public ResourceObject<?> resourceObject() {
Namifiable elem = HugeResource.NameObject.ANY;
Nameable elem = HugeResource.NameObject.ANY;
return ResourceObject.of(this.owner, this.resource, elem);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
import com.baidu.hugegraph.task.TaskStatus;
import com.baidu.hugegraph.traversal.optimize.HugeScriptTraversal;
import com.baidu.hugegraph.type.HugeType;
import com.baidu.hugegraph.type.Namifiable;
import com.baidu.hugegraph.type.Nameable;
import com.baidu.hugegraph.type.define.GraphMode;
import com.baidu.hugegraph.type.define.GraphReadMode;
import com.baidu.hugegraph.type.define.NodeRole;
Expand Down Expand Up @@ -790,7 +790,7 @@ private void verifyPermission(HugePermission actionPerm,
*/
verifyResPermission(actionPerm, true, () -> {
String graph = this.hugegraph.name();
Namifiable elem = HugeResource.NameObject.ANY;
Nameable elem = HugeResource.NameObject.ANY;
return ResourceObject.of(graph, resType, elem);
});
}
Expand Down Expand Up @@ -869,7 +869,7 @@ private void verifyNamePermission(HugePermission actionPerm,
ResourceType resType, String name) {
verifyResPermission(actionPerm, true, () -> {
String graph = this.hugegraph.name();
Namifiable elem = HugeResource.NameObject.of(name);
Nameable elem = HugeResource.NameObject.of(name);
return ResourceObject.of(graph, resType, elem);
});
}
Expand Down Expand Up @@ -1105,7 +1105,7 @@ private <V> HugeTask<V> verifyTaskPermission(HugePermission actionPerm,
Object r = verifyResPermission(actionPerm, throwIfNoPerm, () -> {
String graph = HugeGraphAuthProxy.this.hugegraph.name();
String name = task.id().toString();
Namifiable elem = HugeResource.NameObject.of(name);
Nameable elem = HugeResource.NameObject.of(name);
return ResourceObject.of(graph, ResourceType.TASK, elem);
}, () -> {
return hasTaskPermission(task);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum UpdateStrategy {
SUM {
@Override
Object updatePropertyValue(Object oldProperty, Object newProperty) {
// TODO: Improve preformance? (like write a method in common module)
// TODO: Improve performance? (like write a method in common module)
BigDecimal oldNumber = new BigDecimal(oldProperty.toString());
BigDecimal newNumber = new BigDecimal(newProperty.toString());
return oldNumber.add(newNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ApiVersion {
* version 0.2:
* [0.2] HugeGraph-527: First add the version to the hugegraph module
* [0.3] HugeGraph-525: Add versions check of components and api
* [0.4] HugeGraph-162: Add schema builder to seperate client and
* [0.4] HugeGraph-162: Add schema builder to separate client and
* inner interface.
* [0.5] HugeGraph-498: Support three kind of id strategy
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public Iterator<BackendEntry> query(Query query) {
iterators.add(table.query(this.session(), q));
}
entries = new MergeIterator<>(entries, iterators,
BackendEntry::mergable);
BackendEntry::mergeable);
}
return entries;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ protected void registerMetaHandlers() {
E.checkArgument(args.length == 1,
"The args count of %s must be 1", meta);
long splitSize = (long) args[0];
CassandraShard spliter = new CassandraShard(session,
CassandraShard splitter = new CassandraShard(session,
session.keyspace(),
this.table());
return spliter.getSplits(0, splitSize);
return splitter.getSplits(0, splitSize);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
import com.baidu.hugegraph.auth.SchemaDefine.AuthElement;
import com.baidu.hugegraph.structure.HugeElement;
import com.baidu.hugegraph.traversal.optimize.TraversalUtil;
import com.baidu.hugegraph.type.Namifiable;
import com.baidu.hugegraph.type.Typifiable;
import com.baidu.hugegraph.type.Nameable;
import com.baidu.hugegraph.type.Typeable;
import com.baidu.hugegraph.util.JsonUtil;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -124,7 +124,7 @@ public boolean filter(ResourceObject<?> resourceObject) {
return this.filter((AuthElement) resourceObject.operated());
}
if (resType.isSchema() || CHECK_NAME_RESS.contains(resType)) {
return this.filter((Namifiable) resourceObject.operated());
return this.filter((Nameable) resourceObject.operated());
}
}

Expand All @@ -137,15 +137,15 @@ public boolean filter(ResourceObject<?> resourceObject) {

private boolean filter(AuthElement element) {
assert this.type.match(element.type());
if (element instanceof Namifiable) {
return this.filter((Namifiable) element);
if (element instanceof Nameable) {
return this.filter((Nameable) element);
}
return true;
}

private boolean filter(Namifiable element) {
assert !(element instanceof Typifiable) || this.type.match(
ResourceType.from(((Typifiable) element).type()));
private boolean filter(Nameable element) {
assert !(element instanceof Typeable) || this.type.match(
ResourceType.from(((Typeable) element).type()));

return this.matchLabel(element.name());
}
Expand Down Expand Up @@ -248,7 +248,7 @@ public String toString() {
public static boolean allowed(ResourceObject<?> resourceObject) {
// Allowed to access system(hidden) schema by anyone
if (resourceObject.type().isSchema()) {
Namifiable schema = (Namifiable) resourceObject.operated();
Nameable schema = (Nameable) resourceObject.operated();
return Hidden.isHidden(schema.name());
}

Expand All @@ -264,7 +264,7 @@ public static List<HugeResource> parseResources(String resources) {
return JsonUtil.fromJson(resources, type);
}

public static class NameObject implements Namifiable {
public static class NameObject implements Nameable {

public static final NameObject ANY = new NameObject("*");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.baidu.hugegraph.auth.SchemaDefine.AuthElement;
import com.baidu.hugegraph.schema.SchemaElement;
import com.baidu.hugegraph.structure.HugeElement;
import com.baidu.hugegraph.type.Namifiable;
import com.baidu.hugegraph.type.Nameable;
import com.baidu.hugegraph.util.E;

public class ResourceObject<V> {
Expand Down Expand Up @@ -89,7 +89,7 @@ public static ResourceObject<AuthElement> of(String graph,
}

public static ResourceObject<?> of(String graph, ResourceType type,
Namifiable elem) {
Nameable elem) {
return new ResourceObject<>(graph, type, elem);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ protected Object[] asArray(List<Object> list) {
protected abstract Object[] asArray();
}

// NOTE: travis-ci fails if class Entity implements Namifiable
// NOTE: travis-ci fails if class Entity implements Nameable
public static abstract class Entity extends AuthElement
implements com.baidu.hugegraph.type.Namifiable {
implements com.baidu.hugegraph.type.Nameable {

private static final long serialVersionUID = 4113319546914811762L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void merge(BackendEntry other) {
}

@Override
public boolean mergable(BackendEntry other) {
public boolean mergeable(BackendEntry other) {
if (!(other instanceof BinaryBackendEntry)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void merge(BackendEntry other) {
}

@Override
public boolean mergable(BackendEntry other) {
public boolean mergeable(BackendEntry other) {
if (!(other instanceof TableBackendEntry)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public void merge(BackendEntry other) {
}

@Override
public boolean mergable(BackendEntry other) {
public boolean mergeable(BackendEntry other) {
if (!(other instanceof TextBackendEntry)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void parseProperty(String colName, String colValue,
} else {
if (!(value instanceof Collection)) {
throw new BackendException(
"Invalid value of non-sigle property: %s", colValue);
"Invalid value of non-single property: %s", colValue);
}
for (Object v : (Collection<?>) value) {
v = JsonUtil.castNumber(v, pkey.dataType().clazz());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean equals(Object obj) {
public void columns(BackendColumn... columns);

public void merge(BackendEntry other);
public boolean mergable(BackendEntry other);
public boolean mergeable(BackendEntry other);

public void clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public static final String joinTableName(String prefix, String table) {

public abstract void eliminate(Session session, Entry entry);

/****************************** ShardSpliter ******************************/
/****************************** ShardSplitter ******************************/

public static abstract class ShardSpliter<Session extends BackendSession> {
public static abstract class ShardSplitter<Session extends BackendSession> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

API change


// The min shard size should >= 1M to prevent too many number of shards
protected static final int MIN_SHARD_SIZE = (int) Bytes.MB;
Expand All @@ -142,7 +142,7 @@ public static abstract class ShardSpliter<Session extends BackendSession> {

private final String table;

public ShardSpliter(String table) {
public ShardSplitter(String table) {
this.table = table;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ public class InMemoryDBTable extends BackendTable<BackendSession,
private static final Logger LOG = Log.logger(InMemoryDBTable.class);

protected final Map<Id, BackendEntry> store;
private final InMemoryShardSpliter shardSpliter;
private final InMemoryShardSplitter shardSplitter;

public InMemoryDBTable(HugeType type) {
super(type.name());
this.store = new ConcurrentHashMap<>();
this.shardSpliter = new InMemoryShardSpliter(this.table());
this.shardSplitter = new InMemoryShardSplitter(this.table());
}

public InMemoryDBTable(HugeType type, Map<Id, BackendEntry> store) {
super(type.name());
this.store = store;
this.shardSpliter = new InMemoryShardSpliter(this.table());
this.shardSplitter = new InMemoryShardSplitter(this.table());
}

@Override
Expand All @@ -77,7 +77,7 @@ protected void registerMetaHandlers() {
E.checkArgument(args.length == 1,
"The args count of %s must be 1", meta);
long splitSize = (long) args[0];
return this.shardSpliter.getSplits(session, splitSize);
return this.shardSplitter.getSplits(session, splitSize);
});
}

Expand Down Expand Up @@ -328,9 +328,9 @@ private static boolean matchCondition(BackendEntry item, Condition c) {
return false;
}

private class InMemoryShardSpliter extends ShardSpliter<BackendSession> {
private class InMemoryShardSplitter extends ShardSplitter<BackendSession> {

public InMemoryShardSpliter(String table) {
public InMemoryShardSplitter(String table) {
super(table);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public String transferLeaderTo(String endpoint) {
Status status = this.raftNode.node().transferLeadershipTo(peerId);
if (!status.isOk()) {
throw new BackendException(
"Failed to transafer leader to '%s', raft error: %s",
"Failed to transfer leader to '%s', raft error: %s",
endpoint, status.getErrorMsg());
}
return peerId.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static byte[] writeMutation(BackendMutation mutation) {
buffer.write(entry.type().code());
// write id
buffer.writeBytes(entry.id().asBytes());
// wirte subId
// write subId
if (entry.subId() != null) {
buffer.writeId(entry.subId());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onApply(Iterator iter) {
future.get();
}
} catch (Throwable e) {
String title = "StateMachine occured critical error";
String title = "StateMachine occurred critical error";
LOG.error("{}", title, e);
Status status = new Status(RaftError.ESTATEMACHINE,
"%s: %s", title, e.getMessage());
Expand Down Expand Up @@ -204,7 +204,7 @@ public boolean onSnapshotLoad(SnapshotReader reader) {
return false;
}
/*
* Snapshot load occured in RaftNode constructor, specifically at step
* Snapshot load occurred in RaftNode constructor, specifically at step
* `this.node = this.initRaftNode()`, at this time the NodeImpl is null
* in RaftNode so we can't call `this.node().nodeId()`
*/
Expand Down
Loading