Java Code Examples for org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator#writeStringField()
The following examples show how to use
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator#writeStringField() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HistoryServer.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
private static String createConfigJson(DashboardConfiguration dashboardConfiguration) throws IOException { StringWriter writer = new StringWriter(); JsonGenerator gen = JsonFactory.JACKSON_FACTORY.createGenerator(writer); gen.writeStartObject(); gen.writeNumberField(DashboardConfiguration.FIELD_NAME_REFRESH_INTERVAL, dashboardConfiguration.getRefreshInterval()); gen.writeNumberField(DashboardConfiguration.FIELD_NAME_TIMEZONE_OFFSET, dashboardConfiguration.getTimeZoneOffset()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_TIMEZONE_NAME, dashboardConfiguration.getTimeZoneName()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_FLINK_VERSION, dashboardConfiguration.getFlinkVersion()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_FLINK_REVISION, dashboardConfiguration.getFlinkRevision()); gen.writeEndObject(); gen.close(); return writer.toString(); }
Example 2
Source File: JobConfigInfo.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Override public void serialize( JobConfigInfo jobConfigInfo, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobConfigInfo.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobConfigInfo.getJobName()); if (jobConfigInfo.getExecutionConfigInfo() != null) { jsonGenerator.writeObjectField(FIELD_NAME_EXECUTION_CONFIG, jobConfigInfo.getExecutionConfigInfo()); } jsonGenerator.writeEndObject(); }
Example 3
Source File: HistoryServer.java From flink with Apache License 2.0 | 6 votes |
private static String createConfigJson(DashboardConfiguration dashboardConfiguration) throws IOException { StringWriter writer = new StringWriter(); JsonGenerator gen = JsonFactory.JACKSON_FACTORY.createGenerator(writer); gen.writeStartObject(); gen.writeNumberField(DashboardConfiguration.FIELD_NAME_REFRESH_INTERVAL, dashboardConfiguration.getRefreshInterval()); gen.writeNumberField(DashboardConfiguration.FIELD_NAME_TIMEZONE_OFFSET, dashboardConfiguration.getTimeZoneOffset()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_TIMEZONE_NAME, dashboardConfiguration.getTimeZoneName()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_FLINK_VERSION, dashboardConfiguration.getFlinkVersion()); gen.writeStringField(DashboardConfiguration.FIELD_NAME_FLINK_REVISION, dashboardConfiguration.getFlinkRevision()); gen.writeEndObject(); gen.close(); return writer.toString(); }
Example 4
Source File: JobConfigInfo.java From flink with Apache License 2.0 | 6 votes |
@Override public void serialize( JobConfigInfo jobConfigInfo, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobConfigInfo.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobConfigInfo.getJobName()); if (jobConfigInfo.getExecutionConfigInfo() != null) { jsonGenerator.writeObjectField(FIELD_NAME_EXECUTION_CONFIG, jobConfigInfo.getExecutionConfigInfo()); } jsonGenerator.writeEndObject(); }
Example 5
Source File: JobConfigInfo.java From flink with Apache License 2.0 | 6 votes |
@Override public void serialize( JobConfigInfo jobConfigInfo, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobConfigInfo.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobConfigInfo.getJobName()); if (jobConfigInfo.getExecutionConfigInfo() != null) { jsonGenerator.writeObjectField(FIELD_NAME_EXECUTION_CONFIG, jobConfigInfo.getExecutionConfigInfo()); } jsonGenerator.writeEndObject(); }
Example 6
Source File: JobDetails.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public void serialize( JobDetails jobDetails, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobDetails.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobDetails.getJobName()); jsonGenerator.writeStringField(FIELD_NAME_STATUS, jobDetails.getStatus().name()); jsonGenerator.writeNumberField(FIELD_NAME_START_TIME, jobDetails.getStartTime()); jsonGenerator.writeNumberField(FIELD_NAME_END_TIME, jobDetails.getEndTime()); jsonGenerator.writeNumberField(FIELD_NAME_DURATION, jobDetails.getDuration()); jsonGenerator.writeNumberField(FIELD_NAME_LAST_MODIFICATION, jobDetails.getLastUpdateTime()); jsonGenerator.writeObjectFieldStart("tasks"); jsonGenerator.writeNumberField(FIELD_NAME_TOTAL_NUMBER_TASKS, jobDetails.getNumTasks()); final int[] perState = jobDetails.getTasksPerState(); for (ExecutionState executionState : ExecutionState.values()) { jsonGenerator.writeNumberField(executionState.name().toLowerCase(), perState[executionState.ordinal()]); } jsonGenerator.writeEndObject(); jsonGenerator.writeEndObject(); }
Example 7
Source File: SerializedThrowableSerializer.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public void serialize(final SerializedThrowable value, final JsonGenerator gen, final SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeStringField(FIELD_NAME_CLASS, value.getOriginalErrorClassName()); gen.writeStringField(FIELD_NAME_STACK_TRACE, value.getFullStringifiedStackTrace()); gen.writeBinaryField(FIELD_NAME_SERIALIZED_THROWABLE, InstantiationUtil.serializeObject(value)); gen.writeEndObject(); }
Example 8
Source File: JobDetails.java From flink with Apache License 2.0 | 5 votes |
@Override public void serialize( JobDetails jobDetails, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobDetails.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobDetails.getJobName()); jsonGenerator.writeStringField(FIELD_NAME_STATUS, jobDetails.getStatus().name()); jsonGenerator.writeNumberField(FIELD_NAME_START_TIME, jobDetails.getStartTime()); jsonGenerator.writeNumberField(FIELD_NAME_END_TIME, jobDetails.getEndTime()); jsonGenerator.writeNumberField(FIELD_NAME_DURATION, jobDetails.getDuration()); jsonGenerator.writeNumberField(FIELD_NAME_LAST_MODIFICATION, jobDetails.getLastUpdateTime()); jsonGenerator.writeObjectFieldStart("tasks"); jsonGenerator.writeNumberField(FIELD_NAME_TOTAL_NUMBER_TASKS, jobDetails.getNumTasks()); final int[] perState = jobDetails.getTasksPerState(); for (ExecutionState executionState : ExecutionState.values()) { jsonGenerator.writeNumberField(executionState.name().toLowerCase(), perState[executionState.ordinal()]); } jsonGenerator.writeEndObject(); jsonGenerator.writeEndObject(); }
Example 9
Source File: SerializedThrowableSerializer.java From flink with Apache License 2.0 | 5 votes |
@Override public void serialize(final SerializedThrowable value, final JsonGenerator gen, final SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeStringField(FIELD_NAME_CLASS, value.getOriginalErrorClassName()); gen.writeStringField(FIELD_NAME_STACK_TRACE, value.getFullStringifiedStackTrace()); gen.writeBinaryField(FIELD_NAME_SERIALIZED_THROWABLE, InstantiationUtil.serializeObject(value)); gen.writeEndObject(); }
Example 10
Source File: JobDetails.java From flink with Apache License 2.0 | 5 votes |
@Override public void serialize( JobDetails jobDetails, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeStringField(FIELD_NAME_JOB_ID, jobDetails.getJobId().toString()); jsonGenerator.writeStringField(FIELD_NAME_JOB_NAME, jobDetails.getJobName()); jsonGenerator.writeStringField(FIELD_NAME_STATUS, jobDetails.getStatus().name()); jsonGenerator.writeNumberField(FIELD_NAME_START_TIME, jobDetails.getStartTime()); jsonGenerator.writeNumberField(FIELD_NAME_END_TIME, jobDetails.getEndTime()); jsonGenerator.writeNumberField(FIELD_NAME_DURATION, jobDetails.getDuration()); jsonGenerator.writeNumberField(FIELD_NAME_LAST_MODIFICATION, jobDetails.getLastUpdateTime()); jsonGenerator.writeObjectFieldStart("tasks"); jsonGenerator.writeNumberField(FIELD_NAME_TOTAL_NUMBER_TASKS, jobDetails.getNumTasks()); final int[] perState = jobDetails.getTasksPerState(); for (ExecutionState executionState : ExecutionState.values()) { jsonGenerator.writeNumberField(executionState.name().toLowerCase(), perState[executionState.ordinal()]); } jsonGenerator.writeEndObject(); jsonGenerator.writeEndObject(); }
Example 11
Source File: SerializedThrowableSerializer.java From flink with Apache License 2.0 | 5 votes |
@Override public void serialize(final SerializedThrowable value, final JsonGenerator gen, final SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeStringField(FIELD_NAME_CLASS, value.getOriginalErrorClassName()); gen.writeStringField(FIELD_NAME_STACK_TRACE, value.getFullStringifiedStackTrace()); gen.writeBinaryField(FIELD_NAME_SERIALIZED_THROWABLE, InstantiationUtil.serializeObject(value)); gen.writeEndObject(); }
Example 12
Source File: JsonMapper.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
private static void addProperty(JsonGenerator gen, String name, String value) throws IOException { gen.writeStartObject(); gen.writeStringField("name", name); gen.writeStringField("value", value); gen.writeEndObject(); }
Example 13
Source File: JsonMapper.java From flink with Apache License 2.0 | 4 votes |
private static void addProperty(JsonGenerator gen, String name, String value) throws IOException { gen.writeStartObject(); gen.writeStringField("name", name); gen.writeStringField("value", value); gen.writeEndObject(); }
Example 14
Source File: JsonMapper.java From flink with Apache License 2.0 | 4 votes |
private static void addProperty(JsonGenerator gen, String name, String value) throws IOException { gen.writeStartObject(); gen.writeStringField("name", name); gen.writeStringField("value", value); gen.writeEndObject(); }