|
89 | 89 | import org.hpccsystems.ws.client.wrappers.gen.filespray.ProgressResponseWrapper; |
90 | 90 | import org.w3c.dom.Document; |
91 | 91 |
|
| 92 | +import io.opentelemetry.instrumentation.annotations.SpanAttribute; |
| 93 | +import io.opentelemetry.instrumentation.annotations.WithSpan; |
| 94 | + |
92 | 95 | /** |
93 | 96 | * Facilitates File Spray related activities. |
94 | 97 | * This includes listing available dropzones, uploading files to dropzone, listing files in a dropzone, |
@@ -356,7 +359,6 @@ private void initWsFileSprayStub(Connection connection) |
356 | 359 | { |
357 | 360 | initErrMessage += "\nCould not initialize FileSprayStub - Review all HPCC connection values"; |
358 | 361 | } |
359 | | - |
360 | 362 | } |
361 | 363 |
|
362 | 364 | /** |
@@ -421,6 +423,7 @@ public void setFileUploadReadBufferLength(int length) |
421 | 423 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
422 | 424 | * the array of esp exception wrapper |
423 | 425 | */ |
| 426 | + @WithSpan |
424 | 427 | public boolean handleSprayResponse(ProgressResponseWrapper progressResponseWrapper, int maxRetries, int milliesBetweenRetry) |
425 | 428 | throws Exception, org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
426 | 429 | { |
@@ -560,7 +563,8 @@ public List<DropZoneWrapper> fetchLocalDropZones() throws Exception, ArrayOfEspE |
560 | 563 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
561 | 564 | * the array of esp exception wrapper |
562 | 565 | */ |
563 | | - public List<DropZoneWrapper> fetchDropZones(String dropzoneNetAddress) throws Exception, ArrayOfEspExceptionWrapper |
| 566 | + @WithSpan |
| 567 | + public List<DropZoneWrapper> fetchDropZones(@SpanAttribute String dropzoneNetAddress) throws Exception, ArrayOfEspExceptionWrapper |
564 | 568 | { |
565 | 569 | verifyStub(); |
566 | 570 |
|
@@ -621,7 +625,8 @@ public List<DropZoneWrapper> fetchDropZones(String dropzoneNetAddress) throws Ex |
621 | 625 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
622 | 626 | * the array of esp exception wrapper |
623 | 627 | */ |
624 | | - public String copyFile(String from, String to, boolean overwrite) throws Exception, ArrayOfEspExceptionWrapper |
| 628 | + @WithSpan |
| 629 | + public String copyFile(@SpanAttribute String from, @SpanAttribute String to, @SpanAttribute boolean overwrite) throws Exception, ArrayOfEspExceptionWrapper |
625 | 630 | { |
626 | 631 | verifyStub(); |
627 | 632 | Copy cp = new Copy(); |
@@ -671,7 +676,8 @@ public String copyFile(String from, String to, boolean overwrite) throws Excepti |
671 | 676 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
672 | 677 | * the array of esp exception wrapper |
673 | 678 | */ |
674 | | - public DropZoneFilesResponseWrapper fetchDropZones(String dzname, String netaddress, String os, String path, String subfolder, boolean dironly, |
| 679 | + @WithSpan |
| 680 | + public DropZoneFilesResponseWrapper fetchDropZones(@SpanAttribute String dzname, @SpanAttribute String netaddress, @SpanAttribute String os, @SpanAttribute String path, String subfolder, boolean dironly, |
675 | 681 | boolean watchvisibleonely) throws Exception, ArrayOfEspExceptionWrapper |
676 | 682 | { |
677 | 683 | verifyStub(); |
@@ -699,6 +705,7 @@ public DropZoneFilesResponseWrapper fetchDropZones(String dzname, String netaddr |
699 | 705 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
700 | 706 | * the array of esp exception wrapper |
701 | 707 | */ |
| 708 | + @WithSpan |
702 | 709 | public DropZoneFilesResponseWrapper fetchDropZones(DropZoneFilesRequestWrapper szrequest) throws Exception, ArrayOfEspExceptionWrapper |
703 | 710 | { |
704 | 711 | if (szrequest == null) throw new Exception("DropZoneFilesRequestWrapper null detected"); |
@@ -740,7 +747,8 @@ public DropZoneFilesResponseWrapper fetchDropZones(DropZoneFilesRequestWrapper s |
740 | 747 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
741 | 748 | * the array of esp exception wrapper |
742 | 749 | */ |
743 | | - public PhysicalFileStruct[] dzFileSearch(String dzname, String netaddr, String namefilter) throws Exception, ArrayOfEspExceptionWrapper |
| 750 | + @WithSpan |
| 751 | + public PhysicalFileStruct[] dzFileSearch(@SpanAttribute String dzname, @SpanAttribute String netaddr, @SpanAttribute String namefilter) throws Exception, ArrayOfEspExceptionWrapper |
744 | 752 | { |
745 | 753 | verifyStub(); |
746 | 754 |
|
@@ -788,7 +796,8 @@ public PhysicalFileStruct[] dzFileSearch(String dzname, String netaddr, String n |
788 | 796 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
789 | 797 | * the array of esp exception wrapper |
790 | 798 | */ |
791 | | - public List<PhysicalFileStructWrapper> listFiles(String netAddress, String path, String OS) throws Exception, ArrayOfEspExceptionWrapper |
| 799 | + @WithSpan |
| 800 | + public List<PhysicalFileStructWrapper> listFiles(@SpanAttribute String netAddress, @SpanAttribute String path, @SpanAttribute String OS) throws Exception, ArrayOfEspExceptionWrapper |
792 | 801 | { |
793 | 802 | verifyStub(); |
794 | 803 |
|
@@ -994,8 +1003,9 @@ public ProgressResponseWrapper sprayVariable(DelimitedDataOptions options, DropZ |
994 | 1003 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
995 | 1004 | * the array of esp exception wrapper |
996 | 1005 | */ |
997 | | - public ProgressResponseWrapper sprayVariable(DelimitedDataOptions options, DropZoneWrapper targetDropZone, String sourceFileName, |
998 | | - String targetFileName, String prefix, String destGroup, boolean overwrite, SprayVariableFormat format, Integer sourceMaxRecordSize, |
| 1006 | + @WithSpan |
| 1007 | + public ProgressResponseWrapper sprayVariable(@SpanAttribute DelimitedDataOptions options, @SpanAttribute DropZoneWrapper targetDropZone, @SpanAttribute String sourceFileName, |
| 1008 | + @SpanAttribute String targetFileName, String prefix, String destGroup, boolean overwrite, SprayVariableFormat format, Integer sourceMaxRecordSize, |
999 | 1009 | Integer maxConnections, Boolean compress, Boolean replicate, Boolean failIfNoSourceFile, Boolean recordStructurePresent, |
1000 | 1010 | Integer expireDays) throws Exception, ArrayOfEspExceptionWrapper |
1001 | 1011 | { |
@@ -1149,8 +1159,9 @@ public ProgressResponseWrapper sprayLocalXML(String sourceFileName, String targe |
1149 | 1159 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
1150 | 1160 | * the array of esp exception wrapper |
1151 | 1161 | */ |
1152 | | - public ProgressResponseWrapper sprayXML(DropZoneWrapper targetDropZone, String sourceFileName, String targetFileName, String prefix, |
1153 | | - String destGroup, String rowtag, boolean overwrite, SprayVariableFormat format, Integer maxrecsize, Integer maxConnections, |
| 1162 | + @WithSpan |
| 1163 | + public ProgressResponseWrapper sprayXML(@SpanAttribute DropZoneWrapper targetDropZone,@SpanAttribute String sourceFileName,@SpanAttribute String targetFileName, String prefix, |
| 1164 | + @SpanAttribute String destGroup, String rowtag, boolean overwrite, SprayVariableFormat format, Integer maxrecsize, Integer maxConnections, |
1154 | 1165 | Boolean replicate, Boolean compress, Boolean failIfNoSourceFile, Integer expireDays) throws Exception, ArrayOfEspExceptionWrapper |
1155 | 1166 | { |
1156 | 1167 | verifyStub(); |
@@ -1303,7 +1314,8 @@ public ProgressResponseWrapper sprayFixedLocalDropZone(String sourceFileName, in |
1303 | 1314 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
1304 | 1315 | * the array of esp exception wrapper |
1305 | 1316 | */ |
1306 | | - public ProgressResponseWrapper sprayFixed(DropZoneWrapper targetDropZone, String sourceFileName, int recordSize, String targetFileLabel, |
| 1317 | + @WithSpan |
| 1318 | + public ProgressResponseWrapper sprayFixed(@SpanAttribute DropZoneWrapper targetDropZone, @SpanAttribute String sourceFileName, int recordSize, String targetFileLabel, |
1307 | 1319 | String prefix, String destGroup, boolean overwrite, Integer maxConnections, Boolean compress, Boolean replicate, |
1308 | 1320 | Boolean failIfNoSourceFile, Integer expireDays, String decryptKey, String encryptKey, Boolean nosplit, Boolean recordStructurePresent, |
1309 | 1321 | Integer transferBufferSize, Boolean wrap) throws Exception, ArrayOfEspExceptionWrapper |
@@ -1364,7 +1376,8 @@ public ProgressResponseWrapper sprayFixed(DropZoneWrapper targetDropZone, String |
1364 | 1376 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
1365 | 1377 | * the array of esp exception wrapper |
1366 | 1378 | */ |
1367 | | - public ProgressResponseWrapper getDfuProgress(String dfuwuid) throws Exception, ArrayOfEspExceptionWrapper |
| 1379 | + @WithSpan |
| 1380 | + public ProgressResponseWrapper getDfuProgress(@SpanAttribute String dfuwuid) throws Exception, ArrayOfEspExceptionWrapper |
1368 | 1381 | { |
1369 | 1382 | verifyStub(); |
1370 | 1383 |
|
@@ -1411,7 +1424,8 @@ public ProgressResponseWrapper getDfuProgress(String dfuwuid) throws Exception, |
1411 | 1424 | * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper |
1412 | 1425 | * the array of esp exception wrapper |
1413 | 1426 | */ |
1414 | | - public boolean uploadFile(File file, String targetDropzoneAddress) throws Exception, ArrayOfEspExceptionWrapper |
| 1427 | + @WithSpan |
| 1428 | + public boolean uploadFile(@SpanAttribute File file, @SpanAttribute String targetDropzoneAddress) throws Exception, ArrayOfEspExceptionWrapper |
1415 | 1429 | { |
1416 | 1430 | List<DropZoneWrapper> dropZones = fetchDropZones(targetDropzoneAddress); |
1417 | 1431 | if (dropZones == null || dropZones.size() <= 0) throw new Exception("Could not fetch target dropzone information"); |
@@ -1469,7 +1483,8 @@ static protected void setupUploadResultParser() throws XPathExpressionException, |
1469 | 1483 | * - The target dropzone |
1470 | 1484 | * @return - Boolean, success |
1471 | 1485 | */ |
1472 | | - public boolean uploadLargeFile(File uploadFile, DropZoneWrapper dropZone) |
| 1486 | + @WithSpan |
| 1487 | + public boolean uploadLargeFile(@SpanAttribute File uploadFile, @SpanAttribute DropZoneWrapper dropZone) |
1473 | 1488 | { |
1474 | 1489 | if (uploadFile == null || dropZone == null) |
1475 | 1490 | { |
@@ -1619,7 +1634,8 @@ public boolean uploadLargeFile(File uploadFile, DropZoneWrapper dropZone) |
1619 | 1634 | * @throws Exception |
1620 | 1635 | * the exception |
1621 | 1636 | */ |
1622 | | - private boolean uploadFile(File file, DropZoneWrapper dropZone) throws Exception |
| 1637 | + @WithSpan |
| 1638 | + private boolean uploadFile(@SpanAttribute File file, @SpanAttribute DropZoneWrapper dropZone) throws Exception |
1623 | 1639 | { |
1624 | 1640 | if (file == null) return false; |
1625 | 1641 | String filename = file.getName(); |
|
0 commit comments