class MemoryMetricsCommandHandler extends GridRestCommandHandlerAdapter {
    /**
     * Supported commands.
     */
    private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(
        DATA_REGION_METRICS);

    /**
     * @param ctx Context.
     */
    public MemoryMetricsCommandHandler(GridKernalContext ctx) {
        super(ctx);
    }

    /** {@inheritDoc} */
    @Override public Collection<GridRestCommand> supportedCommands() {
        return SUPPORTED_COMMANDS;
    }

    /** {@inheritDoc} */
    @Override public IgniteInternalFuture<GridRestResponse> handleAsync(GridRestRequest req) {<FILL_FUNCTION_BODY>}
}

        assert req != null;

        if (log.isDebugEnabled())
            log.debug("Handling " + req.command().key() + " REST request: " + req);

        GridRestCommand cmd = req.command();

        switch (cmd) {
            case DATA_REGION_METRICS:
                return new GridFinishedFuture<>(new GridRestResponse(ctx.grid().dataRegionMetrics()));

            default:
                return new GridFinishedFuture<>(new GridRestResponse(GridRestResponse.STATUS_FAILED, "Unknown command"));
        }
    
<methods><variables>protected final non-sealed org.apache.ignite.internal.GridKernalContext ctx,protected final non-sealed org.apache.ignite.IgniteLogger log