Skip to content

Commit

Permalink
add Unknown sync mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie-coming committed Dec 14, 2024
1 parent 6859fe1 commit 9842289
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private ApolloConfig loadApolloConfig() {

ConfigSyncType configSyncType=ConfigSyncType.fromString(result.getConfigSyncType());

if (configSyncType == ConfigSyncType.INCREMENTALSYNC) {
if (configSyncType == ConfigSyncType.INCREMENTAL_SYNC) {

ApolloConfig previousConfig = m_configCache.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.ctrip.framework.apollo.build.MockInjector;
import com.ctrip.framework.apollo.core.dto.*;
import com.ctrip.framework.apollo.core.enums.ConfigSyncType;
import com.ctrip.framework.apollo.core.enums.ConfigurationChangeType;
import com.ctrip.framework.apollo.core.signature.Signature;
import com.ctrip.framework.apollo.enums.ConfigSourceType;
import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
Expand Down Expand Up @@ -487,7 +486,7 @@ private ApolloConfig assembleApolloConfigWithIncrementalSync(List<ConfigurationC
ApolloConfig apolloConfig =
new ApolloConfig(someAppId, someClusterName, someNamespace, someReleaseKey);

apolloConfig.setConfigSyncType(ConfigSyncType.INCREMENTALSYNC.getValue());
apolloConfig.setConfigSyncType(ConfigSyncType.INCREMENTAL_SYNC.getValue());
apolloConfig.setConfigurationChanges(configurationChanges);
return apolloConfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.ctrip.framework.apollo.core.dto;


import com.ctrip.framework.apollo.core.enums.ConfigurationChangeType;

/**
* Holds the information for a Configuration change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@

import com.ctrip.framework.apollo.core.utils.StringUtils;

import java.util.stream.Stream;

/**
* This enum represents all the possible Configuration sync from apollo-config
*
* @author jason
*/
public enum ConfigSyncType {
FULLSYNC("FullSync"), INCREMENTALSYNC("IncrementalSync");
FULL_SYNC("FullSync"), INCREMENTAL_SYNC("IncrementalSync"), UNKNOWN("UnKnown");

private final String value;

Expand All @@ -46,14 +44,14 @@ public enum ConfigSyncType {
*/
public static ConfigSyncType fromString(String value) {
if (StringUtils.isEmpty(value)) {
return FULLSYNC;
return FULL_SYNC;
}
for (ConfigSyncType type : values()) {
if (type.value.equals(value)) {
return type;
}
}
throw new IllegalArgumentException("Invalid ConfigSyncType: " + value);
return UNKNOWN;

}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</developers>

<properties>
<revision>2.5.0-SNAPSHOT</revision>
<revision>2.4.0-SNAPSHOT</revision>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.7.18</spring-boot.version>
Expand Down

0 comments on commit 9842289

Please sign in to comment.