diff --git a/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/constants/ValueConstants.java b/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/constants/ValueConstants.java index 005127563..b6246daf4 100644 --- a/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/constants/ValueConstants.java +++ b/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/constants/ValueConstants.java @@ -26,42 +26,53 @@ public class ValueConstants { /** * The constant DEFAULT_GROUP. */ - public static final String DEFAULT_GROUP = "DEFAULT_GROUP"; + public static final String DEFAULT_GROUP = "DEFAULT_GROUP"; /** * The constant DEFAULT_ZONE. */ - public static final String DEFAULT_ZONE = "DEFAULT_ZONE"; + public static final String DEFAULT_ZONE = "DEFAULT_ZONE"; - public static final String DEFAULT_INSTANCE_ID = "DEFAULT_INSTANCE_ID"; + public static final String DEFAULT_INSTANCE_ID = "DEFAULT_INSTANCE_ID"; /** * The constant DEFAULT_DATA_CENTER. */ - public static final String DEFAULT_DATA_CENTER = "DefaultDataCenter"; + public static final String DEFAULT_DATA_CENTER = "DefaultDataCenter"; - public static final long DEFAULT_NO_DATUM_VERSION = 1L; + public static final long DEFAULT_NO_DATUM_VERSION = 1L; - private static final Integer SYSTEM_RAFT_PORT = Integer - .getInteger("RAFT_SERVER_PORT"); + private static final Integer SYSTEM_RAFT_PORT = Integer + .getInteger("RAFT_SERVER_PORT"); - public static final int RAFT_SERVER_PORT = SYSTEM_RAFT_PORT != null ? SYSTEM_RAFT_PORT - : 9614; + public static final int RAFT_SERVER_PORT = SYSTEM_RAFT_PORT != null ? SYSTEM_RAFT_PORT + : 9614; - private static final String SYSTEM_RAFT_GROUP = System - .getProperty("RAFT_SERVER_GROUP"); + private static final String SYSTEM_RAFT_GROUP = System + .getProperty("RAFT_SERVER_GROUP"); - public static final String RAFT_SERVER_GROUP = SYSTEM_RAFT_GROUP != null ? SYSTEM_RAFT_GROUP - : "RegistryGroup"; + public static final String RAFT_SERVER_GROUP = SYSTEM_RAFT_GROUP != null ? SYSTEM_RAFT_GROUP + : "RegistryGroup"; - public static final String STOP_PUSH_DATA_SWITCH_DATA_ID = "session.stop.push.data.switch#@#9600#@#CONFIG"; + public static final String STOP_PUSH_DATA_SWITCH_DATA_ID = "session.stop.push.data.switch#@#9600#@#CONFIG"; - public static final String BLACK_LIST_DATA_ID = "session.blacklist.data#@#9600#@#CONFIG"; + public static final String BLACK_LIST_DATA_ID = "session.blacklist.data#@#9600#@#CONFIG"; - public static final String ENABLE_DATA_RENEW_SNAPSHOT = "session.enable.datum.renew.switch#@#9600#@#CONFIG"; + public static final String ENABLE_DATA_RENEW_SNAPSHOT = "session.enable.datum.renew.switch#@#9600#@#CONFIG"; - public static final String ENABLE_DATA_DATUM_EXPIRE = "data.enable.datum.expire.switch#@#9600#@#CONFIG"; + public static final String ENABLE_DATA_DATUM_EXPIRE = "data.enable.datum.expire.switch#@#9600#@#CONFIG"; - public static final String LOGGER_NAME_RENEW = "RENEW-LOGGER"; + public static final String LOGGER_NAME_RENEW = "RENEW-LOGGER"; + + /** + * switch key for dataId sensitive is disable or not + */ + public static final String DISABLE_DATA_ID_CASE_SENSITIVE_SWITCH = "disable.dataId.case.sensitive"; + /** + * switch for dataId sensitive is disable or not, default value is false which means dataId is case sensitive + */ + public static final Boolean DISABLE_DATA_ID_CASE_SENSITIVE = Boolean + .valueOf(System + .getProperty(DISABLE_DATA_ID_CASE_SENSITIVE_SWITCH)); } diff --git a/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/store/DataInfo.java b/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/store/DataInfo.java index f519b44b0..02e5ee7f2 100644 --- a/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/store/DataInfo.java +++ b/server/common/model/src/main/java/com/alipay/sofa/registry/common/model/store/DataInfo.java @@ -16,6 +16,8 @@ */ package com.alipay.sofa.registry.common.model.store; +import com.alipay.sofa.registry.common.model.constants.ValueConstants; + import java.io.Serializable; /** @@ -61,7 +63,11 @@ public static String toDataInfoId(String dataId, String instanceId, String dataT if (dataId == null || dataId.isEmpty()) { throw new IllegalArgumentException("error dataId:" + dataId); } - buf.append(dataId); + if (ValueConstants.DISABLE_DATA_ID_CASE_SENSITIVE) { + buf.append(dataId.toUpperCase()); + } else { + buf.append(dataId); + } if (instanceId == null || instanceId.isEmpty()) { throw new IllegalArgumentException("error instanceId:" + instanceId); diff --git a/server/common/util/src/main/java/com/alipay/sofa/registry/task/listener/TaskEvent.java b/server/common/util/src/main/java/com/alipay/sofa/registry/task/listener/TaskEvent.java index 7b505d878..a46f40f8d 100644 --- a/server/common/util/src/main/java/com/alipay/sofa/registry/task/listener/TaskEvent.java +++ b/server/common/util/src/main/java/com/alipay/sofa/registry/task/listener/TaskEvent.java @@ -41,7 +41,9 @@ public enum TaskType { RECEIVED_DATA_CONFIG_PUSH_TASK("ReceivedDataConfigPushTask"), // CANCEL_DATA_TASK("CancelDataTask"), // SYNC_PUBLISHER_TASK("SyncPublisherTask"), // + SYNC_UNPUBLISHER_TASK("SyncUnPublisherTask"), // SYNC_SUBSCRIBER_TASK("SyncSubscriberTask"), // + SYNC_UNSUBSCRIBER_TASK("SyncUnSubscriberTask"), // SESSION_REGISTER_DATA_TASK("SessionRegisterDataTask"), // PROVIDE_DATA_CHANGE_FETCH_TASK("ProvideDataChangeFetchTask"), // SUBSCRIBER_MULTI_FETCH_TASK("SubscriberMultiFetchTask"), //