From 48195fade2465d85a4ee03ac04429f32360b9ef0 Mon Sep 17 00:00:00 2001 From: Sicheng Song Date: Thu, 18 May 2023 22:02:46 +0000 Subject: [PATCH 1/4] fix Jenkins CI pipeline for OS 3.0 version bump Signed-off-by: Sicheng Song --- .../ml/client/MachineLearningClient.class | Bin 0 -> 5901 bytes .../ml/client/MachineLearningNodeClient.class | Bin 0 -> 19056 bytes .../org/opensearch/ml/client/package-info.class | Bin 0 -> 130 bytes .../org.mockito.plugins.MockMaker | 1 + .../ml/client/MachineLearningClientTest$1.class | Bin 0 -> 5245 bytes .../ml/client/MachineLearningClientTest.class | Bin 0 -> 8143 bytes .../client/MachineLearningNodeClientTest.class | Bin 0 -> 27764 bytes client/build.gradle | 2 ++ 8 files changed, 3 insertions(+) create mode 100644 client/bin/main/org/opensearch/ml/client/MachineLearningClient.class create mode 100644 client/bin/main/org/opensearch/ml/client/MachineLearningNodeClient.class create mode 100644 client/bin/main/org/opensearch/ml/client/package-info.class create mode 100644 client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker create mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class create mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class create mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningNodeClientTest.class diff --git a/client/bin/main/org/opensearch/ml/client/MachineLearningClient.class b/client/bin/main/org/opensearch/ml/client/MachineLearningClient.class new file mode 100644 index 0000000000000000000000000000000000000000..7cb93b25f68c166d35d3f68e582fef5de09213c5 GIT binary patch literal 5901 zcmcJTZByJ-6vzK}S=a&rYE{%)E85lq1wyT@l*MXGMbTZB@}$zzHY{-oF4=81YsHSv zIO99(_z~1kpyR`g^@T6h@e`;Y#_`;nknVRBVdZrNsr`fbZDOp4wVk_?A8j1LXHXxIfk zx4L2GU4~TIG1n~Ky4|07czfP;XlObU;iR;=S+aG@E?3D_W}5$|2f_~;dDo(+E{mV3 zs#|r;G(-EmRj>_y!Epb8-A#m%xIi9zsp@+0Inh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client/bin/main/org/opensearch/ml/client/MachineLearningNodeClient.class new file mode 100644 index 0000000000000000000000000000000000000000..fe832dc44f715f10e86ed18956c8622c2682417a GIT binary patch literal 19056 zcmcg!d0-Uf6@PDX%w{t}NB{{S28fW8c%l#l!yOF>B%t8ANrq%$vm19eC|a?ewbWZ$ zuht8d7Ohux3E)**FKnyTYHJUB(L-C?YAP_FdgIN#vZ=%;d;pwf7z&I2OJ0Q@wXNQXes zo{%&!rt5N6`=_XoLp7?P$pR+KCe+-?biRv8e~N&nYE(&wF=?H_SZ^TS(JgF;DOk1c zQv@+xqbjOqDv(yn)O?_9w6O@DS*wvsz9Oop29;(oEgYUX8X-!f!|4bnU-R>Fl!&Kd+$Crhieht@0l1Pt~Ov^LOJ>VWvoiN>p71OaaOQqwO zCOXuWmJc+VO(G}g=jk1NaYX3e>@eCk_v+bWzZti(4@yfABU_Lim-qFw>(RDAdk7#( zTOu8S(3(IrD88FF^W)vY7}L>C`Ey9Lkgzl})iGtrYRBmGzz#zRnK_MVniGNh3^0wd z!@H>!rX|joZI*)x-jHZ)x{@$4rlM9kS-9dGRHj5)1iE0jDcosVGtF+-*WPxOC+0lbPCci-g%}A#=KLu=DgvYE@|! z)0x9Yot2Zw&}~dxbDpD|GSF~EUn3IWDWaIoE#nQB-&&FD)}g#R5HpMXb~>G@(iw>V zxlW!LRFYg z(R0r5(`MSD(M9xGtRu`pCX3Hy8spa2AVtRM5{)jU%TN*k_2Ry;3^&U`o$0tt?4G(v zeG^4VC(}0nG!|KskufcniV#_wLR}Hb zGX`i|=_-}JfV$69mb79~qpRr}G-NT%Dab^F@$McNMHY)r#|a&8rRy}ho^D_|2vjWL zQT@)&LME#iqPp2eUsCCdX-iIqL1}ao-HaNyI}qy@>ml&;s_JGR-I}cX0^v?GKL{#c z*61sAJ8T686bJ!Tnyr{#R=v(gMLufxQCBf-r+Zbp2jWPZO`5hw_X#q^nD96XsMtyR zW-;`u8hwp+0t4&|T2HmZB<&QJFmI{!019r~CFVyW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ul*7WnW zEwy3}Q%PKo+;c?=I+btW8!@H;c($3u&>m-?n`xp$!Q=|<2FP|}3N#1Od%*N?VhZQX9(i*lQvwlEqFYFP6NaP=2cFplDH!W5O1Ns z`DgO#ZT=$c&UdLYGO3=E76 R%s|^ffRTX}NHQ_70RT0wB9{OF literal 0 HcmV?d00001 diff --git a/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker b/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000..ca6ee9cea8 --- /dev/null +++ b/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline \ No newline at end of file diff --git a/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class b/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class new file mode 100644 index 0000000000000000000000000000000000000000..a3dfbdda2650447132ac087d49b85e20b3c86a74 GIT binary patch literal 5245 zcmcIn{a4#m7=CW~=qOo1)KyXEHW7gVg~>Lx3}tK+u)xNbb2_#(jU_BiN|G{n{5X1! z`m2A7o;g2$@DK2h^7!6+LnvtiZACbg<+?&7u`SULTSMfy>35F@#DP`@7 zZn?VZXxrJcnbk}~x4i6;F4b5ZF zhVlpMu6YjWpNsNpm&>-5HLOaN@|9oU|Lg2j%`?boR{YBwuBThNljC7^tr;at^{Ng9 z^wa;1I33U5u6i*W9A$DEp$E!)a!f>hivQY3E&QfVe#|$HlV|U{mE+lcDVIYJX zsiT57Fu;(qtySHv*wjS~FV;#aTSLg5EK`}83q@W%b=jrtmrapChR8yWN;ShN(@!YF zU^vJ~!c=Bw4%hCJ%6|Q>HsqnHL{jf~j%rx5R`K?Jao=e;zJ~Y+ZNENQpH0QcTd6}t z$*|fmk9&;=_st1AZ8EwPrf?;R%M25tmf)L(tjnN<*Lk*ST*+2eXrFn9O1n@s%%biv zvicZ$7jTQ3UV0a-9ydwXrY+GHN2k$?FaMCl8wVr@FqTB*s5)7 zeG(e}v97Mx@E&rrlq4O0;YDgra7+e0Zfnk~EV`y0^qfJwq;{X2SI! zJ*N3kdC=<9M`*B=7u141_Kt#8tcl&n=X@bd@Ss8WA7)q#8%0LZ5D$iK(n|MqAAje> zqV_pS@7WsyWPh6u1h}i<6Ht?+rP==X3}Z1NM!RF!h_RnNbnvQ^TJ}t znD4+pzpsg7{HnfN<;UZOD2Wa9`;+$@7ix&9JT?XSc&I={f$|~Ej?YK5J37qoI}lPZ zjK+u&dR_|mU(*?K8pKGAM$_~X4)>DFqU+0 z+b$~b_8hRX(_w53G1w9e&PnSU1{{~iEO8TcxC#1p z0+RvmC4pNdKRoix*zb5-LcjYA)6Xy)DM5jx(`qEh1Ozf7a84kDo46$;$ka)|SEK|V zVm_d$^qfz>pt`q407k%26t^fc4 literal 0 HcmV?d00001 diff --git a/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class b/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class new file mode 100644 index 0000000000000000000000000000000000000000..22add9589f91940e74552d22e04ed613f4ccddd8 GIT binary patch literal 8143 zcmb_h33yc189g@%ykYWW8I(l@0V$BMj4X;6RAL|yoe4-V5UJuYd4z$PH*w~Tm9}bY zH+Qiuu5I1hx-XR>5w#T8TG!gTFKyLU+iF{FtF23W?tO12ZzgXtBQ5zd@6FA<|2^mb z&wuZKFOPnD_k957i*XvN1m+}DUBP6xVWy2pD!MV4hzFzbm|IpXb>0_GrKc1Im>HkGLcA{ z!On;k*^r7PjNoFvHOn^+9J?}OTCs%D9!tm8$BjnQOj;2umNe4>0c9+ajBbuu$zYgI z4j7!wSZb>J(o@-8g5l6|)t966M0`a=PH7n_TAp8etRfQZ&UL1d#&}m!4NlY0Xh}nX zZ;VQqp;+27Od};QrPyXfbqE&rqlqDHu`V-WWm1N~%8CXpEbb+PZhN(u>Jgk^Xr~b; z(UnHJn||ahGmFPN(CmJ}#Rc7^0b5(;4LBNXQ&P-zrvWXI>@+sFbjld^>8{O6QJ3n^ z@i05Y1tt|E>thxUsXpvJI1y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fm$fh+-NnMj_=LO~b?(I#85QF`kVUW2sCWOq0bSSxiks8ahsyS`NHuw|R;;c@X(ifN zb#<^dPAgMa<=S|yN?lFRCTmmF)l_YUHd9^A(hk+;sH?-Yd0MTyny)R=7OSf|tzK(T zS4*`cv=v&Tnt!m?q^;79g71&!kG0ivi^OW)uC1Xw?P#18K6XH!xSLzF?@*rjkoRaP zz2o>mw{{%vH`AS32>)I~Z)$7t?>XWOtp)!+Djw8Y(VxUOS{VPfiOJgfoIEX}wP_pi LZxmOtoV@=BAGG+; literal 0 HcmV?d00001 diff --git a/client/build.gradle b/client/build.gradle index f4cf9f1900..db3201ff59 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -48,6 +48,8 @@ jacocoTestCoverageVerification { check.dependsOn jacocoTestCoverageVerification tasks.named("jar").configure { dependsOn("publishShadowPublicationToMavenLocal") } +tasks.named("jar").configure { dependsOn("publishShadowPublicationToSnapshotsRepository") } +tasks.named("jar").configure { dependsOn("publishShadowPublicationToStagingRepository") } shadowJar { archiveClassifier.set(null) From 84b837d7dba2713e2c82960aef9022c71bb91106 Mon Sep 17 00:00:00 2001 From: Sicheng Song Date: Thu, 18 May 2023 22:08:41 +0000 Subject: [PATCH 2/4] Remove build cache Signed-off-by: Sicheng Song --- .../ml/client/MachineLearningClient.class | Bin 5901 -> 0 bytes .../ml/client/MachineLearningNodeClient.class | Bin 19056 -> 0 bytes .../org/opensearch/ml/client/package-info.class | Bin 130 -> 0 bytes .../org.mockito.plugins.MockMaker | 1 - .../ml/client/MachineLearningClientTest$1.class | Bin 5245 -> 0 bytes .../ml/client/MachineLearningClientTest.class | Bin 8143 -> 0 bytes .../client/MachineLearningNodeClientTest.class | Bin 27764 -> 0 bytes 7 files changed, 1 deletion(-) delete mode 100644 client/bin/main/org/opensearch/ml/client/MachineLearningClient.class delete mode 100644 client/bin/main/org/opensearch/ml/client/MachineLearningNodeClient.class delete mode 100644 client/bin/main/org/opensearch/ml/client/package-info.class delete mode 100644 client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker delete mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class delete mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class delete mode 100644 client/bin/test/org/opensearch/ml/client/MachineLearningNodeClientTest.class diff --git a/client/bin/main/org/opensearch/ml/client/MachineLearningClient.class b/client/bin/main/org/opensearch/ml/client/MachineLearningClient.class deleted file mode 100644 index 7cb93b25f68c166d35d3f68e582fef5de09213c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5901 zcmcJTZByJ-6vzK}S=a&rYE{%)E85lq1wyT@l*MXGMbTZB@}$zzHY{-oF4=81YsHSv zIO99(_z~1kpyR`g^@T6h@e`;Y#_`;nknVRBVdZrNsr`fbZDOp4wVk_?A8j1LXHXxIfk zx4L2GU4~TIG1n~Ky4|07czfP;XlObU;iR;=S+aG@E?3D_W}5$|2f_~;dDo(+E{mV3 zs#|r;G(-EmRj>_y!Epb8-A#m%xIi9zsp@+0InhX8BDCaWY0d0FC%RJ581zu!ems?G zxmmXTex4Qeuu|N_nHWWH=VT_B)gAx>aEq4I6GybtG(RlY}i!uW`dW z>WkkliV|YzkFp(AYz&$g&$iNM!y_AIi?Dj@queTQN4gT%SjY&pai$|1z>+ou} z*Jih;f*Ivp$V$BS-5|9;ZmPjp5%O2+q=r76Vz{P^At?ecthyKIljhot6&uf9tH>Th zPMKp_F=_XjYcW=2JZon(oW>BtoH~bk+S-lEmYrWPDjzVgWrk0i>?BsSJdZ6-)n-^x z#_%T7s%sT#!7r<>z~AlB{>09?yQat6Owc;2QdzN-;dStmhEbds8j@cPIA7nRC>$zGmJ&7Rw_xRIse8Uhwg%# z%?Kqd_hIE7@C1Jz{Xi@U0bd#pU$8c+}R7&=Fno^V|Zvwj>;Y%e;ySn10 zeWhR5aD^+~=29Qu$}KciG~W}$&4@T8p6XX(l|Z;;omAAOYx>1qh;X+j+5G*cXI#H3 ze9W1Za)}OSzJwVK(_F&al6ch1t${O!jfk)$UK^;`z!g`t!wcH0!%puk>dU)x-S+MI zC)Rm!aGf*nRLzR=5%RMg6Y74A?x>w;gLTp6$(vIaKhPeH{2(&I52J0g`9lkR zRRJEORx8?&K#HysID~fky@MqE0X@HT1EG^uJpSKS2+jL>Eqx z8DP*Gg2&NIS2P$;;7KyiTTkIA8BfxOhNp3i#y&&68r}1Hj-!P>)6nssdOVD0snv() z0<7l+*84P)V|No)marb+L<@$(RAXfIB3U07RDIrvfT~-taL*lrB~in|dyXSPEOc%P zSYDvkY4isy15pwkBZ&qhB+8Pb8ImX`k%$Z9Ni>X+h7!@iAi&b8HHxzV){6q`9{CGp z?py>`o*r5wEVCij1^VCxxM>+tUkmT@{h#cM}zK)hvHV0VKTBA4*TrMWg;-{BEvT0{ zi7xXIy8KQoe-O)`5|$;rLy^jI^sdl_mbO5b_o%h3z;Zo;sVIk IeM{ix|5LGo;s5{u diff --git a/client/bin/main/org/opensearch/ml/client/MachineLearningNodeClient.class b/client/bin/main/org/opensearch/ml/client/MachineLearningNodeClient.class deleted file mode 100644 index fe832dc44f715f10e86ed18956c8622c2682417a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19056 zcmcg!d0-Uf6@PDX%w{t}NB{{S28fW8c%l#l!yOF>B%t8ANrq%$vm19eC|a?ewbWZ$ zuht8d7Ohux3E)**FKnyTYHJUB(L-C?YAP_FdgIN#vZ=%;d;pwf7z&I2OJ0Q@wXNQXes zo{%&!rt5N6`=_XoLp7?P$pR+KCe+-?biRv8e~N&nYE(&wF=?H_SZ^TS(JgF;DOk1c zQv@+xqbjOqDv(yn)O?_9w6O@DS*wvsz9Oop29;(oEgYUX8X-!f!|4bnU-R>Fl!&Kd+$Crhieht@0l1Pt~Ov^LOJ>VWvoiN>p71OaaOQqwO zCOXuWmJc+VO(G}g=jk1NaYX3e>@eCk_v+bWzZti(4@yfABU_Lim-qFw>(RDAdk7#( zTOu8S(3(IrD88FF^W)vY7}L>C`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OjRk$tad812Fh$m@G+(`j}yv-B9h9S>juwI<{c30PAKy(DDw^|b335k3uSJHGVgO& zCLaao71o=o%z1o5hB8GGWuBh`Ji`hW0Qk}bFEfF!5WrX4z_VDvPO!Tlz#jncodEtI zfIkf24+8ijg8;sUPsspoSiz|SS;1Oi1!vl5vsl67u!3Dc_&BVff5=v#h@Wd)mU)&l z6!6(rDByq<3b@@f6zqjnKZ#JV7jFI(kUg8Cx1ofBB`^yaFj!OSJH)BGZYeI8I>PJvivxloyO9AT4X9OMlkJxcsv zCx}*tgBvb~QM^%Ft{4?cj>5e>T;qS$z%x;XZozlq?9*yrpb?^WDB~WHZYSPCV_>fl z>uxNWgj3_|D-i2dM9tTb=3b}6a9Uf0Bm==T3-L57kxt`2S@MX42UU$60~8nWCg498 zcM9P_=iyV}nhTT)KK(Vjcymqd<5VLG07Vu67>Da4B`+hT`Ym35=+8%7;ul>n=x)JC z5uY!TRA-q~i$xH*csGAekrlN;R#fOjm%zs^m86Z@x0t`cS4o2Ca!sYp!>1Ul*7WnW zEwy3}Q%PKo+;c?=I+btW8!@H;c($3u&>m-?n`xp$!Q=|<2FP|}3N#1Od%*N?VhZQX9(i*lQvwlEqFYFP6NaP=2cFplDH!W5O1Ns z`DgO#ZT=$c&UdLYGO3=E76 R%s|^ffRTX}NHQ_70RT0wB9{OF diff --git a/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker b/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index ca6ee9cea8..0000000000 --- a/client/bin/test/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline \ No newline at end of file diff --git a/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class b/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest$1.class deleted file mode 100644 index a3dfbdda2650447132ac087d49b85e20b3c86a74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5245 zcmcIn{a4#m7=CW~=qOo1)KyXEHW7gVg~>Lx3}tK+u)xNbb2_#(jU_BiN|G{n{5X1! z`m2A7o;g2$@DK2h^7!6+LnvtiZACbg<+?&7u`SULTSMfy>35F@#DP`@7 zZn?VZXxrJcnbk}~x4i6;F4b5ZF zhVlpMu6YjWpNsNpm&>-5HLOaN@|9oU|Lg2j%`?boR{YBwuBThNljC7^tr;at^{Ng9 z^wa;1I33U5u6i*W9A$DEp$E!)a!f>hivQY3E&QfVe#|$HlV|U{mE+lcDVIYJX zsiT57Fu;(qtySHv*wjS~FV;#aTSLg5EK`}83q@W%b=jrtmrapChR8yWN;ShN(@!YF zU^vJ~!c=Bw4%hCJ%6|Q>HsqnHL{jf~j%rx5R`K?Jao=e;zJ~Y+ZNENQpH0QcTd6}t z$*|fmk9&;=_st1AZ8EwPrf?;R%M25tmf)L(tjnN<*Lk*ST*+2eXrFn9O1n@s%%biv zvicZ$7jTQ3UV0a-9ydwXrY+GHN2k$?FaMCl8wVr@FqTB*s5)7 zeG(e}v97Mx@E&rrlq4O0;YDgra7+e0Zfnk~EV`y0^qfJwq;{X2SI! zJ*N3kdC=<9M`*B=7u141_Kt#8tcl&n=X@bd@Ss8WA7)q#8%0LZ5D$iK(n|MqAAje> zqV_pS@7WsyWPh6u1h}i<6Ht?+rP==X3}Z1NM!RF!h_RnNbnvQ^TJ}t znD4+pzpsg7{HnfN<;UZOD2Wa9`;+$@7ix&9JT?XSc&I={f$|~Ej?YK5J37qoI}lPZ zjK+u&dR_|mU(*?K8pKGAM$_~X4)>DFqU+0 z+b$~b_8hRX(_w53G1w9e&PnSU1{{~iEO8TcxC#1p z0+RvmC4pNdKRoix*zb5-LcjYA)6Xy)DM5jx(`qEh1Ozf7a84kDo46$;$ka)|SEK|V zVm_d$^qfz>pt`q407k%26t^fc4 diff --git a/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class b/client/bin/test/org/opensearch/ml/client/MachineLearningClientTest.class deleted file mode 100644 index 22add9589f91940e74552d22e04ed613f4cc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n9}4uhLlFM438pJP`e$l51CmDlf8ErO zyXNx+;A9&O;|o!YxCqo=4C*gH3FZ=Ta49sh9SgZjkXm2n(n^0#Ehx{ir1AAIkWT`@ zj1(8TU2Y?ay9&j936TI8>`I8;z=dA|(H=>N-^|LXD9Z7|n%cMJTfo(=;OaKm+U>MI z-vQ3*Xgq!cW*Xn?;%r9Jbt)~_8BIfR#`!6@`FJeH28pLr zzyYnqGYZ;p8YhjjpTLzRXKrxVEuKZ>dTw>0c%e|dv{Sr-ko0>b6I)kTmIZ@B+`Zw; zn^`7#1iU>8UVa75JO-^i?xH>2?MG3O__O#6XrG{H|7!~E5*&tub|Fsu205hK|llwd&zM7TOBfgeQ{U@R2`toI(+9%-aQ}Fc}px|>r!54G@e+d})6ukW% z&h!;b?H@3;zr)o22~+#pr7qLdWb`pjO+)k@h9j2&aHdR6%S+)5tu*{+Plg2L;jJ{z z{_CbD@+n^!G)fGl31Scu^T96K`)z9SkXah-($uj1MN=!28Guy4dr-*-6)9@TEi1~E zmNuX$r)Yq$sfm$fh+-NnMj_=LO~b?(I#85QF`kVUW2sCWOq0bSSxiks8ahsyS`NHuw|R;;c@X(ifN zb#<^dPAgMa<=S|yN?lFRCTmmF)l_YUHd9^A(hk+;sH?-Yd0MTyny)R=7OSf|tzK(T zS4*`cv=v&Tnt!m?q^;79g71&!kG0ivi^OW)uC1Xw?P#18K6XH!xSLzF?@*rjkoRaP zz2o>mw{{%vH`AS32>)I~Z)$7t?>XWOtp)!+Djw8Y(VxUOS{VPfiOJgfoIEX}wP_pi LZxmOtoV@=BAGG+; From 5f72f2bfe029bbb442b4057011ebc41c209872b7 Mon Sep 17 00:00:00 2001 From: Sicheng Song Date: Thu, 18 May 2023 22:13:07 +0000 Subject: [PATCH 3/4] Bug fix Signed-off-by: Sicheng Song --- client/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/client/build.gradle b/client/build.gradle index db3201ff59..477ce23616 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -48,7 +48,6 @@ jacocoTestCoverageVerification { check.dependsOn jacocoTestCoverageVerification tasks.named("jar").configure { dependsOn("publishShadowPublicationToMavenLocal") } -tasks.named("jar").configure { dependsOn("publishShadowPublicationToSnapshotsRepository") } tasks.named("jar").configure { dependsOn("publishShadowPublicationToStagingRepository") } shadowJar { From d40f88c4c4168b39de88526a3e5b3c4d151c9a6f Mon Sep 17 00:00:00 2001 From: Sicheng Song Date: Thu, 18 May 2023 23:35:10 +0000 Subject: [PATCH 4/4] Code fix on OS 3.0 major refactor Signed-off-by: Sicheng Song --- .../org/opensearch/ml/common/TestHelper.java | 14 +-- .../ml/common/dataframe/BooleanValueTest.java | 4 +- .../ml/common/dataframe/ColumnMetaTest.java | 4 +- .../dataframe/DefaultDataFrameTest.java | 59 +++++++------ .../ml/common/dataframe/DoubleValueTest.java | 4 +- .../ml/common/dataframe/FloatValueTest.java | 4 +- .../ml/common/dataframe/IntValueTest.java | 4 +- .../ml/common/dataframe/LongValueTest.java | 8 +- .../ml/common/dataframe/NullValueTest.java | 4 +- .../ml/common/dataframe/RowTest.java | 58 +++++++----- .../ml/common/dataframe/ShortValueTest.java | 10 +-- .../ml/common/dataframe/StringValueTest.java | 4 +- .../ml/common/input/MLInputTest.java | 47 +++++----- .../AnomalyLocalizationInputTests.java | 88 ++++++++++--------- .../common/input/nlp/TextDocsMLInputTest.java | 15 ++-- .../common/output/MLPredictionOutputTest.java | 16 ++-- .../common/output/MLTrainingOutputTest.java | 4 +- .../AnomalyLocalizationOutputTests.java | 4 +- .../LocalSampleCalculatorOutputTest.java | 7 +- .../output/sample/SampleAlgoOutputTest.java | 7 +- .../MLDeployModelNodesResponseTest.java | 14 ++- .../deploy/MLDeployModelResponseTest.java | 4 +- .../forward/MLForwardResponseTest.java | 16 ++-- .../model/MLModelGetResponseTest.java | 7 +- .../MLPredictionTaskResponseTest.java | 54 +++++++----- .../register/MLRegisterModelInputTest.java | 48 +++++----- .../register/MLRegisterModelResponseTest.java | 4 +- .../transport/sync/MLSyncUpResponseTest.java | 4 +- .../transport/task/MLTaskGetResponseTest.java | 7 +- .../undeploy/MLUndeployModelInputTest.java | 35 ++++---- .../MLUndeployModelNodesResponseTest.java | 16 ++-- .../MLUploadModelChunkInputTest.java | 7 +- .../ml/cluster/DiscoveryNodeHelper.java | 2 +- .../org/opensearch/ml/task/MLTaskManager.java | 32 ++++--- .../opensearch/ml/utils/MLExceptionUtils.java | 3 +- .../opensearch/ml/utils/RestActionUtils.java | 27 +++--- .../ml/rest/RestMLDeleteModelActionTests.java | 2 +- .../ml/rest/RestMLDeleteTaskActionTests.java | 2 +- .../ml/rest/RestMLDeployModelActionTests.java | 2 +- .../ml/rest/RestMLExecuteActionTests.java | 2 +- .../ml/rest/RestMLGetModelActionTests.java | 2 +- .../ml/rest/RestMLGetTaskActionTests.java | 2 +- .../ml/rest/RestMLPredictionActionTests.java | 2 +- .../ml/rest/RestMLProfileActionTests.java | 2 +- .../rest/RestMLRegisterModelActionTests.java | 2 +- .../RestMLRegisterModelMetaActionTests.java | 2 +- .../ml/rest/RestMLSearchModelActionTests.java | 2 +- .../ml/rest/RestMLSearchTaskActionTests.java | 2 +- .../RestMLTrainAndPredictActionTests.java | 2 +- .../ml/rest/RestMLTrainingActionTests.java | 2 +- .../rest/RestMLUndeployModelActionTests.java | 2 +- .../RestMLUploadModelChunkActionTests.java | 2 +- .../opensearch/ml/utils/IntegTestUtils.java | 12 +-- 53 files changed, 382 insertions(+), 307 deletions(-) diff --git a/common/src/test/java/org/opensearch/ml/common/TestHelper.java b/common/src/test/java/org/opensearch/ml/common/TestHelper.java index 0eef4af5f2..fce35b3c90 100644 --- a/common/src/test/java/org/opensearch/ml/common/TestHelper.java +++ b/common/src/test/java/org/opensearch/ml/common/TestHelper.java @@ -5,7 +5,7 @@ package org.opensearch.ml.common; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentFactory; @@ -16,7 +16,6 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; - import java.io.IOException; import java.util.function.Function; @@ -26,7 +25,8 @@ public static void testParse(ToXContentObject obj, Function void testParse(ToXContentObject obj, Function function, boolean wrapWithObject) throws IOException { + public static void testParse(ToXContentObject obj, Function function, boolean wrapWithObject) + throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); if (wrapWithObject) { builder.startObject(); @@ -35,12 +35,14 @@ public static void testParse(ToXContentObject obj, Function void testParseFromString(ToXContentObject obj, String jsonStr, Function function) throws IOException { - XContentParser parser = XContentType.JSON.xContent().createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, jsonStr); + public static void testParseFromString(ToXContentObject obj, String jsonStr, + Function function) throws IOException { + XContentParser parser = XContentType.JSON.xContent().createParser(NamedXContentRegistry.EMPTY, + LoggingDeprecationHandler.INSTANCE, jsonStr); parser.nextToken(); T parsedObj = function.apply(parser); obj.equals(parsedObj); diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/BooleanValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/BooleanValueTest.java index 4e3def5ba1..36be596962 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/BooleanValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/BooleanValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -31,7 +31,7 @@ public void testToXContent() throws IOException { value.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"BOOLEAN\",\"value\":true}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/ColumnMetaTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/ColumnMetaTest.java index f212473e9f..1ea78c04cd 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/ColumnMetaTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/ColumnMetaTest.java @@ -7,7 +7,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -55,7 +55,7 @@ public void testToXContent() throws IOException { columnMeta.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"name\":\"columnMetaName\",\"column_type\":\"STRING\"}", jsonStr); } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java index 06d8922b4d..f1addd77f1 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/DefaultDataFrameTest.java @@ -9,7 +9,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; @@ -173,21 +173,21 @@ public void columnMetas_Success() { } @Test - public void remove_Exception_InputColumnIndexBiggerThanColumensLength(){ + public void remove_Exception_InputColumnIndexBiggerThanColumensLength() { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("columnIndex can't be negative or bigger than columns length:4"); defaultDataFrame.remove(4); } @Test - public void remove_Exception_InputColumnIndexNegtiveColumensLength(){ + public void remove_Exception_InputColumnIndexNegtiveColumensLength() { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("columnIndex can't be negative or bigger than columns length:4"); defaultDataFrame.remove(-1); } @Test - public void remove_EmptyColumnMeta(){ + public void remove_EmptyColumnMeta() { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("columnIndex can't be negative or bigger than columns length:0"); DefaultDataFrame dataFrame = new DefaultDataFrame(new ColumnMeta[0]); @@ -196,31 +196,31 @@ public void remove_EmptyColumnMeta(){ } @Test - public void remove_Success(){ + public void remove_Success() { DataFrame dataFrame = defaultDataFrame.remove(3); assertEquals(3, dataFrame.columnMetas().length); assertEquals(3, dataFrame.getRow(0).size()); } @Test - public void select_Success(){ - DataFrame dataFrame = defaultDataFrame.select(new int[]{1, 3}); + public void select_Success() { + DataFrame dataFrame = defaultDataFrame.select(new int[] { 1, 3 }); assertEquals(2, dataFrame.columnMetas().length); assertEquals(2, dataFrame.getRow(0).size()); } @Test - public void select_Exception_EmptyInputColumns(){ + public void select_Exception_EmptyInputColumns() { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("columns can't be null or empty"); defaultDataFrame.select(new int[0]); } @Test - public void select_Exception_InvalidColumn(){ + public void select_Exception_InvalidColumn() { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("columnIndex can't be negative or bigger than columns length"); - defaultDataFrame.select(new int[]{5}); + defaultDataFrame.select(new int[] { 5 }); } @Test @@ -231,43 +231,44 @@ public void testToXContent() throws IOException { builder.endObject(); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_metas\":[" + - "{\"name\":\"c1\",\"column_type\":\"STRING\"}," + - "{\"name\":\"c2\",\"column_type\":\"INTEGER\"}," + - "{\"name\":\"c3\",\"column_type\":\"DOUBLE\"}," + - "{\"name\":\"c4\",\"column_type\":\"BOOLEAN\"}]," + - "\"rows\":[" + - "{\"values\":[" + - "{\"column_type\":\"STRING\",\"value\":\"string\"}," + - "{\"column_type\":\"INTEGER\",\"value\":1}," + - "{\"column_type\":\"DOUBLE\",\"value\":2.0}," + - "{\"column_type\":\"BOOLEAN\",\"value\":true}]}]}", jsonStr); + "{\"name\":\"c1\",\"column_type\":\"STRING\"}," + + "{\"name\":\"c2\",\"column_type\":\"INTEGER\"}," + + "{\"name\":\"c3\",\"column_type\":\"DOUBLE\"}," + + "{\"name\":\"c4\",\"column_type\":\"BOOLEAN\"}]," + + "\"rows\":[" + + "{\"values\":[" + + "{\"column_type\":\"STRING\",\"value\":\"string\"}," + + "{\"column_type\":\"INTEGER\",\"value\":1}," + + "{\"column_type\":\"DOUBLE\",\"value\":2.0}," + + "{\"column_type\":\"BOOLEAN\",\"value\":true}]}]}", jsonStr); } @Test public void testParse_EmptyDataFrame() throws IOException { - ColumnMeta[] columnMetas = new ColumnMeta[] {new ColumnMeta("test_int", ColumnType.INTEGER)}; + ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("test_int", ColumnType.INTEGER) }; DefaultDataFrame dataFrame = new DefaultDataFrame(columnMetas); TestHelper.testParse(dataFrame, function, true); } @Test public void testParse_DataFrame() throws IOException { - ColumnMeta[] columnMetas = new ColumnMeta[] {new ColumnMeta("test_int", ColumnType.INTEGER)}; + ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("test_int", ColumnType.INTEGER) }; DefaultDataFrame dataFrame = new DefaultDataFrame(columnMetas); - dataFrame.appendRow(new Integer[]{1}); - dataFrame.appendRow(new Integer[]{2}); + dataFrame.appendRow(new Integer[] { 1 }); + dataFrame.appendRow(new Integer[] { 2 }); TestHelper.testParse(dataFrame, function, true); } @Test public void testParse_WrongExtraField() throws IOException { - ColumnMeta[] columnMetas = new ColumnMeta[] {new ColumnMeta("test_int", ColumnType.INTEGER)}; + ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("test_int", ColumnType.INTEGER) }; DefaultDataFrame dataFrame = new DefaultDataFrame(columnMetas); - dataFrame.appendRow(new Integer[]{1}); - dataFrame.appendRow(new Integer[]{2}); - String jsonStr = "{\"wrong_field\":{\"test\":\"abc\"},\"column_metas\":[{\"name\":\"test_int\",\"column_type\":" + + dataFrame.appendRow(new Integer[] { 1 }); + dataFrame.appendRow(new Integer[] { 2 }); + String jsonStr = "{\"wrong_field\":{\"test\":\"abc\"},\"column_metas\":[{\"name\":\"test_int\",\"column_type\":" + + "\"INTEGER\"}],\"rows\":[{\"values\":[{\"column_type\":\"INTEGER\",\"value\":1}]},{\"values\":" + "[{\"column_type\":\"INTEGER\",\"value\":2}]}]}"; TestHelper.testParseFromString(dataFrame, jsonStr, function); diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/DoubleValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/DoubleValueTest.java index 3e720f8f1e..a5a74e41a8 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/DoubleValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/DoubleValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -51,7 +51,7 @@ public void testToXContent() throws IOException { doubleValue.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"DOUBLE\",\"value\":5.0}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/FloatValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/FloatValueTest.java index 08f5ec81e3..b85309779b 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/FloatValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/FloatValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -34,7 +34,7 @@ public void testToXContent() throws IOException { floatValue.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"FLOAT\",\"value\":2.1}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/IntValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/IntValueTest.java index 3feea82fc3..a86d58ca6f 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/IntValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/IntValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -33,7 +33,7 @@ public void testToXContent() throws IOException { intValue.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"INTEGER\",\"value\":2}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/LongValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/LongValueTest.java index 97b6cbcc1c..1210cddfe7 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/LongValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/LongValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -20,7 +20,7 @@ public class LongValueTest { @Test public void longValue() { - LongValue longValue = new LongValue((long)2); + LongValue longValue = new LongValue((long) 2); assertEquals(ColumnType.LONG, longValue.columnType()); assertEquals(2L, longValue.getValue()); assertEquals(2.0d, longValue.doubleValue(), 1e-5); @@ -28,12 +28,12 @@ public void longValue() { @Test public void testToXContent() throws IOException { - LongValue longValue = new LongValue((long)2); + LongValue longValue = new LongValue((long) 2); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); longValue.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"LONG\",\"value\":2}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/NullValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/NullValueTest.java index 327848a6e8..8721567474 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/NullValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/NullValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; @@ -34,7 +34,7 @@ public void testToXContent() throws IOException { value.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"NULL\"}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/RowTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/RowTest.java index 0cfa5ae18d..0316bc5c8f 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/RowTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/RowTest.java @@ -9,7 +9,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -40,7 +40,7 @@ public void setup() { row = new Row(1); row.setValue(0, ColumnValueBuilder.build(0)); - function = parser -> { + function = parser -> { try { return Row.parse(parser); } catch (IOException e) { @@ -126,7 +126,7 @@ public void select() { row = new Row(2); row.setValue(0, ColumnValueBuilder.build(0)); row.setValue(1, ColumnValueBuilder.build(false)); - row = row.select(new int[]{1}); + row = row.select(new int[] { 1 }); assertEquals(1, row.size()); assertFalse(row.getValue(0).booleanValue()); } @@ -137,52 +137,59 @@ public void testToXContent() throws IOException { row.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"values\":[{\"column_type\":\"INTEGER\",\"value\":0}]}", jsonStr); } @Test public void testParse_NullValue() throws IOException { - ColumnValue[] values = new ColumnValue[] {new NullValue()}; + ColumnValue[] values = new ColumnValue[] { new NullValue() }; Row row = new Row(values); testParse(row, function); } @Test public void testParse_NullValue_AtLast() throws IOException { - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new StringValue("test"), new BooleanValue(true), new NullValue()}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new StringValue("test"), + new BooleanValue(true), new NullValue() }; Row row = new Row(values); testParse(row, function); } @Test public void testParse_NullValue_AtFirst() throws IOException { - ColumnValue[] values = new ColumnValue[] {new NullValue(), new IntValue(1), new DoubleValue(2.0), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new NullValue(), new IntValue(1), new DoubleValue(2.0), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); testParse(row, function); } @Test public void testParse_NullValue_AtMiddle() throws IOException { - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); testParse(row, function); } @Test public void testParse_ExtraWrongValueField() throws IOException { - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); - String jsonStr = "{\"values\":[{\"column_type\":\"INTEGER\",\"value\":1},{\"column_type\":\"DOUBLE\",\"value\":2}," + - "{\"column_type\":\"NULL\"},{\"column_type\":\"STRING\",\"value\":\"test\"},{\"column_type\":\"BOOLEAN\"," + + String jsonStr = "{\"values\":[{\"column_type\":\"INTEGER\",\"value\":1},{\"column_type\":\"DOUBLE\",\"value\":2}," + + + "{\"column_type\":\"NULL\"},{\"column_type\":\"STRING\",\"value\":\"test\"},{\"column_type\":\"BOOLEAN\"," + + "\"value\":true},{\"column_type\":\"WRONG\",\"value\":true}],\"wrong_filed\":{\"test\":\"abc\"}}"; testParseFromString(row, jsonStr, function); } @Test public void testParse_EmptyValueField() throws IOException { - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); String jsonStr = "{\"values\":[{}]}"; testParseFromString(row, jsonStr, function); @@ -192,7 +199,8 @@ public void testParse_EmptyValueField() throws IOException { public void testParse_WrongColumnTypeField() throws IOException { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("wrong column type, expect column_type field but got column_type_wrong"); - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); String jsonStr = "{\"values\":[{\"column_type_wrong\":\"INTEGER\",\"value\":1}]}"; testParseFromString(row, jsonStr, function); @@ -202,7 +210,8 @@ public void testParse_WrongColumnTypeField() throws IOException { public void testParse_WrongValueField() throws IOException { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("wrong column value, expect value field but got value_wrong"); - ColumnValue[] values = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row = new Row(values); String jsonStr = "{\"values\":[{\"column_type\":\"INTEGER\",\"value_wrong\":1}]}"; testParseFromString(row, jsonStr, function); @@ -216,34 +225,41 @@ public void testEquals_EmptyValues() { Row row2 = new Row(values2); assertTrue(row1.equals(row2)); - ColumnValue[] values3 = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values3 = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row3 = new Row(values3); assertFalse(row1.equals(row3)); } @Test public void testEquals_AllValuesMatch() { - ColumnValue[] values1 = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values1 = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row1 = new Row(values1); - ColumnValue[] values2 = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values2 = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row2 = new Row(values2); assertTrue(row1.equals(row2)); } @Test public void testEquals_SomeValueNotMatch() { - ColumnValue[] values1 = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values1 = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row1 = new Row(values1); - ColumnValue[] values2 = new ColumnValue[] {new IntValue(2), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values2 = new ColumnValue[] { new IntValue(2), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row2 = new Row(values2); assertFalse(row1.equals(row2)); } @Test public void testEquals_SomeTypeNotMatch() { - ColumnValue[] values1 = new ColumnValue[] {new IntValue(1), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values1 = new ColumnValue[] { new IntValue(1), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row1 = new Row(values1); - ColumnValue[] values2 = new ColumnValue[] {new DoubleValue(1.0), new DoubleValue(2.0), new NullValue(), new StringValue("test"), new BooleanValue(true)}; + ColumnValue[] values2 = new ColumnValue[] { new DoubleValue(1.0), new DoubleValue(2.0), new NullValue(), + new StringValue("test"), new BooleanValue(true) }; Row row2 = new Row(values2); assertFalse(row1.equals(row2)); } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/ShortValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/ShortValueTest.java index 6db79f115c..6f075d085a 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/ShortValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/ShortValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; @@ -20,20 +20,20 @@ public class ShortValueTest { @Test public void shortValue() { - ShortValue shortValue = new ShortValue((short)2); + ShortValue shortValue = new ShortValue((short) 2); assertEquals(ColumnType.SHORT, shortValue.columnType()); - assertEquals((short)2, shortValue.getValue()); + assertEquals((short) 2, shortValue.getValue()); assertEquals(2.0d, shortValue.doubleValue(), 1e-5); } @Test public void testToXContent() throws IOException { - ShortValue shortValue = new ShortValue((short)2); + ShortValue shortValue = new ShortValue((short) 2); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); shortValue.toXContent(builder); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"SHORT\",\"value\":2}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/dataframe/StringValueTest.java b/common/src/test/java/org/opensearch/ml/common/dataframe/StringValueTest.java index 6b64c4813c..d1ff2b781f 100644 --- a/common/src/test/java/org/opensearch/ml/common/dataframe/StringValueTest.java +++ b/common/src/test/java/org/opensearch/ml/common/dataframe/StringValueTest.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.dataframe; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.ToXContent; @@ -38,7 +38,7 @@ public void testToXContent() throws IOException { value.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"column_type\":\"STRING\",\"value\":\"str\"}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java b/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java index 76b19dc254..42ccdb9bc2 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/MLInputTest.java @@ -10,7 +10,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; @@ -61,11 +61,11 @@ public class MLInputTest { @Before public void setUp() throws Exception { - final ColumnMeta[] columnMetas = new ColumnMeta[]{new ColumnMeta("test", ColumnType.DOUBLE)}; + final ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("test", ColumnType.DOUBLE) }; List rows = new ArrayList<>(); - rows.add(new Row(new ColumnValue[]{new DoubleValue(1.0)})); - rows.add(new Row(new ColumnValue[]{new DoubleValue(2.0)})); - rows.add(new Row(new ColumnValue[]{new DoubleValue(3.0)})); + rows.add(new Row(new ColumnValue[] { new DoubleValue(1.0) })); + rows.add(new Row(new ColumnValue[] { new DoubleValue(2.0) })); + rows.add(new Row(new ColumnValue[] { new DoubleValue(3.0) })); DataFrame dataFrame = new DefaultDataFrame(columnMetas, rows); input = MLInput.builder() .algorithm(algorithm) @@ -89,20 +89,23 @@ public void parse_LinearRegression() throws IOException { .searchSourceBuilder(new SearchSourceBuilder().query(new MatchAllQueryBuilder()).size(1)) .build(); String expectedInputStr = "{\"algorithm\":\"LINEAR_REGRESSION\",\"input_index\":[\"index1\"],\"input_query\":{\"size\":1,\"query\":{\"match_all\":{\"boost\":1.0}}}}"; - testParse(FunctionName.LINEAR_REGRESSION, inputDataset, expectedInputStr, parsedInput -> { + testParse(FunctionName.LINEAR_REGRESSION, inputDataset, expectedInputStr, parsedInput -> { assertNotNull(parsedInput.getInputDataset()); - assertEquals(1, ((SearchQueryInputDataset)parsedInput.getInputDataset()).getIndices().size()); - assertEquals(indexName, ((SearchQueryInputDataset)parsedInput.getInputDataset()).getIndices().get(0)); + assertEquals(1, ((SearchQueryInputDataset) parsedInput.getInputDataset()).getIndices().size()); + assertEquals(indexName, ((SearchQueryInputDataset) parsedInput.getInputDataset()).getIndices().get(0)); }); - @NonNull DataFrame dataFrame = new DefaultDataFrame(new ColumnMeta[]{ColumnMeta.builder().name("value").columnType(ColumnType.FLOAT).build()}); - dataFrame.appendRow(new Float[]{1.0f}); + @NonNull + DataFrame dataFrame = new DefaultDataFrame( + new ColumnMeta[] { ColumnMeta.builder().name("value").columnType(ColumnType.FLOAT).build() }); + dataFrame.appendRow(new Float[] { 1.0f }); DataFrameInputDataset dataFrameInputDataset = DataFrameInputDataset.builder().dataFrame(dataFrame).build(); expectedInputStr = "{\"algorithm\":\"LINEAR_REGRESSION\",\"input_data\":{\"column_metas\":[{\"name\":\"value\",\"column_type\":\"FLOAT\"}],\"rows\":[{\"values\":[{\"column_type\":\"FLOAT\",\"value\":1.0}]}]}}"; - testParse(FunctionName.LINEAR_REGRESSION, dataFrameInputDataset, expectedInputStr, parsedInput -> { + testParse(FunctionName.LINEAR_REGRESSION, dataFrameInputDataset, expectedInputStr, parsedInput -> { assertNotNull(parsedInput.getInputDataset()); - assertEquals(1, ((DataFrameInputDataset)parsedInput.getInputDataset()).getDataFrame().size()); - assertEquals(1.0f, ((DataFrameInputDataset)parsedInput.getInputDataset()).getDataFrame().getRow(0).getValue(0).floatValue(), 1e-5); + assertEquals(1, ((DataFrameInputDataset) parsedInput.getInputDataset()).getDataFrame().size()); + assertEquals(1.0f, ((DataFrameInputDataset) parsedInput.getInputDataset()).getDataFrame().getRow(0) + .getValue(0).floatValue(), 1e-5); }); } @@ -115,7 +118,8 @@ public void parse_TextEmbedding() throws IOException { .targetResponse(Arrays.asList(column)) .targetResponsePositions(Arrays.asList(position)) .build(); - TextDocsInputDataSet inputDataset = TextDocsInputDataSet.builder().docs(Arrays.asList(sentence)).resultFilter(resultFilter).build(); + TextDocsInputDataSet inputDataset = TextDocsInputDataSet.builder().docs(Arrays.asList(sentence)) + .resultFilter(resultFilter).build(); String expectedInputStr = "{\"algorithm\":\"TEXT_EMBEDDING\",\"text_docs\":[\"test sentence\"],\"return_bytes\":false,\"return_number\":false,\"target_response\":[\"column1\"],\"target_response_positions\":[1]}"; testParse(FunctionName.TEXT_EMBEDDING, inputDataset, expectedInputStr, parsedInput -> { assertNotNull(parsedInput.getInputDataset()); @@ -135,21 +139,23 @@ public void parse_TextEmbedding_NullResultFilter() throws IOException { String expectedInputStr = "{\"algorithm\":\"TEXT_EMBEDDING\",\"text_docs\":[\"test sentence\"]}"; testParse(FunctionName.TEXT_EMBEDDING, inputDataset, expectedInputStr, parsedInput -> { assertNotNull(parsedInput.getInputDataset()); - assertEquals(1, ((TextDocsInputDataSet)parsedInput.getInputDataset()).getDocs().size()); - assertEquals(sentence, ((TextDocsInputDataSet)parsedInput.getInputDataset()).getDocs().get(0)); + assertEquals(1, ((TextDocsInputDataSet) parsedInput.getInputDataset()).getDocs().size()); + assertEquals(sentence, ((TextDocsInputDataSet) parsedInput.getInputDataset()).getDocs().get(0)); }); } - private void testParse(FunctionName algorithm, MLInputDataset inputDataset, String expectedInputStr, Consumer verify) throws IOException { + private void testParse(FunctionName algorithm, MLInputDataset inputDataset, String expectedInputStr, + Consumer verify) throws IOException { MLInput input = MLInput.builder().inputDataset(inputDataset).algorithm(algorithm).build(); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); input.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals(expectedInputStr, jsonStr); - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), null, jsonStr); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), null, jsonStr); parser.nextToken(); MLInput parsedInput = MLInput.parse(parser, algorithm.name()); assertEquals(input.getFunctionName(), parsedInput.getFunctionName()); @@ -157,7 +163,6 @@ private void testParse(FunctionName algorithm, MLInputDataset inputDataset, Stri verify.accept(parsedInput); } - @Test public void readInputStream_Success() throws IOException { readInputStream(input, parsedInput -> { diff --git a/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java b/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java index 71a8918281..71b1b67509 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java +++ b/common/src/test/java/org/opensearch/ml/common/input/execute/anomalylocalization/AnomalyLocalizationInputTests.java @@ -6,7 +6,7 @@ package org.opensearch.ml.common.input.execute.anomalylocalization; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; import org.opensearch.common.io.stream.NamedWriteableRegistry; @@ -29,51 +29,59 @@ public class AnomalyLocalizationInputTests { - @Test - public void testXContentFullObject() throws Exception { - AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), Arrays.asList(AggregationBuilders.max("max").field("field"), - AggregationBuilders.min("min").field("field")), "@timestamp", 0L, 10L, 1L, 2, Optional.of(3L), - Optional.of(QueryBuilders.matchAllQuery())); - XContentBuilder builder = XContentFactory.jsonBuilder(); - builder = input.toXContent(builder, null); - String json = Strings.toString(builder); + @Test + public void testXContentFullObject() throws Exception { + AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), + Arrays.asList(AggregationBuilders.max("max").field("field"), + AggregationBuilders.min("min").field("field")), + "@timestamp", 0L, 10L, 1L, 2, Optional.of(3L), + Optional.of(QueryBuilders.matchAllQuery())); + XContentBuilder builder = XContentFactory.jsonBuilder(); + builder = input.toXContent(builder, null); + String json = org.opensearch.common.Strings.toString(builder); - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), null, json); - parser.nextToken(); - AnomalyLocalizationInput newInput = AnomalyLocalizationInput.parse(parser); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), null, json); + parser.nextToken(); + AnomalyLocalizationInput newInput = AnomalyLocalizationInput.parse(parser); - assertEquals(input, newInput); - } + assertEquals(input, newInput); + } - @Test - public void testXContentMissingAnomalyStartFilter() throws Exception { - AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), Arrays.asList(AggregationBuilders.max("max").field("field")), - "@timestamp", 0L, 10L, 1L, 2, Optional.empty(), Optional.empty()); - XContentBuilder builder = XContentFactory.jsonBuilder(); - builder = input.toXContent(builder, null); - String json = Strings.toString(builder); + @Test + public void testXContentMissingAnomalyStartFilter() throws Exception { + AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), + Arrays.asList(AggregationBuilders.max("max").field("field")), + "@timestamp", 0L, 10L, 1L, 2, Optional.empty(), Optional.empty()); + XContentBuilder builder = XContentFactory.jsonBuilder(); + builder = input.toXContent(builder, null); + String json = org.opensearch.common.Strings.toString(builder); - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), null, json); - parser.nextToken(); - AnomalyLocalizationInput newInput = AnomalyLocalizationInput.parse(parser); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), null, json); + parser.nextToken(); + AnomalyLocalizationInput newInput = AnomalyLocalizationInput.parse(parser); - assertEquals(input, newInput); - } + assertEquals(input, newInput); + } - @Test - public void testWriteable() throws Exception { - AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), Arrays.asList(AggregationBuilders.max("max").field("field"), - AggregationBuilders.min("min").field("field")), "@timestamp", 0L, 10L, 1L, 2, Optional.of(3L), - Optional.of(QueryBuilders.matchAllQuery())); + @Test + public void testWriteable() throws Exception { + AnomalyLocalizationInput input = new AnomalyLocalizationInput("indexName", Arrays.asList("attribute"), + Arrays.asList(AggregationBuilders.max("max").field("field"), + AggregationBuilders.min("min").field("field")), + "@timestamp", 0L, 10L, 1L, 2, Optional.of(3L), + Optional.of(QueryBuilders.matchAllQuery())); - BytesStreamOutput out = new BytesStreamOutput(); - input.writeTo(out); - StreamInput in = new NamedWriteableAwareStreamInput(out.bytes().streamInput(), - new NamedWriteableRegistry(new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedWriteables())); - AnomalyLocalizationInput newInput = new AnomalyLocalizationInput(in); + BytesStreamOutput out = new BytesStreamOutput(); + input.writeTo(out); + StreamInput in = new NamedWriteableAwareStreamInput(out.bytes().streamInput(), + new NamedWriteableRegistry(new SearchModule(Settings.EMPTY, Collections.emptyList()) + .getNamedWriteables())); + AnomalyLocalizationInput newInput = new AnomalyLocalizationInput(in); - assertEquals(input, newInput); - } + assertEquals(input, newInput); + } } diff --git a/common/src/test/java/org/opensearch/ml/common/input/nlp/TextDocsMLInputTest.java b/common/src/test/java/org/opensearch/ml/common/input/nlp/TextDocsMLInputTest.java index 10176140b6..2a097e2047 100644 --- a/common/src/test/java/org/opensearch/ml/common/input/nlp/TextDocsMLInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/input/nlp/TextDocsMLInputTest.java @@ -4,7 +4,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -38,8 +38,10 @@ public class TextDocsMLInputTest { @Before public void setUp() throws Exception { - ModelResultFilter resultFilter = ModelResultFilter.builder().returnBytes(true).returnNumber(true).targetResponse(Arrays.asList("field1")).targetResponsePositions(Arrays.asList(2)).build(); - MLInputDataset inputDataset = TextDocsInputDataSet.builder().docs(Arrays.asList("doc1", "doc2")).resultFilter(resultFilter).build(); + ModelResultFilter resultFilter = ModelResultFilter.builder().returnBytes(true).returnNumber(true) + .targetResponse(Arrays.asList("field1")).targetResponsePositions(Arrays.asList(2)).build(); + MLInputDataset inputDataset = TextDocsInputDataSet.builder().docs(Arrays.asList("doc1", "doc2")) + .resultFilter(resultFilter).build(); input = new TextDocsMLInput(algorithm, inputDataset); } @@ -47,7 +49,7 @@ public void setUp() throws Exception { public void parseTextDocsMLInput() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); input.toXContent(builder, ToXContent.EMPTY_PARAMS); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); System.out.println(jsonStr); parseMLInput(jsonStr); } @@ -65,8 +67,9 @@ public void parseTextDocsMLInput_NewWay() throws IOException { } private void parseMLInput(String jsonStr) throws IOException { - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), null, jsonStr); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), null, jsonStr); parser.nextToken(); MLInput parsedInput = MLInput.parse(parser, input.getFunctionName().name()); diff --git a/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java b/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java index 99d1c71605..00a6d94e8f 100644 --- a/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/output/MLPredictionOutputTest.java @@ -7,7 +7,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.xcontent.XContentFactory; @@ -31,12 +31,13 @@ public class MLPredictionOutputTest { MLPredictionOutput output; + @Before public void setUp() { - ColumnMeta[] columnMetas = new ColumnMeta[]{new ColumnMeta("test", ColumnType.INTEGER)}; + ColumnMeta[] columnMetas = new ColumnMeta[] { new ColumnMeta("test", ColumnType.INTEGER) }; List rows = new ArrayList<>(); - rows.add(new Row(new ColumnValue[]{new IntValue(1)})); - rows.add(new Row(new ColumnValue[]{new IntValue(2)})); + rows.add(new Row(new ColumnValue[] { new IntValue(1) })); + rows.add(new Row(new ColumnValue[] { new IntValue(2) })); DataFrame dataFrame = new DefaultDataFrame(columnMetas, rows); output = MLPredictionOutput.builder() .taskId("test_task_id") @@ -44,11 +45,12 @@ public void setUp() { .predictionResult(dataFrame) .build(); } + @Test public void toXContent() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); output.toXContent(builder, ToXContent.EMPTY_PARAMS); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"task_id\":\"test_task_id\",\"status\":\"test_status\",\"prediction_result\":" + "{\"column_metas\":[{\"name\":\"test\",\"column_type\":\"INTEGER\"}],\"rows\":[{\"values\":" + "[{\"column_type\":\"INTEGER\",\"value\":1}]},{\"values\":[{\"column_type\":\"INTEGER\"," + @@ -60,7 +62,7 @@ public void toXContent_EmptyOutput() throws IOException { MLPredictionOutput output = MLPredictionOutput.builder().build(); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); output.toXContent(builder, ToXContent.EMPTY_PARAMS); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{}", jsonStr); } @@ -90,7 +92,7 @@ private void readInputStream(MLPredictionOutput output) throws IOException { assertEquals(output.predictionResult, parsedOutput.getPredictionResult()); } else { assertEquals(output.predictionResult.size(), parsedOutput.getPredictionResult().size()); - for (int i = 0 ;i responseList = new ArrayList<>(); @@ -56,8 +55,7 @@ public void testToXContent() throws IOException { new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Collections.emptyMap(), Collections.singleton(CLUSTER_MANAGER_ROLE), - Version.CURRENT - ); + Version.CURRENT); Map modelToDeployStatus1 = new HashMap<>(); modelToDeployStatus1.put("modelName:version1", "response"); nodes.add(new MLDeployModelNodeResponse(node1, modelToDeployStatus1)); @@ -68,8 +66,7 @@ public void testToXContent() throws IOException { new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Collections.emptyMap(), Collections.singleton(CLUSTER_MANAGER_ROLE), - Version.CURRENT - ); + Version.CURRENT); Map modelToDeployStatus2 = new HashMap<>(); modelToDeployStatus2.put("modelName:version2", "response"); nodes.add(new MLDeployModelNodeResponse(node2, modelToDeployStatus2)); @@ -78,10 +75,9 @@ public void testToXContent() throws IOException { MLDeployModelNodesResponse response = new MLDeployModelNodesResponse(clusterName, nodes, failures); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals( "{\"foo1\":{\"stats\":{\"modelName:version1\":\"response\"}},\"foo2\":{\"stats\":{\"modelName:version2\":\"response\"}}}", - jsonStr - ); + jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponseTest.java index 90d11d3421..b9afc837a2 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/deploy/MLDeployModelResponseTest.java @@ -2,7 +2,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -46,7 +46,7 @@ public void testToXContent() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); // Verify the results assertEquals("{\"task_id\":\"test_id\"," + "\"status\":\"test\"}", jsonStr); diff --git a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java index 1fe6602f32..a35cd3ab73 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/forward/MLForwardResponseTest.java @@ -5,7 +5,7 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import org.opensearch.action.ActionResponse; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; @@ -32,9 +32,11 @@ public class MLForwardResponseTest { @Before public void setUp() throws Exception { status = "test"; - DataFrame dataFrame = DataFrameBuilder.load(Collections.singletonList(new HashMap() {{ - put("key1", 2.0D); - }})); + DataFrame dataFrame = DataFrameBuilder.load(Collections.singletonList(new HashMap() { + { + put("key1", 2.0D); + } + })); predictionOutput = MLPredictionOutput.builder() .status("Success") .predictionResult(dataFrame) @@ -63,9 +65,11 @@ public void testToXContent() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); // Verify the results - assertEquals("{\"result\":{\"task_id\":\"taskId\",\"status\":\"Success\",\"prediction_result\":{\"column_metas\":[{\"name\":\"key1\",\"column_type\":\"DOUBLE\"}],\"rows\":[{\"values\":[{\"column_type\":\"DOUBLE\",\"value\":2.0}]}]}}}", jsonStr); + assertEquals( + "{\"result\":{\"task_id\":\"taskId\",\"status\":\"Success\",\"prediction_result\":{\"column_metas\":[{\"name\":\"key1\",\"column_type\":\"DOUBLE\"}],\"rows\":[{\"values\":[{\"column_type\":\"DOUBLE\",\"value\":2.0}]}]}}}", + jsonStr); } @Test diff --git a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java index 262dbbd7f2..29df2a7740 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/model/MLModelGetResponseTest.java @@ -7,7 +7,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -58,11 +58,12 @@ public void toXContentTest() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); mlModelGetResponse.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"name\":\"model\"," + "\"algorithm\":\"KMEANS\"," + "\"model_version\":\"1.0.0\"," + "\"model_content\":\"content\"," + - "\"user\":{\"name\":\"\",\"backend_roles\":[],\"roles\":[],\"custom_attribute_names\":[],\"user_requested_tenant\":null},\"model_state\":\"TRAINED\"}", jsonStr); + "\"user\":{\"name\":\"\",\"backend_roles\":[],\"roles\":[],\"custom_attribute_names\":[],\"user_requested_tenant\":null},\"model_state\":\"TRAINED\"}", + jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java index 365a86b9fc..bb2948cc70 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/prediction/MLPredictionTaskResponseTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.opensearch.action.ActionResponse; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; @@ -32,9 +32,11 @@ public void writeTo_Success() throws IOException { MLPredictionOutput output = MLPredictionOutput.builder() .taskId("taskId") .status("Success") - .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() {{ - put("key1", 2.0D); - }}))) + .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() { + { + put("key1", 2.0D); + } + }))) .build(); MLTaskResponse response = MLTaskResponse.builder() .output(output) @@ -42,7 +44,7 @@ public void writeTo_Success() throws IOException { BytesStreamOutput bytesStreamOutput = new BytesStreamOutput(); response.writeTo(bytesStreamOutput); response = new MLTaskResponse(bytesStreamOutput.bytes().streamInput()); - MLPredictionOutput mlPredictionOutput = (MLPredictionOutput)response.getOutput(); + MLPredictionOutput mlPredictionOutput = (MLPredictionOutput) response.getOutput(); assertEquals("taskId", mlPredictionOutput.getTaskId()); assertEquals("Success", mlPredictionOutput.getStatus()); assertEquals(1, mlPredictionOutput.getPredictionResult().size()); @@ -53,9 +55,11 @@ public void fromActionResponse_WithMLPredictionTaskResponse() { MLPredictionOutput output = MLPredictionOutput.builder() .taskId("taskId") .status("Success") - .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() {{ - put("key1", 2.0D); - }}))) + .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() { + { + put("key1", 2.0D); + } + }))) .build(); MLTaskResponse response = MLTaskResponse.builder() .output(output) @@ -68,9 +72,11 @@ public void fromActionResponse_WithNonMLPredictionTaskResponse() { MLPredictionOutput output = MLPredictionOutput.builder() .taskId("taskId") .status("Success") - .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() {{ - put("key1", 2.0D); - }}))) + .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() { + { + put("key1", 2.0D); + } + }))) .build(); MLTaskResponse response = MLTaskResponse.builder() .output(output) @@ -88,7 +94,8 @@ public void writeTo(StreamOutput out) throws IOException { MLPredictionOutput resultMlPredictionOutput = (MLPredictionOutput) result.getOutput(); assertEquals(mlPredictionOutput.getTaskId(), resultMlPredictionOutput.getTaskId()); assertEquals(mlPredictionOutput.getStatus(), resultMlPredictionOutput.getStatus()); - assertEquals(mlPredictionOutput.getPredictionResult().size(), resultMlPredictionOutput.getPredictionResult().size()); + assertEquals(mlPredictionOutput.getPredictionResult().size(), + resultMlPredictionOutput.getPredictionResult().size()); } @Test(expected = UncheckedIOException.class) @@ -100,7 +107,6 @@ public void writeTo(StreamOutput out) throws IOException { } }; - MLTaskResponse.fromActionResponse(actionResponse); } @@ -109,22 +115,24 @@ public void toXContentTest() throws IOException { MLPredictionOutput output = MLPredictionOutput.builder() .taskId("b5009b99-268f-476d-a676-379a30f82457") .status("Success") - .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() {{ - put("ClusterID", 0); - }}))) + .predictionResult(DataFrameBuilder.load(Collections.singletonList(new HashMap() { + { + put("ClusterID", 0); + } + }))) .build(); MLTaskResponse response = MLTaskResponse.builder() - .output(output) - .build(); + .output(output) + .build(); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"task_id\":\"b5009b99-268f-476d-a676-379a30f82457\"," + - "\"status\":\"Success\"," + - "\"prediction_result\":{" + - "\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}]," + - "\"rows\":[{\"values\":[{\"column_type\":\"INTEGER\",\"value\":0}]}]}}", jsonStr); + "\"status\":\"Success\"," + + "\"prediction_result\":{" + + "\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}]," + + "\"rows\":[{\"values\":[{\"column_type\":\"INTEGER\",\"value\":0}]}]}}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java index 0116d6d23b..7f4611c267 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelInputTest.java @@ -8,7 +8,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; @@ -40,8 +40,10 @@ public class MLRegisterModelInputTest { @Rule public ExpectedException exceptionRule = ExpectedException.none(); - private final String expectedInputStr = "{\"function_name\":\"LINEAR_REGRESSION\",\"name\":\"modelName\",\"version\":\"version\",\"url\":\"url\",\"model_format\":\"ONNX\"," + - "\"model_config\":{\"model_type\":\"testModelType\",\"embedding_dimension\":100,\"framework_type\":\"SENTENCE_TRANSFORMERS\"," + + private final String expectedInputStr = "{\"function_name\":\"LINEAR_REGRESSION\",\"name\":\"modelName\",\"version\":\"version\",\"url\":\"url\",\"model_format\":\"ONNX\"," + + + "\"model_config\":{\"model_type\":\"testModelType\",\"embedding_dimension\":100,\"framework_type\":\"SENTENCE_TRANSFORMERS\"," + + "\"all_config\":\"{\\\"field1\\\":\\\"value1\\\",\\\"field2\\\":\\\"value2\\\"}\"" + "},\"deploy_model\":true,\"model_node_ids\":[\"modelNodeIds\"]}"; private final FunctionName functionName = FunctionName.LINEAR_REGRESSION; @@ -66,7 +68,7 @@ public void setUp() throws Exception { .modelFormat(MLModelFormat.ONNX) .modelConfig(config) .deployModel(true) - .modelNodeIds(new String[]{"modelNodeIds" }) + .modelNodeIds(new String[] { "modelNodeIds" }) .build(); } @@ -135,11 +137,14 @@ public void constructor_SuccessWithMinimalSetup() { .modelConfig(config) .url(url) .build(); - // MLRegisterModelInput.functionName is set to FunctionName.TEXT_EMBEDDING if not explicitly passed, with no exception thrown + // MLRegisterModelInput.functionName is set to FunctionName.TEXT_EMBEDDING if + // not explicitly passed, with no exception thrown assertEquals(FunctionName.TEXT_EMBEDDING, input.getFunctionName()); - // MLRegisterModelInput.deployModel is set to false if not explicitly passed, with no exception thrown + // MLRegisterModelInput.deployModel is set to false if not explicitly passed, + // with no exception thrown assertFalse(input.isDeployModel()); - // MLRegisterModelInput.deployModel is set to null if not explicitly passed, with no exception thrown + // MLRegisterModelInput.deployModel is set to null if not explicitly passed, + // with no exception thrown assertNull(input.getModelNodeIds()); } @@ -148,14 +153,13 @@ public void testToXContent() throws Exception { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); input.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals(expectedInputStr, jsonStr); } @Test public void testToXContent_Incomplete() throws Exception { - String expectedIncompleteInputStr = - "{\"function_name\":\"LINEAR_REGRESSION\",\"name\":\"modelName\"," + + String expectedIncompleteInputStr = "{\"function_name\":\"LINEAR_REGRESSION\",\"name\":\"modelName\"," + "\"version\":\"version\",\"deploy_model\":true}"; input.setUrl(null); input.setModelConfig(null); @@ -164,7 +168,7 @@ public void testToXContent_Incomplete() throws Exception { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); input.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals(expectedIncompleteInputStr, jsonStr); } @@ -179,24 +183,30 @@ public void parse_WithModel() throws Exception { @Test public void parse_WithoutModel() throws Exception { - testParseFromJsonString( false, expectedInputStr, parsedInput -> { + testParseFromJsonString(false, expectedInputStr, parsedInput -> { assertFalse(parsedInput.isDeployModel()); assertEquals("modelName", parsedInput.getModelName()); assertEquals("version", parsedInput.getVersion()); }); } - private void testParseFromJsonString(String modelName, String version, Boolean deployModel, String expectedInputStr, Consumer verify) throws Exception { - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, expectedInputStr); + private void testParseFromJsonString(String modelName, String version, Boolean deployModel, String expectedInputStr, + Consumer verify) throws Exception { + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, + expectedInputStr); parser.nextToken(); MLRegisterModelInput parsedInput = MLRegisterModelInput.parse(parser, modelName, version, deployModel); verify.accept(parsedInput); } - private void testParseFromJsonString(Boolean deployModel,String expectedInputStr, Consumer verify) throws Exception { - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, expectedInputStr); + private void testParseFromJsonString(Boolean deployModel, String expectedInputStr, + Consumer verify) throws Exception { + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, + expectedInputStr); parser.nextToken(); MLRegisterModelInput parsedInput = MLRegisterModelInput.parse(parser, deployModel); verify.accept(parsedInput); @@ -210,7 +220,6 @@ public void readInputStream_Success() throws IOException { }); } - @Test public void readInputStream_SuccessWithNullFields() throws IOException { input.setModelFormat(null); @@ -221,7 +230,6 @@ public void readInputStream_SuccessWithNullFields() throws IOException { }); } - private void readInputStream(MLRegisterModelInput input, Consumer verify) throws IOException { BytesStreamOutput bytesStreamOutput = new BytesStreamOutput(); input.writeTo(bytesStreamOutput); diff --git a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponseTest.java index 6eefcd1fba..826e4b1ac5 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/register/MLRegisterModelResponseTest.java @@ -2,7 +2,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -46,7 +46,7 @@ public void testToXContent() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); // Verify the results assertEquals("{\"task_id\":\"test_id\"," + "\"status\":\"test\"}", jsonStr); diff --git a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponseTest.java index f8bfe61bf7..0bb334cb43 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/sync/MLSyncUpResponseTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -45,7 +45,7 @@ public void testToXContent() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); // Verify the results assertEquals("{\"status\":\"test\"}", jsonStr); } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetResponseTest.java index 10b2e0b07c..d464e862e5 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/task/MLTaskGetResponseTest.java @@ -2,7 +2,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -71,7 +71,7 @@ public void toXContentTest() throws IOException { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); mlTaskGetResponse.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals("{\"task_id\":\"id\"," + "\"model_id\":\"model id\"," + "\"task_type\":\"EXECUTION\"," + @@ -84,7 +84,8 @@ public void toXContentTest() throws IOException { "\"create_time\":123," + "\"last_update_time\":123," + "\"error\":\"error\"," + - "\"user\":{\"name\":\"\",\"backend_roles\":[],\"roles\":[],\"custom_attribute_names\":[],\"user_requested_tenant\":null}," + + "\"user\":{\"name\":\"\",\"backend_roles\":[],\"roles\":[],\"custom_attribute_names\":[],\"user_requested_tenant\":null}," + + "\"is_async\":true}", jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java index f1e6eee6c4..cdf52df4f4 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelInputTest.java @@ -2,7 +2,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; @@ -22,9 +22,9 @@ public class MLUndeployModelInputTest { private MLUndeployModelInput input; - private final String [] modelIds = new String [] {"modelId1","modelId2","modelId3"}; - private final String [] nodeIds = new String [] {"nodeId1","nodeId2","nodeId3"}; - private final String expectedInputStr = "{\"model_ids\":[\"modelId1\",\"modelId2\",\"modelId3\"]," + + private final String[] modelIds = new String[] { "modelId1", "modelId2", "modelId3" }; + private final String[] nodeIds = new String[] { "nodeId1", "nodeId2", "nodeId3" }; + private final String expectedInputStr = "{\"model_ids\":[\"modelId1\",\"modelId2\",\"modelId3\"]," + "\"node_ids\":[\"nodeId1\",\"nodeId2\",\"nodeId3\"]}"; @Before @@ -40,31 +40,35 @@ public void testToXContent() throws Exception { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); input.toXContent(builder, ToXContent.EMPTY_PARAMS); assertNotNull(builder); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals(expectedInputStr, jsonStr); } @Test public void testParse() throws Exception { - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, expectedInputStr); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, + expectedInputStr); parser.nextToken(); MLUndeployModelInput parsedInput = MLUndeployModelInput.parse(parser); - assertArrayEquals(new String [] {"modelId1","modelId2","modelId3"}, parsedInput.getModelIds()); - assertArrayEquals(new String [] {"nodeId1","nodeId2","nodeId3"}, parsedInput.getNodeIds()); + assertArrayEquals(new String[] { "modelId1", "modelId2", "modelId3" }, parsedInput.getModelIds()); + assertArrayEquals(new String[] { "nodeId1", "nodeId2", "nodeId3" }, parsedInput.getNodeIds()); } @Test public void testParseWithInvalidField() throws Exception { - String withInvalidFieldInputStr = "{\"void\":\"void\"," + + String withInvalidFieldInputStr = "{\"void\":\"void\"," + "\"model_ids\":[\"modelId1\",\"modelId2\",\"modelId3\"]," + "\"node_ids\":[\"nodeId1\",\"nodeId2\",\"nodeId3\"]}"; - XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, - Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, withInvalidFieldInputStr); + XContentParser parser = XContentType.JSON.xContent() + .createParser(new NamedXContentRegistry(new SearchModule(Settings.EMPTY, + Collections.emptyList()).getNamedXContents()), LoggingDeprecationHandler.INSTANCE, + withInvalidFieldInputStr); parser.nextToken(); MLUndeployModelInput parsedInput = MLUndeployModelInput.parse(parser); - assertArrayEquals(new String [] {"modelId1","modelId2","modelId3"}, parsedInput.getModelIds()); - assertArrayEquals(new String [] {"nodeId1","nodeId2","nodeId3"}, parsedInput.getNodeIds()); + assertArrayEquals(new String[] { "modelId1", "modelId2", "modelId3" }, parsedInput.getModelIds()); + assertArrayEquals(new String[] { "nodeId1", "nodeId2", "nodeId3" }, parsedInput.getNodeIds()); } @Test @@ -76,5 +80,4 @@ public void readInputStream() throws IOException { assertArrayEquals(input.getModelIds(), parsedInput.getModelIds()); assertArrayEquals(input.getNodeIds(), parsedInput.getNodeIds()); } - } - +} diff --git a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponseTest.java b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponseTest.java index 5a384f32df..a20fa951ce 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponseTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelNodesResponseTest.java @@ -9,7 +9,7 @@ import org.opensearch.action.FailedNodeException; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.xcontent.XContentFactory; @@ -42,16 +42,14 @@ public void setUp() throws Exception { new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Collections.emptyMap(), Collections.singleton(CLUSTER_MANAGER_ROLE), - Version.CURRENT - ); + Version.CURRENT); node2 = new DiscoveryNode( "foo2", "foo2", new TransportAddress(InetAddress.getLoopbackAddress(), 9300), Collections.emptyMap(), Collections.singleton(CLUSTER_MANAGER_ROLE), - Version.CURRENT - ); + Version.CURRENT); modelWorkerNodeCounts = new HashMap<>(); modelWorkerNodeCounts.put("modelId1", 1); } @@ -60,7 +58,8 @@ public void setUp() throws Exception { public void testSerializationDeserialization1() throws IOException { List responseList = new ArrayList<>(); List failuresList = new ArrayList<>(); - MLUndeployModelNodesResponse response = new MLUndeployModelNodesResponse(clusterName, responseList, failuresList); + MLUndeployModelNodesResponse response = new MLUndeployModelNodesResponse(clusterName, responseList, + failuresList); BytesStreamOutput output = new BytesStreamOutput(); response.writeTo(output); MLUndeployModelNodesResponse newResponse = new MLUndeployModelNodesResponse(output.bytes().streamInput()); @@ -87,10 +86,9 @@ public void testToXContent() throws IOException { MLUndeployModelNodesResponse response = new MLUndeployModelNodesResponse(clusterName, nodes, failures); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); response.toXContent(builder, ToXContent.EMPTY_PARAMS); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); assertEquals( "{\"foo1\":{\"stats\":{\"modelId1\":\"response\"}},\"foo2\":{\"stats\":{\"modelId2\":\"response\"}}}", - jsonStr - ); + jsonStr); } } diff --git a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java index c8206097e0..b6fbff0f73 100644 --- a/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java +++ b/common/src/test/java/org/opensearch/ml/common/transport/upload_chunk/MLUploadModelChunkInputTest.java @@ -7,7 +7,7 @@ import org.junit.Before; import org.junit.Test; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; @@ -90,11 +90,12 @@ public void testToXContent() throws IOException { public void testMLUploadModelChunkInputParser() throws IOException { XContentBuilder builder = XContentFactory.jsonBuilder(); builder = mlUploadModelChunkInput.toXContent(builder, null); - String json = Strings.toString(builder); + String json = org.opensearch.common.Strings.toString(builder); XContentParser parser = XContentType.JSON.xContent().createParser(new NamedXContentRegistry( new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents()), null, json); parser.nextToken(); - MLUploadModelChunkInput newMlUploadModelChunkInput = MLUploadModelChunkInput.parse(parser, new byte[] { 1, 3, 4 }); + MLUploadModelChunkInput newMlUploadModelChunkInput = MLUploadModelChunkInput.parse(parser, + new byte[] { 1, 3, 4 }); assertEquals(mlUploadModelChunkInput, newMlUploadModelChunkInput); } diff --git a/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java b/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java index 6dcfc1269b..7344c75e79 100644 --- a/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/cluster/DiscoveryNodeHelper.java @@ -18,8 +18,8 @@ import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.ml.common.CommonValue; import org.opensearch.ml.utils.MLNodeUtils; diff --git a/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java b/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java index 86c313bb15..a7f377a7cf 100644 --- a/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java +++ b/plugin/src/main/java/org/opensearch/ml/task/MLTaskManager.java @@ -30,9 +30,9 @@ import org.opensearch.action.update.UpdateRequest; import org.opensearch.action.update.UpdateResponse; import org.opensearch.client.Client; -import org.opensearch.common.Strings; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.MLTask; @@ -68,7 +68,7 @@ public class MLTaskManager { /** * Constructor to create ML task manager. * - * @param client client + * @param client client * @param mlIndicesHandler ML indices handler */ public MLTaskManager(Client client, ThreadPool threadPool, MLIndicesHandler mlIndicesHandler) { @@ -141,9 +141,11 @@ public void remove(String taskId) { MLTask mlTask = taskCache.getMlTask(); if (mlTask.getState() != MLTaskState.CREATED) { - // Task initial state is CREATED. It will move forward to RUNNING state once it starts on worker node. + // Task initial state is CREATED. It will move forward to RUNNING state once it + // starts on worker node. // When finished or failed, it's possible to move to COMPLETED/FAILED state. - // So if its state is not CREATED when remove it, the task already started on worker node, we should + // So if its state is not CREATED when remove it, the task already started on + // worker node, we should // decrement running task count. AtomicInteger runningTaskCount = runningTasksCount.get(mlTask.getTaskType()); if (runningTaskCount != null) { @@ -190,6 +192,7 @@ public void addNodeError(String taskId, String workerNodeId, String error) { /** * Get all taskIds from cache + * * @return an array of all the keys in the taskCaches */ public String[] getAllTaskIds() { @@ -221,7 +224,8 @@ public void clear() { /** * Create ML task. Will init ML task index first if absent. - * @param mlTask ML task + * + * @param mlTask ML task * @param listener action listener */ public void createMLTask(MLTask mlTask, ActionListener listener) { @@ -260,9 +264,11 @@ public void updateTaskStateAsRunning(String taskId, boolean isAsyncTask) { /** * Update ML task with default listener. - * @param taskId task id - * @param updatedFields updated field and values - * @param timeoutInMillis time out waiting for updating task semaphore, zero or negative means don't wait at all + * + * @param taskId task id + * @param updatedFields updated field and values + * @param timeoutInMillis time out waiting for updating task semaphore, zero or + * negative means don't wait at all * @param removeFromCache remove ML task from cache */ public void updateMLTask(String taskId, Map updatedFields, long timeoutInMillis, boolean removeFromCache) { @@ -278,10 +284,12 @@ public void updateMLTask(String taskId, Map updatedFields, long /** * Update ML task. - * @param taskId task id - * @param updatedFields updated field and values - * @param listener action listener - * @param timeoutInMillis time out waiting for updating task semaphore, zero or negative means don't wait at all + * + * @param taskId task id + * @param updatedFields updated field and values + * @param listener action listener + * @param timeoutInMillis time out waiting for updating task semaphore, zero or + * negative means don't wait at all * @param removeFromCache remove ML task from cache */ public void updateMLTask( diff --git a/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java b/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java index de2c713d5e..26b82f335c 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/MLExceptionUtils.java @@ -10,7 +10,6 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.logging.log4j.Logger; -import org.opensearch.common.Strings; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.exception.MLLimitExceededException; @@ -39,7 +38,7 @@ public static String toJsonString(Map nodeErrors) throws IOExcep builder.field(entry.getKey(), entry.getValue()); } builder.endObject(); - return Strings.toString(builder); + return org.opensearch.common.Strings.toString(builder); } public static void logException(String errorMessage, Exception e, Logger log) { diff --git a/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java b/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java index 5241874dcb..ff43a6739f 100644 --- a/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java +++ b/plugin/src/main/java/org/opensearch/ml/utils/RestActionUtils.java @@ -18,7 +18,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.Nullable; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; @@ -75,12 +75,16 @@ public static String getParameterId(RestRequest request, String idName) { } /** - * Checks to see if the request came from OpenSearch Dashboards, if so we want to return the UI Metadata from the document. - * If the request came from the client then we exclude the UI Metadata from the search result. + * Checks to see if the request came from OpenSearch Dashboards, if so we want + * to return the UI Metadata from the document. + * If the request came from the client then we exclude the UI Metadata from the + * search result. * - * @param request rest request - * @param searchSourceBuilder instance of searchSourceBuilder to fetch includes and excludes - * @return instance of {@link org.opensearch.search.fetch.subphase.FetchSourceContext} + * @param request rest request + * @param searchSourceBuilder instance of searchSourceBuilder to fetch includes + * and excludes + * @return instance of + * {@link org.opensearch.search.fetch.subphase.FetchSourceContext} */ public static FetchSourceContext getSourceContext(RestRequest request, SearchSourceBuilder searchSourceBuilder) { String userAgent = coalesceToEmpty(request.header("User-Agent")); @@ -106,7 +110,8 @@ public static FetchSourceContext getSourceContext(RestRequest request, SearchSou return new FetchSourceContext(true, includes, excludes); } } else { - // When user does not set the _source field in search model api request, searchSourceBuilder.fetchSource becomes null + // When user does not set the _source field in search model api request, + // searchSourceBuilder.fetchSource becomes null String[] excludes = new String[] { OLD_MODEL_CONTENT_FIELD, MODEL_CONTENT_FIELD }; if (!userAgent.contains(OPENSEARCH_DASHBOARDS_USER_AGENT)) { return new FetchSourceContext(true, Strings.EMPTY_ARRAY, ArrayUtils.add(excludes, "ui_metadata")); @@ -118,6 +123,7 @@ public static FetchSourceContext getSourceContext(RestRequest request, SearchSou /** * Return FetchSourceContext + * * @param returnModelContent if the model content should be returned */ public static FetchSourceContext getFetchSourceContext(boolean returnModelContent) { @@ -129,6 +135,7 @@ public static FetchSourceContext getFetchSourceContext(boolean returnModelConten /** * Return all nodes in the cluster + * * @param clusterService the cluster service */ public static String[] getAllNodes(ClusterService clusterService) { @@ -142,10 +149,10 @@ public static String[] getAllNodes(ClusterService clusterService) { /** * - * @param channel RestChannel - * @param status RestStatus enums + * @param channel RestChannel + * @param status RestStatus enums * @param errorMessage Error messages - * @param exception Reported Exception + * @param exception Reported Exception */ public static void onFailure(RestChannel channel, RestStatus status, String errorMessage, Exception exception) { BytesRestResponse bytesRestResponse; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java index 2e22c56255..b52f33d58e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteModelActionTests.java @@ -21,8 +21,8 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.delete.DeleteResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelDeleteAction; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java index 4c5d3c90d0..c6b8745a86 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeleteTaskActionTests.java @@ -21,8 +21,8 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.delete.DeleteResponse; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.task.MLTaskDeleteAction; import org.opensearch.ml.common.transport.task.MLTaskDeleteRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java index b13e6a224f..631dac8b79 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLDeployModelActionTests.java @@ -17,10 +17,10 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.deploy.MLDeployModelAction; import org.opensearch.ml.common.transport.deploy.MLDeployModelRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java index 156139b2eb..0580ba9723 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLExecuteActionTests.java @@ -22,8 +22,8 @@ import org.mockito.MockitoAnnotations; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.input.Input; import org.opensearch.ml.common.transport.execute.MLExecuteTaskAction; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java index 3738fb85f3..f951f6b92d 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetModelActionTests.java @@ -22,8 +22,8 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetAction; import org.opensearch.ml.common.transport.model.MLModelGetRequest; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java index 41c742ef02..365e7e3f18 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLGetTaskActionTests.java @@ -20,8 +20,8 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.task.*; import org.opensearch.rest.RestChannel; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java index 0c8361d897..2932ca00bb 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLPredictionActionTests.java @@ -25,8 +25,8 @@ import org.mockito.MockitoAnnotations; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.ml.common.FunctionName; import org.opensearch.ml.common.MLModel; import org.opensearch.ml.common.input.MLInput; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLProfileActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLProfileActionTests.java index e8306e4535..795784f227 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLProfileActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLProfileActionTests.java @@ -39,11 +39,11 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.commons.authuser.User; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.action.profile.MLProfileAction; import org.opensearch.ml.action.profile.MLProfileNodeResponse; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java index 4e5f9f20d1..1e71fab701 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelActionTests.java @@ -19,10 +19,10 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.register.MLRegisterModelAction; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java index e431d3a22c..503e09f2b9 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRegisterModelMetaActionTests.java @@ -22,10 +22,10 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.upload_chunk.MLRegisterModelMetaAction; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java index c2f42e2393..baf254f9e6 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchModelActionTests.java @@ -30,9 +30,9 @@ import org.opensearch.action.search.SearchResponseSections; import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.ml.common.transport.model.MLModelSearchAction; import org.opensearch.ml.utils.TestHelper; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java index df030118b1..58713cb277 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLSearchTaskActionTests.java @@ -9,7 +9,7 @@ import org.hamcrest.Matchers; import org.junit.Before; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.test.OpenSearchTestCase; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainAndPredictActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainAndPredictActionTests.java index ee0857b41f..ef2c9a3f38 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainAndPredictActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainAndPredictActionTests.java @@ -22,8 +22,8 @@ import org.mockito.MockitoAnnotations; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.output.MLTrainingOutput; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainingActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainingActionTests.java index a2b11aaa21..f795f7117e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainingActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLTrainingActionTests.java @@ -25,8 +25,8 @@ import org.mockito.MockitoAnnotations; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.ml.common.MLTaskState; import org.opensearch.ml.common.input.MLInput; import org.opensearch.ml.common.output.MLTrainingOutput; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java index 55fcb69006..51c391e320 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUndeployModelActionTests.java @@ -23,10 +23,10 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.undeploy.MLUndeployModelAction; diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java index c3f227789c..307175a352 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLUploadModelChunkActionTests.java @@ -19,9 +19,9 @@ import org.mockito.Mock; import org.opensearch.action.ActionListener; import org.opensearch.client.node.NodeClient; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.ml.common.transport.model.MLModelGetResponse; import org.opensearch.ml.common.transport.upload_chunk.MLUploadModelChunkAction; diff --git a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java index 6979f5b788..9476fec766 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java @@ -22,7 +22,6 @@ import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.support.WriteRequest; -import org.opensearch.common.Strings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; @@ -117,9 +116,11 @@ public static SearchSourceBuilder generateSearchSourceBuilder() { } /** - * Train model and return model id if not async request or task id for async request. + * Train model and return model id if not async request or task id for async + * request. + * * @param inputDataset input data set - * @param async async request or not + * @param async async request or not * @return model id for sync request or task id for async request. */ public static String trainModel(MLInputDataset inputDataset, boolean async) { @@ -141,7 +142,8 @@ public static String trainModel(MLInputDataset inputDataset, boolean async) { return id; } - // Wait a while (20 seconds at most) for the model to be available in the ml index. + // Wait a while (20 seconds at most) for the model to be available in the ml + // index. public static SearchResponse waitModelAvailable1(String taskId) throws InterruptedException { SearchSourceBuilder modelSearchSourceBuilder = new SearchSourceBuilder(); QueryBuilder queryBuilder = QueryBuilders.termQuery("taskId", taskId); @@ -194,7 +196,7 @@ public static void predictAndVerifyResult(String taskId, MLInputDataset inputDat MLPredictionOutput mlPredictionOutput = (MLPredictionOutput) predictionResponse.getOutput(); mlPredictionOutput.getPredictionResult().toXContent(builder, ToXContent.EMPTY_PARAMS); builder.endObject(); - String jsonStr = Strings.toString(builder); + String jsonStr = org.opensearch.common.Strings.toString(builder); String expectedStr1 = "{\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}]," + "\"rows\":[{\"values\":[{\"column_type\":\"INTEGER\",\"value\":0}]}]}"; String expectedStr2 = "{\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}],"