Class InternalThreadLocalMap

java.lang.Object
io.netty.util.internal.UnpaddedInternalThreadLocalMap
io.netty.util.internal.InternalThreadLocalMap

public final class InternalThreadLocalMap extends UnpaddedInternalThreadLocalMap
The internal data structure that stores the thread-local variables for Netty and all FastThreadLocals. Note that this class is for internal use only and is subject to change at any time. Use FastThreadLocal unless you know what you are doing.
  • Field Details

    • slowThreadLocalMap

      private static final ThreadLocal<InternalThreadLocalMap> slowThreadLocalMap
    • nextIndex

      private static final AtomicInteger nextIndex
    • VARIABLES_TO_REMOVE_INDEX

      public static final int VARIABLES_TO_REMOVE_INDEX
    • DEFAULT_ARRAY_LIST_INITIAL_CAPACITY

      private static final int DEFAULT_ARRAY_LIST_INITIAL_CAPACITY
      See Also:
    • ARRAY_LIST_CAPACITY_EXPAND_THRESHOLD

      private static final int ARRAY_LIST_CAPACITY_EXPAND_THRESHOLD
      See Also:
    • ARRAY_LIST_CAPACITY_MAX_SIZE

      private static final int ARRAY_LIST_CAPACITY_MAX_SIZE
      See Also:
    • HANDLER_SHARABLE_CACHE_INITIAL_CAPACITY

      private static final int HANDLER_SHARABLE_CACHE_INITIAL_CAPACITY
      See Also:
    • INDEXED_VARIABLE_TABLE_INITIAL_SIZE

      private static final int INDEXED_VARIABLE_TABLE_INITIAL_SIZE
      See Also:
    • STRING_BUILDER_INITIAL_SIZE

      private static final int STRING_BUILDER_INITIAL_SIZE
    • STRING_BUILDER_MAX_SIZE

      private static final int STRING_BUILDER_MAX_SIZE
    • logger

      private static final InternalLogger logger
    • UNSET

      public static final Object UNSET
      Internal use only.
    • indexedVariables

      private Object[] indexedVariables
    • futureListenerStackDepth

      private int futureListenerStackDepth
    • localChannelReaderStackDepth

      private int localChannelReaderStackDepth
    • handlerSharableCache

      private Map<Class<?>,Boolean> handlerSharableCache
    • counterHashCode

      private IntegerHolder counterHashCode
    • random

      private ThreadLocalRandom random
    • typeParameterMatcherGetCache

      private Map<Class<?>,TypeParameterMatcher> typeParameterMatcherGetCache
    • typeParameterMatcherFindCache

      private Map<Class<?>,Map<String,TypeParameterMatcher>> typeParameterMatcherFindCache
    • stringBuilder

      private StringBuilder stringBuilder
    • charsetEncoderCache

      private Map<Charset,CharsetEncoder> charsetEncoderCache
    • charsetDecoderCache

      private Map<Charset,CharsetDecoder> charsetDecoderCache
    • arrayList

      private ArrayList<Object> arrayList
    • cleanerFlags

      private BitSet cleanerFlags
    • rp1

      public long rp1
      Deprecated.
      These padding fields will be removed in the future.
    • rp2

      public long rp2
      Deprecated.
      These padding fields will be removed in the future.
    • rp3

      public long rp3
      Deprecated.
      These padding fields will be removed in the future.
    • rp4

      public long rp4
      Deprecated.
      These padding fields will be removed in the future.
    • rp5

      public long rp5
      Deprecated.
      These padding fields will be removed in the future.
    • rp6

      public long rp6
      Deprecated.
      These padding fields will be removed in the future.
    • rp7

      public long rp7
      Deprecated.
      These padding fields will be removed in the future.
    • rp8

      public long rp8
      Deprecated.
      These padding fields will be removed in the future.
  • Constructor Details

    • InternalThreadLocalMap

      private InternalThreadLocalMap()
  • Method Details

    • getIfSet

      public static InternalThreadLocalMap getIfSet()
    • get

      public static InternalThreadLocalMap get()
    • fastGet

      private static InternalThreadLocalMap fastGet(FastThreadLocalThread thread)
    • slowGet

      private static InternalThreadLocalMap slowGet()
    • remove

      public static void remove()
    • destroy

      public static void destroy()
    • nextVariableIndex

      public static int nextVariableIndex()
    • lastVariableIndex

      public static int lastVariableIndex()
    • newIndexedVariableTable

      private static Object[] newIndexedVariableTable()
    • size

      public int size()
    • stringBuilder

      public StringBuilder stringBuilder()
    • charsetEncoderCache

      public Map<Charset,CharsetEncoder> charsetEncoderCache()
    • charsetDecoderCache

      public Map<Charset,CharsetDecoder> charsetDecoderCache()
    • arrayList

      public <E> ArrayList<E> arrayList()
    • arrayList

      public <E> ArrayList<E> arrayList(int minCapacity)
    • futureListenerStackDepth

      public int futureListenerStackDepth()
    • setFutureListenerStackDepth

      public void setFutureListenerStackDepth(int futureListenerStackDepth)
    • random

      public ThreadLocalRandom random()
    • typeParameterMatcherGetCache

      public Map<Class<?>,TypeParameterMatcher> typeParameterMatcherGetCache()
    • typeParameterMatcherFindCache

      public Map<Class<?>,Map<String,TypeParameterMatcher>> typeParameterMatcherFindCache()
    • counterHashCode

      @Deprecated public IntegerHolder counterHashCode()
      Deprecated.
    • setCounterHashCode

      @Deprecated public void setCounterHashCode(IntegerHolder counterHashCode)
      Deprecated.
    • handlerSharableCache

      public Map<Class<?>,Boolean> handlerSharableCache()
    • localChannelReaderStackDepth

      public int localChannelReaderStackDepth()
    • setLocalChannelReaderStackDepth

      public void setLocalChannelReaderStackDepth(int localChannelReaderStackDepth)
    • indexedVariable

      public Object indexedVariable(int index)
    • setIndexedVariable

      public boolean setIndexedVariable(int index, Object value)
      Returns:
      true if and only if a new thread-local variable has been created
    • expandIndexedVariableTableAndSet

      private void expandIndexedVariableTableAndSet(int index, Object value)
    • removeIndexedVariable

      public Object removeIndexedVariable(int index)
    • isIndexedVariableSet

      public boolean isIndexedVariableSet(int index)
    • isCleanerFlagSet

      public boolean isCleanerFlagSet(int index)
    • setCleanerFlag

      public void setCleanerFlag(int index)