Skip to content

Commit

Permalink
BIGTOP-4190: Remove nop stack and mock real stack on dev mode (apache#48
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kevinw66 committed Aug 20, 2024
1 parent 272f24b commit fe418a7
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 1,542 deletions.
5 changes: 0 additions & 5 deletions bigtop-manager-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@
<artifactId>bigtop-manager-stack-bigtop</artifactId>
</dependency>

<dependency>
<groupId>org.apache.bigtop</groupId>
<artifactId>bigtop-manager-stack-nop</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
public class Environments {

/**
* Indicates whether the application is running in development mode, which is disabled by default.
* In development mode, only NOP stacks are available and no real shell commands will be executed on the agent side.
* Indicates whether the application is running in development mode.
* In development mode, most tasks run on agent side will be proxied and return success by default.
* This should help developers test framework functions without depending on the existence of big data components.
*/
public static Boolean isDevMode() {
String devMode = System.getenv("DEV_MODE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.bigtop.manager.server.utils;

import org.apache.bigtop.manager.common.enums.Command;
import org.apache.bigtop.manager.common.utils.Environments;
import org.apache.bigtop.manager.common.utils.JsonUtils;
import org.apache.bigtop.manager.server.exception.ApiException;
import org.apache.bigtop.manager.server.exception.ServerException;
Expand Down Expand Up @@ -77,8 +76,6 @@ public class StackUtils {

private static final String DEPENDENCY_FILE_NAME = "order.json";

private static final String NOP_STACK = "nop";

private static final Map<String, Map<String, List<String>>> STACK_DEPENDENCY_MAP = new HashMap<>();

private static final Map<String, Map<String, List<TypeConfigDTO>>> STACK_CONFIG_MAP = new HashMap<>();
Expand Down Expand Up @@ -202,13 +199,6 @@ public static Map<StackDTO, List<ServiceDTO>> stackList() {

for (File stackFolder : stackFolders) {
String stackName = stackFolder.getName();

// If in dev mode, only parse nop stack
// If not in dev mode, skip nop stack
if (Environments.isDevMode() != stackName.equals(NOP_STACK)) {
continue;
}

File[] versionFolders = Optional.ofNullable(stackFolder.listFiles()).orElse(new File[0]);

for (File versionFolder : versionFolders) {
Expand Down

This file was deleted.

Loading

0 comments on commit fe418a7

Please sign in to comment.