-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing TransactionLog to be instantiated with max_samples_stored = 0
- Loading branch information
Showing
4 changed files
with
146 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
newrelic-agent/src/main/java/com/newrelic/agent/util/NoOpQueue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* | ||
* * Copyright 2024 New Relic Corporation. All rights reserved. | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package com.newrelic.agent.util; | ||
|
||
import com.newrelic.agent.model.LogEvent; | ||
import com.newrelic.agent.model.PriorityAware; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.Iterator; | ||
import java.util.Queue; | ||
|
||
public final class NoOpQueue<E extends PriorityAware> implements Queue<E> { | ||
private static final Queue<? extends PriorityAware> INSTANCE = new NoOpQueue<>(); | ||
|
||
public static <T extends PriorityAware> Queue<T> getInstance() { | ||
return (Queue<T>) INSTANCE; | ||
} | ||
|
||
@Override | ||
public boolean add(E e) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean offer(E e) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public E remove() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public E poll() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public E element() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public E peek() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int size() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean contains(Object o) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public Iterator<E> iterator() { | ||
return Collections.emptyIterator(); | ||
} | ||
|
||
@Override | ||
public Object[] toArray() { | ||
return new Object[0]; | ||
} | ||
|
||
@Override | ||
public <T> T[] toArray(T[] a) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean remove(Object o) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean containsAll(Collection<?> c) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean addAll(Collection<? extends E> c) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean removeAll(Collection<?> c) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean retainAll(Collection<?> c) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void clear() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters