Class ClusteredRequestTraceStore
- java.lang.Object
-
- fish.payara.nucleus.requesttracing.store.ClusteredRequestTraceStore
-
- All Implemented Interfaces:
RequestTraceStoreInterface
,Serializable
public class ClusteredRequestTraceStore extends Object implements RequestTraceStoreInterface, Serializable
A store ofRequestTrace
objects. Stores the list across a cluster.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestTrace
addTrace(RequestTrace trace)
Adds a request trace to the store.RequestTrace
addTrace(RequestTrace trace, RequestTrace traceToRemove)
Adds a request trace to the store, removing the specified trace if present and necessary.Collection<RequestTrace>
emptyStore()
Removes all of the traces from the store.int
getStoreSize()
Gets the current size of the store.Collection<RequestTrace>
getTraces()
Gets the entire contents of the store.Collection<RequestTrace>
getTraces(int limit)
Gets the contents of the store, up to a limit number of items.boolean
isShared()
void
setSize(IntSupplier maxSize)
Sets the supplier for the maximum size of the store.
-
-
-
Method Detail
-
addTrace
public RequestTrace addTrace(RequestTrace trace)
Description copied from interface:RequestTraceStoreInterface
Adds a request trace to the store.- Specified by:
addTrace
in interfaceRequestTraceStoreInterface
- Parameters:
trace
- the trace to add.- Returns:
- The trace that was removed, or null if no trace was removed
-
addTrace
public RequestTrace addTrace(RequestTrace trace, RequestTrace traceToRemove)
Description copied from interface:RequestTraceStoreInterface
Adds a request trace to the store, removing the specified trace if present and necessary.- Specified by:
addTrace
in interfaceRequestTraceStoreInterface
- Parameters:
trace
- The trace to addtraceToRemove
- The trace to remove if present- Returns:
- The trace that was removed, or null if no trace was removed
-
getTraces
public Collection<RequestTrace> getTraces()
Description copied from interface:RequestTraceStoreInterface
Gets the entire contents of the store.- Specified by:
getTraces
in interfaceRequestTraceStoreInterface
- Returns:
- every request trace in the store.
-
getTraces
public Collection<RequestTrace> getTraces(int limit)
Description copied from interface:RequestTraceStoreInterface
Gets the contents of the store, up to a limit number of items.- Specified by:
getTraces
in interfaceRequestTraceStoreInterface
- Parameters:
limit
- the maximum number of traces to return.- Returns:
- up to the limit number of items from the store.
-
setSize
public void setSize(IntSupplier maxSize)
Description copied from interface:RequestTraceStoreInterface
Sets the supplier for the maximum size of the store. Any traces added after this size will cause another to be removed. The trace removed depends on the store implementation.- Specified by:
setSize
in interfaceRequestTraceStoreInterface
- Parameters:
maxSize
- A supplier for the maximum size of the store.
-
getStoreSize
public int getStoreSize()
Description copied from interface:RequestTraceStoreInterface
Gets the current size of the store.- Specified by:
getStoreSize
in interfaceRequestTraceStoreInterface
- Returns:
- the size of the store.
-
emptyStore
public Collection<RequestTrace> emptyStore()
Description copied from interface:RequestTraceStoreInterface
Removes all of the traces from the store. The store will be empty after this method is called.- Specified by:
emptyStore
in interfaceRequestTraceStoreInterface
- Returns:
- The traces that were stored
-
isShared
public boolean isShared()
- Specified by:
isShared
in interfaceRequestTraceStoreInterface
- Returns:
- true in case of a clustered store, false in case of a local store.
-
-