Skip to content

Commit

Permalink
refact: merge pd into hugegraph (#2270)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Aug 7, 2023
1 parent 49a1acf commit a891780
Show file tree
Hide file tree
Showing 236 changed files with 36,208 additions and 1 deletion.
1 change: 1 addition & 0 deletions hugegraph-pd/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
13 changes: 13 additions & 0 deletions hugegraph-pd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/hg-pd-grpc/src/main/java/
/.idea/
/hg-pd-grpc/target/
/dist/
**/target/
.DS_Store
**/tmp/
*.log
*.iml
/hg-pd-common/target_B000000405016P_Oct-28-114458-2021_conflict_parent/

dist/
.flattened-pom.xml
121 changes: 121 additions & 0 deletions hugegraph-pd/.mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the
* wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" +
outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file added hugegraph-pd/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions hugegraph-pd/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to You under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Loading

0 comments on commit a891780

Please sign in to comment.