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

chore(pd-store): minor improvement #2443

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.hugegraph.pd.grpc.pulse.PartitionHeartbeatRequest;
import org.apache.hugegraph.pd.pulse.PulseServerNotice;
import org.junit.BeforeClass;
import org.junit.Test;

public class PDPulseTest {
private static PDClient pdClient;
Expand All @@ -40,7 +41,7 @@ public static void beforeClass() throws Exception {
pdClient.getLeader();
}

// @Test
@Test
public void listen() {

PDPulse pulse = new PDPulseImpl(pdClient.getLeaderIp());
Expand Down Expand Up @@ -106,4 +107,4 @@ public void onCompleted() {
HgPDTestUtil.println(this.listenerName + " is completed");
}
}
}
}
2 changes: 1 addition & 1 deletion hugegraph-pd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<include>*.tar.gz</include>
<include>.flattened-pom.xml</include>
<!-- WARN: delete dist dir may influence dev? -->
<!-- <include>dist/**</include>-->
<include>dist/**</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hugegraph;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -179,8 +178,6 @@ public class StandardHugeGraph implements HugeGraph {

private final RamTable ramtable;

private final MetaManager metaManager = MetaManager.instance();

private final String schedulerType;

public StandardHugeGraph(HugeConfig config) {
Expand Down Expand Up @@ -230,7 +227,10 @@ public StandardHugeGraph(HugeConfig config) {
}

if (isHstore()) {
initMetaManager();
// TODO: parameterize the remaining configurations
MetaManager.instance().connect("hg", MetaManager.MetaDriverType.PD,
"ca", "ca", "ca",
config.get(CoreOptions.PD_PEERS));
}

try {
Expand Down Expand Up @@ -470,12 +470,6 @@ private boolean isHstore() {
return this.storeProvider.isHstore();
}

private void initMetaManager() {
this.metaManager.connect("hg", MetaManager.MetaDriverType.PD,
"ca", "ca", "ca",
Collections.singletonList("127.0.0.1:8686"));
}

private ISchemaTransaction openSchemaTransaction() throws HugeException {
this.checkGraphNotClosed();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,4 +674,11 @@ public static synchronized CoreOptions instance() {
CollectionType::valueOf,
"EC"
);

public static final ConfigOption<String> PD_PEERS = new ConfigOption<>(
"pd.peers",
"The addresses of pd nodes, separated with commas.",
disallowEmpty(),
"127.0.0.1:8686"
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ serializer=binary

store=hugegraph

# pd config
pd.peers=127.0.0.1:8686

# task config
task.scheduler_type=local
task.schedule_period=10
task.retry=0
task.wait_timeout=10

# raft config
raft.mode=false
raft.path=./raft-log
raft.safe_read=true
Expand All @@ -45,6 +55,7 @@ raft.rpc_connect_timeout=5000
raft.rpc_timeout=60
raft.install_snapshot_rpc_timeout=36000

# search config
search.text_analyzer=jieba
search.text_analyzer_mode=INDEX

Expand Down

This file was deleted.

Loading
Loading