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 class
BinaryHeaderMap.Entry
-
Field Summary
Fields Modifier and Type Field Description static int
MAXIMUM_HEADER_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description BinaryHeaderMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.String key, byte[] value)
void
copyFrom(BinaryHeaderMap other)
boolean
isEmpty()
java.util.Iterator<BinaryHeaderMap.Entry>
iterator()
void
resetState()
resets pooled object state so it can be reusedint
size()
-
-
-
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, byte[] value)
-
resetState
public void resetState()
Description copied from interface:Recyclable
resets pooled object state so it can be reused- Specified by:
resetState
in interfaceRecyclable
-
iterator
public java.util.Iterator<BinaryHeaderMap.Entry> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<BinaryHeaderMap.Entry>
-
copyFrom
public void copyFrom(BinaryHeaderMap other)
-
-