Commit Graph

8 Commits

Author SHA1 Message Date
Norman Maurer
2d9e0f53a5 Better implementation of AttributeMap and also add hasAttr(...). SeeĀ [#2439]
Motivation:
The old DefaultAttributeMap impl did more synchronization then needed and also did not expose a efficient way to check if an attribute exists with a specific key.

Modifications:
* Rewrite DefaultAttributeMap to not use IdentityHashMap and synchronization on the map directly. The new impl uses a combination of AtomicReferenceArray and synchronization per chain (linked-list). Also access the first Attribute per bucket can be done without any synchronization at all and just uses atomic operations. This should fit for most use-cases pretty weel.
* Add hasAttr(...) implementation

Result:
It's now possible to check for the existence of a attribute without create one. Synchronization is per linked-list and the first entry can even be added via atomic operation.
2014-05-15 06:47:42 +02:00
Jeff Pinner
6c9c151d66 minor documentation cleanup 2013-07-20 08:01:14 +02:00
Trustin Lee
1011227b88 Remove apiviz tags - we are focusing on user guide instead and putting diagrams there 2013-02-14 12:09:16 -08:00
Trustin Lee
a2e5cd94be Prettify APIviz / Tighten visibility / Move subclasses to top level / Remove unused UnknownSocksMessage 2013-02-11 19:42:23 +09:00
Norman Maurer
7db47dd0d0 Finish javadocs for common module 2012-12-21 08:16:00 +01:00
Trustin Lee
1eced1e9e3 Update license headers 2012-06-04 13:31:44 -07:00
Trustin Lee
c7bd0b41e6 Remove unnecessary parameter 2012-04-12 17:54:56 +09:00
Trustin Lee
22a815eaf8 Revamp channel handler API
- Merged LifeCycleAwareChannelHandler into ChannelHandler
- Replaced ChannelUpstreamHandler and ChannelDownstreamHandler with
  ChannelReader and ChannelWriter
  - These two new interfaces are much more type-safe than its ancestor.
- Simplified channel state model as described in #68
- Handler creates send/receive buffer.
  - Previously, Netty created them, but it led to more memory copies and
    inflexibility.  I'm going to allow a handler to create a bounded
    queue for example.
  - It currently uses Queue<T> but I'll define a new interface and make
    ChannelBuffer implement it (e.g. Queue<Byte>)
- Introduced AttributeMap which replaces attachments in Channel and
  ChannelHandlerContext and ChannelLocal
2012-04-12 17:39:01 +09:00