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(com.fasterxml.jackson.databind.JsonNode json) |
static void |
accumulableInfoToJson(AccumulableInfo accumulableInfo,
com.fasterxml.jackson.core.JsonGenerator g) |
static void |
accumulablesToJson(scala.collection.Iterable<AccumulableInfo> accumulables,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerApplicationEnd |
applicationEndFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
applicationEndToJson(SparkListenerApplicationEnd applicationEnd,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerApplicationStart |
applicationStartFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
applicationStartToJson(SparkListenerApplicationStart applicationStart,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerBlockManagerAdded |
blockManagerAddedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockManagerAddedToJson(SparkListenerBlockManagerAdded blockManagerAdded,
com.fasterxml.jackson.core.JsonGenerator g) |
static BlockManagerId |
blockManagerIdFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockManagerIdToJson(BlockManagerId blockManagerId,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerBlockManagerRemoved |
blockManagerRemovedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockManagerRemovedToJson(SparkListenerBlockManagerRemoved blockManagerRemoved,
com.fasterxml.jackson.core.JsonGenerator g) |
static BlockStatus |
blockStatusFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockStatusToJson(BlockStatus blockStatus,
com.fasterxml.jackson.core.JsonGenerator g) |
static BlockUpdatedInfo |
blockUpdatedInfoFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockUpdatedInfoToJson(BlockUpdatedInfo blockUpdatedInfo,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerBlockUpdated |
blockUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
blockUpdateToJson(SparkListenerBlockUpdated blockUpdate,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerEnvironmentUpdate |
environmentUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
environmentUpdateToJson(SparkListenerEnvironmentUpdate environmentUpdate,
com.fasterxml.jackson.core.JsonGenerator g) |
static Exception |
exceptionFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
exceptionToJson(Exception exception,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerExecutorAdded |
executorAddedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
executorAddedToJson(SparkListenerExecutorAdded executorAdded,
com.fasterxml.jackson.core.JsonGenerator g) |
static ExecutorInfo |
executorInfoFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
executorInfoToJson(ExecutorInfo executorInfo,
com.fasterxml.jackson.core.JsonGenerator g) |
static org.apache.spark.executor.ExecutorMetrics |
executorMetricsFromJson(com.fasterxml.jackson.databind.JsonNode maybeJson)
Extract the executor metrics from JSON.
|
static void |
executorMetricsToJson(org.apache.spark.executor.ExecutorMetrics executorMetrics,
com.fasterxml.jackson.core.JsonGenerator g)
Convert executor metrics to JSON.
|
static SparkListenerExecutorMetricsUpdate |
executorMetricsUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
executorMetricsUpdateToJson(SparkListenerExecutorMetricsUpdate metricsUpdate,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerExecutorRemoved |
executorRemovedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
executorRemovedToJson(SparkListenerExecutorRemoved executorRemoved,
com.fasterxml.jackson.core.JsonGenerator g) |
static ExecutorResourceRequest |
executorResourceRequestFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static scala.collection.Map<String,ExecutorResourceRequest> |
executorResourceRequestMapFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
executorResourceRequestMapToJson(scala.collection.Map<String,ExecutorResourceRequest> m,
com.fasterxml.jackson.core.JsonGenerator g) |
static void |
executorResourceRequestToJson(ExecutorResourceRequest execReq,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerJobEnd |
jobEndFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
jobEndToJson(SparkListenerJobEnd jobEnd,
com.fasterxml.jackson.core.JsonGenerator g) |
static JobResult |
jobResultFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
jobResultToJson(JobResult jobResult,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerJobStart |
jobStartFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
jobStartToJson(SparkListenerJobStart jobStart,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerLogStart |
logStartFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
logStartToJson(SparkListenerLogStart logStart,
com.fasterxml.jackson.core.JsonGenerator g) |
static scala.collection.Map<String,String> |
mapFromJson(com.fasterxml.jackson.databind.JsonNode json)
-------------------------------- *
Util JSON deserialization methods |
|
static java.util.Properties |
propertiesFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
propertiesToJson(java.util.Properties properties,
com.fasterxml.jackson.core.JsonGenerator g) |
static RDDInfo |
rddInfoFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
rddInfoToJson(RDDInfo rddInfo,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerResourceProfileAdded |
resourceProfileAddedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
resourceProfileAddedToJson(SparkListenerResourceProfileAdded profileAdded,
com.fasterxml.jackson.core.JsonGenerator g) |
static scala.collection.Map<String,ResourceInformation> |
resourcesMapFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static SparkListenerEvent |
sparkEventFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static SparkListenerEvent |
sparkEventFromJson(String json) |
static String |
sparkEventToJsonString(SparkListenerEvent event)
------------------------------------------------- *
JSON serialization methods for SparkListenerEvents |
|
static StackTraceElement[] |
stackTraceFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
stackTraceToJson(StackTraceElement[] stackTrace,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerStageCompleted |
stageCompletedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
stageCompletedToJson(SparkListenerStageCompleted stageCompleted,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerStageExecutorMetrics |
stageExecutorMetricsFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
stageExecutorMetricsToJson(SparkListenerStageExecutorMetrics metrics,
com.fasterxml.jackson.core.JsonGenerator g) |
static StageInfo |
stageInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
--------------------------------------------------------------------- *
JSON deserialization methods for classes SparkListenerEvents depend on |
|
static void |
stageInfoToJson(StageInfo stageInfo,
com.fasterxml.jackson.core.JsonGenerator g)
------------------------------------------------------------------- *
JSON serialization methods for classes SparkListenerEvents depend on |
|
static SparkListenerStageSubmitted |
stageSubmittedFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
stageSubmittedToJson(SparkListenerStageSubmitted stageSubmitted,
com.fasterxml.jackson.core.JsonGenerator g) |
static StorageLevel |
storageLevelFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
storageLevelToJson(StorageLevel storageLevel,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerTaskEnd |
taskEndFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static TaskEndReason |
taskEndReasonFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskEndReasonToJson(TaskEndReason taskEndReason,
com.fasterxml.jackson.core.JsonGenerator g) |
static void |
taskEndToJson(SparkListenerTaskEnd taskEnd,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerTaskGettingResult |
taskGettingResultFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskGettingResultToJson(SparkListenerTaskGettingResult taskGettingResult,
com.fasterxml.jackson.core.JsonGenerator g) |
static TaskInfo |
taskInfoFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskInfoToJson(TaskInfo taskInfo,
com.fasterxml.jackson.core.JsonGenerator g) |
static org.apache.spark.executor.TaskMetrics |
taskMetricsFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskMetricsToJson(org.apache.spark.executor.TaskMetrics taskMetrics,
com.fasterxml.jackson.core.JsonGenerator g) |
static TaskResourceRequest |
taskResourceRequestFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static scala.collection.Map<String,TaskResourceRequest> |
taskResourceRequestMapFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskResourceRequestMapToJson(scala.collection.Map<String,TaskResourceRequest> m,
com.fasterxml.jackson.core.JsonGenerator g) |
static void |
taskResourceRequestToJson(TaskResourceRequest taskReq,
com.fasterxml.jackson.core.JsonGenerator g) |
static SparkListenerTaskStart |
taskStartFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
taskStartToJson(SparkListenerTaskStart taskStart,
com.fasterxml.jackson.core.JsonGenerator g) |
static String |
toJsonString(scala.Function1<com.fasterxml.jackson.core.JsonGenerator,scala.runtime.BoxedUnit> block) |
static SparkListenerUnpersistRDD |
unpersistRDDFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
unpersistRDDToJson(SparkListenerUnpersistRDD unpersistRDD,
com.fasterxml.jackson.core.JsonGenerator g) |
static java.util.UUID |
UUIDFromJson(com.fasterxml.jackson.databind.JsonNode json) |
static void |
UUIDToJson(java.util.UUID id,
com.fasterxml.jackson.core.JsonGenerator g) |
static void |
writeMapField(String name,
scala.collection.Map<String,String> m,
com.fasterxml.jackson.core.JsonGenerator g)
------------------------------ *
Util JSON serialization methods |
|
static void |
writeSparkEventToJson(SparkListenerEvent event,
com.fasterxml.jackson.core.JsonGenerator g) |
public static String sparkEventToJsonString(SparkListenerEvent event)
event
- (undocumented)public static void writeSparkEventToJson(SparkListenerEvent event, com.fasterxml.jackson.core.JsonGenerator g)
public static void stageSubmittedToJson(SparkListenerStageSubmitted stageSubmitted, com.fasterxml.jackson.core.JsonGenerator g)
public static void stageCompletedToJson(SparkListenerStageCompleted stageCompleted, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskStartToJson(SparkListenerTaskStart taskStart, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskGettingResultToJson(SparkListenerTaskGettingResult taskGettingResult, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskEndToJson(SparkListenerTaskEnd taskEnd, com.fasterxml.jackson.core.JsonGenerator g)
public static void jobStartToJson(SparkListenerJobStart jobStart, com.fasterxml.jackson.core.JsonGenerator g)
public static void jobEndToJson(SparkListenerJobEnd jobEnd, com.fasterxml.jackson.core.JsonGenerator g)
public static void environmentUpdateToJson(SparkListenerEnvironmentUpdate environmentUpdate, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockManagerAddedToJson(SparkListenerBlockManagerAdded blockManagerAdded, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockManagerRemovedToJson(SparkListenerBlockManagerRemoved blockManagerRemoved, com.fasterxml.jackson.core.JsonGenerator g)
public static void unpersistRDDToJson(SparkListenerUnpersistRDD unpersistRDD, com.fasterxml.jackson.core.JsonGenerator g)
public static void applicationStartToJson(SparkListenerApplicationStart applicationStart, com.fasterxml.jackson.core.JsonGenerator g)
public static void applicationEndToJson(SparkListenerApplicationEnd applicationEnd, com.fasterxml.jackson.core.JsonGenerator g)
public static void resourceProfileAddedToJson(SparkListenerResourceProfileAdded profileAdded, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorAddedToJson(SparkListenerExecutorAdded executorAdded, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorRemovedToJson(SparkListenerExecutorRemoved executorRemoved, com.fasterxml.jackson.core.JsonGenerator g)
public static void logStartToJson(SparkListenerLogStart logStart, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorMetricsUpdateToJson(SparkListenerExecutorMetricsUpdate metricsUpdate, com.fasterxml.jackson.core.JsonGenerator g)
public static void stageExecutorMetricsToJson(SparkListenerStageExecutorMetrics metrics, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockUpdateToJson(SparkListenerBlockUpdated blockUpdate, com.fasterxml.jackson.core.JsonGenerator g)
public static void stageInfoToJson(StageInfo stageInfo, com.fasterxml.jackson.core.JsonGenerator g)
stageInfo
- (undocumented)g
- (undocumented)
--------------------------------------------------------------------public static void taskInfoToJson(TaskInfo taskInfo, com.fasterxml.jackson.core.JsonGenerator g)
public static void accumulablesToJson(scala.collection.Iterable<AccumulableInfo> accumulables, com.fasterxml.jackson.core.JsonGenerator g)
public static void accumulableInfoToJson(AccumulableInfo accumulableInfo, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskMetricsToJson(org.apache.spark.executor.TaskMetrics taskMetrics, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorMetricsToJson(org.apache.spark.executor.ExecutorMetrics executorMetrics, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskEndReasonToJson(TaskEndReason taskEndReason, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockManagerIdToJson(BlockManagerId blockManagerId, com.fasterxml.jackson.core.JsonGenerator g)
public static void jobResultToJson(JobResult jobResult, com.fasterxml.jackson.core.JsonGenerator g)
public static void rddInfoToJson(RDDInfo rddInfo, com.fasterxml.jackson.core.JsonGenerator g)
public static void storageLevelToJson(StorageLevel storageLevel, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockStatusToJson(BlockStatus blockStatus, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorInfoToJson(ExecutorInfo executorInfo, com.fasterxml.jackson.core.JsonGenerator g)
public static void blockUpdatedInfoToJson(BlockUpdatedInfo blockUpdatedInfo, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorResourceRequestToJson(ExecutorResourceRequest execReq, com.fasterxml.jackson.core.JsonGenerator g)
public static void executorResourceRequestMapToJson(scala.collection.Map<String,ExecutorResourceRequest> m, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskResourceRequestToJson(TaskResourceRequest taskReq, com.fasterxml.jackson.core.JsonGenerator g)
public static void taskResourceRequestMapToJson(scala.collection.Map<String,TaskResourceRequest> m, com.fasterxml.jackson.core.JsonGenerator g)
public static void writeMapField(String name, scala.collection.Map<String,String> m, com.fasterxml.jackson.core.JsonGenerator g)
name
- (undocumented)m
- (undocumented)g
- (undocumented)
-------------------------------public static void propertiesToJson(java.util.Properties properties, com.fasterxml.jackson.core.JsonGenerator g)
public static void UUIDToJson(java.util.UUID id, com.fasterxml.jackson.core.JsonGenerator g)
public static void stackTraceToJson(StackTraceElement[] stackTrace, com.fasterxml.jackson.core.JsonGenerator g)
public static void exceptionToJson(Exception exception, com.fasterxml.jackson.core.JsonGenerator g)
public static SparkListenerEvent sparkEventFromJson(String json)
public static SparkListenerEvent sparkEventFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerStageSubmitted stageSubmittedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerStageCompleted stageCompletedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerTaskStart taskStartFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerTaskGettingResult taskGettingResultFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static org.apache.spark.executor.ExecutorMetrics executorMetricsFromJson(com.fasterxml.jackson.databind.JsonNode maybeJson)
public static SparkListenerTaskEnd taskEndFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerJobStart jobStartFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerJobEnd jobEndFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerResourceProfileAdded resourceProfileAddedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static ExecutorResourceRequest executorResourceRequestFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static TaskResourceRequest taskResourceRequestFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static scala.collection.Map<String,TaskResourceRequest> taskResourceRequestMapFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static scala.collection.Map<String,ExecutorResourceRequest> executorResourceRequestMapFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerEnvironmentUpdate environmentUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerBlockManagerAdded blockManagerAddedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerBlockManagerRemoved blockManagerRemovedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerUnpersistRDD unpersistRDDFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerApplicationStart applicationStartFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerApplicationEnd applicationEndFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerExecutorAdded executorAddedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerExecutorRemoved executorRemovedFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerLogStart logStartFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerExecutorMetricsUpdate executorMetricsUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerStageExecutorMetrics stageExecutorMetricsFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static SparkListenerBlockUpdated blockUpdateFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static StageInfo stageInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
json
- (undocumented)public static TaskInfo taskInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static AccumulableInfo accumulableInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static org.apache.spark.executor.TaskMetrics taskMetricsFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static TaskEndReason taskEndReasonFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static BlockManagerId blockManagerIdFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static JobResult jobResultFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static RDDInfo rddInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static StorageLevel storageLevelFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static BlockStatus blockStatusFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static ExecutorInfo executorInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static BlockUpdatedInfo blockUpdatedInfoFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static scala.collection.Map<String,ResourceInformation> resourcesMapFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static scala.collection.Map<String,String> mapFromJson(com.fasterxml.jackson.databind.JsonNode json)
json
- (undocumented)public static java.util.Properties propertiesFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static java.util.UUID UUIDFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static StackTraceElement[] stackTraceFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static Exception exceptionFromJson(com.fasterxml.jackson.databind.JsonNode json)
public static String toJsonString(scala.Function1<com.fasterxml.jackson.core.JsonGenerator,scala.runtime.BoxedUnit> block)