http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorPK.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorPK.java new file mode 100644 index 0000000..e7cc6ee --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorPK.java @@ -0,0 +1,75 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +public class ProcessErrorPK implements Serializable { + private final static Logger logger = LoggerFactory.getLogger(ProcessErrorPK.class); + private String errorId; + private String processId; + + @Column(name = "ERROR_ID") + @Id + public String getErrorId() { + return errorId; + } + + public void setErrorId(String errorId) { + this.errorId = errorId; + } + + @Column(name = "PROCESS_ID") + @Id + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ProcessErrorPK that = (ProcessErrorPK) o; + + if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false; + if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = getErrorId() != null ? getErrorId().hashCode() : 0; + result = 31 * result + (getProcessId() != null ? getProcessId().hashCode() : 0); + return result; + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputEntity.java new file mode 100644 index 0000000..a63ff37 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputEntity.java @@ -0,0 +1,174 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "PROCESS_INPUT") +@IdClass(ProcessInputPK.class) +public class ProcessInputEntity { + private String processId; + public String name; + public String value; + public String type; + public String applicationArgument; + public boolean standardInput; + public String userFriendlyDescription; + public String metaData; + public int inputOrder; + public boolean isRequired; + public boolean requiredToAddedToCommandLine; + public boolean dataStaged; + public String storageResourceId; + + private ProcessEntity process; + + @Id + @Column(name = "PROCESS_ID") + public String getProceesId() { + return processId; + } + + public void setProceseId(String processId) { + this.processId = processId; + } + + @Id + @Column(name = "INPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "INPUT_VALUE") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Column(name = "INPUT_TYPE") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Column(name = "APPLICATION_ARGUMENT") + public String getApplicationArgument() { + return applicationArgument; + } + + public void setApplicationArgument(String applicationArgument) { + this.applicationArgument = applicationArgument; + } + + @Column(name = "STANDARD_INPUT") + public boolean isStandardInput() { + return standardInput; + } + + public void setStandardInput(boolean standardInput) { + this.standardInput = standardInput; + } + + @Column(name = "USER_FRIENDLY_DESCRIPTION") + public String getUserFriendlyDescription() { + return userFriendlyDescription; + } + + public void setUserFriendlyDescription(String userFriendlyDescription) { + this.userFriendlyDescription = userFriendlyDescription; + } + + @Lob + @Column(name = "METADATA") + public String getMetaData() { + return metaData; + } + + public void setMetaData(String metaData) { + this.metaData = metaData; + } + + @Column(name = "INPUT_ORDER") + public int getInputOrder() { + return inputOrder; + } + + public void setInputOrder(int inputOrder) { + this.inputOrder = inputOrder; + } + + @Column(name = "REQUIRED") + public boolean isRequired() { + return isRequired; + } + + public void setRequired(boolean isRequired) { + this.isRequired = isRequired; + } + + @Column(name = "REQUIRED_TO_ADDED_TO_COMMANDLINE") + public boolean isRequiredToAddedToCommandLine() { + return requiredToAddedToCommandLine; + } + + public void setRequiredToAddedToCommandLine(boolean requiredToAddedToCommandLine) { + this.requiredToAddedToCommandLine = requiredToAddedToCommandLine; + } + + @Column(name = "DATA_STAGED") + public boolean isDataStaged() { + return dataStaged; + } + + public void setDataStaged(boolean dataStaged) { + this.dataStaged = dataStaged; + } + + @Column(name = "STORAGE_RESOURCE_ID") + public String getStorageResourceId() { + return storageResourceId; + } + + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + } + + @ManyToOne(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID") + public ProcessEntity getProcess() { + return process; + } + + public void setProcess(ProcessEntity process) { + this.process = process; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputPK.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputPK.java new file mode 100644 index 0000000..188b35f --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessInputPK.java @@ -0,0 +1,74 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +public class ProcessInputPK implements Serializable { + private final static Logger logger = LoggerFactory.getLogger(ProcessInputPK.class); + private String processId; + private String name; + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Id + @Column(name = "INPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ProcessInputPK that = (ProcessInputPK) o; + + if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false; + if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = getProcessId() != null ? getProcessId().hashCode() : 0; + result = 31 * result + (getName() != null ? getName().hashCode() : 0); + return result; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputEntity.java new file mode 100644 index 0000000..06181bc --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputEntity.java @@ -0,0 +1,165 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "PROCESS_OUTPUT") +@IdClass(ProcessOutputPK.class) +public class ProcessOutputEntity { + private String processId; + public String name; + public String value; + public String type; + public String applicationArgument; + public boolean isRequired; + public boolean requiredToAddedToCommandLine; + public boolean dataMovement; + public String location; + public String searchQuery; + public boolean outputStreaming; + public String storageResourceId; + + private ProcessEntity process; + + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Id + @Column(name = "OUTPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "OUTPUT_VALUE") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Column(name = "OUTPUT_TYPE") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Column(name = "APPLICATION_ARGUMENT") + public String getApplicationArgument() { + return applicationArgument; + } + + public void setApplicationArgument(String applicationArgument) { + this.applicationArgument = applicationArgument; + } + + @Column(name = "REQUIRED") + public boolean isRequired() { + return isRequired; + } + + public void setRequired(boolean isRequired) { + this.isRequired = isRequired; + } + + + @Column(name = "REQUIRED_TO_ADDED_TO_COMMANDLINE") + public boolean isRequiredToAddedToCommandLine() { + return requiredToAddedToCommandLine; + } + + public void setRequiredToAddedToCommandLine(boolean requiredToAddedToCommandLine) { + this.requiredToAddedToCommandLine = requiredToAddedToCommandLine; + } + + @Column(name = "DATA_MOVEMENT") + public boolean isDataMovement() { + return dataMovement; + } + + public void setDataMovement(boolean dataMovement) { + this.dataMovement = dataMovement; + } + + @Column(name = "LOCATION") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + @Column(name = "SEARCH_QUERY") + public String getSearchQuery() { + return searchQuery; + } + + public void setSearchQuery(String searchQuery) { + this.searchQuery = searchQuery; + } + + @Column(name = "OUTPUT_STREAMING") + public boolean isOutputStreaming() { + return outputStreaming; + } + + public void setOutputStreaming(boolean outputStreaming) { + this.outputStreaming = outputStreaming; + } + + @Column(name = "STORAGE_RESOURCE_ID") + public String getStorageResourceId() { + return storageResourceId; + } + + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + } + + @ManyToOne(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID") + public ProcessEntity getProcess() { + return process; + } + + public void setProcess(ProcessEntity process) { + this.process = process; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputPK.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputPK.java new file mode 100644 index 0000000..bde7c50 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessOutputPK.java @@ -0,0 +1,70 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +public class ProcessOutputPK implements Serializable { + private String processId; + private String name; + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Id + @Column(name = "OUTPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ProcessOutputPK that = (ProcessOutputPK) o; + + if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false; + if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = getProcessId() != null ? getProcessId().hashCode() : 0; + result = 31 * result + (getName() != null ? getName().hashCode() : 0); + return result; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessResourceSchedulingEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessResourceSchedulingEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessResourceSchedulingEntity.java new file mode 100644 index 0000000..11f167d --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessResourceSchedulingEntity.java @@ -0,0 +1,170 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "PROCESS_RESOURCE_SCHEDULING") +public class ProcessResourceSchedulingEntity { + private String processId; + private String resourceHostId; + private int totalCPUCount; + private int nodeCount; + private int numberOfThreads; + private String queueName; + private int wallTimeLimit; + private int totalPhysicalMemory; + private String chessisNumber; + private String staticWorkingDir; + private String overrideLoginUserName; + private String overrideScratchLocation; + private String overrideAllocationProjectNumber; + private ProcessEntity process; + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Column(name = "RESOURCE_HOST_ID") + public String getResourceHostId() { + return resourceHostId; + } + + public void setResourceHostId(String resourceHostId) { + this.resourceHostId = resourceHostId; + } + + @Column(name = "CPU_COUNT") + public int getTotalCPUCount() { + return totalCPUCount; + } + + public void setTotalCPUCount(int totalCPUCount) { + this.totalCPUCount = totalCPUCount; + } + + @Column(name = "NODE_COUNT") + public int getNodeCount() { + return nodeCount; + } + + public void setNodeCount(int nodeCount) { + this.nodeCount = nodeCount; + } + + @Column(name = "NUMBER_OF_THREADS") + public int getNumberOfThreads() { + return numberOfThreads; + } + + public void setNumberOfThreads(int numberOfThreads) { + this.numberOfThreads = numberOfThreads; + } + + @Column(name = "QUEUE_NAME") + public String getQueueName() { + return queueName; + } + + public void setQueueName(String queueName) { + this.queueName = queueName; + } + + @Column(name = "WALL_TIME_LIMIT") + public int getWallTimeLimit() { + return wallTimeLimit; + } + + public void setWallTimeLimit(int wallTimeLimit) { + this.wallTimeLimit = wallTimeLimit; + } + + @Column(name = "TOTAL_PHYSICAL_MEMORY") + public int getTotalPhysicalMemory() { + return totalPhysicalMemory; + } + + public void setTotalPhysicalMemory(int totalPhysicalMemory) { + this.totalPhysicalMemory = totalPhysicalMemory; + } + + @Column(name = "CHESSIS_NUMBER") + public String getChessisNumber() { + return chessisNumber; + } + + public void setChessisNumber(String chessisNumber) { + this.chessisNumber = chessisNumber; + } + + @Column(name = "STATIC_WORKING_DIRECTORY") + public String getStaticWorkingDir() { + return staticWorkingDir; + } + + public void setStaticWorkingDir(String staticWorkingDir) { + this.staticWorkingDir = staticWorkingDir; + } + + @Column(name = "OVERRIDE_LOGIN_USERNAME") + public String getOverrideLoginUserName() { + return overrideLoginUserName; + } + + public void setOverrideLoginUserName(String overrideLoginUserName) { + this.overrideLoginUserName = overrideLoginUserName; + } + + @Column(name = "OVERRIDE_SCRATCH_LOCATION") + public String getOverrideScratchLocation() { + return overrideScratchLocation; + } + + public void setOverrideScratchLocation(String overrideScratchLocation) { + this.overrideScratchLocation = overrideScratchLocation; + } + + @Column(name = "OVERRIDE_ALLOCATION_PROJECT_NUMBER") + public String getOverrideAllocationProjectNumber() { + return overrideAllocationProjectNumber; + } + + public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) { + this.overrideAllocationProjectNumber = overrideAllocationProjectNumber; + } + + @OneToOne(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID") + public ProcessEntity getProcess() { + return process; + } + + public void setProcess(ProcessEntity process) { + this.process = process; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusEntity.java new file mode 100644 index 0000000..ea816b5 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusEntity.java @@ -0,0 +1,83 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "PROCESS_STATUS") +@IdClass(ProcessStatusPK.class) +public class ProcessStatusEntity { + private String processId; + private String state; + private long timeOfStateChange; + private String reason; + + private ProcessEntity process; + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Id + @Column(name = "STATE") + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + @Column(name = "TIME_OF_STATE_CHANGE") + public long getTimeOfStateChange() { + return timeOfStateChange; + } + + public void setTimeOfStateChange(long timeOfStateChange) { + this.timeOfStateChange = timeOfStateChange; + } + + @Column(name = "REASON") + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + @ManyToOne(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID") + public ProcessEntity getProcess() { + return process; + } + + public void setProcess(ProcessEntity process) { + this.process = process; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusPK.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusPK.java new file mode 100644 index 0000000..dba568a --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessStatusPK.java @@ -0,0 +1,74 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.persistence.Column; +import javax.persistence.Id; +import java.io.Serializable; + +public class ProcessStatusPK implements Serializable { + private final static Logger logger = LoggerFactory.getLogger(ProcessStatusPK.class); + private String state; + private String processId; + + @Id + @Column(name = "STATUS_ID") + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ProcessStatusPK that = (ProcessStatusPK) o; + + if (getState() != null ? !getState().equals(that.getState()) : that.getState() != null) return false; + if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = getState() != null ? getState().hashCode() : 0; + result = 31 * result + (getProcessId() != null ? getProcessId().hashCode() : 0); + return result; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java index b20650d..5a52dff 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java @@ -49,8 +49,11 @@ public class ExperimentRepository extends AbstractRepository<ExperimentModel, Ex Mapper mapper = ObjectMapperSingleton.getInstance(); ExperimentEntity entity = mapper.map(experiment, ExperimentEntity.class); - if(entity.getUserConfigurationData() != null) + if(entity.getUserConfigurationData() != null) { entity.getUserConfigurationData().setExperimentId(experimentId); + if (entity.getUserConfigurationData().getComputeResourceSchedulingEntity() != null) + entity.getUserConfigurationData().getComputeResourceSchedulingEntity().setExperimentId(experimentId); + } if(entity.getExperimentInputs() != null) entity.getExperimentInputs().forEach(expIn->expIn.setExperimentId(experimentId)); if(entity.getExperimentOutputs() != null) @@ -60,6 +63,23 @@ public class ExperimentRepository extends AbstractRepository<ExperimentModel, Ex if(entity.getExperimentStatuses() != null) entity.getExperimentStatuses().forEach(expStatus->expStatus.setExperimentId(experimentId)); + if(entity.getProcesses() != null){ + entity.getProcesses().forEach(process->{ + process.setExperimentId(experimentId); + String processId = process.getProcessId(); + if(process.getProcessResourceSchedule() != null) + process.getProcessResourceSchedule().setProcessId(processId); + if(process.getProcessInputs() != null) + process.getProcessInputs().forEach(proInput->proInput.setProceseId(processId)); + if(process.getProcessOutputs() != null) + process.getProcessOutputs().forEach(proOutput->proOutput.setProcessId(processId)); + if(process.getProcessError() != null) + process.getProcessError().forEach(processErr->processErr.setProcessId(processId)); + if(process.getProcessStatus() != null) + process.getProcessStatus().forEach(processStat->processStat.setProcessId(processId)); + }); + } + ExperimentEntity persistedCopy = JPAUtils.execute(entityManager -> entityManager.merge(entity)); return mapper.map(persistedCopy, ExperimentModel.class); } http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml index f7d72f3..8367f97 100644 --- a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml +++ b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml @@ -34,6 +34,12 @@ <class>org.apache.airavata.registry.core.entities.expcatalog.ExperimentOutputEntity</class> <class>org.apache.airavata.registry.core.entities.expcatalog.ExperimentStatusEntity</class> <class>org.apache.airavata.registry.core.entities.expcatalog.UserConfigurationEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessErrorEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessInputEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessOutputEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessResourceSchedulingEntity</class> + <class>org.apache.airavata.registry.core.entities.expcatalog.ProcessStatusEntity</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> </persistence-unit> </persistence> http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/resources/experiment_catalog.sql ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/resources/experiment_catalog.sql b/modules/registry-refactoring/src/main/resources/experiment_catalog.sql index 4d401a3..8c11027 100644 --- a/modules/registry-refactoring/src/main/resources/experiment_catalog.sql +++ b/modules/registry-refactoring/src/main/resources/experiment_catalog.sql @@ -116,4 +116,112 @@ CREATE TABLE IF NOT EXISTS EXPERIMENT_STATUS( REASON VARCHAR (255), PRIMARY KEY (EXPERIMENT_ID, STATE), FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS( + PROCESS_ID VARCHAR (255), + EXPERIMENT_ID VARCHAR (255), + CREATION_TIME BIGINT, + LAST_UPDATE_TIME BIGINT, + PROCESS_DETAIL VARCHAR (255), + APPLICATION_INTERFACE_ID VARCHAR (255), + APPLICATION_DEPLOYMENT_ID VARCHAR (255), + COMPUTE_RESOURCE_ID VARCHAR (255), + TASK_DAG VARCHAR (255), + GATEWAY_EXECUTION_ID VARCHAR (255), + ENABLE_EMAIL_NOTIFICATION TINYINT(1), + STORAGE_RESOURCE_ID VARCHAR (255), + USER_DN VARCHAR (255), + GENERATE_CERT VARCHAR (255), + EXPERIMENT_DATA_DIR VARCHAR (255), + USER_NAME VARCHAR (255), + PRIMARY KEY (PROCESS_ID), + FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_EMAIL ( + PROCESS_ID VARCHAR (255), + EMAIL VARCHAR (255), + PRIMARY KEY (PROCESS_ID, EMAIL), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_RESOURCE_SCHEDULING( + PROCESS_ID VARCHAR (255), + RESOURCE_HOST_ID VARCHAR (255), + CPU_COUNT INT, + NODE_COUNT INT, + NUMBER_OF_THREADS INT, + QUEUE_NAME VARCHAR (255), + WALL_TIME_LIMIT INT, + TOTAL_PHYSICAL_MEMORY INT, + CHESSIS_NUMBER VARCHAR (255), + STATIC_WORKING_DIRECTORY VARCHAR (255), + OVERRIDE_LOGIN_USERNAME VARCHAR (255), + OVERRIDE_SCRATCH_LOCATION VARCHAR (255), + OVERRIDE_ALLOCATION_PROJECT_NUMBER VARCHAR (255), + PRIMARY KEY (PROCESS_ID), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_INPUT( + PROCESS_ID VARCHAR (255), + INPUT_NAME VARCHAR (255), + INPUT_VALUE VARCHAR (255), + INPUT_TYPE VARCHAR (255), + APPLICATION_ARGUMENT VARCHAR (255), + STANDARD_INPUT TINYINT(1), + USER_FRIENDLY_DESCRIPTION VARCHAR (255), + METADATA VARCHAR (4096), + INPUT_ORDER INT, + REQUIRED TINYINT(1), + REQUIRED_TO_ADDED_TO_COMMANDLINE TINYINT(1), + DATA_STAGED TINYINT(1), + STORAGE_RESOURCE_ID VARCHAR (255), + PRIMARY KEY (PROCESS_ID,INPUT_NAME), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_OUTPUT( + PROCESS_ID VARCHAR (255), + OUTPUT_NAME VARCHAR (255), + OUTPUT_VALUE VARCHAR (255), + OUTPUT_TYPE VARCHAR (255), + APPLICATION_ARGUMENT VARCHAR (255), + REQUIRED TINYINT(1), + REQUIRED_TO_ADDED_TO_COMMANDLINE TINYINT(1), + DATA_MOVEMENT TINYINT(1), + LOCATION VARCHAR (255), + SEARCH_QUERY VARCHAR (255), + OUTPUT_STREAMING TINYINT(1), + STORAGE_RESOURCE_ID VARCHAR (255), + PRIMARY KEY (PROCESS_ID,OUTPUT_NAME), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_ERROR( + ERROR_ID VARCHAR (255), + PROCESS_ID VARCHAR (255), + CREATION_TIME BIGINT, + ACTUAL_ERROR_MESSAGE VARCHAR (255), + USER_FRIENDLY_MESSAGE VARCHAR (255), + TRANSIENT_OR_PERSISTENT TINYINT, + PRIMARY KEY (ERROR_ID, PROCESS_ID), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_ERROR_ROOT_CAUSE_ERROR_ID( + ERROR_ID VARCHAR (255), + ROOT_CAUSE_ERROR_ID VARCHAR (255), + PRIMARY KEY (ERROR_ID, ROOT_CAUSE_ERROR_ID), + FOREIGN KEY(ERROR_ID) REFERENCES PROCESS_ERROR(ERROR_ID) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS PROCESS_STATUS( + PROCESS_ID VARCHAR (255), + STATE VARCHAR (255), + TIME_OF_STATE_CHANGE BIGINT, + REASON VARCHAR (255), + PRIMARY KEY (PROCESS_ID, STATE), + FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE ); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java index 3066886..f66b283 100644 --- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java +++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java @@ -293,8 +293,8 @@ public class ExperimentRegistry { processResource.save(); - if(process.getResourceSchedule() != null) { - addProcessResourceSchedule(process.getResourceSchedule(), process.getProcessId()); + if(process.getProcessResourceSchedule() != null) { + addProcessResourceSchedule(process.getProcessResourceSchedule(), process.getProcessId()); } if(process.getProcessInputs() != null && process.getProcessInputs().size() > 0) { addProcessInputs(process.getProcessInputs(), process.getProcessId()); @@ -305,10 +305,12 @@ public class ExperimentRegistry { ProcessStatus processStatus = new ProcessStatus(); processStatus.setState(ProcessState.CREATED); - addProcessStatus(processStatus, process.getProcessId()); + List<ProcessStatus> processStatuses = new ArrayList<>(); + processStatuses.add(processStatus); + addProcessStatus(processStatuses.get(0), process.getProcessId()); if(process.getProcessError() != null) { - addProcessError(process.getProcessError(), process.getProcessId()); + addProcessError(process.getProcessError().get(0), process.getProcessId()); } } catch (Exception e) { logger.error(expId, "Error while adding process...", e); @@ -391,27 +393,27 @@ public class ExperimentRegistry { public String addProcessStatus(ProcessStatus processStatus, String processID) throws RegistryException { try { - ProcessResource processResource = new ProcessResource(); - processResource.setProcessId(processID); - ProcessStatusResource status = processResource.getProcessStatus(); - ProcessState newState = processStatus.getState(); - if (status == null) { - status = (ProcessStatusResource) processResource.create(ResourceType.PROCESS_STATUS); - status.setStatusId(getStatusID("PROCESS_STATE")); - }else { - String state = status.getState(); - if (newState != null && !state.equals(newState.toString())){ + ProcessResource processResource = new ProcessResource(); + processResource.setProcessId(processID); + ProcessStatusResource status = processResource.getProcessStatus(); + ProcessState newState = processStatus.getState(); + if (status == null) { + status = (ProcessStatusResource) processResource.create(ResourceType.PROCESS_STATUS); status.setStatusId(getStatusID("PROCESS_STATE")); + }else { + String state = status.getState(); + if (newState != null && !state.equals(newState.toString())){ + status.setStatusId(getStatusID("PROCESS_STATE")); + } } - } - status.setProcessId(processID); - status.setTimeOfStateChange(AiravataUtils.getTime(processStatus.getTimeOfStateChange())); - if (newState != null){ - status.setState(newState.toString()); - } - status.setReason(processStatus.getReason()); - status.save(); - logger.debug(processID, "Added process {} status to {}.", processID, processStatus.toString()); + status.setProcessId(processID); + status.setTimeOfStateChange(AiravataUtils.getTime(processStatus.getTimeOfStateChange())); + if (newState != null){ + status.setState(newState.toString()); + } + status.setReason(processStatus.getReason()); + status.save(); + logger.debug(processID, "Added process {} status to {}.", processID, processStatus.toString()); } catch (Exception e) { logger.error(processID, "Error while adding process status...", e); throw new RegistryException(e); @@ -752,8 +754,8 @@ public class ExperimentRegistry { processResource.save(); - if(process.getResourceSchedule() != null) { - updateProcessResourceSchedule(process.getResourceSchedule(), process.getProcessId()); + if(process.getProcessResourceSchedule() != null) { + updateProcessResourceSchedule(process.getProcessResourceSchedule(), process.getProcessId()); } if(process.getProcessInputs() != null && process.getProcessInputs().size() > 0) { updateProcessInputs(process.getProcessInputs(), process.getProcessId()); @@ -762,10 +764,10 @@ public class ExperimentRegistry { updateProcessOutputs(process.getProcessOutputs(), process.getProcessId()); } if(process.getProcessStatus() != null) { - updateProcessStatus(process.getProcessStatus(), process.getProcessId()); + updateProcessStatus(process.getProcessStatus().get(0), process.getProcessId()); } if(process.getProcessError() != null) { - updateProcessError(process.getProcessError(), process.getProcessId()); + updateProcessError(process.getProcessError().get(0), process.getProcessId()); } if(process.getTasks() != null && process.getTasks().size() > 0){ for(TaskModel task : process.getTasks()){ @@ -864,8 +866,8 @@ public class ExperimentRegistry { return addProcessStatus(processStatus, processID); } - public String updateProcessError(ErrorModel processError, String processID) throws RegistryException { - return addProcessError(processError, processID); + public String updateProcessError(ErrorModel processErrors, String processID) throws RegistryException { + return addProcessError(processErrors, processID); } public String updateTask(TaskModel task, String taskID) throws RegistryException { http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java index 3e04fcd..533e719 100644 --- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java +++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java @@ -384,16 +384,20 @@ public class ThriftDataModelConversion { ErrorModel errorModel = getErrorModel(processResource.getProcessError()); if (errorModel != null){ - processModel.setProcessError(errorModel); + List<ErrorModel> errorModels = new ArrayList<>(); + errorModels.add(errorModel); + processModel.setProcessError(errorModels); } ProcessStatus processStatus = getProcessStatus(processResource.getProcessStatus()); if (processStatus != null){ - processModel.setProcessStatus(processStatus); + List<ProcessStatus> statuses = new ArrayList<>(); + statuses.add(processStatus); + processModel.setProcessStatus(statuses); } ComputationalResourceSchedulingModel schedule = getProcessResourceSchedule(processResource.getProcessResourceSchedule()); if (schedule != null){ - processModel.setResourceSchedule(schedule); + processModel.setProcessResourceSchedule(schedule); } processModel.setTasks(getTaskModelList(processResource.getTaskList())); processModel.setStorageResourceId(processResource.getStorageResourceId()); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift index b780203..0a72923 100644 --- a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift +++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift @@ -44,17 +44,17 @@ struct ProcessModel { 2: required string experimentId, 3: optional i64 creationTime, 4: optional i64 lastUpdateTime, - 5: optional status_models.ProcessStatus processStatus, + 5: optional list<status_models.ProcessStatus> processStatus, 6: optional string processDetail, 7: optional string applicationInterfaceId, 8: optional string applicationDeploymentId, 9: optional string computeResourceId, 10: optional list<application_io_models.InputDataObjectType> processInputs, 11: optional list<application_io_models.OutputDataObjectType> processOutputs, - 12: optional scheduling_model.ComputationalResourceSchedulingModel resourceSchedule, + 12: optional scheduling_model.ComputationalResourceSchedulingModel processResourceSchedule, 13: optional list<task_model.TaskModel> tasks, 14: optional string taskDag, - 15: optional airavata_commons.ErrorModel processError, + 15: optional list<airavata_commons.ErrorModel> processError, 16: optional string gatewayExecutionId, 17: optional bool enableEmailNotification, 18: optional list<string> emailAddresses,
