Package org.eclipse.mat.snapshot.query
Class SnapshotQuery
java.lang.Object
org.eclipse.mat.snapshot.query.SnapshotQuery
This class provides possibility to lookup, inspect, parameterize and execute queries on a given heap dump.
NOTE: The queries delivered with Memory Analyzer and their expected parameters are not part of the API. Both names/identifiers and parameters may change.
Usage example:IResult result = SnapshotQuery.lookup("top_consumers_html", snapshot) // .setArgument("objects", retained) // .execute(listener);
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(IProgressListener listener) Execute the query and return the result.List<? extends IArgumentDescriptor>
Get the list of the query arguments.Get a descriptor for the query.static SnapshotQuery
Factory method to create a query by name.static SnapshotQuery
Factory method to create a query by command line, i.e.refine
(IProgressListener listener) Execute the query and return aRefinedResultBuilder
which allows for filtering, sorting and limiting of the result.Deprecated.use setArgument() insteadsetArgument
(String name, Object value) Set the argument identified byname
.
-
Method Details
-
lookup
Factory method to create a query by name.- Throws:
SnapshotException
-
parse
Factory method to create a query by command line, i.e. setting the arguments accordingly.- Throws:
SnapshotException
-
getDescriptor
Get a descriptor for the query. From it one can inspect the Name, Help, Icon, etc... for the query.- Returns:
IAnnotatedObjectDescriptor
a descriptor for the query- Since:
- 1.0
-
getArguments
Get the list of the query arguments.- Returns:
- the list of
IArgumentDescriptor
describing the arguments which the query expects - Since:
- 1.0
-
setArgument
Set the argument identified byname
. Heap objects can be provided asint
,Integer
,int[]
orIObject
.- Parameters:
name
- the name of the argumentvalue
- the new value of the argument- Returns:
- the modified SnapshotQuery object
- Throws:
SnapshotException
- Since:
- 1.0
-
set
Deprecated.use setArgument() instead- Throws:
SnapshotException
-
execute
Execute the query and return the result.- Throws:
SnapshotException
-
refine
Execute the query and return aRefinedResultBuilder
which allows for filtering, sorting and limiting of the result.- Throws:
SnapshotException
-