Commit Graph

29 Commits

Author SHA1 Message Date
Trustin Lee
2e98566916 Introduce MessageAggregator and DecoderResultProvider
Motivation:

We have different message aggregator implementations for different
protocols, but they are very similar with each other.  They all stems
from HttpObjectAggregator.  If we provide an abstract class that provide
generic message aggregation functionality, we will remove their code
duplication.

Modifications:

- Add MessageAggregator which provides generic message aggregation
- Reimplement all existing aggregators using MessageAggregator
- Add DecoderResultProvider interface and extend it wherever possible so
  that MessageAggregator respects the state of the decoded message

Result:

Less code duplication
2014-06-05 16:39:59 +09:00
Trustin Lee
d2614cfc01 Synchronized between 4.1 and master
Motivation:

4 and 5 were diverged long time ago and we recently reverted some of the
early commits in master.  We must make sure 4.1 and master are not very
different now.

Modification:

Fix found differences

Result:

4.1 and master got closer.
2014-04-25 00:36:01 +09:00
Michael Nitschinger
797d6d94a4 [codec-memcache] Avoid NPE on channelInactive.
Motivation:
When no currentMessage has been set and the channel is inactive, a NPE is raised.

Modification:
Make sure that a currentMessage is available before checking the extras.

Result:
No more NPE raised potentially.
2014-04-23 11:41:07 +02:00
Michael Nitschinger
1fe0b53e29 [codec-memcache] Simplify object hierachy and remove Headers.
This changeset removes the separate message headers and merges the
field directly into the messages. This greatly simplifies the
object hierachy and also saves header allocations in the pipeline.
2014-03-04 13:04:44 +01:00
Michael Nitschinger
3f53ba2e36 Always upstream full memcache messages.
This changeset is related to #2182, which exposes the failure in
the http codec, but the memcache codec works very similar. In addition,
better failure handling in the decoder has been added.
2014-02-23 16:44:06 +01:00
Trustin Lee
0f1b1be0aa Enable a user specify an arbitrary information with ReferenceCounted.touch()
- Related: #2163
- Add ResourceLeakHint to allow a user to provide a meaningful information about the leak when touching it
- DefaultChannelHandlerContext now implements ResourceLeakHint to tell where the message is going.
- Cleaner resource leak report by excluding noisy stack trace elements
2014-01-29 11:44:59 +09:00
Trustin Lee
b887e35ac2 Add ReferenceCounted.touch() / Add missing retain() overrides
- Fixes #2163
- Inspector warnings
2014-01-28 20:06:55 +09:00
Trustin Lee
94d6e44bba Change the return type of EmbeddedChannel.read*() from Object to an ad-hoc type parameter
.. so that there's no need to explicitly down-cast.

Fixes #2067
2013-12-16 22:22:47 +09:00
Michael Nitschinger
31b977bcad codec-memcache: prefix abstract classes with Abstract. 2013-12-09 11:28:59 +01:00
Michael Nitschinger
a06810609b codec-memcache: No need to allocate a buffer if no extra is used. 2013-12-09 08:07:05 +01:00
Trustin Lee
4903b7fd17 Fix another buffer leak in BinaryMemcacheDecoderTest 2013-12-07 21:50:49 +09:00
Trustin Lee
5e86ccace9 Fix buffer leaks in BinaryMemcacheDecoderTest 2013-12-07 15:06:30 +09:00
Trustin Lee
f03f1eaaba Fix a buffer leak in BinaryMemcacheDecoder 2013-12-07 15:00:32 +09:00
Trustin Lee
2e53322be0 Fix buffer leaks in BinaryMemcacheEncoderTest 2013-12-07 12:15:44 +09:00
Trustin Lee
f8138619f0 Fix a buffer leak in BinaryMemcacheObjectAggregatorTest 2013-12-07 11:22:59 +09:00
Trustin Lee
73379195eb Fix a buffer leak in BinaryMemcacheObjectAggregatorTest 2013-12-07 11:19:26 +09:00
Trustin Lee
6554b8c395 readableBytes() ==0 -> !isReadable() 2013-12-06 13:29:46 +09:00
Trustin Lee
27d020fc35 Hide protocol detail from users 2013-12-06 13:27:51 +09:00
Michael Nitschinger
920e7a5539 codec-memcache: increase default buffer size and only encode extras if set. 2013-12-05 13:37:16 +01:00
Michael Nitschinger
addae7b8ad [codec-memcache] encode key directly, no need to use unpooled. 2013-12-02 13:01:51 +01:00
Michael Nitschinger
624b92b4b1 codec-memcache: removed println in test case. 2013-12-02 11:58:44 +01:00
Michael Nitschinger
5fb7dcc4c6 codec-memcache: fix decoding issue for value parts.
This changeset fixes an issue when decoding would stop if the value
comes separated in two or more packets, leading to invalid bytes read.
2013-12-02 11:54:38 +01:00
Trustin Lee
110745b0eb Remove the distinction of inbound handlers and outbound handlers
- Fixes #1808
- Move all methods in ChannelInboundHandler and ChannelOutboundHandler up to ChannelHandler
- Remove ChannelInboundHandler and ChannelOutboundHandler
- Deprecate ChannelInboundHandlerAdapter, ChannelOutboundHandlerAdapter, and ChannelDuplexHandler
- Replace CombinedChannelDuplexHandler with ChannelHandlerAppender
  because it's not possible to combine two handlers into one easily now
- Introduce 'Skip' annotation to pass events through efficiently
- Remove all references to the deprecated types and update Javadoc
2013-11-27 17:31:28 +09:00
Michael Nitschinger
8b5f8de2ef Avoid memory leak when encoding the key 2013-11-22 19:22:45 +01:00
Trustin Lee
a9893f3bd2 Abstract classes' names should start with 'Abstract' 2013-11-04 20:21:55 +09:00
Trustin Lee
f7c70366ea Fixed various inspector warnings 2013-11-04 20:19:33 +09:00
Trustin Lee
ff34bb08a6 Moved constant classes out of util 2013-11-04 20:10:52 +09:00
Trustin Lee
26415b8f4c Use StringUtil.simpleClassName(..) instead of Class.getSimpleName() where necessary
- Class.getSimpleName() doesn't render anonymous classes very well
- + some minor cleanup
2013-11-04 19:42:33 +09:00
Michael Nitschinger
5169376309 Implementing the Binary Memcache protocol
This changeset implements the full memcache binary protocol spec, including
a first batch of tests. Ascii protocol and more coverage and helper classes
will follow.
2013-11-04 19:24:14 +09:00