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:
parent
1c534d8b0c
commit
0950c1ad6e
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue