Skip to content

Commit 66c47cb

Browse files
committed
downgrade sofa-rpc to 5.12.
1 parent aae62e0 commit 66c47cb

23 files changed

+85
-97
lines changed

hugegraph-commons/hugegraph-rpc/pom.xml

+33-33
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<dependency>
6363
<groupId>com.alipay.sofa</groupId>
6464
<artifactId>sofa-rpc-all</artifactId>
65-
<version>5.13.1</version>
65+
<version>5.12.0</version>
6666
<exclusions>
6767
<exclusion>
6868
<groupId>org.jboss.resteasy</groupId>
@@ -100,38 +100,38 @@
100100
<groupId>io.grpc</groupId>
101101
<artifactId>grpc-core</artifactId>
102102
</exclusion>
103-
<exclusion>
104-
<groupId>io.grpc</groupId>
105-
<artifactId>grpc-all</artifactId>
106-
</exclusion>
107-
<exclusion>
108-
<artifactId>bolt</artifactId>
109-
<groupId>com.alipay.sofa</groupId>
110-
</exclusion>
111-
<exclusion>
112-
<artifactId>jackson-annotations</artifactId>
113-
<groupId>com.fasterxml.jackson.core</groupId>
114-
</exclusion>
115-
<exclusion>
116-
<artifactId>jackson-core</artifactId>
117-
<groupId>com.fasterxml.jackson.core</groupId>
118-
</exclusion>
119-
<exclusion>
120-
<artifactId>jackson-databind</artifactId>
121-
<groupId>com.fasterxml.jackson.core</groupId>
122-
</exclusion>
123-
<exclusion>
124-
<artifactId>netty-all</artifactId>
125-
<groupId>io.netty</groupId>
126-
</exclusion>
127-
<exclusion>
128-
<artifactId>commons-lang3</artifactId>
129-
<groupId>org.apache.commons</groupId>
130-
</exclusion>
131-
<exclusion>
132-
<artifactId>protobuf-java</artifactId>
133-
<groupId>com.google.protobuf</groupId>
134-
</exclusion>
103+
<!-- <exclusion>-->
104+
<!-- <groupId>io.grpc</groupId>-->
105+
<!-- <artifactId>grpc-all</artifactId>-->
106+
<!-- </exclusion>-->
107+
<!-- <exclusion>-->
108+
<!-- <artifactId>bolt</artifactId>-->
109+
<!-- <groupId>com.alipay.sofa</groupId>-->
110+
<!-- </exclusion>-->
111+
<!-- <exclusion>-->
112+
<!-- <artifactId>jackson-annotations</artifactId>-->
113+
<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
114+
<!-- </exclusion>-->
115+
<!-- <exclusion>-->
116+
<!-- <artifactId>jackson-core</artifactId>-->
117+
<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
118+
<!-- </exclusion>-->
119+
<!-- <exclusion>-->
120+
<!-- <artifactId>jackson-databind</artifactId>-->
121+
<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
122+
<!-- </exclusion>-->
123+
<!-- <exclusion>-->
124+
<!-- <artifactId>netty-all</artifactId>-->
125+
<!-- <groupId>io.netty</groupId>-->
126+
<!-- </exclusion>-->
127+
<!-- <exclusion>-->
128+
<!-- <artifactId>commons-lang3</artifactId>-->
129+
<!-- <groupId>org.apache.commons</groupId>-->
130+
<!-- </exclusion>-->
131+
<!-- <exclusion>-->
132+
<!-- <artifactId>protobuf-java</artifactId>-->
133+
<!-- <groupId>com.google.protobuf</groupId>-->
134+
<!-- </exclusion>-->
135135
</exclusions>
136136
</dependency>
137137
<dependency>

hugegraph-server/hugegraph-api/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<groupId>io.grpc</groupId>
4040
<artifactId>grpc-netty-shaded</artifactId>
4141
<!-- Keep consistent with grpc dependency version (pd/store) -->
42+
<!-- <version>1.47.0</version>-->
4243
<version>1.39.0</version>
4344
</dependency>
4445

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/HugeGraphParams.java

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.hugegraph.backend.store.ram.RamTable;
2626
import org.apache.hugegraph.backend.tx.GraphTransaction;
2727
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
28-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2928
import org.apache.hugegraph.config.HugeConfig;
3029
import org.apache.hugegraph.event.EventHub;
3130
import org.apache.hugegraph.job.EphemeralJob;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinaryBackendEntry.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public BinaryBackendEntry(HugeType type, byte[] bytes, boolean enablePartition)
4949
}
5050

5151
// FIXME: `enablePartition` is unused here
52-
public BinaryBackendEntry(HugeType type, byte[] bytes, boolean enablePartition, boolean isOlap) {
52+
public BinaryBackendEntry(HugeType type, byte[] bytes, boolean enablePartition,
53+
boolean isOlap) {
5354
this(type, BytesBuffer.wrap(bytes).parseOlapId(type, isOlap));
5455
}
5556

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinarySerializer.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.hugegraph.backend.serializer;
1919

20+
import static org.apache.hugegraph.schema.SchemaElement.UNDEF;
21+
2022
import java.util.Arrays;
2123
import java.util.Collection;
2224
import java.util.Iterator;
@@ -74,8 +76,6 @@
7476
import org.apache.hugegraph.util.StringEncoding;
7577
import org.apache.tinkerpop.gremlin.structure.Edge;
7678

77-
import static org.apache.hugegraph.schema.SchemaElement.UNDEF;
78-
7979
public class BinarySerializer extends AbstractSerializer {
8080

8181
/*
@@ -932,10 +932,10 @@ public BackendEntry parse(BackendEntry originEntry) {
932932
BytesBuffer buffer = BytesBuffer.allocate(BytesBuffer.BUF_EDGE_ID);
933933
buffer.write(parsedEntry.id().asBytes());
934934
buffer.write(bytes);
935-
parsedEntry = new BinaryBackendEntry(originEntry.type(), new BinaryId(buffer.bytes(),
936-
BytesBuffer.wrap(
937-
buffer.bytes())
938-
.readEdgeId()));
935+
parsedEntry = new BinaryBackendEntry(originEntry.type(),
936+
new BinaryId(buffer.bytes(),
937+
BytesBuffer.wrap(buffer.bytes())
938+
.readEdgeId()));
939939

940940
for (BackendColumn col : originEntry.columns()) {
941941
parsedEntry.column(buffer.bytes(), col.value);

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
import java.util.stream.Collectors;
3535
import java.util.stream.Stream;
3636

37-
import com.google.common.collect.Iterators;
38-
3937
import org.apache.commons.collections.CollectionUtils;
4038
import org.apache.hugegraph.HugeException;
4139
import org.apache.hugegraph.HugeGraph;
@@ -103,6 +101,7 @@
103101
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
104102

105103
import com.google.common.collect.ImmutableList;
104+
import com.google.common.collect.Iterators;
106105

107106
import jakarta.ws.rs.ForbiddenException;
108107

@@ -1053,8 +1052,10 @@ protected Iterator<HugeEdge> queryEdgesFromBackend(Query query) {
10531052
if (query instanceof ConditionQuery && !query.paging()) {
10541053
// TODO: support: paging + parent label
10551054
boolean supportIn = this.storeFeatures().supportsQueryWithInCondition();
1056-
// consider multi labels + properties, see org.apache.hugegraph.core.EdgeCoreTest.testQueryInEdgesOfVertexByLabels
1057-
Stream<ConditionQuery> flattenedQueries = ConditionQueryFlatten.flatten((ConditionQuery) query, supportIn).stream();
1055+
// consider multi labels + properties,
1056+
// see org.apache.hugegraph.core.EdgeCoreTest.testQueryInEdgesOfVertexByLabels
1057+
Stream<ConditionQuery> flattenedQueries =
1058+
ConditionQueryFlatten.flatten((ConditionQuery) query, supportIn).stream();
10581059

10591060
Stream<Iterator<HugeEdge>> edgeIterators = flattenedQueries.map(cq -> {
10601061
Id label = cq.condition(HugeKeys.LABEL);
@@ -1073,7 +1074,8 @@ protected Iterator<HugeEdge> queryEdgesFromBackend(Query query) {
10731074
}
10741075
});
10751076

1076-
return edgeIterators.reduce(ExtendableIterator::concat).orElse(Collections.emptyIterator());
1077+
return edgeIterators.reduce(ExtendableIterator::concat)
1078+
.orElse(Collections.emptyIterator());
10771079
}
10781080

10791081
return queryEdgesFromBackendInternal(query);
@@ -1640,7 +1642,8 @@ private Query optimizeQuery(ConditionQuery query) {
16401642
*/
16411643
boolean byLabel = (label != null && query.conditionsSize() == 1);
16421644
if (!byLabel || this.store().features().supportsQueryByLabel()) {
1643-
if (this.storeFeatures().supportsFatherAndSubEdgeLabel() && byLabel && query.resultType().isEdge()) {
1645+
if (this.storeFeatures().supportsFatherAndSubEdgeLabel() && byLabel &&
1646+
query.resultType().isEdge()) {
16441647
// for memory backend
16451648
EdgeLabel edgeLabel = graph().edgeLabel(label);
16461649
if (edgeLabel.hasFather()) {

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ public Id createOlapPk(PropertyKey propertyKey) {
626626
return asyncRun(this.graph(), propertyKey, job);
627627
}
628628

629-
// -- store related methods, divided into two categories: 1. olap table related 2. ID generation strategy
629+
// -- store related methods, divided into two categories:
630+
// 1. olap table related 2. ID generation strategy
630631
// - 1. olap table related
631632
public void createOlapPk(Id id) {
632633
this.graphParams().loadGraphStore().createOlapTable(id);

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/algorithm/cent/BetweennessCentralityAlgorithmV2.java

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.apache.hugegraph.backend.query.Query;
2727
import org.apache.hugegraph.job.UserJob;
2828
import org.apache.hugegraph.job.algorithm.BfsTraverser;
29-
import org.apache.hugegraph.schema.SchemaLabel;
3029
import org.apache.hugegraph.structure.HugeVertex;
3130
import org.apache.hugegraph.traversal.algorithm.HugeTraverser;
3231
import org.apache.hugegraph.type.define.Directions;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/EdgeLabelRemoveJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.apache.hugegraph.backend.id.Id;
2424
import org.apache.hugegraph.backend.tx.GraphTransaction;
2525
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
26-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2726
import org.apache.hugegraph.schema.EdgeLabel;
2827
import org.apache.hugegraph.type.define.SchemaStatus;
2928
import org.apache.hugegraph.util.LockUtil;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/IndexLabelRebuildJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.hugegraph.backend.id.Id;
2626
import org.apache.hugegraph.backend.tx.GraphTransaction;
2727
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
28-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2928
import org.apache.hugegraph.schema.EdgeLabel;
3029
import org.apache.hugegraph.schema.IndexLabel;
3130
import org.apache.hugegraph.schema.SchemaElement;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/IndexLabelRemoveJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.hugegraph.backend.id.Id;
2222
import org.apache.hugegraph.backend.tx.GraphTransaction;
2323
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
24-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2524
import org.apache.hugegraph.schema.IndexLabel;
2625
import org.apache.hugegraph.type.define.SchemaStatus;
2726
import org.apache.hugegraph.util.LockUtil;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/OlapPropertyKeyClearJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.hugegraph.backend.id.Id;
2222
import org.apache.hugegraph.backend.tx.GraphTransaction;
2323
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
24-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2524
import org.apache.hugegraph.schema.IndexLabel;
2625
import org.apache.hugegraph.type.define.SchemaStatus;
2726
import org.apache.hugegraph.util.LockUtil;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/OlapPropertyKeyCreateJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.hugegraph.job.schema;
1919

2020
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
21-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2221
import org.apache.hugegraph.schema.PropertyKey;
2322

2423
public class OlapPropertyKeyCreateJob extends SchemaJob {

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/OlapPropertyKeyRemoveJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import org.apache.hugegraph.backend.id.Id;
2121
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
22-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2322
import org.apache.hugegraph.schema.PropertyKey;
2423

2524
public class OlapPropertyKeyRemoveJob extends OlapPropertyKeyClearJob {

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/job/schema/VertexLabelRemoveJob.java

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.hugegraph.backend.id.Id;
2626
import org.apache.hugegraph.backend.tx.GraphTransaction;
2727
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
28-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2928
import org.apache.hugegraph.schema.EdgeLabel;
3029
import org.apache.hugegraph.schema.VertexLabel;
3130
import org.apache.hugegraph.type.define.SchemaStatus;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/masterelection/GlobalMasterInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// TODO: rename to GlobalNodeRoleInfo
2626
public final class GlobalMasterInfo {
2727

28-
private final static NodeInfo NO_MASTER = new NodeInfo(false, "");
28+
private static final NodeInfo NO_MASTER = new NodeInfo(false, "");
2929

3030
private volatile boolean supportElection;
3131
private volatile NodeInfo masterNodeInfo;

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaDriver.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@
2525

2626
public interface MetaDriver {
2727

28-
public void put(String key, String value);
28+
void put(String key, String value);
2929

30-
public String get(String key);
30+
String get(String key);
3131

32-
public void delete(String key);
32+
void delete(String key);
3333

34-
public void deleteWithPrefix(String prefix);
34+
void deleteWithPrefix(String prefix);
3535

36-
public Map<String, String> scanWithPrefix(String prefix);
36+
Map<String, String> scanWithPrefix(String prefix);
3737

38-
public <T> void listen(String key, Consumer<T> consumer);
38+
<T> void listen(String key, Consumer<T> consumer);
3939

40-
public <T> void listenPrefix(String prefix, Consumer<T> consumer);
40+
<T> void listenPrefix(String prefix, Consumer<T> consumer);
4141

42-
public <T> List<String> extractValuesFromResponse(T response);
42+
<T> List<String> extractValuesFromResponse(T response);
4343

4444
/**
4545
* Extract K-V pairs of response
@@ -48,19 +48,19 @@ public interface MetaDriver {
4848
* @param response
4949
* @return
5050
*/
51-
public <T> Map<String, String> extractKVFromResponse(T response);
51+
<T> Map<String, String> extractKVFromResponse(T response);
5252

53-
public LockResult tryLock(String key, long ttl, long timeout);
53+
LockResult tryLock(String key, long ttl, long timeout);
5454

5555
/**
5656
* return if the key is Locked.
5757
*
5858
* @param key
5959
* @return bool
6060
*/
61-
public boolean isLocked(String key);
61+
boolean isLocked(String key);
6262

63-
public void unlock(String key, LockResult lockResult);
63+
void unlock(String key, LockResult lockResult);
6464

6565
/**
6666
* keepAlive of current lease
@@ -69,5 +69,5 @@ public interface MetaDriver {
6969
* @param lease
7070
* @return next leaseId
7171
*/
72-
public long keepAlive(String key, long lease);
72+
long keepAlive(String key, long lease);
7373
}

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/lock/EtcdDistributedLock.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ public class EtcdDistributedLock {
4444
private final Lease leaseClient;
4545

4646
private static final int poolSize = 8;
47-
private final ScheduledExecutorService service = new ScheduledThreadPoolExecutor(poolSize, r -> {
48-
Thread t = new Thread(r, "keepalive");
49-
t.setDaemon(true);
50-
return t;
51-
});
47+
private final ScheduledExecutorService service =
48+
new ScheduledThreadPoolExecutor(poolSize, r -> {
49+
Thread t = new Thread(r, "keepalive");
50+
t.setDaemon(true);
51+
return t;
52+
});
5253

5354
private EtcdDistributedLock(Client client) {
5455
this.kvClient = client.getKVClient();

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/PropertyKeyBuilder.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.hugegraph.backend.id.Id;
2626
import org.apache.hugegraph.backend.id.IdGenerator;
2727
import org.apache.hugegraph.backend.tx.ISchemaTransaction;
28-
import org.apache.hugegraph.backend.tx.SchemaTransaction;
2928
import org.apache.hugegraph.config.CoreOptions;
3029
import org.apache.hugegraph.exception.ExistedException;
3130
import org.apache.hugegraph.exception.NotAllowException;
@@ -42,17 +41,16 @@
4241
import org.apache.hugegraph.type.define.WriteType;
4342
import org.apache.hugegraph.util.E;
4443

45-
public class PropertyKeyBuilder extends AbstractBuilder
46-
implements PropertyKey.Builder {
44+
public class PropertyKeyBuilder extends AbstractBuilder implements PropertyKey.Builder {
4745

4846
private Id id;
49-
private String name;
47+
private final String name;
5048
private DataType dataType;
5149
private Cardinality cardinality;
5250
private AggregateType aggregateType;
5351
private WriteType writeType;
5452
private boolean checkExist;
55-
private Userdata userdata;
53+
private final Userdata userdata;
5654

5755
public PropertyKeyBuilder(ISchemaTransaction transaction,
5856
HugeGraph graph, String name) {

0 commit comments

Comments
 (0)