Package org.apache.hadoop.hbase.http
Class ProfilerCommandMapper
java.lang.Object
org.apache.hadoop.hbase.http.ProfilerCommandMapper
Utility class that maps
ProfileServlet.ProfileRequest to async-profiler commands in both
the in-process Java API format (comma-separated string) and the CLI format (argument list).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendOption(StringBuilder sb, String key, Object value) toCliCommand(ProfileServlet.ProfileRequest request, File outputFile, String profilerHome, Integer pid) Builds the CLI argument list for invoking the async-profiler binary (asprof / profiler.sh).(package private) static StringtoFileExtension(ProfileServlet.Output output) Maps theProfileServlet.Outputenum to a file extension / format token without emitting any log warnings.(package private) static StringtoFormatString(ProfileServlet.Output output) Maps theProfileServlet.Outputenum to the format string used by both backends.(package private) static StringBuilds the start command string for the async-profiler Java API.(package private) static StringtoLibraryStopCommand(ProfileServlet.ProfileRequest request, File outputFile) Builds the stop command string for the async-profiler Java API.
-
Field Details
-
LOG
-
PROFILER_SCRIPT
- See Also:
-
OLD_PROFILER_SCRIPT
- See Also:
-
-
Constructor Details
-
ProfilerCommandMapper
private ProfilerCommandMapper()
-
-
Method Details
-
toLibraryStartCommand
Builds the start command string for the async-profiler Java API. Format:start,event=<event>[,interval=N][,jstackdepth=N][,threads][,simple]Note:
bufsizeis intentionally omitted — it is not a recognized option in the async-profiler 4.x agent grammar and is silently ignored. It remains supported by the BinaryBackend CLI path via-b. -
toLibraryStopCommand
Builds the stop command string for the async-profiler Java API. Format:stop,file=<path>[,<format-token>][,minwidth=N][,reverse]In async-profiler 4.x the output format is derived from the file extension for html/jfr, and via a bare token (e.g.
tree,flat) for text-based formats. Theformat=key is not recognized.widthandheightare also not recognized by the 4.x agent grammar; they remain supported via the BinaryBackend CLI. -
toCliCommand
static List<String> toCliCommand(ProfileServlet.ProfileRequest request, File outputFile, String profilerHome, Integer pid) Builds the CLI argument list for invoking the async-profiler binary (asprof / profiler.sh). Locates the script under<profilerHome>/bin/asprof, falling back to<profilerHome>/profiler.shfor older installations. -
toFormatString
Maps theProfileServlet.Outputenum to the format string used by both backends. Logs a deprecation warning when SVG is requested (it was removed in async-profiler 2.0, see HBASE-25685). UsetoFileExtension(org.apache.hadoop.hbase.http.ProfileServlet.Output)when only the file extension is needed and the warning has already been emitted. -
toFileExtension
Maps theProfileServlet.Outputenum to a file extension / format token without emitting any log warnings. SVG is silently remapped to"html". -
appendOption
-