-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Move transport decoding and aggregation to server #48263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 66 commits
a0878e6
c4abd27
68da522
6b68651
c3e9874
9ac20c8
3a8643c
0066edf
965eca3
68720c4
ada1292
c8e0d35
fb3be69
1966ca9
9c1095e
e3f1f34
19f09ca
dc3de32
6250303
efb7886
44bf7fa
67f635c
71bf38b
b936c9e
a5b649e
b476490
90d3769
380dbd7
bb7c8db
4b5349a
6d737ba
74cea7c
e28336d
3f5f9b0
6cba066
27671ad
d70a290
dc46e10
6df1b60
20994c7
d64d449
8db094c
ab90f84
fde092d
aede3ba
f41a5c3
5aaaf20
5b722c2
4fc06a4
1e0b9e2
fc231d2
85e1915
04eaff2
9610065
72ec229
82479ba
a313fed
2a70c3d
f607a12
5a60df4
4971d05
871e40f
e761215
e25e25f
ad20c99
98f3211
ab9cb05
b24b3b3
6f5cbbf
ddf36bb
4aa607d
aacc96c
9dff5cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| import org.elasticsearch.common.io.stream.StreamInput; | ||
| import org.elasticsearch.common.lease.Releasable; | ||
| import org.elasticsearch.common.lease.Releasables; | ||
| import org.elasticsearch.common.util.concurrent.AbstractRefCounted; | ||
| import org.elasticsearch.common.xcontent.XContentBuilder; | ||
|
|
||
| import java.io.IOException; | ||
|
|
@@ -33,21 +34,43 @@ | |
| * An extension to {@link BytesReference} that requires releasing its content. This | ||
| * class exists to make it explicit when a bytes reference needs to be released, and when not. | ||
| */ | ||
| public final class ReleasableBytesReference implements Releasable, BytesReference { | ||
| public final class ReleasableBytesReference extends AbstractRefCounted implements Releasable, BytesReference { | ||
|
|
||
| public static final Releasable NOOP = () -> {}; | ||
| private final BytesReference delegate; | ||
| private final Releasable releasable; | ||
|
|
||
| public ReleasableBytesReference(BytesReference delegate, Releasable releasable) { | ||
| super("bytes-reference"); | ||
| this.delegate = delegate; | ||
| this.releasable = releasable; | ||
| } | ||
|
|
||
| public static ReleasableBytesReference wrap(BytesReference reference) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to only be used in tests and should probably live in test code
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is used by production code now. And I imagine it's use will grow as more things need to interface with the Releasable version (#50107 type of work). |
||
| return new ReleasableBytesReference(reference, NOOP); | ||
| } | ||
|
|
||
| @Override | ||
| public void close() { | ||
| protected void closeInternal() { | ||
| Releasables.close(releasable); | ||
| } | ||
|
|
||
| public ReleasableBytesReference retain() { | ||
| incRef(); | ||
| return this; | ||
| } | ||
|
|
||
| public ReleasableBytesReference retainedSlice(int from, int length) { | ||
| BytesReference slice = delegate.slice(from, length); | ||
| incRef(); | ||
| return new ReleasableBytesReference(slice, this); | ||
| } | ||
|
|
||
| @Override | ||
| public void close() { | ||
| decRef(); | ||
| } | ||
|
|
||
| @Override | ||
| public byte get(int index) { | ||
| return delegate.get(index); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.