You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/04/01 16:53:59 UTC
[airavata] branch mft-integration updated: AIRAVATA-3311 Add mft
enabled flag to StoragePreference
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch mft-integration
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/mft-integration by this push:
new 221ce9f AIRAVATA-3311 Add mft enabled flag to StoragePreference
221ce9f is described below
commit 221ce9f59bdfb02f3e62cd3428da2e7f058b4165
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Mar 31 12:13:10 2020 -0400
AIRAVATA-3311 Add mft enabled flag to StoragePreference
---
.../model/appcatalog/gatewayprofile/ttypes.py | 14 ++-
.../airavata/model/transfer/__init__.py | 1 +
.../airavata/model/transfer/constants.py | 12 +++
.../airavata/model/transfer/ttypes.py | 103 +++++++++++++++++++
.../airavata-python-sdk/airavata/model/ttypes.py | 1 +
.../gatewayprofile/StoragePreference.java | 110 ++++++++++++++++++++-
.../ComputeResourceReservation.java | 32 +++---
.../GroupComputeResourcePreference.java | 76 +++++++-------
.../airavata/helix/impl/task/TaskContext.java | 4 +
.../helix/impl/task/staging/ArchiveTask.java | 2 +-
.../impl/task/staging/InputDataStagingTask.java | 2 +-
.../impl/task/staging/OutputDataStagingTask.java | 4 +-
.../init/03-appcatalog-migrations.sql | 3 +
.../appcatalog/StoragePreferenceEntity.java | 11 +++
.../src/main/resources/appcatalog-derby.sql | 1 +
.../src/main/resources/appcatalog-mysql.sql | 1 +
.../appcatalog/GatewayProfileRepositoryTest.java | 22 +++++
.../next/DeltaScripts/appCatalog_schema_delta.sql | 3 +
.../gateway_resource_profile_model.thrift | 3 +-
19 files changed, 341 insertions(+), 64 deletions(-)
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/ttypes.py
index 6908a39..f47d818 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/ttypes.py
@@ -322,6 +322,7 @@ class StoragePreference(object):
- loginUserName
- fileSystemRootLocation
- resourceSpecificCredentialStoreToken
+ - managedFileTransferEnabled
"""
thrift_spec = (
@@ -330,13 +331,15 @@ class StoragePreference(object):
(2, TType.STRING, 'loginUserName', 'UTF8', None, ), # 2
(3, TType.STRING, 'fileSystemRootLocation', 'UTF8', None, ), # 3
(4, TType.STRING, 'resourceSpecificCredentialStoreToken', 'UTF8', None, ), # 4
+ (5, TType.BOOL, 'managedFileTransferEnabled', None, None, ), # 5
)
- def __init__(self, storageResourceId=None, loginUserName=None, fileSystemRootLocation=None, resourceSpecificCredentialStoreToken=None,):
+ def __init__(self, storageResourceId=None, loginUserName=None, fileSystemRootLocation=None, resourceSpecificCredentialStoreToken=None, managedFileTransferEnabled=None,):
self.storageResourceId = storageResourceId
self.loginUserName = loginUserName
self.fileSystemRootLocation = fileSystemRootLocation
self.resourceSpecificCredentialStoreToken = resourceSpecificCredentialStoreToken
+ self.managedFileTransferEnabled = managedFileTransferEnabled
def read(self, iprot):
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -367,6 +370,11 @@ class StoragePreference(object):
self.resourceSpecificCredentialStoreToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
else:
iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.BOOL:
+ self.managedFileTransferEnabled = iprot.readBool()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -393,6 +401,10 @@ class StoragePreference(object):
oprot.writeFieldBegin('resourceSpecificCredentialStoreToken', TType.STRING, 4)
oprot.writeString(self.resourceSpecificCredentialStoreToken.encode('utf-8') if sys.version_info[0] == 2 else self.resourceSpecificCredentialStoreToken)
oprot.writeFieldEnd()
+ if self.managedFileTransferEnabled is not None:
+ oprot.writeFieldBegin('managedFileTransferEnabled', TType.BOOL, 5)
+ oprot.writeBool(self.managedFileTransferEnabled)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/__init__.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/__init__.py
new file mode 100644
index 0000000..adefd8e
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants']
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/constants.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/constants.py
new file mode 100644
index 0000000..eb0d35a
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/constants.py
@@ -0,0 +1,12 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+from .ttypes import *
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/ttypes.py
new file mode 100644
index 0000000..04789fe
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/transfer/ttypes.py
@@ -0,0 +1,103 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+# options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+
+from thrift.transport import TTransport
+
+
+class TransferModel(object):
+ """
+ Attributes:
+ - taskId
+ - transferId
+ - filePath
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'taskId', 'UTF8', None, ), # 1
+ (2, TType.STRING, 'transferId', 'UTF8', None, ), # 2
+ (3, TType.STRING, 'filePath', 'UTF8', None, ), # 3
+ )
+
+ def __init__(self, taskId=None, transferId=None, filePath=None,):
+ self.taskId = taskId
+ self.transferId = transferId
+ self.filePath = filePath
+
+ def read(self, iprot):
+ if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+ iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.taskId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.transferId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.filePath = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot._fast_encode is not None and self.thrift_spec is not None:
+ oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TransferModel')
+ if self.taskId is not None:
+ oprot.writeFieldBegin('taskId', TType.STRING, 1)
+ oprot.writeString(self.taskId.encode('utf-8') if sys.version_info[0] == 2 else self.taskId)
+ oprot.writeFieldEnd()
+ if self.transferId is not None:
+ oprot.writeFieldBegin('transferId', TType.STRING, 2)
+ oprot.writeString(self.transferId.encode('utf-8') if sys.version_info[0] == 2 else self.transferId)
+ oprot.writeFieldEnd()
+ if self.filePath is not None:
+ oprot.writeFieldBegin('filePath', TType.STRING, 3)
+ oprot.writeString(self.filePath.encode('utf-8') if sys.version_info[0] == 2 else self.filePath)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.taskId is None:
+ raise TProtocolException(message='Required field taskId is unset!')
+ if self.transferId is None:
+ raise TProtocolException(message='Required field transferId is unset!')
+ if self.filePath is None:
+ raise TProtocolException(message='Required field filePath is unset!')
+ return
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.items()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/ttypes.py
index 4a98c34..58430a7 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/ttypes.py
@@ -21,6 +21,7 @@ import airavata.model.task.ttypes
import airavata.model.process.ttypes
import airavata.model.scheduling.ttypes
import airavata.model.status.ttypes
+import airavata.model.transfer.ttypes
import airavata.model.data.movement.ttypes
import airavata.model.data.replica.ttypes
import airavata.model.user.ttypes
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/StoragePreference.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/StoragePreference.java
index b8754ed..fddcea8 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/StoragePreference.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/StoragePreference.java
@@ -32,6 +32,7 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
private static final org.apache.thrift.protocol.TField LOGIN_USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("loginUserName", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField FILE_SYSTEM_ROOT_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("fileSystemRootLocation", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceSpecificCredentialStoreToken", org.apache.thrift.protocol.TType.STRING, (short)4);
+ private static final org.apache.thrift.protocol.TField MANAGED_FILE_TRANSFER_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("managedFileTransferEnabled", org.apache.thrift.protocol.TType.BOOL, (short)5);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new StoragePreferenceStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new StoragePreferenceTupleSchemeFactory();
@@ -40,13 +41,15 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
private java.lang.String loginUserName; // optional
private java.lang.String fileSystemRootLocation; // optional
private java.lang.String resourceSpecificCredentialStoreToken; // optional
+ private boolean managedFileTransferEnabled; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
STORAGE_RESOURCE_ID((short)1, "storageResourceId"),
LOGIN_USER_NAME((short)2, "loginUserName"),
FILE_SYSTEM_ROOT_LOCATION((short)3, "fileSystemRootLocation"),
- RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN((short)4, "resourceSpecificCredentialStoreToken");
+ RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN((short)4, "resourceSpecificCredentialStoreToken"),
+ MANAGED_FILE_TRANSFER_ENABLED((short)5, "managedFileTransferEnabled");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
@@ -69,6 +72,8 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
return FILE_SYSTEM_ROOT_LOCATION;
case 4: // RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN
return RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN;
+ case 5: // MANAGED_FILE_TRANSFER_ENABLED
+ return MANAGED_FILE_TRANSFER_ENABLED;
default:
return null;
}
@@ -109,7 +114,9 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
}
// isset id assignments
- private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.FILE_SYSTEM_ROOT_LOCATION,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN};
+ private static final int __MANAGEDFILETRANSFERENABLED_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ private static final _Fields optionals[] = {_Fields.LOGIN_USER_NAME,_Fields.FILE_SYSTEM_ROOT_LOCATION,_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN,_Fields.MANAGED_FILE_TRANSFER_ENABLED};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -121,6 +128,8 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("resourceSpecificCredentialStoreToken", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.MANAGED_FILE_TRANSFER_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("managedFileTransferEnabled", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoragePreference.class, metaDataMap);
}
@@ -139,6 +148,7 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
* Performs a deep copy on <i>other</i>.
*/
public StoragePreference(StoragePreference other) {
+ __isset_bitfield = other.__isset_bitfield;
if (other.isSetStorageResourceId()) {
this.storageResourceId = other.storageResourceId;
}
@@ -151,6 +161,7 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
if (other.isSetResourceSpecificCredentialStoreToken()) {
this.resourceSpecificCredentialStoreToken = other.resourceSpecificCredentialStoreToken;
}
+ this.managedFileTransferEnabled = other.managedFileTransferEnabled;
}
public StoragePreference deepCopy() {
@@ -163,6 +174,8 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
this.loginUserName = null;
this.fileSystemRootLocation = null;
this.resourceSpecificCredentialStoreToken = null;
+ setManagedFileTransferEnabledIsSet(false);
+ this.managedFileTransferEnabled = false;
}
public java.lang.String getStorageResourceId() {
@@ -257,6 +270,28 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
}
}
+ public boolean isManagedFileTransferEnabled() {
+ return this.managedFileTransferEnabled;
+ }
+
+ public void setManagedFileTransferEnabled(boolean managedFileTransferEnabled) {
+ this.managedFileTransferEnabled = managedFileTransferEnabled;
+ setManagedFileTransferEnabledIsSet(true);
+ }
+
+ public void unsetManagedFileTransferEnabled() {
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MANAGEDFILETRANSFERENABLED_ISSET_ID);
+ }
+
+ /** Returns true if field managedFileTransferEnabled is set (has been assigned a value) and false otherwise */
+ public boolean isSetManagedFileTransferEnabled() {
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MANAGEDFILETRANSFERENABLED_ISSET_ID);
+ }
+
+ public void setManagedFileTransferEnabledIsSet(boolean value) {
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MANAGEDFILETRANSFERENABLED_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case STORAGE_RESOURCE_ID:
@@ -291,6 +326,14 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
}
break;
+ case MANAGED_FILE_TRANSFER_ENABLED:
+ if (value == null) {
+ unsetManagedFileTransferEnabled();
+ } else {
+ setManagedFileTransferEnabled((java.lang.Boolean)value);
+ }
+ break;
+
}
}
@@ -308,6 +351,9 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
case RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN:
return getResourceSpecificCredentialStoreToken();
+ case MANAGED_FILE_TRANSFER_ENABLED:
+ return isManagedFileTransferEnabled();
+
}
throw new java.lang.IllegalStateException();
}
@@ -327,6 +373,8 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
return isSetFileSystemRootLocation();
case RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN:
return isSetResourceSpecificCredentialStoreToken();
+ case MANAGED_FILE_TRANSFER_ENABLED:
+ return isSetManagedFileTransferEnabled();
}
throw new java.lang.IllegalStateException();
}
@@ -382,6 +430,15 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
return false;
}
+ boolean this_present_managedFileTransferEnabled = true && this.isSetManagedFileTransferEnabled();
+ boolean that_present_managedFileTransferEnabled = true && that.isSetManagedFileTransferEnabled();
+ if (this_present_managedFileTransferEnabled || that_present_managedFileTransferEnabled) {
+ if (!(this_present_managedFileTransferEnabled && that_present_managedFileTransferEnabled))
+ return false;
+ if (this.managedFileTransferEnabled != that.managedFileTransferEnabled)
+ return false;
+ }
+
return true;
}
@@ -405,6 +462,10 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
if (isSetResourceSpecificCredentialStoreToken())
hashCode = hashCode * 8191 + resourceSpecificCredentialStoreToken.hashCode();
+ hashCode = hashCode * 8191 + ((isSetManagedFileTransferEnabled()) ? 131071 : 524287);
+ if (isSetManagedFileTransferEnabled())
+ hashCode = hashCode * 8191 + ((managedFileTransferEnabled) ? 131071 : 524287);
+
return hashCode;
}
@@ -456,6 +517,16 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
return lastComparison;
}
}
+ lastComparison = java.lang.Boolean.valueOf(isSetManagedFileTransferEnabled()).compareTo(other.isSetManagedFileTransferEnabled());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetManagedFileTransferEnabled()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.managedFileTransferEnabled, other.managedFileTransferEnabled);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -513,6 +584,12 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
}
first = false;
}
+ if (isSetManagedFileTransferEnabled()) {
+ if (!first) sb.append(", ");
+ sb.append("managedFileTransferEnabled:");
+ sb.append(this.managedFileTransferEnabled);
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -536,6 +613,8 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -592,6 +671,14 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 5: // MANAGED_FILE_TRANSFER_ENABLED
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.managedFileTransferEnabled = iprot.readBool();
+ struct.setManagedFileTransferEnabledIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -631,6 +718,11 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
oprot.writeFieldEnd();
}
}
+ if (struct.isSetManagedFileTransferEnabled()) {
+ oprot.writeFieldBegin(MANAGED_FILE_TRANSFER_ENABLED_FIELD_DESC);
+ oprot.writeBool(struct.managedFileTransferEnabled);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -659,7 +751,10 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
if (struct.isSetResourceSpecificCredentialStoreToken()) {
optionals.set(2);
}
- oprot.writeBitSet(optionals, 3);
+ if (struct.isSetManagedFileTransferEnabled()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
if (struct.isSetLoginUserName()) {
oprot.writeString(struct.loginUserName);
}
@@ -669,6 +764,9 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
if (struct.isSetResourceSpecificCredentialStoreToken()) {
oprot.writeString(struct.resourceSpecificCredentialStoreToken);
}
+ if (struct.isSetManagedFileTransferEnabled()) {
+ oprot.writeBool(struct.managedFileTransferEnabled);
+ }
}
@Override
@@ -676,7 +774,7 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.storageResourceId = iprot.readString();
struct.setStorageResourceIdIsSet(true);
- java.util.BitSet incoming = iprot.readBitSet(3);
+ java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.loginUserName = iprot.readString();
struct.setLoginUserNameIsSet(true);
@@ -689,6 +787,10 @@ public class StoragePreference implements org.apache.thrift.TBase<StoragePrefere
struct.resourceSpecificCredentialStoreToken = iprot.readString();
struct.setResourceSpecificCredentialStoreTokenIsSet(true);
}
+ if (incoming.get(3)) {
+ struct.managedFileTransferEnabled = iprot.readBool();
+ struct.setManagedFileTransferEnabledIsSet(true);
+ }
}
}
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourceReservation.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourceReservation.java
index 5909f9c..df76be4 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourceReservation.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/ComputeResourceReservation.java
@@ -686,13 +686,13 @@ public class ComputeResourceReservation implements org.apache.thrift.TBase<Compu
case 3: // QUEUE_NAMES
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
- struct.queueNames = new java.util.ArrayList<java.lang.String>(_list16.size);
- java.lang.String _elem17;
- for (int _i18 = 0; _i18 < _list16.size; ++_i18)
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ struct.queueNames = new java.util.ArrayList<java.lang.String>(_list0.size);
+ java.lang.String _elem1;
+ for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
- _elem17 = iprot.readString();
- struct.queueNames.add(_elem17);
+ _elem1 = iprot.readString();
+ struct.queueNames.add(_elem1);
}
iprot.readListEnd();
}
@@ -744,9 +744,9 @@ public class ComputeResourceReservation implements org.apache.thrift.TBase<Compu
oprot.writeFieldBegin(QUEUE_NAMES_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.queueNames.size()));
- for (java.lang.String _iter19 : struct.queueNames)
+ for (java.lang.String _iter3 : struct.queueNames)
{
- oprot.writeString(_iter19);
+ oprot.writeString(_iter3);
}
oprot.writeListEnd();
}
@@ -779,9 +779,9 @@ public class ComputeResourceReservation implements org.apache.thrift.TBase<Compu
oprot.writeString(struct.reservationName);
{
oprot.writeI32(struct.queueNames.size());
- for (java.lang.String _iter20 : struct.queueNames)
+ for (java.lang.String _iter4 : struct.queueNames)
{
- oprot.writeString(_iter20);
+ oprot.writeString(_iter4);
}
}
oprot.writeI64(struct.startTime);
@@ -796,13 +796,13 @@ public class ComputeResourceReservation implements org.apache.thrift.TBase<Compu
struct.reservationName = iprot.readString();
struct.setReservationNameIsSet(true);
{
- org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.queueNames = new java.util.ArrayList<java.lang.String>(_list21.size);
- java.lang.String _elem22;
- for (int _i23 = 0; _i23 < _list21.size; ++_i23)
+ org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.queueNames = new java.util.ArrayList<java.lang.String>(_list5.size);
+ java.lang.String _elem6;
+ for (int _i7 = 0; _i7 < _list5.size; ++_i7)
{
- _elem22 = iprot.readString();
- struct.queueNames.add(_elem22);
+ _elem6 = iprot.readString();
+ struct.queueNames.add(_elem6);
}
}
struct.setQueueNamesIsSet(true);
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupComputeResourcePreference.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupComputeResourcePreference.java
index f43c58b..f4cae3d 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupComputeResourcePreference.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/groupresourceprofile/GroupComputeResourcePreference.java
@@ -239,7 +239,7 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.RESERVATIONS, new org.apache.thrift.meta_data.FieldMetaData("reservations", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "ComputeResourceReservation"))));
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComputeResourceReservation.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GroupComputeResourcePreference.class, metaDataMap);
}
@@ -323,7 +323,7 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
if (other.isSetReservations()) {
java.util.List<ComputeResourceReservation> __this__reservations = new java.util.ArrayList<ComputeResourceReservation>(other.reservations.size());
for (ComputeResourceReservation other_element : other.reservations) {
- __this__reservations.add(other_element);
+ __this__reservations.add(new ComputeResourceReservation(other_element));
}
this.reservations = __this__reservations;
}
@@ -1956,14 +1956,14 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
case 17: // GROUP_SSHACCOUNT_PROVISIONER_CONFIGS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- struct.groupSSHAccountProvisionerConfigs = new java.util.ArrayList<GroupAccountSSHProvisionerConfig>(_list0.size);
- GroupAccountSSHProvisionerConfig _elem1;
- for (int _i2 = 0; _i2 < _list0.size; ++_i2)
+ org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
+ struct.groupSSHAccountProvisionerConfigs = new java.util.ArrayList<GroupAccountSSHProvisionerConfig>(_list8.size);
+ GroupAccountSSHProvisionerConfig _elem9;
+ for (int _i10 = 0; _i10 < _list8.size; ++_i10)
{
- _elem1 = new GroupAccountSSHProvisionerConfig();
- _elem1.read(iprot);
- struct.groupSSHAccountProvisionerConfigs.add(_elem1);
+ _elem9 = new GroupAccountSSHProvisionerConfig();
+ _elem9.read(iprot);
+ struct.groupSSHAccountProvisionerConfigs.add(_elem9);
}
iprot.readListEnd();
}
@@ -1983,14 +1983,14 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
case 19: // RESERVATIONS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
- struct.reservations = new java.util.ArrayList<ComputeResourceReservation>(_list3.size);
- ComputeResourceReservation _elem4;
- for (int _i5 = 0; _i5 < _list3.size; ++_i5)
+ org.apache.thrift.protocol.TList _list11 = iprot.readListBegin();
+ struct.reservations = new java.util.ArrayList<ComputeResourceReservation>(_list11.size);
+ ComputeResourceReservation _elem12;
+ for (int _i13 = 0; _i13 < _list11.size; ++_i13)
{
- _elem4 = new ComputeResourceReservation();
- _elem4.read(iprot);
- struct.reservations.add(_elem4);
+ _elem12 = new ComputeResourceReservation();
+ _elem12.read(iprot);
+ struct.reservations.add(_elem12);
}
iprot.readListEnd();
}
@@ -2117,9 +2117,9 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
oprot.writeFieldBegin(GROUP_SSHACCOUNT_PROVISIONER_CONFIGS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.groupSSHAccountProvisionerConfigs.size()));
- for (GroupAccountSSHProvisionerConfig _iter6 : struct.groupSSHAccountProvisionerConfigs)
+ for (GroupAccountSSHProvisionerConfig _iter14 : struct.groupSSHAccountProvisionerConfigs)
{
- _iter6.write(oprot);
+ _iter14.write(oprot);
}
oprot.writeListEnd();
}
@@ -2138,9 +2138,9 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
oprot.writeFieldBegin(RESERVATIONS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.reservations.size()));
- for (ComputeResourceReservation _iter7 : struct.reservations)
+ for (ComputeResourceReservation _iter15 : struct.reservations)
{
- _iter7.write(oprot);
+ _iter15.write(oprot);
}
oprot.writeListEnd();
}
@@ -2259,9 +2259,9 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
if (struct.isSetGroupSSHAccountProvisionerConfigs()) {
{
oprot.writeI32(struct.groupSSHAccountProvisionerConfigs.size());
- for (GroupAccountSSHProvisionerConfig _iter8 : struct.groupSSHAccountProvisionerConfigs)
+ for (GroupAccountSSHProvisionerConfig _iter16 : struct.groupSSHAccountProvisionerConfigs)
{
- _iter8.write(oprot);
+ _iter16.write(oprot);
}
}
}
@@ -2271,9 +2271,9 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
if (struct.isSetReservations()) {
{
oprot.writeI32(struct.reservations.size());
- for (ComputeResourceReservation _iter9 : struct.reservations)
+ for (ComputeResourceReservation _iter17 : struct.reservations)
{
- _iter9.write(oprot);
+ _iter17.write(oprot);
}
}
}
@@ -2343,14 +2343,14 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
}
if (incoming.get(13)) {
{
- org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.groupSSHAccountProvisionerConfigs = new java.util.ArrayList<GroupAccountSSHProvisionerConfig>(_list10.size);
- GroupAccountSSHProvisionerConfig _elem11;
- for (int _i12 = 0; _i12 < _list10.size; ++_i12)
+ org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.groupSSHAccountProvisionerConfigs = new java.util.ArrayList<GroupAccountSSHProvisionerConfig>(_list18.size);
+ GroupAccountSSHProvisionerConfig _elem19;
+ for (int _i20 = 0; _i20 < _list18.size; ++_i20)
{
- _elem11 = new GroupAccountSSHProvisionerConfig();
- _elem11.read(iprot);
- struct.groupSSHAccountProvisionerConfigs.add(_elem11);
+ _elem19 = new GroupAccountSSHProvisionerConfig();
+ _elem19.read(iprot);
+ struct.groupSSHAccountProvisionerConfigs.add(_elem19);
}
}
struct.setGroupSSHAccountProvisionerConfigsIsSet(true);
@@ -2361,14 +2361,14 @@ public class GroupComputeResourcePreference implements org.apache.thrift.TBase<G
}
if (incoming.get(15)) {
{
- org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.reservations = new java.util.ArrayList<ComputeResourceReservation>(_list13.size);
- ComputeResourceReservation _elem14;
- for (int _i15 = 0; _i15 < _list13.size; ++_i15)
+ org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.reservations = new java.util.ArrayList<ComputeResourceReservation>(_list21.size);
+ ComputeResourceReservation _elem22;
+ for (int _i23 = 0; _i23 < _list21.size; ++_i23)
{
- _elem14 = new ComputeResourceReservation();
- _elem14.read(iprot);
- struct.reservations.add(_elem14);
+ _elem22 = new ComputeResourceReservation();
+ _elem22.read(iprot);
+ struct.reservations.add(_elem22);
}
}
struct.setReservationsIsSet(true);
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
index e57fa1e..f19b241 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
@@ -579,6 +579,10 @@ public class TaskContext {
return gatewayStorageResourcePreference.getStorageResourceId();
}
+ public boolean isStorageResourceManagedFileTransferEnabled() {
+ return gatewayStorageResourcePreference.isManagedFileTransferEnabled();
+ }
+
private ComputationalResourceSchedulingModel getProcessCRSchedule() {
if (getProcessModel() != null) {
return getProcessModel().getProcessResourceSchedule();
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/ArchiveTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/ArchiveTask.java
index f97254f..de61036 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/ArchiveTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/ArchiveTask.java
@@ -100,7 +100,7 @@ public class ArchiveTask extends DataStagingTask {
if (fileMetadata.getSize() < maxArchiveSize) {
boolean fileTransferred = false;
- if (ServerSettings.isAgentTransferEnabled()) {
+ if (ServerSettings.isAgentTransferEnabled() && taskContext.isStorageResourceManagedFileTransferEnabled()) {
fileTransferred = transferFileToStorageThroughMFT(tarCreationAbsPath, destFilePath);
} else {
fileTransferred = transferFileToStorage(tarCreationAbsPath, destFilePath, archiveFileName, adaptor, storageResourceAdaptor);
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/InputDataStagingTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/InputDataStagingTask.java
index 1b15c7a..e4200ee 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/InputDataStagingTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/InputDataStagingTask.java
@@ -88,7 +88,7 @@ public class InputDataStagingTask extends DataStagingTask {
URI destinationURI = new URI(dataStagingTaskModel.getDestination());
logger.info("Source file " + sourceURI.getPath() + ", destination uri " + destinationURI.getPath() + " for task " + getTaskId());
- if (ServerSettings.isAgentTransferEnabled()) {
+ if (ServerSettings.isAgentTransferEnabled() && taskContext.isStorageResourceManagedFileTransferEnabled()) {
logger.info("Transferring through MFT");
transferFileToComputeResourceThroughMFT(sourceURI.getPath(), destinationURI.getPath());
} else {
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
index 612af2f..b697281 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
@@ -155,7 +155,7 @@ public class OutputDataStagingTask extends DataStagingTask {
logger.info("Transferring file " + sourceFileName);
boolean transferred;
- if (ServerSettings.isAgentTransferEnabled()) {
+ if (ServerSettings.isAgentTransferEnabled() && taskContext.isStorageResourceManagedFileTransferEnabled()) {
transferred = transferFileToStorageThroughMFT(newSourceURI.getPath(), destinationURI.getPath());
} else {
transferred = transferFileToStorage(newSourceURI.getPath(), destinationURI.getPath(), sourceFileName, adaptor, storageResourceAdaptor);
@@ -187,7 +187,7 @@ public class OutputDataStagingTask extends DataStagingTask {
// Uploading output file to the storage resource
assert processOutput != null;
boolean transferred = false;
- if (ServerSettings.isAgentTransferEnabled()) {
+ if (ServerSettings.isAgentTransferEnabled() && taskContext.isStorageResourceManagedFileTransferEnabled()) {
transferred = transferFileToStorageThroughMFT(sourceURI.getPath(), destinationURI.getPath());
} else {
diff --git a/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql b/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
index f6978cb..25bcab5 100644
--- a/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
+++ b/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
@@ -10,3 +10,6 @@ CREATE TABLE IF NOT EXISTS COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID VA
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE INDEX I_CMPTN_Q_RESERVATION_ID ON COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID);
ALTER TABLE COMPUTE_RESOURCE_RESERVATION ADD CONSTRAINT FK_COMPUTE_RESOURCE_RESERVATION FOREIGN KEY (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) REFERENCES GROUP_COMPUTE_RESOURCE_PREFERENCE (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) ON DELETE CASCADE;
+
+-- AIRAVATA-3311
+ALTER TABLE STORAGE_PREFERENCE ADD MANAGED_FILE_TRANSFER_ENABLED SMALLINT NOT NULL DEFAULT 0;
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferenceEntity.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferenceEntity.java
index 8031b8f..bfb7d80 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferenceEntity.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferenceEntity.java
@@ -49,6 +49,9 @@ public class StoragePreferenceEntity implements Serializable {
@Column(name = "RESOURCE_CS_TOKEN")
private String resourceSpecificCredentialStoreToken;
+ @Column(name = "MANAGED_FILE_TRANSFER_ENABLED", nullable = false)
+ private boolean managedFileTransferEnabled = false;
+
@ManyToOne(targetEntity = GatewayProfileEntity.class, cascade = CascadeType.MERGE)
@JoinColumn(name = "GATEWAY_ID")
private GatewayProfileEntity gatewayProfileResource;
@@ -96,6 +99,14 @@ public class StoragePreferenceEntity implements Serializable {
this.resourceSpecificCredentialStoreToken = resourceSpecificCredentialStoreToken;
}
+ public boolean isManagedFileTransferEnabled() {
+ return managedFileTransferEnabled;
+ }
+
+ public void setManagedFileTransferEnabled(boolean managedFileTransferEnabled) {
+ this.managedFileTransferEnabled = managedFileTransferEnabled;
+ }
+
public GatewayProfileEntity getGatewayProfileResource() {
return gatewayProfileResource;
}
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
index afe5fed..0392688 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
@@ -513,6 +513,7 @@ CREATE TABLE STORAGE_PREFERENCE
LOGIN_USERNAME VARCHAR(255),
FS_ROOT_LOCATION VARCHAR(255),
RESOURCE_CS_TOKEN VARCHAR(255),
+ MANAGED_FILE_TRANSFER_ENABLED SMALLINT NOT NULL DEFAULT 0,
PRIMARY KEY(GATEWAY_ID,STORAGE_RESOURCE_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE
);
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
index 9ee940b..3f25109 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
@@ -506,6 +506,7 @@ CREATE TABLE STORAGE_PREFERENCE
LOGIN_USERNAME VARCHAR(255),
FS_ROOT_LOCATION VARCHAR(255),
RESOURCE_CS_TOKEN VARCHAR(255),
+ MANAGED_FILE_TRANSFER_ENABLED TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY(GATEWAY_ID,STORAGE_RESOURCE_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
index a28cb4e..0cbec68 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
@@ -25,6 +25,8 @@ import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescr
import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
+import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
+import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
import org.apache.airavata.model.data.movement.DataMovementProtocol;
import org.apache.airavata.registry.core.repositories.common.TestBase;
import org.apache.airavata.registry.cpi.AppCatalogException;
@@ -63,6 +65,7 @@ public class GatewayProfileRepositoryTest extends TestBase {
GatewayResourceProfile gf = new GatewayResourceProfile();
ComputeResourceRepository computeResourceRepository = new ComputeResourceRepository();
+ StorageResourceRepository storageResourceRepository = new StorageResourceRepository();
ComputeResourceDescription cm1 = new ComputeResourceDescription();
cm1.setHostName("localhost");
cm1.setResourceDescription("test compute host");
@@ -73,6 +76,10 @@ public class GatewayProfileRepositoryTest extends TestBase {
cm2.setResourceDescription("test compute host");
String hostId2 = computeResourceRepository.addComputeResource(cm2);
+ StorageResourceDescription sr1 = new StorageResourceDescription();
+ sr1.setHostName("localhost");;
+ String storageResourceId = storageResourceRepository.addStorageResource(sr1);
+
ComputeResourcePreference preference1 = new ComputeResourcePreference();
preference1.setComputeResourceId(hostId1);
preference1.setOverridebyAiravata(true);
@@ -99,6 +106,14 @@ public class GatewayProfileRepositoryTest extends TestBase {
list.add(preference1);
list.add(preference2);
+ StoragePreference storagePreference = new StoragePreference();
+ storagePreference.setStorageResourceId(storageResourceId);
+ storagePreference.setFileSystemRootLocation("/scratch/data");
+ storagePreference.setLoginUserName("loginUserName");
+ storagePreference.setManagedFileTransferEnabled(true);
+
+ gf.addToStoragePreferences(storagePreference);
+
gf.setGatewayID("testGateway");
gf.setCredentialStoreToken("testCredential");
gf.setIdentityServerPwdCredToken("pwdCredential");
@@ -142,6 +157,13 @@ public class GatewayProfileRepositoryTest extends TestBase {
System.out.println(cm.getPreferredJobSubmissionProtocol());
}
}
+ List<StoragePreference> storagePreferences = gwyResourceProfileRepository.getAllStoragePreferences(gwId);
+ assertEquals(1, storagePreferences.size());
+ StoragePreference sp1 = storagePreferences.get(0);
+ assertEquals("/scratch/data", sp1.getFileSystemRootLocation());
+ assertEquals("loginUserName", sp1.getLoginUserName());
+ assertTrue(sp1.isManagedFileTransferEnabled());
+
computeResourceRepository.removeComputeResource(hostId1);
computeResourceRepository.removeComputeResource(hostId2);
gwyResourceProfileRepository.delete("testGateway");
diff --git a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
index 6286a56..48641ef 100644
--- a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
@@ -47,3 +47,6 @@ CREATE TABLE IF NOT EXISTS COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID VA
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE INDEX IF NOT EXISTS I_CMPTN_Q_RESERVATION_ID ON COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID);
ALTER TABLE COMPUTE_RESOURCE_RESERVATION ADD CONSTRAINT FK_COMPUTE_RESOURCE_RESERVATION FOREIGN KEY IF NOT EXISTS (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) REFERENCES GROUP_COMPUTE_RESOURCE_PREFERENCE (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) ON DELETE CASCADE;
+
+-- AIRAVATA-3311
+ALTER TABLE STORAGE_PREFERENCE ADD COLUMN IF NOT EXISTS MANAGED_FILE_TRANSFER_ENABLED SMALLINT NOT NULL DEFAULT 0;
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
index b5ad3ac..62fca97 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
@@ -85,7 +85,8 @@ struct StoragePreference {
1: required string storageResourceId,
2: optional string loginUserName,
3: optional string fileSystemRootLocation,
- 4: optional string resourceSpecificCredentialStoreToken
+ 4: optional string resourceSpecificCredentialStoreToken,
+ 5: optional bool managedFileTransferEnabled,
}
/**