Skip to content

[ISSUE #9335] Unify the home dir #9336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public class PlainPermissionManager {

private static final Logger log = LoggerFactory.getLogger(LoggerName.COMMON_LOGGER_NAME);

private String fileHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY,
System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private String fileHome = MixAll.ROCKETMQ_HOME_DIR;

private String defaultAclDir;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class BrokerConfig extends BrokerIdentity {

private String brokerConfigPath = null;

private String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private String rocketmqHome = MixAll.ROCKETMQ_HOME_DIR;
@ImportantField
private String namesrvAddr = System.getProperty(MixAll.NAMESRV_ADDR_PROPERTY, System.getenv(MixAll.NAMESRV_ADDR_ENV));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.rocketmq.common.metrics.MetricsExporterType;

public class ControllerConfig {
private String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private String rocketmqHome = MixAll.ROCKETMQ_HOME_DIR;
private String configStorePath = System.getProperty("user.home") + File.separator + "controller" + File.separator + "controller.properties";
public static final String DLEDGER_CONTROLLER = "DLedger";
public static final String JRAFT_CONTROLLER = "jRaft";
Expand Down
4 changes: 4 additions & 0 deletions common/src/main/java/org/apache/rocketmq/common/MixAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
public class MixAll {
public static final String ROCKETMQ_HOME_ENV = "ROCKETMQ_HOME";
public static final String ROCKETMQ_HOME_PROPERTY = "rocketmq.home.dir";
/**
* unify the home dir
*/
public static final String ROCKETMQ_HOME_DIR = System.getProperty(ROCKETMQ_HOME_PROPERTY, System.getenv(ROCKETMQ_HOME_ENV));
public static final String NAMESRV_ADDR_ENV = "NAMESRV_ADDR";
public static final String NAMESRV_ADDR_PROPERTY = "rocketmq.namesrv.addr";
public static final String MESSAGE_COMPRESS_TYPE = "rocketmq.message.compressType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class NamesrvConfig {

private String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private String rocketmqHome = MixAll.ROCKETMQ_HOME_DIR;
private String kvConfigPath = System.getProperty("user.home") + File.separator + "namesrv" + File.separator + "kvConfig.json";
private String configStorePath = System.getProperty("user.home") + File.separator + "namesrv" + File.separator + "namesrv.properties";
private String productEnvName = "center";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class BrokerContainerConfig {

private String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private String rocketmqHome = MixAll.ROCKETMQ_HOME_DIR;

@ImportantField
private String namesrvAddr = System.getProperty(MixAll.NAMESRV_ADDR_PROPERTY, System.getenv(MixAll.NAMESRV_ADDR_ENV));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class ConfigurationManager {
public static final String RMQ_PROXY_HOME = "RMQ_PROXY_HOME";
protected static final String DEFAULT_RMQ_PROXY_HOME = System.getenv(MixAll.ROCKETMQ_HOME_ENV);
protected static final String DEFAULT_RMQ_PROXY_HOME = MixAll.ROCKETMQ_HOME_DIR;
protected static String proxyHome;
protected static Configuration configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public class DefaultMessagingProcessor extends AbstractStartAndShutdown implemen

protected ThreadPoolExecutor producerProcessorExecutor;
protected ThreadPoolExecutor consumerProcessorExecutor;
protected static final String ROCKETMQ_HOME = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY,
System.getenv(MixAll.ROCKETMQ_HOME_ENV));
protected static final String ROCKETMQ_HOME = MixAll.ROCKETMQ_HOME_DIR;

protected DefaultMessagingProcessor(ServiceManager serviceManager) {
ProxyConfig proxyConfig = ConfigurationManager.getProxyConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@
public class MQAdminStartup {
protected static final List<SubCommand> SUB_COMMANDS = new ArrayList<>();

private static final String ROCKETMQ_HOME = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY,
System.getenv(MixAll.ROCKETMQ_HOME_ENV));
private static final String ROCKETMQ_HOME = MixAll.ROCKETMQ_HOME_DIR;

public static void main(String[] args) {
main0(args, null);
Expand Down
Loading