Skip to content

Commit 5ead833

Browse files
authored
HPCC4J-502 Update RDF2HPCC deps (hpcc-systems#601)
* HPCC4J-502 Update RDF2HPCC deps - Updates wsclient dep to cve patched version - Updates target java version - Updates wsclient API references Signed-off-by: Rodrigo Pastrana <[email protected]> * HPCC4J-502 Update RDF2HPCC deps - Updates wsclient dep to cve patched version - Updates target java version - Updates wsclient API references - Does not set query limits Signed-off-by: Rodrigo Pastrana <[email protected]> --------- Signed-off-by: Rodrigo Pastrana <[email protected]>
1 parent a64ce41 commit 5ead833

File tree

2 files changed

+22
-36
lines changed

2 files changed

+22
-36
lines changed

rdf2hpcc/pom.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>org.hpccsystems</groupId>
44
<artifactId>rdf2hpcc</artifactId>
55
<packaging>jar</packaging>
6-
<version>1.0.2-SNAPSHOT</version>
6+
<version>1.0.4-SNAPSHOT</version>
77
<name>RDF Data Ingestion into HPCC</name>
88
<description>This project allows a user to import RDF data into an easily ingestible format for HPCC</description>
99
<url>https://hpccsystems.com</url>
@@ -16,6 +16,8 @@
1616
</licenses>
1717
<properties>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<maven.compiler.source>11</maven.compiler.source>
20+
<maven.compiler.target>11</maven.compiler.target>
1921
</properties>
2022
<scm>
2123
<connection>scm:git:https://github.com/hpcc-systems/hpcc4j.git</connection>
@@ -72,7 +74,7 @@
7274
<dependency>
7375
<groupId>org.hpccsystems</groupId>
7476
<artifactId>wsclient</artifactId>
75-
<version>1.0.0</version>
77+
<version>8.12.0-1</version>
7678
</dependency>
7779
<dependency>
7880
<groupId>org.apache.jena</groupId>

rdf2hpcc/src/main/java/org/hpccsystems/rdf/rdf2hpcc/RDFHPCCWsClient.java

+18-34
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212
import java.util.List;
1313
import java.util.Map;
1414

15-
import org.hpccsystems.ws.client.gen.ecldirect.v1_0.ArrayOfEspException;
16-
import org.hpccsystems.ws.client.gen.ecldirect.v1_0.EspException;
17-
import org.hpccsystems.ws.client.gen.filespray.v1_13.DropZone;
18-
import org.hpccsystems.ws.client.gen.filespray.v1_13.PhysicalFileStruct;
19-
import org.hpccsystems.ws.client.HPCCECLDirectClient;
2015
import org.hpccsystems.ws.client.HPCCFileSprayClient;
2116
import org.hpccsystems.ws.client.HPCCWsClient;
2217
import org.hpccsystems.ws.client.HPCCWsFileIOClient;
23-
import org.hpccsystems.ws.client.platform.WorkunitInfo;
18+
import org.hpccsystems.ws.client.HPCCWsWorkUnitsClient;
19+
import org.hpccsystems.ws.client.gen.axis2.filespray.latest.DropZone;
20+
import org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.*;
21+
import java.lang.String;
2422
import org.hpccsystems.ws.client.utils.DataSingletonCollection;
2523
import org.hpccsystems.ws.client.utils.Connection;
2624
import org.hpccsystems.ws.client.utils.Utils;
25+
import org.hpccsystems.ws.client.wrappers.gen.filespray.DropZoneWrapper;
26+
import org.hpccsystems.ws.client.wrappers.gen.filespray.PhysicalFileStructWrapper;
27+
import org.hpccsystems.ws.client.wrappers.wsworkunits.WorkunitWrapper;
2728
import org.apache.jena.riot.*;
2829
import org.apache.jena.graph.Node;
2930
import org.apache.jena.ttl.turtle.parser.ParseException;
@@ -440,31 +441,21 @@ public String getRDFStats()
440441

441442
try
442443
{
443-
if(eclstatsfile != null)
444+
if(eclstatsfile != null)
444445
{
445446
eclstats = new String(Files.readAllBytes(Paths.get(eclstatsfile)), Charset.defaultCharset());
446447
} else
447448
{
448449
eclstats = STATSECL;
449450
}
450451

451-
HPCCECLDirectClient declient = getEclDirectClient();
452-
WorkunitInfo wu = new WorkunitInfo();
452+
HPCCWsWorkUnitsClient wuClient = getWsWorkunitsClient();
453+
WorkunitWrapper wu = new WorkunitWrapper();
453454
wu.setECL(eclstats + "\n output(RdfTypeStats('~" + targetHPCCFilePath + "'));");
454455
wu.setCluster(targetECLCluster);
455-
wu.setResultLimit(HPCCECLDirectClient.noresultlimit);
456456
wu.setMaxMonitorMillis(eclmaxwaitMS);
457457

458-
eclreturn = declient.submitECLandGetResults(wu );
459-
}
460-
catch (ArrayOfEspException e)
461-
{
462-
Utils.println(System.out, "Error while submiting ecl: ", false, verbosemode);
463-
EspException[] espExceptions = e.getException();
464-
for (EspException espException : espExceptions)
465-
{
466-
Utils.println(System.out, espException.getMessage(), false, verbosemode);
467-
}
458+
eclreturn = wuClient.createAndRunWUFromECLAndGetResults(wu);
468459
}
469460
catch (IOException e)
470461
{
@@ -775,20 +766,21 @@ private boolean setDropZoneInfo() throws Exception
775766

776767
try
777768
{
778-
DropZone[] dropZones = fsclient.fetchLocalDropZones();
769+
List<DropZoneWrapper> dropZones = fsclient.fetchLocalDropZones();
779770

780-
if (dropZones.length > 0)
771+
if (dropZones.size() > 0)
781772
{
782-
targetDropzoneNetAddress = dropZones[0].getNetAddress();
783-
targetHPCCDropzonePath = dropZones[0].getPath();
773+
DropZoneWrapper thisDZ = dropZones.get(0);
774+
targetDropzoneNetAddress = thisDZ.getNetAddress();
775+
targetHPCCDropzonePath = thisDZ.getPath();
784776
Utils.println(System.out, "Found dropzone net address: " + targetDropzoneNetAddress, false, verbosemode);
785777
Utils.println(System.out, "Found dropzone path: " + targetHPCCDropzonePath, false, verbosemode);
786778

787779
try
788780
{
789-
PhysicalFileStruct[] files = fsclient.listFiles(targetDropzoneNetAddress, targetHPCCDropzonePath, null);
781+
List<PhysicalFileStructWrapper> files = fsclient.listFiles(targetDropzoneNetAddress, targetHPCCDropzonePath, null);
790782
Utils.println(System.out, "Existing Dropzone files:", true, verbosemode);
791-
for (PhysicalFileStruct file : files)
783+
for (PhysicalFileStructWrapper file : files)
792784
{
793785
Utils.println(System.out, "\t" + file.getName() +"-"+ file.getFilesize(), true, verbosemode);
794786
}
@@ -800,14 +792,6 @@ private boolean setDropZoneInfo() throws Exception
800792
success = true;
801793
}
802794
}
803-
catch (org.hpccsystems.ws.client.gen.filespray.v1_06.ArrayOfEspException e1)
804-
{
805-
Utils.println(System.out, "ERROR: Attempting to fetch HPCC dropzone Info:", false, verbosemode);
806-
for (org.hpccsystems.ws.client.gen.filespray.v1_06.EspException exception : e1.getException())
807-
{
808-
Utils.println(System.out, "\t"+exception.getMessage(), false, verbosemode);
809-
}
810-
}
811795
catch (RemoteException e1)
812796
{
813797
Utils.println(System.out, "ERROR:\tAttempting to fetch HPCC dropzone Info:", false, verbosemode);

0 commit comments

Comments
 (0)