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 void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,String>>
entrySet()
void
freeze()
String
get(Object key)
Map<String,String>
getAllWithPrefix(String prefix)
Set<String>
getPrefixes()
boolean
isEmpty()
boolean
isFrozen()
Set<String>
keySet()
String
put(String key, String value)
void
putAll(Map<? extends String,? extends String> m)
void
putAllWithPrefix(String prefix, Map<String,String> m, boolean mapMayContainInternalParams)
String
remove(Object key)
void
removeAllWithPrefix(String prefix)
void
reuseMapsWithPrefixes(Collection<String> prefixesToReuse)
Performs internal memory optimization of the parameters starting with the specified prefixes.int
size()
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:
containsKey
in interfaceMap<String,String>
- Overrides:
containsKey
in classAbstractMap<String,String>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,String>
- Overrides:
containsValue
in 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
-
-
-