public class JsonProtocol
extends Object
JsonProtocolSuite contains backwards-compatibility tests which check that the current version of JsonProtocol is able to read output written by earlier versions. We do not currently have tests for reading newer JSON output with older Spark versions.
To ensure that we provide these guarantees, follow these rules when modifying these methods:
- Never delete any JSON fields.
- Any new JSON fields should be optional; use jsonOption
when reading these fields
in *FromJson
methods.
Constructor and Description |
---|
JsonProtocol() |
Modifier and Type | Method and Description |
---|---|
static AccumulableInfo |
accumulableInfoFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
accumulableInfoToJson(AccumulableInfo accumulableInfo) |
static org.json4s.JsonAST.JArray |
accumulablesToJson(scala.collection.Iterable<AccumulableInfo> accumulables) |
static SparkListenerApplicationEnd |
applicationEndFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
applicationEndToJson(SparkListenerApplicationEnd applicationEnd) |
static SparkListenerApplicationStart |
applicationStartFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
applicationStartToJson(SparkListenerApplicationStart applicationStart) |
static SparkListenerBlockManagerAdded |
blockManagerAddedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockManagerAddedToJson(SparkListenerBlockManagerAdded blockManagerAdded) |
static BlockManagerId |
blockManagerIdFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockManagerIdToJson(BlockManagerId blockManagerId) |
static SparkListenerBlockManagerRemoved |
blockManagerRemovedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockManagerRemovedToJson(SparkListenerBlockManagerRemoved blockManagerRemoved) |
static BlockStatus |
blockStatusFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockStatusToJson(BlockStatus blockStatus) |
static BlockUpdatedInfo |
blockUpdatedInfoFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockUpdatedInfoToJson(BlockUpdatedInfo blockUpdatedInfo) |
static SparkListenerBlockUpdated |
blockUpdateFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
blockUpdateToJson(SparkListenerBlockUpdated blockUpdate) |
static SparkListenerEnvironmentUpdate |
environmentUpdateFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
environmentUpdateToJson(SparkListenerEnvironmentUpdate environmentUpdate) |
static Exception |
exceptionFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
exceptionToJson(Exception exception) |
static SparkListenerExecutorAdded |
executorAddedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
executorAddedToJson(SparkListenerExecutorAdded executorAdded) |
static ExecutorInfo |
executorInfoFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
executorInfoToJson(ExecutorInfo executorInfo) |
static org.apache.spark.executor.ExecutorMetrics |
executorMetricsFromJson(org.json4s.JsonAST.JValue json)
Extract the executor metrics from JSON.
|
static org.json4s.JsonAST.JValue |
executorMetricsToJson(org.apache.spark.executor.ExecutorMetrics executorMetrics)
Convert executor metrics to JSON.
|
static SparkListenerExecutorMetricsUpdate |
executorMetricsUpdateFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
executorMetricsUpdateToJson(SparkListenerExecutorMetricsUpdate metricsUpdate) |
static SparkListenerExecutorRemoved |
executorRemovedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
executorRemovedToJson(SparkListenerExecutorRemoved executorRemoved) |
static SparkListenerJobEnd |
jobEndFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
jobEndToJson(SparkListenerJobEnd jobEnd) |
static JobResult |
jobResultFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
jobResultToJson(JobResult jobResult) |
static SparkListenerJobStart |
jobStartFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
jobStartToJson(SparkListenerJobStart jobStart) |
static SparkListenerLogStart |
logStartFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
logStartToJson(SparkListenerLogStart logStart) |
static scala.collection.Map<String,String> |
mapFromJson(org.json4s.JsonAST.JValue json)
-------------------------------- *
Util JSON deserialization methods |
|
static org.json4s.JsonAST.JValue |
mapToJson(scala.collection.Map<String,String> m)
------------------------------ *
Util JSON serialization methods |
|
static java.util.Properties |
propertiesFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
propertiesToJson(java.util.Properties properties) |
static RDDInfo |
rddInfoFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
rddInfoToJson(RDDInfo rddInfo) |
static scala.collection.Map<String,ResourceInformation> |
resourcesMapFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
resourcesMapToJson(scala.collection.Map<String,ResourceInformation> m) |
static SparkListenerEvent |
sparkEventFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
sparkEventToJson(SparkListenerEvent event)
------------------------------------------------- *
JSON serialization methods for SparkListenerEvents |
|
static StackTraceElement[] |
stackTraceFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
stackTraceToJson(StackTraceElement[] stackTrace) |
static SparkListenerStageCompleted |
stageCompletedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
stageCompletedToJson(SparkListenerStageCompleted stageCompleted) |
static SparkListenerStageExecutorMetrics |
stageExecutorMetricsFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
stageExecutorMetricsToJson(SparkListenerStageExecutorMetrics metrics) |
static StageInfo |
stageInfoFromJson(org.json4s.JsonAST.JValue json)
--------------------------------------------------------------------- *
JSON deserialization methods for classes SparkListenerEvents depend on |
|
static org.json4s.JsonAST.JValue |
stageInfoToJson(StageInfo stageInfo)
------------------------------------------------------------------- *
JSON serialization methods for classes SparkListenerEvents depend on |
|
static SparkListenerStageSubmitted |
stageSubmittedFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
stageSubmittedToJson(SparkListenerStageSubmitted stageSubmitted) |
static StorageLevel |
storageLevelFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
storageLevelToJson(StorageLevel storageLevel) |
static SparkListenerTaskEnd |
taskEndFromJson(org.json4s.JsonAST.JValue json) |
static TaskEndReason |
taskEndReasonFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
taskEndReasonToJson(TaskEndReason taskEndReason) |
static org.json4s.JsonAST.JValue |
taskEndToJson(SparkListenerTaskEnd taskEnd) |
static SparkListenerTaskGettingResult |
taskGettingResultFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
taskGettingResultToJson(SparkListenerTaskGettingResult taskGettingResult) |
static TaskInfo |
taskInfoFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
taskInfoToJson(TaskInfo taskInfo) |
static org.apache.spark.executor.TaskMetrics |
taskMetricsFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
taskMetricsToJson(org.apache.spark.executor.TaskMetrics taskMetrics) |
static SparkListenerTaskStart |
taskStartFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
taskStartToJson(SparkListenerTaskStart taskStart) |
static SparkListenerUnpersistRDD |
unpersistRDDFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
unpersistRDDToJson(SparkListenerUnpersistRDD unpersistRDD) |
static java.util.UUID |
UUIDFromJson(org.json4s.JsonAST.JValue json) |
static org.json4s.JsonAST.JValue |
UUIDToJson(java.util.UUID id) |
public static org.json4s.JsonAST.JValue sparkEventToJson(SparkListenerEvent event)
event
- (undocumented)public static org.json4s.JsonAST.JValue stageSubmittedToJson(SparkListenerStageSubmitted stageSubmitted)
public static org.json4s.JsonAST.JValue stageCompletedToJson(SparkListenerStageCompleted stageCompleted)
public static org.json4s.JsonAST.JValue taskStartToJson(SparkListenerTaskStart taskStart)
public static org.json4s.JsonAST.JValue taskGettingResultToJson(SparkListenerTaskGettingResult taskGettingResult)
public static org.json4s.JsonAST.JValue taskEndToJson(SparkListenerTaskEnd taskEnd)
public static org.json4s.JsonAST.JValue jobStartToJson(SparkListenerJobStart jobStart)
public static org.json4s.JsonAST.JValue jobEndToJson(SparkListenerJobEnd jobEnd)
public static org.json4s.JsonAST.JValue environmentUpdateToJson(SparkListenerEnvironmentUpdate environmentUpdate)
public static org.json4s.JsonAST.JValue blockManagerAddedToJson(SparkListenerBlockManagerAdded blockManagerAdded)
public static org.json4s.JsonAST.JValue blockManagerRemovedToJson(SparkListenerBlockManagerRemoved blockManagerRemoved)
public static org.json4s.JsonAST.JValue unpersistRDDToJson(SparkListenerUnpersistRDD unpersistRDD)
public static org.json4s.JsonAST.JValue applicationStartToJson(SparkListenerApplicationStart applicationStart)
public static org.json4s.JsonAST.JValue applicationEndToJson(SparkListenerApplicationEnd applicationEnd)
public static org.json4s.JsonAST.JValue executorAddedToJson(SparkListenerExecutorAdded executorAdded)
public static org.json4s.JsonAST.JValue executorRemovedToJson(SparkListenerExecutorRemoved executorRemoved)
public static org.json4s.JsonAST.JValue logStartToJson(SparkListenerLogStart logStart)
public static org.json4s.JsonAST.JValue executorMetricsUpdateToJson(SparkListenerExecutorMetricsUpdate metricsUpdate)
public static org.json4s.JsonAST.JValue stageExecutorMetricsToJson(SparkListenerStageExecutorMetrics metrics)
public static org.json4s.JsonAST.JValue blockUpdateToJson(SparkListenerBlockUpdated blockUpdate)
public static org.json4s.JsonAST.JValue stageInfoToJson(StageInfo stageInfo)
stageInfo
- (undocumented)public static org.json4s.JsonAST.JValue taskInfoToJson(TaskInfo taskInfo)
public static org.json4s.JsonAST.JArray accumulablesToJson(scala.collection.Iterable<AccumulableInfo> accumulables)
public static org.json4s.JsonAST.JValue accumulableInfoToJson(AccumulableInfo accumulableInfo)
public static org.json4s.JsonAST.JValue taskMetricsToJson(org.apache.spark.executor.TaskMetrics taskMetrics)
public static org.json4s.JsonAST.JValue executorMetricsToJson(org.apache.spark.executor.ExecutorMetrics executorMetrics)
public static org.json4s.JsonAST.JValue taskEndReasonToJson(TaskEndReason taskEndReason)
public static org.json4s.JsonAST.JValue blockManagerIdToJson(BlockManagerId blockManagerId)
public static org.json4s.JsonAST.JValue jobResultToJson(JobResult jobResult)
public static org.json4s.JsonAST.JValue rddInfoToJson(RDDInfo rddInfo)
public static org.json4s.JsonAST.JValue storageLevelToJson(StorageLevel storageLevel)
public static org.json4s.JsonAST.JValue blockStatusToJson(BlockStatus blockStatus)
public static org.json4s.JsonAST.JValue executorInfoToJson(ExecutorInfo executorInfo)
public static org.json4s.JsonAST.JValue resourcesMapToJson(scala.collection.Map<String,ResourceInformation> m)
public static org.json4s.JsonAST.JValue blockUpdatedInfoToJson(BlockUpdatedInfo blockUpdatedInfo)
public static org.json4s.JsonAST.JValue mapToJson(scala.collection.Map<String,String> m)
m
- (undocumented)public static org.json4s.JsonAST.JValue propertiesToJson(java.util.Properties properties)
public static org.json4s.JsonAST.JValue UUIDToJson(java.util.UUID id)
public static org.json4s.JsonAST.JValue stackTraceToJson(StackTraceElement[] stackTrace)
public static org.json4s.JsonAST.JValue exceptionToJson(Exception exception)
public static SparkListenerEvent sparkEventFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerStageSubmitted stageSubmittedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerStageCompleted stageCompletedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerTaskStart taskStartFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerTaskGettingResult taskGettingResultFromJson(org.json4s.JsonAST.JValue json)
public static org.apache.spark.executor.ExecutorMetrics executorMetricsFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerTaskEnd taskEndFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerJobStart jobStartFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerJobEnd jobEndFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerEnvironmentUpdate environmentUpdateFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerBlockManagerAdded blockManagerAddedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerBlockManagerRemoved blockManagerRemovedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerUnpersistRDD unpersistRDDFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerApplicationStart applicationStartFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerApplicationEnd applicationEndFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerExecutorAdded executorAddedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerExecutorRemoved executorRemovedFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerLogStart logStartFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerExecutorMetricsUpdate executorMetricsUpdateFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerStageExecutorMetrics stageExecutorMetricsFromJson(org.json4s.JsonAST.JValue json)
public static SparkListenerBlockUpdated blockUpdateFromJson(org.json4s.JsonAST.JValue json)
public static StageInfo stageInfoFromJson(org.json4s.JsonAST.JValue json)
json
- (undocumented)public static TaskInfo taskInfoFromJson(org.json4s.JsonAST.JValue json)
public static AccumulableInfo accumulableInfoFromJson(org.json4s.JsonAST.JValue json)
public static org.apache.spark.executor.TaskMetrics taskMetricsFromJson(org.json4s.JsonAST.JValue json)
public static TaskEndReason taskEndReasonFromJson(org.json4s.JsonAST.JValue json)
public static BlockManagerId blockManagerIdFromJson(org.json4s.JsonAST.JValue json)
public static JobResult jobResultFromJson(org.json4s.JsonAST.JValue json)
public static RDDInfo rddInfoFromJson(org.json4s.JsonAST.JValue json)
public static StorageLevel storageLevelFromJson(org.json4s.JsonAST.JValue json)
public static BlockStatus blockStatusFromJson(org.json4s.JsonAST.JValue json)
public static ExecutorInfo executorInfoFromJson(org.json4s.JsonAST.JValue json)
public static BlockUpdatedInfo blockUpdatedInfoFromJson(org.json4s.JsonAST.JValue json)
public static scala.collection.Map<String,ResourceInformation> resourcesMapFromJson(org.json4s.JsonAST.JValue json)
public static scala.collection.Map<String,String> mapFromJson(org.json4s.JsonAST.JValue json)
json
- (undocumented)public static java.util.Properties propertiesFromJson(org.json4s.JsonAST.JValue json)
public static java.util.UUID UUIDFromJson(org.json4s.JsonAST.JValue json)
public static StackTraceElement[] stackTraceFromJson(org.json4s.JsonAST.JValue json)
public static Exception exceptionFromJson(org.json4s.JsonAST.JValue json)