Class TimelineEntitySetWriter

java.lang.Object
org.apache.hadoop.yarn.api.records.timelineservice.writer.TimelineEntitySetWriter
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<Set<TimelineEntity>>

@Provider @Consumes("application/json") public class TimelineEntitySetWriter extends Object implements javax.ws.rs.ext.MessageBodyWriter<Set<TimelineEntity>>
We have defined a dedicated Writer for TimelineEntity, aimed at adapting to the Jersey2 framework to ensure that TimelineEntity can be converted into JSON format.
  • Constructor Details

    • TimelineEntitySetWriter

      public TimelineEntitySetWriter()
  • Method Details

    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Set<TimelineEntity>>
    • writeTo

      public void writeTo(Set<TimelineEntity> timelinePutResponse, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Set<TimelineEntity>>
      Throws:
      IOException
      javax.ws.rs.WebApplicationException
    • getSize

      public long getSize(Set<TimelineEntity> timelineEntities, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<Set<TimelineEntity>>