use of com.netflix.metacat.common.server.events.MetacatUpdateMViewPostEvent in project metacat by Netflix.
the class MViewServiceImpl method updateAndReturn.
@Override
public TableDto updateAndReturn(@Nonnull final QualifiedName name, @Nonnull final TableDto tableDto) {
final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();
eventBus.postSync(new MetacatUpdateMViewPreEvent(name, metacatRequestContext, this, tableDto));
final QualifiedName viewQName = QualifiedName.ofTable(name.getCatalogName(), VIEW_DB_NAME, createViewName(name));
log.info("Updating view {}.", viewQName);
tableService.update(viewQName, tableDto);
final TableDto updatedDto = getOpt(name).orElseThrow(() -> new IllegalStateException("should exist"));
eventBus.postAsync(new MetacatUpdateMViewPostEvent(name, metacatRequestContext, this, updatedDto));
return updatedDto;
}
Aggregations