use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class FeedManagerMetadataService method disableFeed.
public FeedSummary disableFeed(final String feedId) {
return metadataAccess.commit(() -> {
this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_FEEDS);
FeedMetadata feedMetadata = feedProvider.getFeedById(feedId);
if (feedMetadata == null) {
throw new NotFoundException("Feed not found for id " + feedId);
}
if (!feedMetadata.getState().equals(Feed.State.DISABLED.name())) {
FeedSummary feedSummary = feedProvider.disableFeed(feedId);
boolean updatedNifi = updateNifiFeedRunningStatus(feedSummary, Feed.State.DISABLED);
if (!updatedNifi) {
// rollback
throw new RuntimeException("Unable to disable Feed " + feedId);
}
return feedSummary;
}
return new FeedSummary(feedMetadata);
});
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class FeedRestController method profileStats.
@GET
@Path("/{feedId}/profile-stats")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Gets the profile statistics for the specified job.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the profile statistics.", response = Map.class, responseContainer = "List"), @ApiResponse(code = 500, message = "The profile is unavailable.", response = RestResponseStatus.class) })
public Response profileStats(@PathParam("feedId") String feedId, @QueryParam("processingdttm") String processingdttm) {
FeedMetadata feedMetadata = getMetadataService().getFeedById(feedId);
String profileTable = feedMetadata.getProfileTableName();
String query = "SELECT * from " + HiveUtils.quoteIdentifier(profileTable) + " where processing_dttm = " + HiveUtils.quoteString(processingdttm);
QueryResult rows = hiveService.query(query);
return Response.ok(rows.getRows()).build();
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class DefaultFeedManagerFeedService method disableFeed.
public FeedSummary disableFeed(final String feedId) {
return metadataAccess.commit(() -> {
this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_FEEDS);
if (StringUtils.isNotBlank(feedId)) {
FeedMetadata feedMetadata = getFeedById(feedId);
Feed.ID domainId = feedProvider.resolveFeed(feedId);
boolean disabled = disableFeed(domainId);
// re fetch it
if (disabled) {
feedMetadata.setState(Feed.State.DISABLED.name());
serviceLevelAgreementService.disableServiceLevelAgreementSchedule(domainId);
}
FeedSummary feedSummary = new FeedSummary(feedMetadata);
return feedSummary;
}
return null;
});
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class FeedModelTransform method deserializeFeedMetadata.
public FeedMetadata deserializeFeedMetadata(Feed domain, boolean clearSensitiveProperties) {
String json = domain.getJson();
FeedMetadata feedMetadata = ObjectMapperSerializer.deserialize(json, FeedMetadata.class);
populate(feedMetadata, domain);
if (clearSensitiveProperties) {
clearSensitivePropertyValues(feedMetadata);
}
return feedMetadata;
}
use of com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata in project kylo by Teradata.
the class FeedModelTransform method stripMetadata.
/**
* Clean out any excess or redundant data that should not be serialized and stored
* with the feed domain entity as JSON.
* @param source the source metadata
* @return a new metadata instance without the excess data
*/
private FeedMetadata stripMetadata(FeedMetadata source) {
FeedMetadata result = new FeedMetadata();
result.setDataOwner(source.getDataOwner());
result.setDataTransformation(source.getDataTransformation());
result.setHadoopAuthorizationType(source.getHadoopAuthorizationType());
result.setInputProcessorType(source.getInputProcessorType());
result.setInputProcessorName(source.getInputProcessorName());
result.setIsReusableFeed(source.isReusableFeed());
result.setNifiProcessGroupId(source.getNifiProcessGroupId());
result.setOptions(source.getOptions());
result.setProperties(source.getProperties());
result.setSchedule(source.getSchedule());
result.setTable(source.getTable());
result.setTableOption(source.getTableOption());
if (source.getSourceDataSets() != null) {
result.setSourceDataSets(source.getSourceDataSets());
}
if (source.getSampleDataSet() != null) {
result.setSampleDataSet(source.getSampleDataSet());
}
result.setUiState(source.getUiState());
result.setActive(source.isActive());
return result;
}
Aggregations