use of com.netflix.metacat.common.server.events.MetacatSaveTablePartitionMetadataOnlyPostEvent in project metacat by Netflix.
the class PartitionServiceImpl method savePartitionMetadataOnly.
/**
* Optimization for metadata only updates.
*
* @param metacatRequestContext request context
* @param dto savePartition dto
* @param name qualified name
* @param partitionDtos partition dtos
* @return empty save partition response dto
*/
private PartitionsSaveResponseDto savePartitionMetadataOnly(final MetacatRequestContext metacatRequestContext, final PartitionsSaveRequestDto dto, final QualifiedName name, final List<PartitionDto> partitionDtos) {
registry.distributionSummary(this.partitionMetadataOnlyAddDistSummary.withTags(name.parts())).record(partitionDtos.size());
eventBus.postSync(new MetacatSaveTablePartitionMetadataOnlyPreEvent(name, metacatRequestContext, this, dto));
// Save metadata
log.info("Saving metadata only for partitions for {}", name);
userMetadataService.saveMetadata(metacatRequestContext.getUserName(), partitionDtos, true);
eventBus.postSync(new MetacatSaveTablePartitionMetadataOnlyPostEvent(name, metacatRequestContext, this, partitionDtos, new PartitionsSaveResponseDto()));
// since client (squirrel) only checks the response code
return converterUtil.toPartitionsSaveResponseDto(new PartitionsSaveResponse());
}
Aggregations