Skip to content

Commit

Permalink
Merge branch 'v1.2.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
caojiajun committed Jun 7, 2023
2 parents 08bfa53 + 714db35 commit 1bc1131
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ public static void registerCallback(DynamicConfCallback callback) {
}
}

/**
* Get value from {@link ProxyDynamicConf#conf}. If value is null , this method will return defaultValue.
*/
// Get value from {@link ProxyDynamicConf#conf}. If value is null , this method will return defaultValue.
private static Integer _getInt(String key, Integer defaultValue) {
return ConfigurationUtil.getInteger(conf, key, defaultValue);
}
Expand All @@ -124,9 +122,6 @@ public static int getInt(String key, int defaultValue) {
return _getInt(key, defaultValue);
}

/**
*
*/
public static int getInt(String key, Long bid, String bgroup, int defaultValue) {
try {
if (conf.isEmpty()) return defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public static int bidBgroupConnect(long bid, String bgroup) {

/**
* Put the channelInfo object into {@link ChannelMonitor#bidbgroupMap}. This mthod is thread-safe,
* @param bid
* @param bgroup
* @param channelInfo
* @param bid bid
* @param bgroup bgroup
* @param channelInfo channelInfo
*/
public static void initBidBgroup(long bid, String bgroup, ChannelInfo channelInfo) {
ExecutorUtils.submitToSingleThreadExecutor(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public CommandDecoder(int commandDecodeMaxBatchSize, int commandDecodeBufferInit

/**
* 根据RESP协议去解析 {@link ByteBuf}
* <p>Parse the ByteBuf object according RESP protocol.
* <p>
* RESP-> <a href = "https://redis.io/docs/reference/protocol-spec/">https://redis.io/docs/reference/protocol-spec/
* <p> Parse the ByteBuf object according RESP protocol.
* <p> https://redis.io/docs/reference/protocol-spec/
* @param ctx the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to
* @param in the {@link ByteBuf} from which to read data
* @param out the {@link List} to which decoded messages should be added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public interface ProxyBeanFactory {

/**
* Get bean from the Spring container or create bean by reflection. It depends on the implementation.
* @param requiredType 类型
* @param <T> 类型
* @return instance
*/
<T> T getBean(Class<T> requiredType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public class InstanceInfoSerializeUtil {
public static <T> byte[] serialize(InstanceInfo<T> instanceInfo) {
if (instanceInfo == null) return null;
String string = JSONObject.toJSONString(instanceInfo);
return string.getBytes(StandardCharsets.UTF_8);
JSONObject jsonObject = JSONObject.parseObject(string);
JSONObject instance = jsonObject.getJSONObject("instance");
jsonObject.put("proxy", JSONObject.parseObject(instance.toJSONString()));//为了兼容低版本的camellia-redis-proxy-discovery-zk
return jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8);
}

public static <T> InstanceInfo<T> deserialize(byte[] data, Class<T> clazz) {
Expand All @@ -22,6 +25,9 @@ public static <T> InstanceInfo<T> deserialize(byte[] data, Class<T> clazz) {
InstanceInfo<T> instanceInfo = new InstanceInfo<>();
instanceInfo.setRegisterTime(json.getLong("registerTime"));
T instance = json.getObject("instance", clazz);
if (instance == null) {
instance = json.getObject("proxy", clazz);//为了兼容低版本的camellia-redis-proxy-discovery-zk
}
instanceInfo.setInstance(instance);
return instanceInfo;
}
Expand Down
1 change: 1 addition & 0 deletions update-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
### fix
* camellia-hot-key-server fix `unknown seqId` problem
* CamelliaHotKeyCacheSdk fix namespace wrong,thanks[@21want28k](https://github.com/21want28k) find this bug
* camellia-redis-proxy-discovery-zk 1.2.8/1.2.9 has compatibility issue with 1.2.7 or earlier, 1.2.10 fix this compatibility issue


# 1.2.9(2023/06/02)
Expand Down
1 change: 1 addition & 0 deletions update-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### fix
* camellia-hot-key-server修复`unknown seqId`报错的问题
* CamelliaHotKeyCacheSdk修复namespace错误的问题,感谢[@21want28k](https://github.com/21want28k) 发现这个bug
* camellia-redis-proxy-discovery-zk的1.2.8/1.2.9与1.2.7以及之前的低版本有不兼容的问题,1.2.10增加了兼容性的逻辑


# 1.2.9(2023/06/02)
Expand Down

0 comments on commit 1bc1131

Please sign in to comment.