Skip to content

Commit

Permalink
set properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneguow committed Oct 23, 2024
1 parent a7b686b commit 34fd881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import jakarta.ws.rs._
import jakarta.ws.rs.core.{Context, Response}
import org.eclipse.jetty.server.handler.ContextHandler
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder}
import org.glassfish.jersey.CommonProperties
import org.glassfish.jersey.server.ServerProperties
import org.glassfish.jersey.servlet.ServletContainer

Expand Down Expand Up @@ -62,6 +63,8 @@ private[spark] object ApiRootResource {
jerseyContext.setContextPath("/api")
val holder: ServletHolder = new ServletHolder(classOf[ServletContainer])
holder.setInitParameter(ServerProperties.PROVIDER_PACKAGES, "org.apache.spark.status.api.v1")
holder.setInitParameter(CommonProperties.PROVIDER_DEFAULT_DISABLE, "DATASOURCE")
holder.setInitParameter(ServerProperties.WADL_FEATURE_DISABLE, "true")
UIRootFromServletContext.setUiRoot(jerseyContext, uiRoot)
jerseyContext.addServlet(holder, "/*")
jerseyContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark.status.api.v1
import jakarta.ws.rs._
import jakarta.ws.rs.core.MediaType
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder}
import org.glassfish.jersey.CommonProperties
import org.glassfish.jersey.server.ServerProperties
import org.glassfish.jersey.servlet.ServletContainer

Expand Down Expand Up @@ -114,6 +115,8 @@ private[spark] object PrometheusResource {
jerseyContext.setContextPath("/metrics")
val holder: ServletHolder = new ServletHolder(classOf[ServletContainer])
holder.setInitParameter(ServerProperties.PROVIDER_PACKAGES, "org.apache.spark.status.api.v1")
holder.setInitParameter(CommonProperties.PROVIDER_DEFAULT_DISABLE, "DATASOURCE")
holder.setInitParameter(ServerProperties.WADL_FEATURE_DISABLE, "true")
UIRootFromServletContext.setUiRoot(jerseyContext, uiRoot)
jerseyContext.addServlet(holder, "/*")
jerseyContext
Expand Down

0 comments on commit 34fd881

Please sign in to comment.