Package co.elastic.apm.agent.util
Class BinaryHeaderMap
- java.lang.Object
-
- co.elastic.apm.agent.util.BinaryHeaderMap
-
- All Implemented Interfaces:
Recyclable,java.lang.Iterable<BinaryHeaderMap.Entry>
public class BinaryHeaderMap extends java.lang.Object implements Recyclable, java.lang.Iterable<BinaryHeaderMap.Entry>
A map (not implementing the java.util.Map interface) that only supports String-byte[] pair additions and iterations. The map doesn't allocate during addition or iteration. This map does not support any form of concurrency. It can be either be in a write mode (through itsadd(java.lang.String, byte[])method) or read mode (through theiterator()API) at a given time. Reads and writes must not be performed by more than one thread concurrently.NOTE: this map does not guarantee visibility, therefore ensuring visibility when switching from read to write mode (or the other way around) is under the responsibility of the map's user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinaryHeaderMap.Entry
-
Field Summary
Fields Modifier and Type Field Description static intMAXIMUM_HEADER_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description BinaryHeaderMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.String key, byte[] value)voidcopyFrom(BinaryHeaderMap other)booleanisEmpty()java.util.Iterator<BinaryHeaderMap.Entry>iterator()voidresetState()resets pooled object state so it can be reusedintsize()
-
-
-
Field Detail
-
MAXIMUM_HEADER_BUFFER_SIZE
public static final int MAXIMUM_HEADER_BUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
add
public boolean add(java.lang.String key, @Nullable byte[] value)
-
resetState
public void resetState()
Description copied from interface:Recyclableresets pooled object state so it can be reused- Specified by:
resetStatein interfaceRecyclable
-
iterator
public java.util.Iterator<BinaryHeaderMap.Entry> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<BinaryHeaderMap.Entry>
-
copyFrom
public void copyFrom(BinaryHeaderMap other)
-
-