Class DepParametersMemoryOptimizedMap
- java.lang.Object
-
- java.util.AbstractMap<String,String>
-
- jetbrains.buildServer.serverSide.parameters.DepParametersMemoryOptimizedMap
-
public class DepParametersMemoryOptimizedMap extends AbstractMap<String,String>
This map is intended to reduce memory usage for the case of build parameters. Map knows about some commonly used parameter prefixes and maintains a pool of keys and values thus reducing the memory occupied by strings. For instance if map has keys like: dep..c dep. .d c d Memory occupied by keys can be reduced if dep. . prefix is removed from the first two keys and stored separately. The map is not thread safe. - Since:
- 10.0.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Function<String,String>DEFAULT_PREFIX_FUNCTION
-
Constructor Summary
Constructors Constructor Description DepParametersMemoryOptimizedMap()DepParametersMemoryOptimizedMap(boolean storeInternalParameters)DepParametersMemoryOptimizedMap(DepParametersMemoryOptimizedMap orig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,String>>entrySet()voidfreeze()Stringget(Object key)Map<String,String>getAllWithPrefix(String prefix)Set<String>getPrefixes()booleanisEmpty()booleanisFrozen()Set<String>keySet()Stringput(String key, String value)voidputAll(Map<? extends String,? extends String> m)voidputAllWithPrefix(String prefix, Map<String,String> m, boolean mapMayContainInternalParams)Stringremove(Object key)voidremoveAllWithPrefix(String prefix)voidreuseMapsWithPrefixes(Collection<String> prefixesToReuse)Performs internal memory optimization of the parameters starting with the specified prefixes.intsize()Collection<String>values()-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
DepParametersMemoryOptimizedMap
public DepParametersMemoryOptimizedMap()
-
DepParametersMemoryOptimizedMap
public DepParametersMemoryOptimizedMap(boolean storeInternalParameters)
-
DepParametersMemoryOptimizedMap
public DepParametersMemoryOptimizedMap(@NotNull DepParametersMemoryOptimizedMap orig)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,String>- Overrides:
containsKeyin classAbstractMap<String,String>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,String>- Overrides:
containsValuein classAbstractMap<String,String>
-
removeAllWithPrefix
public void removeAllWithPrefix(@NotNull String prefix)
-
putAllWithPrefix
public void putAllWithPrefix(@NotNull String prefix, @NotNull Map<String,String> m, boolean mapMayContainInternalParams)
-
clear
public void clear()
-
values
@NotNull public Collection<String> values()
-
freeze
public void freeze()
-
isFrozen
public boolean isFrozen()
-
reuseMapsWithPrefixes
public void reuseMapsWithPrefixes(@NotNull Collection<String> prefixesToReuse)Performs internal memory optimization of the parameters starting with the specified prefixes. All parameters with such a common prefix will be placed into another map and this map will be shared in the current context.- Parameters:
prefixesToReuse-
-
-