src/main/java/org/apache/hadoop/hdfs/server/namenode/analytics/web/NamenodeAnalyticsMethods.java
@GET
  @Path("/config")
  @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML})
  public Response config() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    try {
      before();

      String key = request.getParameter("key");
      if (key != null && !key.isEmpty()) {
        return Response.ok(nnLoader.getConfigValue(key), MediaType.TEXT_PLAIN).build();
      } else {
        nnLoader.dumpConfig(response);
        return Response.ok().type(MediaType.APPLICATION_XML).build();
      }
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
/**
   * CONFIG endpoint is a dump of the system configuration in XML form. TODO: Convert the output to
   * JSON form.
   */
CONFIG endpoint is a dump of the system configuration in XML form. TODO: Convert the output to
JSON form.
CONFIG endpoint is a dump of the system configuration in XML form . TODO : Convert the output to JSON form .
@GET
  @Path("/config")
  @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML})
  public Response config() {
    final NameNodeLoader nnLoader = (NameNodeLoader) context.getAttribute(NNA_NN_LOADER);
    try {
      before();
      String key = request.getParameter("key");
      if (key != null && !key.isEmpty()) {
        return Response.ok(nnLoader.getConfigValue(key), MediaType.TEXT_PLAIN).build();
      } else {
        nnLoader.dumpConfig(response);
        return Response.ok().type(MediaType.APPLICATION_XML).build();
      }
    } catch (Exception ex) {
      return handleException(ex);
    } finally {
      after();
    }
  }
@ GET @ Path ( "/config" ) @ Produces ( { MediaType . TEXT_PLAIN , MediaType . APPLICATION_XML } ) public Response config ( ) { final NameNodeLoader nnLoader = ( NameNodeLoader ) context . getAttribute ( NNA_NN_LOADER ) ; try { before ( ) ; String key = request . getParameter ( "key" ) ; if ( key != null && ! key . isEmpty ( ) ) { return Response . ok ( nnLoader . getConfigValue ( key ) , MediaType . TEXT_PLAIN ) . build ( ) ; } else { nnLoader . dumpConfig ( response ) ; return Response . ok ( ) . type ( MediaType . APPLICATION_XML ) . build ( ) ; } } catch ( Exception ex ) { return handleException ( ex ) ; } finally { after ( ) ; } }
CONFIG endpoint is a dump of the system configuration in XML form.
CONFIG endpoint is a dump of the system configuration in XML form .