@Internal public class UpsertTestFileUtil extends Object
UpsertTestSink
.Modifier and Type | Method and Description |
---|---|
static int |
getNumberOfRecords(BufferedInputStream bis)
Returns the total number of records written using the
UpsertTestSinkWriter to the
given File. |
static int |
getNumberOfRecords(File file)
Returns the total number of records written using the
UpsertTestSinkWriter to the
given File. |
static <K,V> Map<K,V> |
readRecords(BufferedInputStream bis,
DeserializationSchema<K> keyDeserializationSchema,
DeserializationSchema<V> valueDeserializationSchema)
Reads records that were written using the
UpsertTestSinkWriter from the given
InputStream and converts them using the provided DeserializationSchema s. |
static <K,V> Map<K,V> |
readRecords(File file,
DeserializationSchema<K> keyDeserializationSchema,
DeserializationSchema<V> valueDeserializationSchema)
Reads records that were written using the
UpsertTestSinkWriter from the given File
and converts them using the provided DeserializationSchema s. |
static void |
writeRecords(BufferedOutputStream bos,
Map<org.apache.flink.connector.upserttest.sink.ImmutableByteArrayWrapper,org.apache.flink.connector.upserttest.sink.ImmutableByteArrayWrapper> records)
Writes a Map of records serialized by the
UpsertTestSinkWriter to the given
BufferedOutputStream. |
public static void writeRecords(BufferedOutputStream bos, Map<org.apache.flink.connector.upserttest.sink.ImmutableByteArrayWrapper,org.apache.flink.connector.upserttest.sink.ImmutableByteArrayWrapper> records) throws IOException
UpsertTestSinkWriter
to the given
BufferedOutputStream.bos
- the BufferedOutputStream to write torecords
- the Map of records created by the UpsertTestSinkWriterIOException
public static int getNumberOfRecords(BufferedInputStream bis) throws IOException
UpsertTestSinkWriter
to the
given File.bis
- The BufferedInputStream to read fromIOException
public static int getNumberOfRecords(File file) throws IOException
UpsertTestSinkWriter
to the
given File.file
- The File to read fromIOException
public static <K,V> Map<K,V> readRecords(BufferedInputStream bis, DeserializationSchema<K> keyDeserializationSchema, DeserializationSchema<V> valueDeserializationSchema) throws IOException
UpsertTestSinkWriter
from the given
InputStream and converts them using the provided DeserializationSchema
s.bis
- The BufferedInputStream to read fromkeyDeserializationSchema
- The key's DeserializationSchemavalueDeserializationSchema
- The value's DeserializationSchemaIOException
public static <K,V> Map<K,V> readRecords(File file, DeserializationSchema<K> keyDeserializationSchema, DeserializationSchema<V> valueDeserializationSchema) throws IOException
UpsertTestSinkWriter
from the given File
and converts them using the provided DeserializationSchema
s.file
- The File to read fromkeyDeserializationSchema
- The key's DeserializationSchemavalueDeserializationSchema
- The value's DeserializationSchemaIOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.