ArrayBlockingQueueBuffer del IF_POSSIBLE strategy (#6053)

* ArrayBlockingQueueBuffer del IF_POSSIBLE strategy

* update CHANGES.md

Co-authored-by: 李家良 <jialiang.li@tongdun.cn>
This commit is contained in:
lijial 2020-12-22 16:05:04 +08:00 committed by GitHub
parent 1c534d8b0c
commit 0950c1ad6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -20,6 +20,7 @@ Release Notes.
* Fix thrift plugin trace link broken when intermediate service does not mount agent
* Fix thrift plugin collects wrong args when the method without parameter.
* Fix DataCarrier's `org.apache.skywalking.apm.commons.datacarrier.buffer.Buffer` implementation isn't activated in `IF_POSSIBLE` mode.
* Fix ArrayBlockingQueueBuffer's useless `IF_POSSIBLE` mode list
#### OAP-Backend
* Make meter receiver support MAL.

View File

@ -40,16 +40,12 @@ public class ArrayBlockingQueueBuffer<T> implements QueueBuffer<T> {
@Override
public boolean save(T data) {
switch (strategy) {
case IF_POSSIBLE:
return queue.offer(data);
default:
try {
queue.put(data);
} catch (InterruptedException e) {
// Ignore the error
return false;
}
//only BufferStrategy.BLOCKING
try {
queue.put(data);
} catch (InterruptedException e) {
// Ignore the error
return false;
}
return true;
}