This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git
The following commit(s) were added to refs/heads/master by this push:
new 74c3ba5 Configuration to overwrite already copied data
74c3ba5 is described below
commit 74c3ba5d448cfbe2ef399599846ff5b91f3f077b
Author: DImuthuUpe <[email protected]>
AuthorDate: Wed Jul 19 17:09:25 2023 -0400
Configuration to overwrite already copied data
---
.../java/org/apache/airavata/mft/agent/TransferOrchestrator.java | 5 ++++-
agent/service/src/main/resources/agent-application.properties | 4 +++-
.../airavata/mft/standalone/server/AgentServiceApplication.java | 9 +++++++++
standalone-service/src/main/resources/application.properties | 3 ++-
.../src/main/resources/distribution/conf/application.properties | 3 ++-
5 files changed, 20 insertions(+), 4 deletions(-)
diff --git
a/agent/service/src/main/java/org/apache/airavata/mft/agent/TransferOrchestrator.java
b/agent/service/src/main/java/org/apache/airavata/mft/agent/TransferOrchestrator.java
index ecbc15e..77a1a30 100644
---
a/agent/service/src/main/java/org/apache/airavata/mft/agent/TransferOrchestrator.java
+++
b/agent/service/src/main/java/org/apache/airavata/mft/agent/TransferOrchestrator.java
@@ -66,6 +66,9 @@ public class TransferOrchestrator {
@org.springframework.beans.factory.annotation.Value("${agent.id}")
private String agentId;
+
@org.springframework.beans.factory.annotation.Value("${overwrite.existing}")
+ private Boolean overwriteExisting;
+
@Autowired
private MFTConsulClient mftConsulClient;
@@ -142,7 +145,7 @@ public class TransferOrchestrator {
MetadataCollector dstMetadataCollector =
dstMetadataCollectorOp.orElseThrow(() -> new Exception("Could not find a
metadata collector for destination"));
dstMetadataCollector.init(destStorage, destSecret);
- if
(dstMetadataCollector.isAvailable(endpointPath.getDestinationPath())) {
+ if (!overwriteExisting &&
dstMetadataCollector.isAvailable(endpointPath.getDestinationPath())) {
ResourceMetadata destinationMetadata =
dstMetadataCollector.getResourceMetadata(endpointPath.getDestinationPath(),
false);
if (destinationMetadata.getMetadataCase() ==
ResourceMetadata.MetadataCase.FILE &&
destinationMetadata.getFile().getResourceSize() ==
srcMetadata.getFile().getResourceSize()) {
diff --git a/agent/service/src/main/resources/agent-application.properties
b/agent/service/src/main/resources/agent-application.properties
index 045b6ce..900b65d 100644
--- a/agent/service/src/main/resources/agent-application.properties
+++ b/agent/service/src/main/resources/agent-application.properties
@@ -44,4 +44,6 @@ agent.transport.directory=plugins
#agent.transport.local.dma = true
agent.transport.local.buffLen = 16777216
agent.transport.s3.chunkSize = 10
-agent.transport.s3.multipart = true
\ No newline at end of file
+agent.transport.s3.multipart = true
+
+overwrite.existing=true
\ No newline at end of file
diff --git
a/standalone-service/src/main/java/org/apache/airavata/mft/standalone/server/AgentServiceApplication.java
b/standalone-service/src/main/java/org/apache/airavata/mft/standalone/server/AgentServiceApplication.java
index fbb2754..bfa79ee 100644
---
a/standalone-service/src/main/java/org/apache/airavata/mft/standalone/server/AgentServiceApplication.java
+++
b/standalone-service/src/main/java/org/apache/airavata/mft/standalone/server/AgentServiceApplication.java
@@ -18,9 +18,18 @@
package org.apache.airavata.mft.standalone.server;
import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
+import
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan(basePackages = {"org.apache.airavata.mft.agent"})
+@SpringBootApplication(exclude = {
+ DataSourceAutoConfiguration.class,
+ DataSourceTransactionManagerAutoConfiguration.class,
+ HibernateJpaAutoConfiguration.class
+})
public class AgentServiceApplication {
public static void main(String[] args) {
SpringApplication.run(AgentServiceApplication.class, args);
diff --git a/standalone-service/src/main/resources/application.properties
b/standalone-service/src/main/resources/application.properties
index fea9489..2b363e9 100644
--- a/standalone-service/src/main/resources/application.properties
+++ b/standalone-service/src/main/resources/application.properties
@@ -30,4 +30,5 @@ agent.concurrent.transfers=8
agent.concurrent.chunked.threads=20
agent.chunk.size=10
agent.chunk.streaming.enabled=true
-agent.transport.directory=plugins
\ No newline at end of file
+agent.transport.directory=plugins
+overwrite.existing=true
diff --git
a/standalone-service/src/main/resources/distribution/conf/application.properties
b/standalone-service/src/main/resources/distribution/conf/application.properties
index 5eaaf45..15be160 100644
---
a/standalone-service/src/main/resources/distribution/conf/application.properties
+++
b/standalone-service/src/main/resources/distribution/conf/application.properties
@@ -30,4 +30,5 @@ agent.concurrent.transfers=8
agent.concurrent.chunked.threads=20
agent.chunk.size=10
agent.chunk.streaming.enabled=true
-agent.transport.directory=${AIRAVATA_HOME}/plugins
\ No newline at end of file
+agent.transport.directory=${AIRAVATA_HOME}/plugins
+overwrite.existing=true