@Component public class BusinessObjectDataDdlPartitionsHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
NO_PARTITIONING_PARTITION_KEY
The partition key value for business object data without partitioning.
|
static String |
NO_PARTITIONING_PARTITION_VALUE
The partition value for business object data without partitioning.
|
static String |
REGEX_S3_EMPTY_PARTITION
The regular expression that represents an empty partition in S3, this is because hadoop file system implements directory support in S3 by creating empty
files with the "directoryname_$folder$" suffix.
|
| Constructor and Description |
|---|
BusinessObjectDataDdlPartitionsHelper() |
| Modifier and Type | Method and Description |
|---|---|
BusinessObjectDataDdlRequest |
buildBusinessObjectDataDdlRequest(BusinessObjectDataPartitionsRequest request)
Builds business object data DDL request object instance and initialise it with the business object data partitions request field values.
|
protected org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper |
buildGenerateDdlPartitionsWrapper(BusinessObjectDataDdlRequest request,
BusinessObjectFormatEntity businessObjectFormatEntity,
CustomDdlEntity customDdlEntity,
BusinessObjectDataStatusEntity businessObjectDataStatusEntity,
List<String> storageNames,
List<StorageEntity> requestedStorageEntities,
Map<String,StorageEntity> cachedStorageEntities,
Map<String,String> cachedS3BucketNames)
Generates the create table Hive 13 DDL as per specified business object data DDL request.
|
protected List<StorageUnitAvailabilityDto> |
excludeDuplicateBusinessObjectData(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos,
List<String> storageNames)
Eliminate storage units that belong to the same business object data by picking storage unit registered in a storage listed earlier in the list of
storage names specified in the request.
|
List<HivePartitionDto> |
getHivePartitions(BusinessObjectDataKey businessObjectDataKey,
List<SchemaColumn> autoDiscoverableSubPartitionColumns,
String s3KeyPrefix,
Collection<String> storageFiles,
String storageName)
Gets a list of Hive partitions.
|
protected void |
notAllowNonAvailableRegisteredSubPartitions(BusinessObjectDefinitionEntity businessObjectDefinitionEntity,
String businessObjectFormatUsage,
FileTypeEntity fileTypeEntity,
Integer businessObjectFormatVersion,
List<List<String>> matchedAvailablePartitionFilters,
List<List<String>> availablePartitions,
List<String> storageNames,
List<StorageEntity> storageEntities,
StoragePlatformEntity s3StoragePlatformEntity)
Searches for and fails on any of "non-available" registered sub-partitions as per list of "matched" partition filters.
|
List<StorageUnitAvailabilityDto> |
processPartitionFiltersForGenerateDdlPartitions(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
Process partitionFilters to retrieve storage unit availability dtos
|
void |
processStorageUnitsForGenerateDdlPartitions(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest,
StringBuilder sb,
List<Partition> partitions,
HashMap<String,String> replacements,
BusinessObjectFormat businessObjectFormatForSchema,
String ifNotExistsOption,
List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos)
Adds the relative "alter table add partition" statements for each storage unit entity.
|
BusinessObjectFormat |
validatePartitionFiltersAndFormat(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
Validate partionFilters and business format
|
public static final String NO_PARTITIONING_PARTITION_KEY
public static final String NO_PARTITIONING_PARTITION_VALUE
public static final String REGEX_S3_EMPTY_PARTITION
public BusinessObjectDataDdlPartitionsHelper()
public BusinessObjectDataDdlRequest buildBusinessObjectDataDdlRequest(BusinessObjectDataPartitionsRequest request)
request - the business object data partitions requestprotected org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper buildGenerateDdlPartitionsWrapper(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity, CustomDdlEntity customDdlEntity, BusinessObjectDataStatusEntity businessObjectDataStatusEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities, Map<String,StorageEntity> cachedStorageEntities, Map<String,String> cachedS3BucketNames)
request - the business object data DDL requestbusinessObjectFormatEntity - the business object format entitycustomDdlEntity - the optional custom DDL entitybusinessObjectDataStatusEntity - the business object data status for available business object datastorageNames - the list of storage namesrequestedStorageEntities - the list of storage entities per storage names specified in the requestcachedStorageEntities - the map of storage names in upper case to the relative storage entitiescachedS3BucketNames - the map of storage names in upper case to the relative S3 bucket namespublic BusinessObjectFormat validatePartitionFiltersAndFormat(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
generateDdlRequest - the generateDdlRequestWrapper objectpublic List<StorageUnitAvailabilityDto> processPartitionFiltersForGenerateDdlPartitions(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
generateDdlRequest - the generateDdlRequestWrapper objectpublic void processStorageUnitsForGenerateDdlPartitions(org.finra.herd.service.helper.BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest,
StringBuilder sb,
List<Partition> partitions,
HashMap<String,String> replacements,
BusinessObjectFormat businessObjectFormatForSchema,
String ifNotExistsOption,
List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos)
generateDdlRequest - the generate ddl request wrapper objectsb - the string builder to be updated with the "alter table add partition" statementspartitions - the list to store business object data partitionsreplacements - the hash map of string values to be used to substitute the custom DDL tokens with their actual valuesbusinessObjectFormatForSchema - the business object format to be used for schemaifNotExistsOption - specifies if generated DDL contains "if not exists" optionstorageUnitAvailabilityDtos - the list of storage unit availability DTOsprotected List<StorageUnitAvailabilityDto> excludeDuplicateBusinessObjectData(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos, List<String> storageNames) throws IllegalArgumentException
storageUnitAvailabilityDtos - the list of storage unit availability DTOsstorageNames - the list of storage namesIllegalArgumentException - on business object data being registered in multiple storage and storage names are not specified to resolve thisprotected void notAllowNonAvailableRegisteredSubPartitions(BusinessObjectDefinitionEntity businessObjectDefinitionEntity, String businessObjectFormatUsage, FileTypeEntity fileTypeEntity, Integer businessObjectFormatVersion, List<List<String>> matchedAvailablePartitionFilters, List<List<String>> availablePartitions, List<String> storageNames, List<StorageEntity> storageEntities, StoragePlatformEntity s3StoragePlatformEntity)
businessObjectDefinitionEntity - the business object definition entitybusinessObjectFormatUsage - the business object format usage (case-insensitive)fileTypeEntity - the file type entitybusinessObjectFormatVersion - the optional business object format version. If a business object format version isn't specified, the latest available
format version for each partition value will be usedmatchedAvailablePartitionFilters - the list of "matched" partition filtersavailablePartitions - the list of already discovered "available" partitions, where each partition consists of primary and optional sub-partition
valuesstorageNames - the list of storage namesstorageEntities - the list of storage entitiess3StoragePlatformEntity - the S3 storage platform entitypublic List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns, String s3KeyPrefix, Collection<String> storageFiles, String storageName)
businessObjectDataKey - the business object data keyautoDiscoverableSubPartitionColumns - the auto-discoverable sub-partition columnss3KeyPrefix - the S3 key prefixstorageFiles - the storage filesstorageName - the storage nameCopyright © 2021. All rights reserved.