This is an automated email from the ASF dual-hosted git repository.
yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new 5d122aab68 Remove dead orchestration util classes (#663)
5d122aab68 is described below
commit 5d122aab6820e323b5dbafd47097b98989be5f77
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sat Jun 13 00:34:17 2026 -0400
Remove dead orchestration util classes (#663)
Eight legacy classes under orchestration-service/util with zero references
anywhere (verified across both repos including config/reflection-string
usages;
the reactor compiles cleanly without them): OrchestratorServerConstants,
ProjectModelUtil, WorkflowContext, OrchestratorServerThreadPoolExecutor,
AiravataJobState, PropertyResolver, ComputeRepositoryFactory, ExecutionType.
Leftovers from the pre-DB-transactional orchestration engine.
---
.../orchestration/util/AiravataJobState.java | 115 ---------------------
.../util/ComputeRepositoryFactory.java | 50 ---------
.../airavata/orchestration/util/ExecutionType.java | 26 -----
.../util/OrchestratorServerConstants.java | 26 -----
.../util/OrchestratorServerThreadPoolExecutor.java | 53 ----------
.../orchestration/util/ProjectModelUtil.java | 33 ------
.../orchestration/util/PropertyResolver.java | 63 -----------
.../orchestration/util/WorkflowContext.java | 86 ---------------
8 files changed, 452 deletions(-)
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/AiravataJobState.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/AiravataJobState.java
deleted file mode 100644
index b7bcdcf663..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/AiravataJobState.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-/*
-These are the job statuses shared in database level between orchestrator and
-gfac instances
- */
-public class AiravataJobState {
-
- private State jobState;
-
- public State getJobState() {
- return jobState;
- }
-
- public void setJobState(State jobState) {
- this.jobState = jobState;
- }
-
- public enum State {
- CREATED {
- public String toString() {
- return "CREATED";
- }
- },
- ACCEPTED {
- public String toString() {
- return "ACCEPTED";
- }
- },
- FETCHED {
- public String toString() {
- return "FETCHED";
- }
- },
- INHANDLERSDONE {
- public String toString() {
- return "INHANDLERSDONE";
- }
- },
- SUBMITTED {
- public String toString() {
- return "SUBMITTED";
- }
- },
- OUTHANDLERSDONE {
- public String toString() {
- return "OUTHANDLERSDONE";
- }
- },
- RUNNING {
- public String toString() {
- return "RUNNING";
- }
- },
- FAILED {
- public String toString() {
- return "FAILED";
- }
- },
- PAUSED {
- public String toString() {
- return "PAUSED";
- }
- },
- PENDING {
- public String toString() {
- return "PENDING";
- }
- },
- ACTIVE {
- public String toString() {
- return "ACTIVE";
- }
- },
- DONE {
- public String toString() {
- return "DONE";
- }
- },
- CANCELLED {
- public String toString() {
- return "CANCELLED";
- }
- },
- UNKNOWN {
- public String toString() {
- return "UNKNOWN";
- }
- },
- HANGED {
- public String toString() {
- return "HANGED";
- }
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ComputeRepositoryFactory.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ComputeRepositoryFactory.java
deleted file mode 100644
index f380e30022..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ComputeRepositoryFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-/**
- * Reflective factory for compute-service repository instances.
- *
- * <p>Decouples airavata-api from compile-time dependency on compute-service.
- * At runtime, compute-service must be on the classpath (provided by
airavata-server).
- */
-public final class ComputeRepositoryFactory {
-
- private static final String REPO_PACKAGE =
"org.apache.airavata.compute.repository.";
-
- private ComputeRepositoryFactory() {}
-
- /**
- * Create a compute repository instance by simple class name.
- *
- * @param simpleClassName e.g. "ComputeResourceRepository"
- * @return the repository instance
- */
- @SuppressWarnings("unchecked")
- public static <T> T create(String simpleClassName) {
- try {
- Class<?> clazz = Class.forName(REPO_PACKAGE + simpleClassName);
- return (T) clazz.getDeclaredConstructor().newInstance();
- } catch (ReflectiveOperationException e) {
- throw new RuntimeException(
- "Failed to create " + simpleClassName + "; is
compute-service on the classpath?", e);
- }
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ExecutionType.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ExecutionType.java
deleted file mode 100644
index a2ad198979..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ExecutionType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-public enum ExecutionType {
- UNKNOWN,
- SINGLE_APP,
- WORKFLOW
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerConstants.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerConstants.java
deleted file mode 100644
index 0a15fa3a60..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerConstants.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-public class OrchestratorServerConstants {
- public static final String ORCHESTRATOT_SERVER_PORT =
"orchestrator.server.port";
- public static final String ORCHESTRATOT_SERVER_HOST =
"orchestrator.server.host";
- public static final String ORCHESTRATOT_SERVER_MIN_THREADS =
"orchestrator.server.min.threads";
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerThreadPoolExecutor.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerThreadPoolExecutor.java
deleted file mode 100644
index 2699491b85..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/OrchestratorServerThreadPoolExecutor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.apache.airavata.config.ServerSettings;
-import org.apache.airavata.exception.ApplicationSettingsException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OrchestratorServerThreadPoolExecutor {
- private static final Logger logger =
LoggerFactory.getLogger(OrchestratorServerThreadPoolExecutor.class);
- public static final String AIRAVATA_SERVER_THREAD_POOL_SIZE =
"airavata.server.thread.pool.size";
-
- private static ExecutorService threadPool;
-
- public static ExecutorService getCachedThreadPool() {
- if (threadPool == null) {
- threadPool = Executors.newCachedThreadPool();
- }
- return threadPool;
- }
-
- public static ExecutorService getFixedThreadPool() {
- if (threadPool == null) {
- try {
- threadPool = Executors.newFixedThreadPool(
-
Integer.parseInt(ServerSettings.getSetting(AIRAVATA_SERVER_THREAD_POOL_SIZE)));
- } catch (ApplicationSettingsException e) {
- logger.error("Error reading " +
AIRAVATA_SERVER_THREAD_POOL_SIZE + " property");
- }
- }
- return threadPool;
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ProjectModelUtil.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ProjectModelUtil.java
deleted file mode 100644
index f564bab81e..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/ProjectModelUtil.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-import org.apache.airavata.model.workspace.proto.Project;
-
-public class ProjectModelUtil {
- public static Project createProject(String projectName, String owner,
String description) {
- return Project.newBuilder()
- .setName(projectName)
- .setProjectId(projectName)
- .setOwner(owner)
- .setDescription(description)
- .build();
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/PropertyResolver.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/PropertyResolver.java
deleted file mode 100644
index 361d89b36f..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/PropertyResolver.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Optional;
-import java.util.Properties;
-
-/**
- * TODO: Class level comments please
- *
- * @author dimuthu
- * @since 1.0.0-SNAPSHOT
- */
-public class PropertyResolver {
- private Properties properties = new Properties();
-
- public void loadFromFile(File propertyFile) throws IOException {
- properties = new Properties();
- properties.load(new FileInputStream(propertyFile));
- }
-
- public void loadInputStream(InputStream inputStream) throws IOException {
- properties = new Properties();
- properties.load(inputStream);
- }
-
- public String get(String key) {
- if (properties.containsKey(key)) {
- if (System.getenv(key.replace(".", "_")) != null) {
- return System.getenv(key.replace(".", "_"));
- } else {
- return properties.getProperty(key);
- }
- } else {
- return null;
- }
- }
-
- public String get(String key, String defaultValue) {
- return Optional.ofNullable(get(key)).orElse(defaultValue);
- }
-}
diff --git
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/WorkflowContext.java
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/WorkflowContext.java
deleted file mode 100644
index 99e010f851..0000000000
---
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/WorkflowContext.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
-*
-* 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.orchestration.util;
-
-import org.apache.airavata.config.RequestContext;
-
-/**
- * The workflow context class. This will be local to a thread. Workflow data
that needs to propagate relevant to a
- * request will be stored here. We use thread local globals to store request
data. Currently we only store user
- * identity.
- */
-public class WorkflowContext {
-
- private static final ThreadLocal userThreadLocal = new
InheritableThreadLocal();
-
- /**
- * Sets the context.
- *
- * @param context
- * The context to be set. - Careful when calling this. Make
sure other data relevant to context is
- * preserved.
- */
- public static void set(RequestContext context) {
- userThreadLocal.set(context);
- }
-
- /**
- * Clears the context
- */
- public static void unset() {
- userThreadLocal.remove();
- }
-
- /**
- * Gets the context associated with current context.
- *
- * @return The context associated with current thread.
- */
- public static RequestContext get() {
- return (RequestContext) userThreadLocal.get();
- }
-
- /**
- * Gets the user associated with current user.
- *
- * @return User id associated with current request.
- */
- public static synchronized String getRequestUser() {
-
- RequestContext requestContext = (RequestContext) userThreadLocal.get();
-
- if (requestContext != null) {
- return requestContext.getUserId();
- }
-
- return null;
- }
-
- public static synchronized String getGatewayId() {
-
- RequestContext requestContext = (RequestContext) userThreadLocal.get();
-
- if (requestContext != null) {
- return requestContext.getGatewayId();
- }
-
- return null;
- }
-}