Search in sources :

Example 1 with MetacatDeleteMViewPostEvent

use of com.netflix.metacat.common.server.events.MetacatDeleteMViewPostEvent in project metacat by Netflix.

the class MViewServiceImpl method deleteAndReturn.

@Override
public TableDto deleteAndReturn(@Nonnull final QualifiedName name) {
    final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();
    eventBus.postSync(new MetacatDeleteMViewPreEvent(name, metacatRequestContext, this));
    final QualifiedName viewQName = QualifiedName.ofTable(name.getCatalogName(), VIEW_DB_NAME, createViewName(name));
    log.info("Deleting view {}.", viewQName);
    final TableDto deletedDto = tableService.deleteAndReturn(viewQName, true);
    eventBus.postAsync(new MetacatDeleteMViewPostEvent(name, metacatRequestContext, this, deletedDto));
    return deletedDto;
}
Also used : MetacatRequestContext(com.netflix.metacat.common.MetacatRequestContext) MetacatDeleteMViewPreEvent(com.netflix.metacat.common.server.events.MetacatDeleteMViewPreEvent) QualifiedName(com.netflix.metacat.common.QualifiedName) MetacatDeleteMViewPostEvent(com.netflix.metacat.common.server.events.MetacatDeleteMViewPostEvent) TableDto(com.netflix.metacat.common.dto.TableDto)

Aggregations

MetacatRequestContext (com.netflix.metacat.common.MetacatRequestContext)1 QualifiedName (com.netflix.metacat.common.QualifiedName)1 TableDto (com.netflix.metacat.common.dto.TableDto)1 MetacatDeleteMViewPostEvent (com.netflix.metacat.common.server.events.MetacatDeleteMViewPostEvent)1 MetacatDeleteMViewPreEvent (com.netflix.metacat.common.server.events.MetacatDeleteMViewPreEvent)1