-
Notifications
You must be signed in to change notification settings - Fork 7
Features/hpcdatamgm 2097 version2 #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
saradachintala
wants to merge
29
commits into
releases/3.24.0
Choose a base branch
from
features/HPCDATAMGM-2097-version2
base: releases/3.24.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
199e5cf
HPCDATAMGM-2097: Backend implementation of single dataObject registra…
saradachintala fdf5794
Merge branch 'releases/3.23.0' into features/HPCDATAMGM-2097-version2
saradachintala 487e485
Merge branch 'releases/3.23.0' into features/HPCDATAMGM-2097-version2
saradachintala 7d5b140
Upgrade assertj library
saradachintala a3bc9d4
HPCDATAMGM-2097: Completely clear the metadata before deleting the IR…
saradachintala 8e3cd56
Merge branch 'releases/3.24.0' into features/HPCDATAMGM-2097-version2
saradachintala 792bc52
HPCDATAMGM-2097: Add removal of dataObject in the BUS schedular layer…
saradachintala cd39a34
HPCDATAMGM-2097: Refactor downloadDataObjectFromExternalSource
saradachintala afd030a
HPCDATAMGM-2097, HPCDATAMGM-2168: Add External Download API for colle…
saradachintala 0af1db3
HPCDATAMGM-2097, HPCDATAMGM-2168: Added some refactoring for shared c…
saradachintala b47b0a4
HPCDATAMGM-2097, HPCDATAMGM-2168: Remove the unecessary setting of da…
saradachintala b6cbd3f
Potential fix for pull request finding
saradachintala 4777374
Potential fix for pull request finding
saradachintala bc0bfc7
Potential fix for pull request finding
saradachintala fd2af6f
Potential fix for pull request finding
saradachintala 76d144e
Potential fix for pull request finding
saradachintala c6a482a
Potential fix for pull request finding
saradachintala 4ecbf0b
Potential fix for pull request finding
saradachintala ab3b4b3
Potential fix for pull request finding
saradachintala e3d7c79
Potential fix for pull request finding
saradachintala b496c09
Potential fix for pull request finding
saradachintala 5809b60
Potential fix for pull request finding
saradachintala 6a51fc4
Potential fix for pull request finding
saradachintala fe4ccb0
Potential fix for pull request finding
saradachintala d97a0ad
HPCDATAMGM-2097, HPCDATAMGM-2168, include the import of Set - which w…
saradachintala d4b8f02
HPCDATAMGM-2097, HPCDATAMGM-2168, restore the previous code as Copilo…
saradachintala 0fd3ccb
HPCDATAMGM-2097, HPCDATAMGM-2168, Add check whether external_storage …
saradachintala f3dc367
HPCDATAMGM-2097, HPCDATAMGM-2168: Fix the code modified by Copilot in…
saradachintala 02884f2
HPCDATAMGM:2092, HPCDATAMGM-2168: Change findDataTransferConfiguratio…
saradachintala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,7 @@ | |
| import gov.nih.nci.hpc.dao.HpcDataDownloadDAO; | ||
| import gov.nih.nci.hpc.dao.HpcDataRegistrationDAO; | ||
| import gov.nih.nci.hpc.dao.HpcGlobusTransferTaskDAO; | ||
| import gov.nih.nci.hpc.domain.datamanagement.HpcDataObject; | ||
| import gov.nih.nci.hpc.domain.datamanagement.HpcPathAttributes; | ||
| import gov.nih.nci.hpc.domain.datamanagement.HpcPathPermissions; | ||
| import gov.nih.nci.hpc.domain.datatransfer.HpcAddArchiveObjectMetadataResponse; | ||
|
|
@@ -96,6 +97,7 @@ | |
| import gov.nih.nci.hpc.domain.error.HpcDomainValidationResult; | ||
| import gov.nih.nci.hpc.domain.error.HpcErrorType; | ||
| import gov.nih.nci.hpc.domain.error.HpcRequestRejectReason; | ||
| import gov.nih.nci.hpc.domain.metadata.HpcMetadataEntries; | ||
| import gov.nih.nci.hpc.domain.metadata.HpcMetadataEntry; | ||
| import gov.nih.nci.hpc.domain.model.HpcDataObjectUploadRequest; | ||
| import gov.nih.nci.hpc.domain.model.HpcDataObjectUploadResponse; | ||
|
|
@@ -572,7 +574,7 @@ public HpcDataObjectDownloadResponse downloadDataObject(String path, HpcFileLoca | |
| HpcSynchronousDownloadFilter synchronousDownloadFilter, HpcDataTransferType dataTransferType, | ||
| String configurationId, String s3ArchiveConfigurationId, String retryTaskId, String userId, | ||
| String retryUserId, boolean completionEvent, String collectionDownloadTaskId, long size, | ||
| HpcDataTransferUploadStatus dataTransferStatus, HpcDeepArchiveStatus deepArchiveStatus) | ||
| HpcDataTransferUploadStatus dataTransferStatus, HpcDeepArchiveStatus deepArchiveStatus, boolean externalArchiveFlag) | ||
| throws HpcException { | ||
| // Input Validation. | ||
| if (dataTransferType == null || !isValidFileLocation(archiveLocation)) { | ||
|
|
@@ -603,6 +605,7 @@ public HpcDataObjectDownloadResponse downloadDataObject(String path, HpcFileLoca | |
| downloadRequest.setCompletionEvent(completionEvent); | ||
| downloadRequest.setCollectionDownloadTaskId(collectionDownloadTaskId); | ||
| downloadRequest.setSize(size); | ||
| downloadRequest.setExternalArchiveFlag(externalArchiveFlag); | ||
|
|
||
| // Create a download response. | ||
| HpcDataObjectDownloadResponse response = new HpcDataObjectDownloadResponse(); | ||
|
|
@@ -1130,7 +1133,6 @@ public boolean getCollectionDownloadTaskCancellationRequested(String taskId) thr | |
| @Override | ||
| public HpcDownloadTaskResult completeDataObjectDownloadTask(HpcDataObjectDownloadTask downloadTask, | ||
| HpcDownloadResult result, String message, Calendar completed, long bytesTransferred) throws HpcException { | ||
|
|
||
| // Input validation | ||
| if (downloadTask == null) { | ||
| throw new HpcException("Invalid data object download task", HpcErrorType.INVALID_REQUEST_INPUT); | ||
|
|
@@ -1488,13 +1490,16 @@ public void stageHyperfileDataObjectDownloadTask(HpcDataObjectDownloadTask downl | |
|
|
||
| @Override | ||
| public void resetDataObjectDownloadTask(HpcDataObjectDownloadTask downloadTask) throws HpcException { | ||
|
|
||
| logger.debug( | ||
| "download task: [taskId={}] - resetDataObjectDownloadTask called. Setting in-process=false [transfer-type={}, server-id={}]", | ||
| downloadTask.getId(), downloadTask.getDataTransferType(), | ||
| HpcDataTransferType.S_3.equals(downloadTask.getDataTransferType()) ? s3DownloadTaskServerId : null); | ||
|
|
||
| downloadTask.setDataTransferStatus(HpcDataTransferDownloadStatus.RECEIVED); | ||
| if(downloadTask.getExternalArchiveFlag()) { | ||
| downloadTask.setDataTransferStatus(HpcDataTransferDownloadStatus.RECEIVED_EXTERNAL); | ||
| } else { | ||
| downloadTask.setDataTransferStatus(HpcDataTransferDownloadStatus.RECEIVED); | ||
| } | ||
|
Comment on lines
+1498
to
+1502
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add the test after studying the test code. |
||
| downloadTask.setPercentComplete(0); | ||
| downloadTask.setInProcess(false); | ||
| downloadTask.setS3DownloadTaskServerId(null); | ||
|
|
@@ -1515,11 +1520,24 @@ public void resetDataObjectDownloadTasksInProcess() throws HpcException { | |
| dataDownloadDAO.resetDataObjectDownloadTaskInProcess(s3DownloadTaskServerId); | ||
| } | ||
|
|
||
| @Override | ||
| public void changeDataObjectDownloadTaskExternalStatus(HpcDataObjectDownloadTask downloadTask) throws HpcException { | ||
| if(downloadTask.getDataTransferStatus().equals(HpcDataTransferDownloadStatus.RECEIVED_EXTERNAL)) { | ||
| downloadTask.setDataTransferStatus(HpcDataTransferDownloadStatus.RECEIVED); | ||
| downloadTask.setExternalArchiveFlag(true); | ||
| } | ||
| dataDownloadDAO.updateDataObjectDownloadTask(downloadTask); | ||
| //return downloadTask; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean markProcessedDataObjectDownloadTask(HpcDataObjectDownloadTask downloadTask, | ||
| HpcDataTransferType dataTransferType, boolean inProcess) throws HpcException { | ||
| // Only set in-process to true if this task in a RECEIVED status, and the | ||
| // in-process not already true. | ||
| if(downloadTask.getDataTransferStatus().equals(HpcDataTransferDownloadStatus.RECEIVED_EXTERNAL)) { | ||
| return false; | ||
| } | ||
| boolean updated = true; | ||
| String serverId = HpcDataTransferType.S_3.equals(dataTransferType) ? s3DownloadTaskServerId : null; | ||
|
|
||
|
|
@@ -1593,7 +1611,6 @@ public boolean updateDataObjectDownloadTask(HpcDataObjectDownloadTask downloadTa | |
| logger.info("download task: [taskId={}] - % complete - {} [transfer-type={}, destination-type={}]", | ||
| downloadTask.getId(), percentComplete, downloadTask.getDataTransferType(), | ||
| downloadTask.getDestinationType()); | ||
|
|
||
| return dataDownloadDAO.updateDataObjectDownloadTask(downloadTask); | ||
| } | ||
|
|
||
|
|
@@ -1604,7 +1621,7 @@ public HpcCollectionDownloadTask downloadCollection(String path, | |
| HpcGoogleDownloadDestination googleCloudStorageDownloadDestination, | ||
| HpcAsperaDownloadDestination asperaDownloadDestination, HpcBoxDownloadDestination boxDownloadDestination, | ||
| String userId, String configurationId, boolean appendPathToDownloadDestination, | ||
| boolean appendCollectionNameToDownloadDestination) throws HpcException { | ||
| boolean appendCollectionNameToDownloadDestination, boolean externalArchiveFlag) throws HpcException { | ||
|
|
||
| // Validate the download destination. | ||
| validateDownloadDestination(globusDownloadDestination, s3DownloadDestination, googleDriveDownloadDestination, | ||
|
|
@@ -1632,6 +1649,11 @@ public HpcCollectionDownloadTask downloadCollection(String path, | |
| downloadTask.setDoc(dataManagementService.getDataManagementConfiguration(configurationId).getDoc()); | ||
| downloadTask.setAppendPathToDownloadDestination(appendPathToDownloadDestination); | ||
| downloadTask.setAppendCollectionNameToDownloadDestination(appendCollectionNameToDownloadDestination); | ||
| if(externalArchiveFlag) { | ||
| downloadTask.setStatus(HpcCollectionDownloadTaskStatus.RECEIVED_EXTERNAL); | ||
| } else { | ||
| downloadTask.setStatus(HpcCollectionDownloadTaskStatus.RECEIVED); | ||
| } | ||
|
|
||
| // Persist the request. | ||
| dataDownloadDAO.upsertCollectionDownloadTask(downloadTask); | ||
|
|
@@ -1646,7 +1668,7 @@ public HpcCollectionDownloadTask downloadCollections(List<String> collectionPath | |
| HpcGoogleDownloadDestination googleCloudStorageDownloadDestination, | ||
| HpcAsperaDownloadDestination asperaDownloadDestination, HpcBoxDownloadDestination boxDownloadDestination, | ||
| String userId, String configurationId, boolean appendPathToDownloadDestination, | ||
| boolean appendCollectionNameToDownloadDestination) throws HpcException { | ||
| boolean appendCollectionNameToDownloadDestination, boolean externalArchiveFlag) throws HpcException { | ||
| // Validate the download destination. | ||
| validateDownloadDestination(globusDownloadDestination, s3DownloadDestination, googleDriveDownloadDestination, | ||
| googleCloudStorageDownloadDestination, asperaDownloadDestination, boxDownloadDestination, null, | ||
|
|
@@ -1669,6 +1691,11 @@ public HpcCollectionDownloadTask downloadCollections(List<String> collectionPath | |
| downloadTask.setAppendPathToDownloadDestination(appendPathToDownloadDestination); | ||
| downloadTask.setAppendCollectionNameToDownloadDestination(appendCollectionNameToDownloadDestination); | ||
| downloadTask.setDoc(dataManagementService.getDataManagementConfiguration(configurationId).getDoc()); | ||
| if(externalArchiveFlag) { | ||
| downloadTask.setStatus(HpcCollectionDownloadTaskStatus.RECEIVED_EXTERNAL); | ||
| } else { | ||
| downloadTask.setStatus(HpcCollectionDownloadTaskStatus.RECEIVED); | ||
| } | ||
|
|
||
| // Persist the request. | ||
| dataDownloadDAO.upsertCollectionDownloadTask(downloadTask); | ||
|
|
@@ -4310,7 +4337,6 @@ private void createDownloadTask(HpcDataObjectDownloadRequest firstHopDownloadReq | |
| HpcFileLocation secondHopArchiveLocation, HpcGlobusDownloadDestination secondHopGlobusDestination, | ||
| HpcDataTransferDownloadStatus dataTransferDownloadStatus, HpcDataTransferType destinationType) | ||
| throws HpcException { | ||
|
|
||
| downloadTask.setDataTransferType(HpcDataTransferType.S_3); | ||
| downloadTask.setDataTransferStatus(dataTransferDownloadStatus); | ||
| downloadTask.setDownloadFilePath(sourceFile.getAbsolutePath()); | ||
|
|
@@ -4330,6 +4356,7 @@ private void createDownloadTask(HpcDataObjectDownloadRequest firstHopDownloadReq | |
| downloadTask.setPercentComplete(0); | ||
| downloadTask.setSize(firstHopDownloadRequest.getSize()); | ||
| downloadTask.setFirstHopRetried(false); | ||
| downloadTask.setExternalArchiveFlag(firstHopDownloadRequest.getExternalArchiveFlag()); | ||
| downloadTask.setS3DownloadTaskServerId( | ||
| dataTransferDownloadStatus.equals(HpcDataTransferDownloadStatus.IN_PROGRESS) | ||
| ? s3DownloadTaskServerId | ||
|
|
@@ -4374,7 +4401,7 @@ private void updateDownloadTask(HpcDataObjectDownloadTask downloadTask, | |
| this.downloadTask.setFirstHopRetried(downloadTask.getFirstHopRetried()); | ||
| this.downloadTask.setRetryTaskId(downloadTask.getRetryTaskId()); | ||
| this.downloadTask.setRetryUserId(downloadTask.getRetryUserId()); | ||
|
|
||
| this.downloadTask.setExternalArchiveFlag(downloadTask.getExternalArchiveFlag()); | ||
| dataDownloadDAO.updateDataObjectDownloadTask(this.downloadTask); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.