Skip to content

Commit c3d4639

Browse files
author
Shih-Hao Yeh
committed
Add FT to bypass fixup
1 parent b8fab9d commit c3d4639

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: evcache-core/src/main/java/com/netflix/evcache/EVCacheImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public class EVCacheImpl implements EVCache, EVCacheImplMBean {
115115
private final Property<String> encoderBase;
116116

117117
private final Property<Boolean> bypassAddOpt;
118+
private final Property<Boolean> bypassFixup;
118119

119120
EVCacheImpl(String appName, String cacheName, int timeToLive, Transcoder<?> transcoder, boolean enableZoneFallback,
120121
boolean throwException, EVCacheClientPoolManager poolManager) {
@@ -174,6 +175,7 @@ public class EVCacheImpl implements EVCache, EVCacheImplMBean {
174175

175176
// bypass short-circuit optimization
176177
this.bypassAddOpt = propertyRepository.get(_appName + ".bypass.add.opt", Boolean.class).orElse(false);
178+
this.bypassFixup = propertyRepository.get(_appName + ".bypass.fixup", Boolean.class).orElse(false);
177179

178180
// if alias changes, refresh my pool to point to the correct alias app
179181
this.alias = propertyRepository.get("EVCacheClientPoolManager." + appName + ".alias", String.class);
@@ -3282,7 +3284,7 @@ public EVCacheClient[] sortClients(EVCacheClient[] clients, EVCacheClient[] writ
32823284
}
32833285

32843286
protected <T> EVCacheLatch add(String key, T value, Transcoder<T> tc, int timeToLive, Policy policy, EVCacheClient[] clients, int latchCount) throws EVCacheException {
3285-
return add(key, value, tc, timeToLive, policy, clients, latchCount, true);
3287+
return add(key, value, tc, timeToLive, policy, clients, latchCount, !bypassFixup.get());
32863288
}
32873289

32883290
protected <T> EVCacheLatch add(String key, T value, Transcoder<T> tc, int timeToLive, Policy policy, EVCacheClient[] clients, int latchCount, boolean fixup) throws EVCacheException {

0 commit comments

Comments
 (0)