Package io.split.storages.memory
Class InMemoryCacheImp
- java.lang.Object
-
- io.split.storages.memory.InMemoryCacheImp
-
- All Implemented Interfaces:
SplitCache,SplitCacheCommons,SplitCacheConsumer,SplitCacheProducer
public class InMemoryCacheImp extends Object implements SplitCache
-
-
Constructor Summary
Constructors Constructor Description InMemoryCacheImp(long startingChangeNumber, FlagSetsFilter flagSets)InMemoryCacheImp(FlagSetsFilter flagSets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voiddecreaseTrafficType(String trafficType)Map<String,ParsedSplit>fetchMany(List<String> names)ParsedSplitget(String name)Collection<ParsedSplit>getAll()longgetChangeNumber()Map<String,HashSet<String>>getNamesByFlagSets(List<String> flagSets)Set<String>getSegments()voidincreaseTrafficType(String trafficType)voidkill(String splitName, String defaultTreatment, long changeNumber)voidputMany(List<ParsedSplit> splits)booleanremove(String name)voidsetChangeNumber(long changeNumber)List<String>splitNames()booleantrafficTypeExists(String trafficTypeName)voidupdate(List<ParsedSplit> toAdd, List<String> toRemove, long changeNumber)
-
-
-
Constructor Detail
-
InMemoryCacheImp
public InMemoryCacheImp(FlagSetsFilter flagSets)
-
InMemoryCacheImp
public InMemoryCacheImp(long startingChangeNumber, FlagSetsFilter flagSets)
-
-
Method Detail
-
remove
public boolean remove(String name)
- Specified by:
removein interfaceSplitCacheProducer
-
get
public ParsedSplit get(String name)
- Specified by:
getin interfaceSplitCacheConsumer
-
getAll
public Collection<ParsedSplit> getAll()
- Specified by:
getAllin interfaceSplitCacheConsumer
-
fetchMany
public Map<String,ParsedSplit> fetchMany(List<String> names)
- Specified by:
fetchManyin interfaceSplitCacheConsumer
-
getChangeNumber
public long getChangeNumber()
- Specified by:
getChangeNumberin interfaceSplitCacheCommons
-
setChangeNumber
public void setChangeNumber(long changeNumber)
- Specified by:
setChangeNumberin interfaceSplitCacheProducer
-
trafficTypeExists
public boolean trafficTypeExists(String trafficTypeName)
- Specified by:
trafficTypeExistsin interfaceSplitCacheConsumer
-
splitNames
public List<String> splitNames()
- Specified by:
splitNamesin interfaceSplitCacheConsumer
-
getNamesByFlagSets
public Map<String,HashSet<String>> getNamesByFlagSets(List<String> flagSets)
- Specified by:
getNamesByFlagSetsin interfaceSplitCacheConsumer
-
kill
public void kill(String splitName, String defaultTreatment, long changeNumber)
- Specified by:
killin interfaceSplitCacheProducer
-
clear
public void clear()
- Specified by:
clearin interfaceSplitCacheProducer
-
putMany
public void putMany(List<ParsedSplit> splits)
- Specified by:
putManyin interfaceSplitCacheProducer
-
increaseTrafficType
public void increaseTrafficType(String trafficType)
- Specified by:
increaseTrafficTypein interfaceSplitCacheProducer
-
decreaseTrafficType
public void decreaseTrafficType(String trafficType)
- Specified by:
decreaseTrafficTypein interfaceSplitCacheProducer
-
update
public void update(List<ParsedSplit> toAdd, List<String> toRemove, long changeNumber)
- Specified by:
updatein interfaceSplitCacheProducer
-
getSegments
public Set<String> getSegments()
- Specified by:
getSegmentsin interfaceSplitCacheCommons
-
-