Package com.linkedin.venice.utils
Class TestWriteUtils
java.lang.Object
com.linkedin.venice.utils.TestWriteUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final String
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
static final org.apache.avro.Schema
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
defaultVPJProps
(String veniceUrl, String inputDirPath, String storeName) static Properties
defaultVPJPropsWithD2Routing
(String parentRegionName, String parentRegionD2ZkAddress, Map<String, String> childRegionNamesToZkAddress, String parentControllerD2ServiceName, String childControllerD2ServiceName, String inputDirPath, String storeName) static org.apache.avro.Schema
getETLFileSchema
(org.apache.avro.Schema keySchema, org.apache.avro.Schema valueSchema) static org.apache.avro.Schema
getETLFileSchemaWithNullDefaultValue
(org.apache.avro.Schema keySchema, org.apache.avro.Schema valueSchema) static org.apache.avro.generic.GenericRecord
getRecordWithFloatArray
(org.apache.avro.Schema recordSchema, int index, int size) static org.apache.avro.generic.GenericRecord
getRecordWithStringMap
(org.apache.avro.Schema recordSchema, int index, int count) static File
static String
loadFileAsString
(String fileName) static String
loadFileAsStringQuietlyWithErrorLogged
(String fileName) static String
loadSchemaFileFromResource
(String fileName) static void
runPushJob
(String jobId, Properties props) static void
runPushJob
(String jobId, Properties props, Consumer<VenicePushJob> jobTransformer) static void
updateStore
(String storeName, ControllerClient controllerClient, UpdateStoreQueryParams params) static org.apache.avro.Schema
static org.apache.avro.Schema
writeAvroFileWithManyFloatsAndCustomTotalSize
(File parentDir, int numberOfRecords, int minValueSize, int maxValueSize) static KeyAndValueSchemas
writeComplexVsonFile
(File parentDir) static org.apache.avro.Schema
writeEmptyAvroFile
(File parentDir, String fileName, org.apache.avro.Schema schema) static org.apache.avro.Schema
writeEmptyAvroFile
(File parentDir, org.apache.avro.Schema schema) static org.apache.avro.Schema
writeETLFileWithUnionWithNullSchema
(File parentDir) static org.apache.avro.Schema
writeETLFileWithUnionWithoutNullSchema
(File parentDir) static org.apache.avro.Schema
writeETLFileWithUserSchema
(File parentDir) static org.apache.avro.Schema
static void
writeInvalidAvroFile
(File parentDir, String fileName) static KeyAndValueSchemas
writeMultiLevelVsonFile
(File parentDir) static Pair<VsonSchema,
VsonSchema> writeMultiLevelVsonFile2
(File parentDir) static org.apache.avro.Schema
writeSchemaWithUnknownFieldIntoAvroFile
(File parentDir) static org.apache.avro.Schema
writeSimpleAvroFile
(File parentDir, org.apache.avro.Schema schema, Function<Integer, org.apache.avro.generic.GenericRecord> recordProvider) static org.apache.avro.Schema
writeSimpleAvroFileForValidateSchemaAndBuildDictMapperOutput
(File parentDir, String file, long inputFileDataSize, ByteBuffer zstdDictionary, org.apache.avro.Schema avroSchema) static org.apache.avro.Schema
writeSimpleAvroFileWithASchemaWithAWrongDefaultValue
(File parentDir, int numberOfRecords) static org.apache.avro.Schema
writeSimpleAvroFileWithCustomSize
(File parentDir, int numberOfRecords, int minValueSize, int maxValueSize) static org.apache.avro.Schema
writeSimpleAvroFileWithDuplicateKey
(File parentDir) static org.apache.avro.Schema
writeSimpleAvroFileWithIntToIntSchema
(File parentDir, int numKeys) static org.apache.avro.Schema
writeSimpleAvroFileWithIntToStringSchema
(File parentDir) static org.apache.avro.Schema
writeSimpleAvroFileWithIntToStringSchema
(File parentDir, String customValue, int numKeys) static org.apache.avro.Schema
writeSimpleAvroFileWithString2StringSchema3
(File parentDir) This file add some new value inwriteSimpleAvroFileWithStringToStringSchema(File)
It's designed to test incremental pushstatic org.apache.avro.Schema
static org.apache.avro.Schema
static org.apache.avro.Schema
writeSimpleAvroFileWithStringToPartialUpdateOpRecordSchema
(File parentDir, int startIndex, int endIndex) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToStringSchema
(File parentDir) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToStringSchema
(File parentDir, int recordCount) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToStringSchema
(File parentDir, int recordCount, int recordSizeMin) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToStringSchema
(File parentDir, int recordCount, String fileName) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToStringSchema2
(File parentDir) This file overrides half of the value inwriteSimpleAvroFileWithStringToStringSchema(File)
and add some new values.static org.apache.avro.Schema
static org.apache.avro.Schema
writeSimpleAvroFileWithStringToUserWithStringMapSchema
(File parentDir, int itemsPerRecord) static org.apache.avro.Schema
writeSimpleAvroFileWithStringToV3Schema
(File parentDir, int recordCount, int recordSizeMin) static KeyAndValueSchemas
writeSimpleVsonFile
(File parentDir) static Pair<org.apache.avro.Schema,
org.apache.avro.Schema> writeSimpleVsonFileWithUserSchema
(File parentDir) static KeyAndValueSchemas
writeVsonByteAndShort
(File parentDir)
-
Field Details
-
DEFAULT_USER_DATA_RECORD_COUNT
public static final int DEFAULT_USER_DATA_RECORD_COUNT- See Also:
-
DEFAULT_USER_DATA_VALUE_PREFIX
- See Also:
-
STRING_SCHEMA
public static final org.apache.avro.Schema STRING_SCHEMA -
INT_SCHEMA
public static final org.apache.avro.Schema INT_SCHEMA -
USER_SCHEMA
public static final org.apache.avro.Schema USER_SCHEMA -
USER_WITH_DEFAULT_SCHEMA
public static final org.apache.avro.Schema USER_WITH_DEFAULT_SCHEMA -
SINGLE_FIELD_RECORD_SCHEMA
public static final org.apache.avro.Schema SINGLE_FIELD_RECORD_SCHEMA -
SIMPLE_USER_WITH_DEFAULT_SCHEMA
public static final org.apache.avro.Schema SIMPLE_USER_WITH_DEFAULT_SCHEMA -
USER_WITH_FLOAT_ARRAY_SCHEMA
public static final org.apache.avro.Schema USER_WITH_FLOAT_ARRAY_SCHEMA -
USER_WITH_STRING_MAP_SCHEMA
public static final org.apache.avro.Schema USER_WITH_STRING_MAP_SCHEMA -
NAME_RECORD_V1_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V1_SCHEMA -
NAME_RECORD_V2_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V2_SCHEMA -
NAME_RECORD_V3_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V3_SCHEMA -
NAME_RECORD_V4_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V4_SCHEMA -
NAME_RECORD_V5_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V5_SCHEMA -
NAME_RECORD_V6_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V6_SCHEMA -
NAME_RECORD_V7_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V7_SCHEMA -
NAME_RECORD_V8_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V8_SCHEMA -
NAME_RECORD_V9_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V9_SCHEMA -
NAME_RECORD_V10_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V10_SCHEMA -
NAME_RECORD_V11_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V11_SCHEMA -
UNION_RECORD_V1_SCHEMA
public static final org.apache.avro.Schema UNION_RECORD_V1_SCHEMA -
UNION_RECORD_V2_SCHEMA
public static final org.apache.avro.Schema UNION_RECORD_V2_SCHEMA -
UNION_RECORD_V3_SCHEMA
public static final org.apache.avro.Schema UNION_RECORD_V3_SCHEMA -
ETL_KEY_SCHEMA
public static final org.apache.avro.Schema ETL_KEY_SCHEMA -
ETL_VALUE_SCHEMA
public static final org.apache.avro.Schema ETL_VALUE_SCHEMA -
ETL_UNION_VALUE_WITH_NULL_SCHEMA
public static final org.apache.avro.Schema ETL_UNION_VALUE_WITH_NULL_SCHEMA -
ETL_UNION_VALUE_WITHOUT_NULL_SCHEMA
public static final org.apache.avro.Schema ETL_UNION_VALUE_WITHOUT_NULL_SCHEMA -
NAME_RECORD_V1_UPDATE_SCHEMA
public static final org.apache.avro.Schema NAME_RECORD_V1_UPDATE_SCHEMA -
INT_TO_STRING_SCHEMA
public static final org.apache.avro.Schema INT_TO_STRING_SCHEMA -
INT_TO_INT_SCHEMA
public static final org.apache.avro.Schema INT_TO_INT_SCHEMA -
STRING_TO_STRING_SCHEMA
public static final org.apache.avro.Schema STRING_TO_STRING_SCHEMA -
STRING_TO_NAME_RECORD_V1_SCHEMA
public static final org.apache.avro.Schema STRING_TO_NAME_RECORD_V1_SCHEMA -
STRING_TO_NAME_RECORD_V2_SCHEMA
public static final org.apache.avro.Schema STRING_TO_NAME_RECORD_V2_SCHEMA -
STRING_TO_NAME_RECORD_V3_SCHEMA
public static final org.apache.avro.Schema STRING_TO_NAME_RECORD_V3_SCHEMA -
STRING_TO_NAME_RECORD_V1_UPDATE_SCHEMA
public static final org.apache.avro.Schema STRING_TO_NAME_RECORD_V1_UPDATE_SCHEMA -
STRING_TO_STRING_WITH_EXTRA_FIELD_SCHEMA
public static final org.apache.avro.Schema STRING_TO_STRING_WITH_EXTRA_FIELD_SCHEMA -
STRING_TO_USER_WITH_STRING_MAP_SCHEMA
public static final org.apache.avro.Schema STRING_TO_USER_WITH_STRING_MAP_SCHEMA
-
-
Constructor Details
-
TestWriteUtils
public TestWriteUtils()
-
-
Method Details
-
getTempDataDirectory
-
writeSimpleAvroFileWithStringToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringSchema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringSchema(File parentDir, int recordCount) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringSchema(File parentDir, int recordCount, String fileName) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToStringWithExtraSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringWithExtraSchema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringSchema(File parentDir, int recordCount, int recordSizeMin) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToV3Schema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToV3Schema(File parentDir, int recordCount, int recordSizeMin) throws IOException - Throws:
IOException
-
writeAlternateSimpleAvroFileWithStringToStringSchema
public static org.apache.avro.Schema writeAlternateSimpleAvroFileWithStringToStringSchema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToStringSchema2
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToStringSchema2(File parentDir) throws IOException This file overrides half of the value inwriteSimpleAvroFileWithStringToStringSchema(File)
and add some new values. It's designed to test incremental push- Throws:
IOException
-
writeSimpleAvroFileWithString2StringSchema3
public static org.apache.avro.Schema writeSimpleAvroFileWithString2StringSchema3(File parentDir) throws IOException This file add some new value inwriteSimpleAvroFileWithStringToStringSchema(File)
It's designed to test incremental push- Throws:
IOException
-
writeSimpleAvroFileWithDuplicateKey
public static org.apache.avro.Schema writeSimpleAvroFileWithDuplicateKey(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithCustomSize
public static org.apache.avro.Schema writeSimpleAvroFileWithCustomSize(File parentDir, int numberOfRecords, int minValueSize, int maxValueSize) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithIntToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithIntToStringSchema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithIntToStringSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithIntToStringSchema(File parentDir, String customValue, int numKeys) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithIntToIntSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithIntToIntSchema(File parentDir, int numKeys) throws IOException - Throws:
IOException
-
writeInvalidAvroFile
- Throws:
IOException
-
writeEmptyAvroFile
public static org.apache.avro.Schema writeEmptyAvroFile(File parentDir, org.apache.avro.Schema schema) throws IOException - Throws:
IOException
-
writeEmptyAvroFile
public static org.apache.avro.Schema writeEmptyAvroFile(File parentDir, String fileName, org.apache.avro.Schema schema) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToNameRecordV1Schema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToNameRecordV1Schema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFile
public static org.apache.avro.Schema writeSimpleAvroFile(File parentDir, org.apache.avro.Schema schema, Function<Integer, org.apache.avro.generic.GenericRecord> recordProvider) throws IOException- Throws:
IOException
-
writeSimpleAvroFileWithStringToUserWithStringMapSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToUserWithStringMapSchema(File parentDir, int itemsPerRecord) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToPartialUpdateOpRecordSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToPartialUpdateOpRecordSchema(File parentDir) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithStringToPartialUpdateOpRecordSchema
public static org.apache.avro.Schema writeSimpleAvroFileWithStringToPartialUpdateOpRecordSchema(File parentDir, int startIndex, int endIndex) throws IOException - Throws:
IOException
-
writeSimpleAvroFileWithASchemaWithAWrongDefaultValue
public static org.apache.avro.Schema writeSimpleAvroFileWithASchemaWithAWrongDefaultValue(File parentDir, int numberOfRecords) throws IOException - Throws:
IOException
-
writeAvroFileWithManyFloatsAndCustomTotalSize
public static org.apache.avro.Schema writeAvroFileWithManyFloatsAndCustomTotalSize(File parentDir, int numberOfRecords, int minValueSize, int maxValueSize) throws IOException - Throws:
IOException
-
getRecordWithFloatArray
public static org.apache.avro.generic.GenericRecord getRecordWithFloatArray(org.apache.avro.Schema recordSchema, int index, int size) -
getRecordWithStringMap
public static org.apache.avro.generic.GenericRecord getRecordWithStringMap(org.apache.avro.Schema recordSchema, int index, int count) -
writeSimpleVsonFile
- Throws:
IOException
-
writeSchemaWithUnknownFieldIntoAvroFile
public static org.apache.avro.Schema writeSchemaWithUnknownFieldIntoAvroFile(File parentDir) throws IOException - Throws:
IOException
-
writeVsonByteAndShort
- Throws:
IOException
-
writeComplexVsonFile
- Throws:
IOException
-
writeSimpleVsonFileWithUserSchema
public static Pair<org.apache.avro.Schema,org.apache.avro.Schema> writeSimpleVsonFileWithUserSchema(File parentDir) throws IOException - Throws:
IOException
-
writeMultiLevelVsonFile
- Throws:
IOException
-
writeMultiLevelVsonFile2
public static Pair<VsonSchema,VsonSchema> writeMultiLevelVsonFile2(File parentDir) throws IOException - Throws:
IOException
-
defaultVPJPropsWithD2Routing
-
defaultVPJProps
-
loadFileAsString
-
loadSchemaFileFromResource
-
loadFileAsStringQuietlyWithErrorLogged
-
updateStore
public static void updateStore(String storeName, ControllerClient controllerClient, UpdateStoreQueryParams params) -
writeSimpleAvroFileForValidateSchemaAndBuildDictMapperOutput
public static org.apache.avro.Schema writeSimpleAvroFileForValidateSchemaAndBuildDictMapperOutput(File parentDir, String file, long inputFileDataSize, ByteBuffer zstdDictionary, org.apache.avro.Schema avroSchema) throws IOException - Throws:
IOException
-
writeETLFileWithUserSchema
- Throws:
IOException
-
writeETLFileWithUserSchemaAndNullDefaultValue
public static org.apache.avro.Schema writeETLFileWithUserSchemaAndNullDefaultValue(File parentDir) throws IOException - Throws:
IOException
-
writeETLFileWithUnionWithNullSchema
public static org.apache.avro.Schema writeETLFileWithUnionWithNullSchema(File parentDir) throws IOException - Throws:
IOException
-
writeETLFileWithUnionWithoutNullSchema
public static org.apache.avro.Schema writeETLFileWithUnionWithoutNullSchema(File parentDir) throws IOException - Throws:
IOException
-
getETLFileSchema
public static org.apache.avro.Schema getETLFileSchema(org.apache.avro.Schema keySchema, org.apache.avro.Schema valueSchema) -
getETLFileSchemaWithNullDefaultValue
public static org.apache.avro.Schema getETLFileSchemaWithNullDefaultValue(org.apache.avro.Schema keySchema, org.apache.avro.Schema valueSchema) -
runPushJob
-
runPushJob
public static void runPushJob(String jobId, Properties props, Consumer<VenicePushJob> jobTransformer)
-