Search in sources :

Example 1 with FeedPrecondition

use of com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition in project kylo by Teradata.

the class FeedsController method ensurePrecondition.

private void ensurePrecondition(Feed feed, com.thinkbiganalytics.metadata.api.feed.Feed domainFeed) {
    FeedPrecondition precond = feed.getPrecondition();
    if (precond != null) {
        List<com.thinkbiganalytics.metadata.sla.api.Metric> domainMetrics = precond.getSla().getObligations().stream().flatMap((grp) -> grp.getMetrics().stream()).map((metric) -> metric).collect(Collectors.toList());
        feedProvider.createPrecondition(domainFeed.getId(), "", domainMetrics);
    }
}
Also used : Arrays(java.util.Arrays) FeedCriteria(com.thinkbiganalytics.metadata.rest.model.feed.FeedCriteria) Produces(javax.ws.rs.Produces) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) DatasourceModelTransform(com.thinkbiganalytics.feedmgr.service.datasource.DatasourceModelTransform) FeedWaterMarkService(com.thinkbiganalytics.feedmgr.service.feed.FeedWaterMarkService) MetadataTopics(com.thinkbiganalytics.metadata.event.jms.MetadataTopics) InitializationStatus(com.thinkbiganalytics.metadata.rest.model.feed.InitializationStatus) FeedPrecondition(com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition) StringUtils(org.apache.commons.lang3.StringUtils) Model(com.thinkbiganalytics.feedmgr.rest.Model) ServiceLevelAgreementModelTransform(com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementModelTransform) FeedDependencyGraph(com.thinkbiganalytics.metadata.rest.model.feed.FeedDependencyGraph) ApiOperation(io.swagger.annotations.ApiOperation) FeedPreconditionService(com.thinkbiganalytics.feedmgr.service.feed.FeedPreconditionService) MediaType(javax.ws.rs.core.MediaType) FeedProvider(com.thinkbiganalytics.metadata.api.feed.FeedProvider) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) Map(java.util.Map) AccessController(com.thinkbiganalytics.security.AccessController) DefaultValue(javax.ws.rs.DefaultValue) HistoryReindexingStatus(com.thinkbiganalytics.metadata.rest.model.feed.reindex.HistoryReindexingStatus) FeedServicesAccessControl(com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl) MetadataAccess(com.thinkbiganalytics.metadata.api.MetadataAccess) ChangeType(com.thinkbiganalytics.security.rest.model.PermissionsChange.ChangeType) HistoryDataReindexingFeedsAvailableCache(com.thinkbiganalytics.feedmgr.config.HistoryDataReindexingFeedsAvailableCache) DELETE(javax.ws.rs.DELETE) MetadataService(com.thinkbiganalytics.feedmgr.service.MetadataService) PermissionsChange(com.thinkbiganalytics.security.rest.model.PermissionsChange) FeedsForDataHistoryReindex(com.thinkbiganalytics.metadata.rest.model.feed.reindex.FeedsForDataHistoryReindex) FeedSource(com.thinkbiganalytics.metadata.rest.model.feed.FeedSource) Collection(java.util.Collection) ActionGroup(com.thinkbiganalytics.security.rest.model.ActionGroup) Set(java.util.Set) ServiceLevelAssessment(com.thinkbiganalytics.metadata.rest.model.sla.ServiceLevelAssessment) Topic(javax.jms.Topic) Collectors(java.util.stream.Collectors) Feed(com.thinkbiganalytics.metadata.rest.model.feed.Feed) FeedInitializationChangeEvent(com.thinkbiganalytics.metadata.rest.model.event.FeedInitializationChangeEvent) List(java.util.List) Principal(java.security.Principal) Stream(java.util.stream.Stream) WebApplicationException(javax.ws.rs.WebApplicationException) PathParam(javax.ws.rs.PathParam) SecurityModelTransform(com.thinkbiganalytics.security.rest.controller.SecurityModelTransform) GET(javax.ws.rs.GET) HashMap(java.util.HashMap) FeedMetadata(com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata) ApiResponses(io.swagger.annotations.ApiResponses) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Inject(javax.inject.Inject) FeedLineage(com.thinkbiganalytics.metadata.rest.model.feed.FeedLineage) RestResponseStatus(com.thinkbiganalytics.rest.model.RestResponseStatus) FeedDependencyDeltaResults(com.thinkbiganalytics.metadata.api.op.FeedDependencyDeltaResults) FeedDataHistoryReindexParams(com.thinkbiganalytics.metadata.rest.model.feed.reindex.FeedDataHistoryReindexParams) FieldPolicy(com.thinkbiganalytics.policy.rest.model.FieldPolicy) Named(javax.inject.Named) Api(io.swagger.annotations.Api) Status(javax.ws.rs.core.Response.Status) FeedOperationsProvider(com.thinkbiganalytics.metadata.api.op.FeedOperationsProvider) FeedNotFoundException(com.thinkbiganalytics.metadata.api.feed.FeedNotFoundException) FormParam(javax.ws.rs.FormParam) DatasourceService(com.thinkbiganalytics.feedmgr.service.datasource.DatasourceService) Datasource(com.thinkbiganalytics.metadata.api.datasource.Datasource) Logger(org.slf4j.Logger) Properties(java.util.Properties) POST(javax.ws.rs.POST) SecurityService(com.thinkbiganalytics.feedmgr.service.security.SecurityService) FeedDestination(com.thinkbiganalytics.metadata.rest.model.feed.FeedDestination) MetadataModelTransform(com.thinkbiganalytics.feedmgr.service.MetadataModelTransform) FeedHistoryDataReindexingService(com.thinkbiganalytics.feedmgr.service.feed.reindexing.FeedHistoryDataReindexingService) Component(org.springframework.stereotype.Component) FeedLineageBuilder(com.thinkbiganalytics.feedmgr.rest.FeedLineageBuilder) ApiResponse(io.swagger.annotations.ApiResponse) PUT(javax.ws.rs.PUT) DatasourceProvider(com.thinkbiganalytics.metadata.api.datasource.DatasourceProvider) JmsMessagingTemplate(org.springframework.jms.core.JmsMessagingTemplate) FeedPrecondition(com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition)

Example 2 with FeedPrecondition

use of com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition in project kylo by Teradata.

the class MetadataClient method createTrigger.

private FeedPrecondition createTrigger(List<Metric> metrics) {
    if (!metrics.isEmpty()) {
        FeedPrecondition trigger = new FeedPrecondition();
        trigger.addMetrics("", metrics);
        return trigger;
    } else {
        return null;
    }
}
Also used : FeedPrecondition(com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition)

Example 3 with FeedPrecondition

use of com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition in project kylo by Teradata.

the class DebugController method examplePrecondition.

/**
 * returns a new feed precondition model for debugging
 *
 * @return the precondition model
 */
@GET
@Path("precondition")
@Produces(MediaType.APPLICATION_JSON)
public FeedPrecondition examplePrecondition() {
    FeedPrecondition procond = new FeedPrecondition("DependingPrecondition");
    procond.addMetrics("Feed dependson on execution of another feed", new FeedExecutedSinceFeed("DependentCategory", "DependentFeed", "ExecutedSinceCategory", "ExecutedSinceFeed"));
    return procond;
}
Also used : FeedPrecondition(com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition) FeedExecutedSinceFeed(com.thinkbiganalytics.metadata.api.sla.FeedExecutedSinceFeed) Path(javax.ws.rs.Path) JcrPath(com.thinkbiganalytics.metadata.modeshape.support.JcrPath) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

FeedPrecondition (com.thinkbiganalytics.metadata.rest.model.feed.FeedPrecondition)3 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 HistoryDataReindexingFeedsAvailableCache (com.thinkbiganalytics.feedmgr.config.HistoryDataReindexingFeedsAvailableCache)1 FeedLineageBuilder (com.thinkbiganalytics.feedmgr.rest.FeedLineageBuilder)1 Model (com.thinkbiganalytics.feedmgr.rest.Model)1 FeedMetadata (com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata)1 FeedServicesAccessControl (com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl)1 MetadataModelTransform (com.thinkbiganalytics.feedmgr.service.MetadataModelTransform)1 MetadataService (com.thinkbiganalytics.feedmgr.service.MetadataService)1 DatasourceModelTransform (com.thinkbiganalytics.feedmgr.service.datasource.DatasourceModelTransform)1 DatasourceService (com.thinkbiganalytics.feedmgr.service.datasource.DatasourceService)1 FeedPreconditionService (com.thinkbiganalytics.feedmgr.service.feed.FeedPreconditionService)1 FeedWaterMarkService (com.thinkbiganalytics.feedmgr.service.feed.FeedWaterMarkService)1 FeedHistoryDataReindexingService (com.thinkbiganalytics.feedmgr.service.feed.reindexing.FeedHistoryDataReindexingService)1 SecurityService (com.thinkbiganalytics.feedmgr.service.security.SecurityService)1 ServiceLevelAgreementModelTransform (com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementModelTransform)1 MetadataAccess (com.thinkbiganalytics.metadata.api.MetadataAccess)1 Datasource (com.thinkbiganalytics.metadata.api.datasource.Datasource)1