Skip to content

Commit a891780

Browse files
VGalaxiesimbajinGYXkeep
authored
refact: merge pd into hugegraph (#2270)
* init(pd): history merged until 2023.5.6 * refact: unify LF line separator Change-Id: I3f38685af534468a51b79b7f45d24fdb30a74f34 * refact: add header & format in test & service & grpc & dist modules Change-Id: Id2fa1374d7fa85635906a7e75655e7dad56f1807 * refact: add header/format in core & common & clitools & client modules Change-Id: Id8ec0a0d754f646c59f7251158dd89de669b2016 * refact: format root/parent modules & pd-service package name & rearrange code Change-Id: Id8ec0a0d754f646c59f7251158dd89de669b2016 * chore: search & replace to "org.apache" manually - also replace "a/b/c" regrex - replace pom version to ${revision} Change-Id: Ia3a9ce891fcff58cef4a5a1f95adb44ef8ee8049 * chore: fix some code problems - lack this with instance filed - lack {} in 'if/while/for' Change-Id: I37d21f1ab94529a8122f4598636fbe02b2264904 * refact: update code to Jun2 2023 GraphPlatform-2020 fix cache bug when direct put Change-Id: I52428d8d5d4bb977ee7796c0fe1e4ced07aff12d GraphPlatform-2020 fix cache bug when direct put Change-Id: Id57427a94732e12f2d96429a2b677d5c5f71e8ff GraphPlatform-1771 update code Change-Id: Ic3b95ca22900453adbc3571734e1da2c97e28355 * build: add flatten plugin and fix dependency version 1. Added the [flatten](#2004) plugin. 2. Unified the global version to 1.5.0. 3. Modified the version of `jraft-core`. --------- Co-authored-by: imbajin <[email protected]> * build: fix build for community edition compatibility (WIP) Please refer to https://hugegraph.feishu.cn/wiki/Y6d2wys9KiWf24kpzNKct0Yknnr for detailed fix documentation. --------- Co-authored-by: imbajin <[email protected]> * refact: adapt for jraft v1.3.13 * refact: GP-2141 handle low speed import - 6.9 from inner commit 0a95b1e587e65ea6a0a06774d53c80868f36af5b --------- Co-authored-by: V_Galaxy <[email protected]> * refact: GP-2141 handle low speed import - Compile OK from inner commit 0a95b1e587e65ea6a0a06774d53c80868f36af5b fix store compile problem https://hugegraph.feishu.cn/wiki/Y6d2wys9KiWf24kpzNKct0Yknnr --------- Co-authored-by: V_Galaxy <[email protected]> * chore: enhance pom & start file --------- Co-authored-by: V_Galaxy <[email protected]> * refact: prepare before merge * chore: fix pom for submodules in hugegraph-pd * chore: add apache-rat-plugin for hugegraph-pd and add some license headers * chore: clean some comment/code --------- Co-authored-by: imbajin <[email protected]> Co-authored-by: What is broken can be reforged <[email protected]>
1 parent 49a1acf commit a891780

File tree

236 files changed

+36208
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+36208
-1
lines changed

hugegraph-pd/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

hugegraph-pd/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/hg-pd-grpc/src/main/java/
2+
/.idea/
3+
/hg-pd-grpc/target/
4+
/dist/
5+
**/target/
6+
.DS_Store
7+
**/tmp/
8+
*.log
9+
*.iml
10+
/hg-pd-common/target_B000000405016P_Oct-28-114458-2021_conflict_parent/
11+
12+
dist/
13+
.flattened-pom.xml
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import java.net.*;
18+
import java.io.*;
19+
import java.nio.channels.*;
20+
import java.util.Properties;
21+
22+
public class MavenWrapperDownloader {
23+
24+
private static final String WRAPPER_VERSION = "0.5.6";
25+
/**
26+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
27+
*/
28+
private static final String DEFAULT_DOWNLOAD_URL =
29+
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
30+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
31+
32+
/**
33+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
34+
* use instead of the default one.
35+
*/
36+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
37+
".mvn/wrapper/maven-wrapper.properties";
38+
39+
/**
40+
* Path where the maven-wrapper.jar will be saved to.
41+
*/
42+
private static final String MAVEN_WRAPPER_JAR_PATH =
43+
".mvn/wrapper/maven-wrapper.jar";
44+
45+
/**
46+
* Name of the property which should be used to override the default download url for the
47+
* wrapper.
48+
*/
49+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
50+
51+
public static void main(String args[]) {
52+
System.out.println("- Downloader started");
53+
File baseDirectory = new File(args[0]);
54+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
55+
56+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
57+
// wrapperUrl parameter.
58+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
59+
String url = DEFAULT_DOWNLOAD_URL;
60+
if (mavenWrapperPropertyFile.exists()) {
61+
FileInputStream mavenWrapperPropertyFileInputStream = null;
62+
try {
63+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
64+
Properties mavenWrapperProperties = new Properties();
65+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
66+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
67+
} catch (IOException e) {
68+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
69+
} finally {
70+
try {
71+
if (mavenWrapperPropertyFileInputStream != null) {
72+
mavenWrapperPropertyFileInputStream.close();
73+
}
74+
} catch (IOException e) {
75+
// Ignore ...
76+
}
77+
}
78+
}
79+
System.out.println("- Downloading from: " + url);
80+
81+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
82+
if (!outputFile.getParentFile().exists()) {
83+
if (!outputFile.getParentFile().mkdirs()) {
84+
System.out.println(
85+
"- ERROR creating output directory '" +
86+
outputFile.getParentFile().getAbsolutePath() + "'");
87+
}
88+
}
89+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
90+
try {
91+
downloadFileFromURL(url, outputFile);
92+
System.out.println("Done");
93+
System.exit(0);
94+
} catch (Throwable e) {
95+
System.out.println("- Error downloading");
96+
e.printStackTrace();
97+
System.exit(1);
98+
}
99+
}
100+
101+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
102+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
103+
String username = System.getenv("MVNW_USERNAME");
104+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
105+
Authenticator.setDefault(new Authenticator() {
106+
@Override
107+
protected PasswordAuthentication getPasswordAuthentication() {
108+
return new PasswordAuthentication(username, password);
109+
}
110+
});
111+
}
112+
URL website = new URL(urlString);
113+
ReadableByteChannel rbc;
114+
rbc = Channels.newChannel(website.openStream());
115+
FileOutputStream fos = new FileOutputStream(destination);
116+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
117+
fos.close();
118+
rbc.close();
119+
}
120+
121+
}
49.5 KB
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with this
4+
# work for additional information regarding copyright ownership. The ASF
5+
# licenses this file to You under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
#
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

0 commit comments

Comments
 (0)