From 7bbfc032846e256cba7be51a46be798f90f00d7e Mon Sep 17 00:00:00 2001 From: imbajin Date: Wed, 1 Mar 2023 20:41:25 +0800 Subject: [PATCH 1/6] chore: clean store file in all modules TODO: we need use a better way to download it when building binary package --- README.md | 2 +- .../org/apache/hugegraph/util/CommonUtil.java | 15 ++++++++++++ .../functional/HugeClientHttpsTest.java | 23 ++++++++++++------ .../org/apache/hugegraph/testutil/Utils.java | 5 +--- .../src/test/resources/hugegraph.truststore | Bin 679 -> 0 bytes .../hugegraph/service/SettingSSLService.java | 5 ++-- .../assembly/static/conf/hugegraph.truststore | Bin 679 -> 0 bytes .../assembly/travis/conf/hugegraph.truststore | Bin 679 -> 0 bytes .../hugegraph/loader/constant/Constants.java | 2 +- .../loader/util/HugeClientHolder.java | 4 +-- .../loader/test/functional/FileLoadTest.java | 13 +++++++--- .../loader/test/functional/LoadTest.java | 5 ++-- .../assembly/conf/hugegraph.truststore | Bin 679 -> 0 bytes .../org/apache/hugegraph/base/ToolClient.java | 17 ++++++------- 14 files changed, 57 insertions(+), 34 deletions(-) delete mode 100644 hugegraph-client/src/test/resources/hugegraph.truststore delete mode 100644 hugegraph-loader/assembly/static/conf/hugegraph.truststore delete mode 100644 hugegraph-loader/assembly/travis/conf/hugegraph.truststore delete mode 100644 hugegraph-tools/assembly/conf/hugegraph.truststore diff --git a/README.md b/README.md index d6558eae3..b1ac7dca5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Build Status](https://github.com/apache/hugegraph-toolchain/actions/workflows/hubble-ci.yml/badge.svg)](https://github.com/apache/hugegraph-toolchain/actions/workflows/hubble-ci.yml) [![Build Status](https://github.com/apache/hugegraph-toolchain/actions/workflows/tools-ci.yml/badge.svg)](https://github.com/apache/hugegraph-toolchain/actions/workflows/tools-ci.yml) [![codecov](https://codecov.io/gh/apache/hugegraph-toolchain/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/hugegraph-toolchain) -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.hugegraph/hugegraph-loader/badge.svg)](https://mvnrepository.com/artifact/org.apache.hugegraph/hugegraph-loader) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.hugegraph/hugegraph-client/badge.svg)](https://mvnrepository.com/artifact/org.apache.hugegraph/hugegraph-client) `hugegraph-toolchain` is the integration project of a series of utilities for [HugeGraph](https://github.com/apache/hugegraph), it includes 4 main modules. diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java index b67d89aad..aa728e3c4 100644 --- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java +++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java @@ -17,8 +17,13 @@ package org.apache.hugegraph.util; +import java.io.File; +import java.io.IOException; +import java.net.URL; import java.util.Map; +import org.apache.commons.io.FileUtils; + public final class CommonUtil { public static void checkMapClass(Object object, Class kClass, @@ -41,4 +46,14 @@ public static void checkMapClass(Object object, Class kClass, "but got '%s'(%s)", vClass, value, value.getClass()); } } + + public static void downloadFileByUrl(String url, String destPath) { + int connectTimeout = 5000; + int readTimeout = 5000; + try { + FileUtils.copyURLToFile(new URL(url), new File(destPath), connectTimeout, readTimeout); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java index c8c733338..22feaa565 100644 --- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java +++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java @@ -25,7 +25,9 @@ import org.apache.hugegraph.structure.constant.T; import org.apache.hugegraph.structure.graph.Vertex; import org.apache.hugegraph.testutil.Assert; +import org.apache.hugegraph.util.CommonUtil; import org.junit.After; +import org.junit.Before; import org.junit.Test; import com.google.common.collect.ImmutableMap; @@ -40,11 +42,18 @@ public class HugeClientHttpsTest { private static final int MAX_CONNS_PER_ROUTE = 10; private static final int MAX_CONNS = 10; private static final int IDLE_TIME = 30; - private static final String TRUST_STORE_FILE = "src/test/resources/hugegraph.truststore"; + private static final String TRUST_STORE_PATH = "src/test/resources/hugegraph.truststore"; private static final String TRUST_STORE_PASSWORD = "hugegraph"; private static HugeClient client; + @Before + public void init() { + String url = "https://github.com/apache/incubator-hugegraph-doc/" + + "raw/binary/dist/toolchain/hugegraph.truststore"; + CommonUtil.downloadFileByUrl(url, TRUST_STORE_PATH); + } + @After public void teardown() throws Exception { Assert.assertNotNull("Client is not opened", client); @@ -55,7 +64,7 @@ public void teardown() throws Exception { public void testHttpsClientBuilderWithConnection() { client = HugeClient.builder(BASE_URL, GRAPH) .configUser(USERNAME, PASSWORD) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); this.addVertexAndCheckPropertyValue(); @@ -66,7 +75,7 @@ public void testHttpsClientWithConnectionPoolNoUserParam() { client = HugeClient.builder(BASE_URL, GRAPH) .configTimeout(TIMEOUT) .configPool(MAX_CONNS, MAX_CONNS_PER_ROUTE) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); this.addVertexAndCheckPropertyValue(); @@ -77,7 +86,7 @@ public void testHttpsClientWithConnectionPoolNoTimeOutParam() { client = HugeClient.builder(BASE_URL, GRAPH) .configUser(USERNAME, PASSWORD) .configPool(MAX_CONNS, MAX_CONNS_PER_ROUTE) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); this.addVertexAndCheckPropertyValue(); @@ -88,7 +97,7 @@ public void testHttpsClientNewBuilderWithConnectionNoPoolParam() { client = HugeClient.builder(BASE_URL, GRAPH) .configUser(USERNAME, PASSWORD) .configTimeout(TIMEOUT) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); this.addVertexAndCheckPropertyValue(); @@ -100,7 +109,7 @@ public void testHttpsClientNewBuilderWithConnectionPool() { .configUser(USERNAME, PASSWORD) .configTimeout(TIMEOUT) .configPool(MAX_CONNS, MAX_CONNS_PER_ROUTE) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .configIdleTime(IDLE_TIME) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); @@ -113,7 +122,7 @@ public void testHttpsClientNewBuilderZeroPoolParam() { .configUser(USERNAME, PASSWORD) .configTimeout(TIMEOUT) .configPool(0, 0) - .configSSL(TRUST_STORE_FILE, TRUST_STORE_PASSWORD) + .configSSL(TRUST_STORE_PATH, TRUST_STORE_PASSWORD) .build(); Assert.assertTrue(client.graphs().listGraph().contains("hugegraph")); this.addVertexAndCheckPropertyValue(); diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java b/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java index 490a28269..1e4dd63fd 100644 --- a/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java +++ b/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java @@ -135,10 +135,7 @@ public static boolean equalPropertyKey(PropertyKey left, if (left.dataType() != right.dataType()) { return false; } - if (left.cardinality() != right.cardinality()) { - return false; - } - return true; + return left.cardinality() == right.cardinality(); } public static boolean equalVertexLabel(VertexLabel left, diff --git a/hugegraph-client/src/test/resources/hugegraph.truststore b/hugegraph-client/src/test/resources/hugegraph.truststore deleted file mode 100644 index 5b0828dc347087e5bbd4482d789ce70952403d32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 679 zcmezO_TO6u1_mY|W(3om8Kvo|=|zbJ89%u6&BG7tdqIfM~L z8wwckfyCH_*^^Q;voiD2VXC;0RdE||f>dz}GkJy>${0w2ILyMr$@#f@Nr{;$rFw9; z8pw(B8W|V@fq|u=iK$5xkZTO&89})N<*df}$l=4t%D~*%%V5yh$<)}$u#BnMr*4N? zUH8A6_1*XT(nMW96rY&?{6G7LMT-TTtaya0XEYrU{QfY=Lds;}q&59^|M+e?&f2!n z^>{>~x6_eD3QJ!I+>f)`^?C9`SI$z2Yc-~OHc34QKK_+awIrii@H)Rsx#iM-UOIN& z+Z;{GRGvLrJ-z$0OE&+x->p;GIpY|am>C%uk(~#OK4zf1T;5AumsUPrsmSd=Z`8R3qWzJu?qAxA|+&90k!7+4C^MM|Q3q4_Xmp`wwZ%u6&BG7tdqIfM~L z8wwckfyCH_*^^Q;voiD2VXC;0RdE||f>dz}GkJy>${0w2ILyMr$@#f@Nr{;$rFw9; z8pw(B8W|V@fq|u=iK$5xkZTO&89})N<*df}$l=4t%D~*%%V5yh$<)}$u#BnMr*4N? zUH8A6_1*XT(nMW96rY&?{6G7LMT-TTtaya0XEYrU{QfY=Lds;}q&59^|M+e?&f2!n z^>{>~x6_eD3QJ!I+>f)`^?C9`SI$z2Yc-~OHc34QKK_+awIrii@H)Rsx#iM-UOIN& z+Z;{GRGvLrJ-z$0OE&+x->p;GIpY|am>C%uk(~#OK4zf1T;5AumsUPrsmSd=Z`8R3qWzJu?qAxA|+&90k!7+4C^MM|Q3q4_Xmp`wwZ%u6&BG7tdqIfM~L z8wwckfyCH_*^^Q;voiD2VXC;0RdE||f>dz}GkJy>${0w2ILyMr$@#f@Nr{;$rFw9; z8pw(B8W|V@fq|u=iK$5xkZTO&89})N<*df}$l=4t%D~*%%V5yh$<)}$u#BnMr*4N? zUH8A6_1*XT(nMW96rY&?{6G7LMT-TTtaya0XEYrU{QfY=Lds;}q&59^|M+e?&f2!n z^>{>~x6_eD3QJ!I+>f)`^?C9`SI$z2Yc-~OHc34QKK_+awIrii@H)Rsx#iM-UOIN& z+Z;{GRGvLrJ-z$0OE&+x->p;GIpY|am>C%uk(~#OK4zf1T;5AumsUPrsmSd=Z`8R3qWzJu?qAxA|+&90k!7+4C^MM|Q3q4_Xmp`wwZ vertices = httpsClient.graph().listVertices(); Assert.assertEquals(2, vertices.size()); @@ -3074,6 +3077,8 @@ public void testHttpsHolderClientValueMapping() { ioUtil.write("vertex_person.csv", "marko,1,1,1", "vadas,2,2,2"); + + CommonUtil.downloadFileByUrl(FILE_URL, TRUST_STORE_PATH); String[] args = new String[]{ "-f", structPath("value_mapping/struct.json"), "-s", configPath("value_mapping/schema.groovy"), @@ -3081,7 +3086,7 @@ public void testHttpsHolderClientValueMapping() { "-h", SERVER, "-p", String.valueOf(HTTPS_PORT), "--protocol", HTTPS_PROTOCOL, - "--trust-store-file", TRUST_STORE_FILE, + "--trust-store-file", TRUST_STORE_PATH, "--trust-store-password", "hugegraph", "--batch-insert-threads", "2", "--test-mode", "true" @@ -3093,7 +3098,7 @@ public void testHttpsHolderClientValueMapping() { options.port = HTTPS_PORT; options.graph = GRAPH; options.protocol = HTTPS_PROTOCOL; - options.trustStoreFile = TRUST_STORE_FILE; + options.trustStoreFile = TRUST_STORE_PATH; options.trustStoreToken = "hugegraph"; HugeClient httpsClient = null; diff --git a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java index 1f597f799..0b14b2b1f 100644 --- a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java +++ b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java @@ -29,7 +29,6 @@ import org.apache.hugegraph.structure.constant.T; import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; - import org.apache.hugegraph.testutil.Assert; public class LoadTest { @@ -43,7 +42,9 @@ public class LoadTest { protected static final String URL = String.format("http://%s:%s", SERVER, PORT); protected static final String HTTPS_URL = String.format("https://%s:%s", SERVER, HTTPS_PORT); protected static final String HTTPS_PROTOCOL = "https"; - protected static final String TRUST_STORE_FILE = "assembly/travis/conf/hugegraph.truststore"; + protected static final String TRUST_STORE_PATH = "assembly/travis/conf/hugegraph.truststore"; + protected static final String FILE_URL = "https://github.com/apache/incubator-hugegraph-doc/" + + "raw/binary/dist/toolchain/hugegraph.truststore"; protected static final HugeClient CLIENT = HugeClient.builder(URL, GRAPH).build(); public static String configPath(String fileName) { diff --git a/hugegraph-tools/assembly/conf/hugegraph.truststore b/hugegraph-tools/assembly/conf/hugegraph.truststore deleted file mode 100644 index 5b0828dc347087e5bbd4482d789ce70952403d32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 679 zcmezO_TO6u1_mY|W(3om8Kvo|=|zbJ89%u6&BG7tdqIfM~L z8wwckfyCH_*^^Q;voiD2VXC;0RdE||f>dz}GkJy>${0w2ILyMr$@#f@Nr{;$rFw9; z8pw(B8W|V@fq|u=iK$5xkZTO&89})N<*df}$l=4t%D~*%%V5yh$<)}$u#BnMr*4N? zUH8A6_1*XT(nMW96rY&?{6G7LMT-TTtaya0XEYrU{QfY=Lds;}q&59^|M+e?&f2!n z^>{>~x6_eD3QJ!I+>f)`^?C9`SI$z2Yc-~OHc34QKK_+awIrii@H)Rsx#iM-UOIN& z+Z;{GRGvLrJ-z$0OE&+x->p;GIpY|am>C%uk(~#OK4zf1T;5AumsUPrsmSd=Z`8R3qWzJu?qAxA|+&90k!7+4C^MM|Q3q4_Xmp`wwZ Date: Wed, 1 Mar 2023 20:57:49 +0800 Subject: [PATCH 2/6] remove useless license files & download parquet test file --- .../src/main/resources/public-certs.store | Bin 892 -> 0 bytes .../src/main/resources/verify-license.json | 7 ------- .../loader/test/functional/FileLoadTest.java | 7 +++++-- .../parquet_compress_file/vertex_person.parquet | Bin 881 -> 0 bytes hugegraph-tools/assembly/bin/keystore | Bin 2246 -> 0 bytes 5 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 hugegraph-hubble/hubble-be/src/main/resources/public-certs.store delete mode 100644 hugegraph-hubble/hubble-be/src/main/resources/verify-license.json delete mode 100644 hugegraph-loader/src/test/resources/parquet_compress_file/vertex_person.parquet delete mode 100644 hugegraph-tools/assembly/bin/keystore diff --git a/hugegraph-hubble/hubble-be/src/main/resources/public-certs.store b/hugegraph-hubble/hubble-be/src/main/resources/public-certs.store deleted file mode 100644 index 0da6d226993ecbab1650809dd3456e549d3844af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmezO_TO6u1_mY|W(3n*1*J(jnaRniMI}I?oOwM}-VCe}dZq@J3=GVc22ISS22D(# z7cet1GBL5_WMuakaI>*%wRxPgU}0uuFvu|!FyLcj4rO5zW)IEF&dV>)gNblph_GXb zaAAmWV~8-rMGWM`c?~TMEDX&J%uURUO`^nkjX+!zD3{KzX=2=A(8Q<%3l2sgN1my% zk>PKBaHDLgkY><*uQ_^eo;?31xIM_`y$i!(Is1lffohqqu?|XszawpXBYy2a`gNDV zx6`vjbFMd9H^`dge@aW(o;@>Q>5}>LU$9gQC>`?Oz4H3M?Z>2lScgA9wqltmKg;jt zZss$WDKSgVz39PsoJo{ndO|?Is51ANO_O#uEqdL; z{UJi;E68czA1-LUHrw{z={>7s%yxwDtemob_b;ngO+UkZxNX^+(gP#I`*vN4^nX^! zF3{Mp#Z#$nDF-VoJKt-mOZo)tLhG^>D73!c%7W~=4GW5^A^{0|57wf`uIDk zic!V-%#x4$Rs>GyT+w|0Vbs(4Y?Hdv;u@+$RZ|#!tpA<&)M9RIWdOP3c;mmqNjtJ0 z)!*AN`G&Ni-Sp5oDOWC)mDFAnzR$h&Bct7)myUMrIjP6pZvQV}=M#AqesP`pq8HJ| zSIjdCN*|uQxk{16@@>9nY{klh%XBqMw68X%@7l>}J@vRi|LRso{^fBEDgPYiCU7`T zR`kCvI&c2|Q%`i*YVswgy6rF3Z3|eeXdrJO3rx4Nd@N!tB2nV=zQh%$2gq=4d2!WJ z&U#+Jx{WC5oLQg2K!-_0L!IGqD4XrvXSFBSY3%0mV%}4;l}V&lE9|A@GD&8pH@B+! hbDwbhs!}!L3FzK_@~w;Bl-ae5gg5M9fPqZ%JdV8yBt)TmfE;EKqp{8eAtQwlw#?V$%_%35B@a`fS>qy%Gp z%`eE0D53wSf2Xr@>Z&QF1&x>)z4vDJNxFFR(Z&e3al3=-kSJKuiTnZ~MC2p5s}M+s zIED}n@#q-@V82!1+R$J$Iw=n>e5ukkIdC{SRaI8u*r4Y&>W=(q(Zu2-AU@5Wb*O9+${^;R!d4^ zuR`g*qTW}`+v=D+GN?pVzshPIX*xMcxNp%Fg`-=A3s!m+T42Xj&N7Q9H&(lHIbMw;>5&5VxW1uUGW#%QuJ#C&)Ju0j6+7sMI!8HYxkhasJXfbeLTvX1dn z));NJ+s>XYtp3G^Iq-G;Mu*9NXBRu{r~e;&x<%yO!+~E$ym`%d8YFSkwgy(W*`DP= wIB&W=r`zoh2EFc(Im1)xoUvJdIOxBc4IQuNo_U^adv?z~K_B21U%=1y1K^O=O#lD@ diff --git a/hugegraph-tools/assembly/bin/keystore b/hugegraph-tools/assembly/bin/keystore deleted file mode 100644 index 606b0484062d1e9cc557418b9887e097942b7432..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2246 zcmchYX*3iHAI4|1B*T!g44JZD?$wN)G-Ru!u`^5>Vg`wfwb5l53`UY{MV4zCq=~E{ zBqbrs*wuVe7_nofu^Mok zMXh3ww&YP}Y2;>rN{)K3w7y%+PaSKj53x9D+sgV4aVy+z%j*Je`pu;1Nt?BV_0Zdc z>!IfrfyrG7{(xC4Fe^;|Xl&TpBv?y;g@sa*39feORQd*I7i9497O1AG2!{+0R4DFnJlf10&HIlnIJtP$MQ3 zX(Eoe*LindXU)X?{YtPAmQHc9uECERRngpt0cnwD5{+K+Xy zcq{wd#G+tDv9I4H2<%p|I2Aw{Trk4x(#2Q@e@i}@5m)Kk9)iy52@zeepM{ zBN5UT5{vcx#$LTKR)=P5PQ9CUNK+F;V;8C?D<52g)E)Gj;>jltOU{!qzp;_4!?(@~ zD-H05!#WL)mCGw#kGg67^9yrzcjlg2`(9E249}p#mFK3Sm5XG?mzi(YXTYIHEJCQ& zog>H<-72cVU3^h&I~N()eV~`)_rfxnRp`M;I~G&rbc+a_ zB`lFo3eIa^EazrIYK$Fsq3cLe9Zph5< z^HZOA=Hzl((R29X^+6F_Px@jDqPJzwK~uOeINN@S;N3Kma3`=whB-!SXwM9Wjp`Q* z=6E-lMgM*i{RARR32{GPdp|jI+JQUY(P=TNb;H=vsM&FrLM`L99X9sVJ5Xhh?0Aln zeC3jRZj=N$)?A!k$8bhNEpzNLI?mYf&+(Smt2x5q`C*r}5HXO{u^ow9`mb)B%sDAV z8>1H54m8Y*R8H0drbJ}D8f7IiEeA@t;zOQScY>o1kmtyCQ2Lgm_IKBBQ|_V=73*^g z_MGXP**k)#Z_ORQV~&&4E*X+286uy6)mqN}C=_YC(i9bYvuW<;SNT08ZJXoG*$aBn{jbL0GQ z&!R?Bu}t&J$+>po&`Mijy8CiUsETsXG;Dt{!Hy8#Lwt?_egRj)1O7|+ ze<6Io5P@IF!CwgYe*`5f0o6dE(P$mCrk0+Dj_bdzhUS0l|M?mkQ0|{`>^}=I4JZsi z(SQOV8W0F5>otRVAEED*I-;Exbcza!*i(ZrSjCXkhO_%(hxCtcs;^4SJz7`fJlUsf zbM2r8^tOC?GXVZQ#(c7`6=P#*tAQ*5q)#R|PAL!G_%HKr)B1|4K&R!lvZ5I>v0N%!w{|7VE%o!So(2)JR0 zRhXzk-X>Hgs>$niEgmlT{wIzQBaHq;E`5sUaEw8k>U7J7i~={twY08ekSf;GebqW^ zq|T!Rb$#2Lf0Qf3ggJ9aR6{IOH8o7Pjn$aGNvP~=G>JvM{PT&2;}kNQ)RV0@&a~5f z8>3F=bA5K45xfc&%W&I~Gj-0Py4P4Ock^$Llg7M4!D|@L)uoFzHZv-*P1}%U>%f|& zF-DhnI@*vplQ+$|B#K}<1n$;32QS4vMU1Mh&BZCrNq9!yv&{D25pnG-q(|;P+S^Ft z>w&~v#Te&>b!!>A40Jd5gd~9vUE^^`H1uJ=7Vp|gO=~Kvle&!Y&IJx%wFf1%eWb(B PNKbdf+(AD?@(BM6loQ$w From 5cfd8f8a2afa499c32462297852c398151e07e18 Mon Sep 17 00:00:00 2001 From: imbajin Date: Wed, 1 Mar 2023 21:36:28 +0800 Subject: [PATCH 3/6] Delete yarn.lock --- hugegraph-hubble/yarn.lock | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 hugegraph-hubble/yarn.lock diff --git a/hugegraph-hubble/yarn.lock b/hugegraph-hubble/yarn.lock deleted file mode 100644 index e69de29bb..000000000 From ff5c6d057098cf2b15120690c00e05f393d327ce Mon Sep 17 00:00:00 2001 From: imbajin Date: Thu, 16 Mar 2023 15:50:09 +0800 Subject: [PATCH 4/6] use a common prefix for the URL --- .../src/main/java/org/apache/hugegraph/util/CommonUtil.java | 5 ++++- .../org/apache/hugegraph/functional/HugeClientHttpsTest.java | 4 +--- .../hugegraph/loader/test/functional/FileLoadTest.java | 4 +--- .../apache/hugegraph/loader/test/functional/LoadTest.java | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java index aa728e3c4..f430fd07c 100644 --- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java +++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java @@ -26,6 +26,9 @@ public final class CommonUtil { + public static final String PREFIX = "https://github.com/apache/incubator-hugegraph-doc/" + + "raw/binary/dist/toolchain/"; + public static void checkMapClass(Object object, Class kClass, Class vClass) { E.checkArgumentNotNull(object, "The object can't be null"); @@ -53,7 +56,7 @@ public static void downloadFileByUrl(String url, String destPath) { try { FileUtils.copyURLToFile(new URL(url), new File(destPath), connectTimeout, readTimeout); } catch (IOException e) { - throw new RuntimeException(e); + throw new RuntimeException("Failed to download file, please check the network", e); } } } diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java index 22feaa565..3a1d846b7 100644 --- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java +++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java @@ -49,9 +49,7 @@ public class HugeClientHttpsTest { @Before public void init() { - String url = "https://github.com/apache/incubator-hugegraph-doc/" + - "raw/binary/dist/toolchain/hugegraph.truststore"; - CommonUtil.downloadFileByUrl(url, TRUST_STORE_PATH); + CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "hugegraph.truststore", TRUST_STORE_PATH); } @After diff --git a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java index 6a453f821..9e38af4c9 100644 --- a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java +++ b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java @@ -2427,9 +2427,7 @@ public void testParquetCompressFile() { }; if (this.ioUtil instanceof HDFSUtil) { HDFSUtil hdfsUtil = (HDFSUtil) this.ioUtil; - String url = "https://github.com/apache/incubator-hugegraph-doc/" + - "raw/binary/dist/toolchain/vertex_person.parquet"; - CommonUtil.downloadFileByUrl(url, + CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", configPath("parquet_compress_file/vertex_person.parquet")); hdfsUtil.copy(configPath( "parquet_compress_file/vertex_person.parquet"), diff --git a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java index 0b14b2b1f..e518dab49 100644 --- a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java +++ b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/LoadTest.java @@ -30,6 +30,7 @@ import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; import org.apache.hugegraph.testutil.Assert; +import org.apache.hugegraph.util.CommonUtil; public class LoadTest { @@ -43,8 +44,7 @@ public class LoadTest { protected static final String HTTPS_URL = String.format("https://%s:%s", SERVER, HTTPS_PORT); protected static final String HTTPS_PROTOCOL = "https"; protected static final String TRUST_STORE_PATH = "assembly/travis/conf/hugegraph.truststore"; - protected static final String FILE_URL = "https://github.com/apache/incubator-hugegraph-doc/" + - "raw/binary/dist/toolchain/hugegraph.truststore"; + protected static final String FILE_URL = CommonUtil.PREFIX + "hugegraph.truststore"; protected static final HugeClient CLIENT = HugeClient.builder(URL, GRAPH).build(); public static String configPath(String fileName) { From 010367c92ea00dfb9cc1956786835425fb31a454 Mon Sep 17 00:00:00 2001 From: imbajin Date: Fri, 24 Mar 2023 18:15:22 +0800 Subject: [PATCH 5/6] Update FileLoadTest.java --- .../hugegraph/loader/test/functional/FileLoadTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java index 9e38af4c9..d6adb79b9 100644 --- a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java +++ b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java @@ -2427,11 +2427,11 @@ public void testParquetCompressFile() { }; if (this.ioUtil instanceof HDFSUtil) { HDFSUtil hdfsUtil = (HDFSUtil) this.ioUtil; + String path = configPath("parquet_compress_file/vertex_person.parquet"); + CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", path); CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", - configPath("parquet_compress_file/vertex_person.parquet")); - hdfsUtil.copy(configPath( - "parquet_compress_file/vertex_person.parquet"), - "hdfs://localhost:8020/files/vertex_person.parquet"); + "src/test/resources/parquet_compress_file/vertex_person.parquet"); + hdfsUtil.copy(path, "hdfs://localhost:8020/files/vertex_person.parquet"); } HugeGraphLoader.main(args); From 87c95a29cdb6ea4e29d1e118d50fe79c2b4f887b Mon Sep 17 00:00:00 2001 From: imbajin Date: Fri, 24 Mar 2023 19:09:53 +0800 Subject: [PATCH 6/6] Update FileLoadTest.java --- .../apache/hugegraph/loader/test/functional/FileLoadTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java index d6adb79b9..06cbe0e54 100644 --- a/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java +++ b/hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/functional/FileLoadTest.java @@ -2425,10 +2425,10 @@ public void testParquetCompressFile() { "--batch-insert-threads", "2", "--test-mode", "true" }; + String path = configPath("parquet_compress_file/vertex_person.parquet"); + CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", path); if (this.ioUtil instanceof HDFSUtil) { HDFSUtil hdfsUtil = (HDFSUtil) this.ioUtil; - String path = configPath("parquet_compress_file/vertex_person.parquet"); - CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", path); CommonUtil.downloadFileByUrl(CommonUtil.PREFIX + "vertex_person.parquet", "src/test/resources/parquet_compress_file/vertex_person.parquet"); hdfsUtil.copy(path, "hdfs://localhost:8020/files/vertex_person.parquet");