@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,
org.apache.flink.api.common.serialization.DeserializationSchema<K> keyDeserializationSchema,
org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializationSchema)
Reads records that were written using the
UpsertTestSinkWriter from the given
InputStream and converts them using the provided DeserializationSchemas. |
static <K,V> Map<K,V> |
readRecords(File file,
org.apache.flink.api.common.serialization.DeserializationSchema<K> keyDeserializationSchema,
org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializationSchema)
Reads records that were written using the
UpsertTestSinkWriter from the given File
and converts them using the provided DeserializationSchemas. |
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 UpsertTestSinkWriterIOExceptionpublic static int getNumberOfRecords(BufferedInputStream bis) throws IOException
UpsertTestSinkWriter to the
given File.bis - The BufferedInputStream to read fromIOExceptionpublic static int getNumberOfRecords(File file) throws IOException
UpsertTestSinkWriter to the
given File.file - The File to read fromIOExceptionpublic static <K,V> Map<K,V> readRecords(BufferedInputStream bis, org.apache.flink.api.common.serialization.DeserializationSchema<K> keyDeserializationSchema, org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializationSchema) throws IOException
UpsertTestSinkWriter from the given
InputStream and converts them using the provided DeserializationSchemas.bis - The BufferedInputStream to read fromkeyDeserializationSchema - The key's DeserializationSchemavalueDeserializationSchema - The value's DeserializationSchemaIOExceptionpublic static <K,V> Map<K,V> readRecords(File file, org.apache.flink.api.common.serialization.DeserializationSchema<K> keyDeserializationSchema, org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializationSchema) throws IOException
UpsertTestSinkWriter from the given File
and converts them using the provided DeserializationSchemas.file - The File to read fromkeyDeserializationSchema - The key's DeserializationSchemavalueDeserializationSchema - The value's DeserializationSchemaIOExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.