Class CsvEntityStreamingSupport
- 
Constructor SummaryConstructorsConstructorDescriptionCsvEntityStreamingSupport(int maxObjectSize) CsvEntityStreamingSupport(int maxLineLength, ContentTypeRange supported, ContentType contentType, org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRenderer, int parallelism, boolean unordered) 
- 
Method SummaryModifier and TypeMethodDescriptionWrite-side, defines what Content-Type the Marshaller should offer and the final Content-Type of the response.org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> Read-side, decode incoming framed entity.org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> Write-side, apply framing to outgoing entity stream.intWrite-side / read-side, defines if (un)marshalling should be done in parallel.Read-side, what content types it is able to frame and unmarshall.toString()booleanWrite-side / read-side, defines if (un)marshalling should preserve ordering of incoming stream elements.Write-side, defines what Content-Type the Marshaller should offer and the final Content-Type of the response.withFramingRenderer(org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRendererFlow) withFramingRendererFlow(org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRendererFlow) Java API: Write-side, apply framing to outgoing entity stream.withParallelMarshalling(int parallelism, boolean unordered) Write-side / read-side, defines parallelism and if ordering should be preserved or not of Source element marshalling.withSupported(ContentTypeRange range) Read-side, allows changing what content types are accepted by this framing.Methods inherited from class org.apache.pekko.http.scaladsl.common.EntityStreamingSupportcsv, csv, getFramingDecoder, getFramingRenderer, json, json
- 
Constructor Details- 
CsvEntityStreamingSupportpublic CsvEntityStreamingSupport(int maxLineLength, ContentTypeRange supported, ContentType contentType, org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRenderer, int parallelism, boolean unordered) 
- 
CsvEntityStreamingSupportpublic CsvEntityStreamingSupport(int maxObjectSize) 
 
- 
- 
Method Details- 
contentTypeDescription copied from class:EntityStreamingSupportWrite-side, defines what Content-Type the Marshaller should offer and the final Content-Type of the response.- Specified by:
- contentTypein class- EntityStreamingSupport
 
- 
framingDecoderpublic org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, framingDecoder()org.apache.pekko.NotUsed> Description copied from class:EntityStreamingSupportRead-side, decode incoming framed entity. For example with an incoming JSON array, chunk it up into JSON objects contained within that array.- Specified by:
- framingDecoderin class- EntityStreamingSupport
- Returns:
- (undocumented)
 
- 
framingRendererpublic org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString,org.apache.pekko.util.ByteString, framingRenderer()org.apache.pekko.NotUsed> Description copied from class:EntityStreamingSupportWrite-side, apply framing to outgoing entity stream.Most typical usage will be a variant of Flow[ByteString].intersperse.For example for rendering a JSON array one would return Flow[ByteString].intersperse(ByteString("["), ByteString(","), ByteString("]"))and for rendering a new-line separated CSV simplyFlow[ByteString].intersperse(ByteString("\n")).- Specified by:
- framingRendererin class- EntityStreamingSupport
- Returns:
- (undocumented)
 
- 
parallelismpublic int parallelism()Description copied from class:EntityStreamingSupportWrite-side / read-side, defines if (un)marshalling should be done in parallel.This may be beneficial marshalling the bottleneck in the pipeline. See also EntityStreamingSupport.parallelism()andEntityStreamingSupport.withParallelMarshalling(int,boolean).- Specified by:
- parallelismin class- EntityStreamingSupport
- Returns:
- (undocumented)
 
- 
supportedDescription copied from class:EntityStreamingSupportRead-side, what content types it is able to frame and unmarshall.- Specified by:
- supportedin class- EntityStreamingSupport
 
- 
toString
- 
unorderedpublic boolean unordered()Description copied from class:EntityStreamingSupportWrite-side / read-side, defines if (un)marshalling should preserve ordering of incoming stream elements.Allowing for parallel and unordered (un)marshalling often yields higher throughput and also allows avoiding head-of-line blocking if some elements are much larger than others. See also EntityStreamingSupport.parallelism()andEntityStreamingSupport.withParallelMarshalling(int,boolean).- Specified by:
- unorderedin class- EntityStreamingSupport
- Returns:
- (undocumented)
 
- 
withContentTypeDescription copied from class:EntityStreamingSupportWrite-side, defines what Content-Type the Marshaller should offer and the final Content-Type of the response.EntityStreamingSupport traits MUST support re-configuring the offered ContentType. This is due to the need integrating with existing systems which sometimes expect custom Content-Types, however really are just plain JSON or something else internally (perhaps with slight extensions).NOTE: Implementations should specialize the return type to their own Type! - Specified by:
- withContentTypein class- EntityStreamingSupport
- Parameters:
- ct- (undocumented)
- Returns:
- (undocumented)
 
- 
withFramingRendererpublic CsvEntityStreamingSupport withFramingRenderer(org.apache.pekko.stream.scaladsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRendererFlow) 
- 
withFramingRendererFlowpublic CsvEntityStreamingSupport withFramingRendererFlow(org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framingRendererFlow) Description copied from class:CsvEntityStreamingSupportJava API: Write-side, apply framing to outgoing entity stream.Most typical usage will be a variant of Flow[ByteString].intersperse.For example for rendering a JSON array one would return Flow[ByteString].intersperse(ByteString("["), ByteString(","), ByteString("]"))and for rendering a new-line separated CSV simplyFlow[ByteString].intersperse(ByteString("\n")).- Specified by:
- withFramingRendererFlowin class- CsvEntityStreamingSupport
- Parameters:
- framingRendererFlow- (undocumented)
- Returns:
- (undocumented)
 
- 
withParallelMarshallingDescription copied from class:EntityStreamingSupportWrite-side / read-side, defines parallelism and if ordering should be preserved or not of Source element marshalling.Sometimes marshalling multiple elements at once (esp. when elements are not evenly sized, and ordering is not enforced) may yield in higher throughput. NOTE: Implementations should specialize the return type to their own Type! - Specified by:
- withParallelMarshallingin class- EntityStreamingSupport
- Parameters:
- parallelism- (undocumented)
- unordered- (undocumented)
- Returns:
- (undocumented)
 
- 
withSupportedDescription copied from class:EntityStreamingSupportRead-side, allows changing what content types are accepted by this framing.EntityStreamingSupport traits MUST support re-configuring the accepted ContentTypeRange.This is in order to support a-typical APIs which users still want to communicate with using the provided support trait. Typical examples include APIs which return valid application/jsonhowever advertise the content type as beingapplication/javascriptor vendor specific content types, which still parse correctly as JSON, CSV or something else that a provided support trait is built for.NOTE: Implementations should specialize the return type to their own Type! - Specified by:
- withSupportedin class- EntityStreamingSupport
- Parameters:
- range- (undocumented)
- Returns:
- (undocumented)
 
 
-