Skip to content

Commit

Permalink
set visibility on a lot of classes
Browse files Browse the repository at this point in the history
  • Loading branch information
squito committed Mar 23, 2015
1 parent 1f361c8 commit a066055
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.apache.spark.ui.jobs.JobProgressListener
import org.apache.spark.ui.jobs.UIData.JobUIData

@Produces(Array(MediaType.APPLICATION_JSON))
class AllJobsResource(uiRoot: UIRoot) {
private[v1] class AllJobsResource(uiRoot: UIRoot) {

@GET
def jobsList(
Expand Down Expand Up @@ -56,7 +56,7 @@ class AllJobsResource(uiRoot: UIRoot) {

}

object AllJobsResource {
private[v1] object AllJobsResource {

def getStatusToJobs(ui: SparkUI): Seq[(JobStatus, Seq[JobUIData])] = {
val statusToJobs = ui.jobProgressListener.synchronized {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.spark.storage.{RDDInfo, StorageStatus, StorageUtils}
import org.apache.spark.ui.storage.StorageListener

@Produces(Array(MediaType.APPLICATION_JSON))
class AllRDDResource(uiRoot: UIRoot) {
private[v1] class AllRDDResource(uiRoot: UIRoot) {

@GET
def jobsList(
Expand All @@ -43,7 +43,7 @@ class AllRDDResource(uiRoot: UIRoot) {

}

object AllRDDResource {
private[spark] object AllRDDResource {

def getRDDStorageInfo(
rddId: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.spark.deploy.history.ApplicationHistoryInfo
import org.apache.spark.deploy.master.{ApplicationInfo => InternalApplicationInfo}

@Produces(Array(MediaType.APPLICATION_JSON))
class ApplicationListResource(uiRoot: UIRoot) {
private[v1] class ApplicationListResource(uiRoot: UIRoot) {

@GET
def appList(
Expand Down Expand Up @@ -52,7 +52,7 @@ class ApplicationListResource(uiRoot: UIRoot) {
}
}

object ApplicationsListResource {
private[spark] object ApplicationsListResource {
def appHistoryInfoToPublicAppInfo(app: ApplicationHistoryInfo): ApplicationInfo = {
new ApplicationInfo(
id = app.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.apache.spark.util.SparkEnum

@Provider
@Produces(Array(MediaType.APPLICATION_JSON))
class CustomObjectMapper extends ContextResolver[ObjectMapper]{
private[v1] class CustomObjectMapper extends ContextResolver[ObjectMapper]{
val mapper = new ObjectMapper() {
override def writeValueAsString(t: Any): String = {
super.writeValueAsString(t)
Expand All @@ -51,16 +51,16 @@ class CustomObjectMapper extends ContextResolver[ObjectMapper]{
}
}

object CustomObjectMapper {
private[spark] object CustomObjectMapper {
def makeISODateFormat: SimpleDateFormat = {
val iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'GMT'");
val cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
iso8601.setCalendar(cal);
iso8601;
val iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'GMT'")
val cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"))
iso8601.setCalendar(cal)
iso8601
}
}

class SparkEnumSerializer extends JsonSerializer[SparkEnum] {
private[v1] class SparkEnumSerializer extends JsonSerializer[SparkEnum] {
def serialize(se: SparkEnum, jgen: JsonGenerator, provider: SerializerProvider): Unit = {
jgen.writeString(se.toString)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import javax.ws.rs.core.MediaType
import org.apache.spark.ui.exec.ExecutorsPage

@Produces(Array(MediaType.APPLICATION_JSON))
class ExecutorListResource(uiRoot: UIRoot) {
private[v1] class ExecutorListResource(uiRoot: UIRoot) {

@GET
def jobsList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.spark.SecurityManager
import org.apache.spark.ui.SparkUI

@Path("/v1")
class JsonRootResource extends UIRootFromServletContext {
private[v1] class JsonRootResource extends UIRootFromServletContext {

@Path("applications")
def getApplicationList(): ApplicationListResource = {
Expand Down Expand Up @@ -85,7 +85,7 @@ class JsonRootResource extends UIRootFromServletContext {

}

object JsonRootResource {
private[spark] object JsonRootResource {

def getJsonServlet(uiRoot: UIRoot): ServletContextHandler = {
val jerseyContext = new ServletContextHandler(ServletContextHandler.NO_SESSIONS)
Expand Down Expand Up @@ -122,7 +122,7 @@ private[spark] trait UIRoot {
def securityManager: SecurityManager
}

object UIRootFromServletContext {
private[v1] object UIRootFromServletContext {
private val attribute = getClass.getCanonicalName
def setUiRoot(contextHandler: ContextHandler, uiRoot: UIRoot): Unit = {
contextHandler.setAttribute(attribute, uiRoot)
Expand All @@ -132,14 +132,14 @@ object UIRootFromServletContext {
}
}

trait UIRootFromServletContext {
private[v1] trait UIRootFromServletContext {
@Context
var servletContext: ServletContext = _

def uiRoot: UIRoot = UIRootFromServletContext.getUiRoot(servletContext)
}

class NotFoundException(msg: String) extends WebApplicationException(
private[v1] class NotFoundException(msg: String) extends WebApplicationException(
new IllegalArgumentException(msg),
Response
.status(Response.Status.NOT_FOUND)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import javax.ws.rs.core.MediaType
import javax.ws.rs.{Produces, PathParam, GET}

@Produces(Array(MediaType.APPLICATION_JSON))
class OneApplicationResource(uiRoot: UIRoot) {
private[v1] class OneApplicationResource(uiRoot: UIRoot) {

@GET
def getApp(@PathParam("appId") appId: String): ApplicationInfo = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ package org.apache.spark.status.api.v1
import javax.ws.rs.{PathParam, GET, Produces}
import javax.ws.rs.core.MediaType

import org.apache.spark.JobExecutionStatus
import org.apache.spark.ui.jobs.UIData.JobUIData

@Produces(Array(MediaType.APPLICATION_JSON))
class OneJobResource(uiRoot: UIRoot) {
private[v1] class OneJobResource(uiRoot: UIRoot) {

@GET
def jobsList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import javax.ws.rs.{PathParam, GET, Produces}
import javax.ws.rs.core.MediaType

@Produces(Array(MediaType.APPLICATION_JSON))
class OneRDDResource(uiRoot: UIRoot) {
private[v1] class OneRDDResource(uiRoot: UIRoot) {

@GET
def rddData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import javax.ws.rs.{GET, PathParam, Produces}
import org.apache.spark.SparkException

@Produces(Array(MediaType.APPLICATION_JSON))
class OneStageAttemptResource(uiRoot: UIRoot) {
private[v1] class OneStageAttemptResource(uiRoot: UIRoot) {

@GET
def stageData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import javax.ws.rs.core.Response

import com.sun.jersey.spi.container.{ContainerRequest, ContainerRequestFilter}

class SecurityFilter extends ContainerRequestFilter with UIRootFromServletContext {
private[v1] class SecurityFilter extends ContainerRequestFilter with UIRootFromServletContext {
def filter(req: ContainerRequest): ContainerRequest = {
val user = Option(req.getUserPrincipal).map { _.getName }.orNull
if (uiRoot.securityManager.checkUIViewPermissions(user)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import javax.ws.rs.core.Response.Status

import scala.util.Try

private[api] class SimpleDateParam(val originalValue: String) {
private[v1] class SimpleDateParam(val originalValue: String) {
val timestamp: Long = {
SimpleDateParam.formats.collectFirst {
case fmt if Try{ fmt.parse(originalValue) }.isSuccess =>
Expand All @@ -39,7 +39,7 @@ private[api] class SimpleDateParam(val originalValue: String) {
}
}

private[api] object SimpleDateParam {
private[v1] object SimpleDateParam {
val formats = Seq(
"yyyy-MM-dd'T'HH:mm:ss.SSSz",
"yyyy-MM-dd"
Expand Down

0 comments on commit a066055

Please sign in to comment.