use of com.thinkbiganalytics.metadata.api.feed.Feed in project kylo by Teradata.
the class FeedWaterMarkService method getWaterMarks.
public List<String> getWaterMarks(String feedId) {
return this.metadata.read(() -> {
this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.ACCESS_FEEDS);
com.thinkbiganalytics.metadata.api.feed.Feed.ID id = feedProvider.resolveFeed(feedId);
com.thinkbiganalytics.metadata.api.feed.Feed feed = feedProvider.getFeed(id);
if (feed != null) {
List<String> list = feed.getWaterMarkNames().stream().collect(Collectors.toList());
Collections.sort(list);
return list;
} else {
throw new FeedNotFoundException(id);
}
});
}
use of com.thinkbiganalytics.metadata.api.feed.Feed in project kylo by Teradata.
the class FeedWaterMarkService method updateWaterMark.
public String updateWaterMark(String feedId, String waterMarkName, String value, boolean cancelActive) {
com.thinkbiganalytics.metadata.api.feed.Feed.ID updId = this.metadata.commit(() -> {
this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_FEEDS);
com.thinkbiganalytics.metadata.api.feed.Feed.ID id = feedProvider.resolveFeed(feedId);
com.thinkbiganalytics.metadata.api.feed.Feed feed = feedProvider.getFeed(id);
if (feed != null) {
feed.setWaterMarkValue(waterMarkName, value);
return id;
} else {
throw new FeedNotFoundException(id);
}
});
if (cancelActive) {
cancelActiveWaterMark(updId, waterMarkName);
}
return this.metadata.commit(() -> {
com.thinkbiganalytics.metadata.api.feed.Feed feed = feedProvider.getFeed(updId);
if (feed != null) {
return feed.getWaterMarkValue(waterMarkName).orElseThrow(() -> new WaterMarkNotFoundExcepton(updId, waterMarkName));
} else {
throw new FeedNotFoundException(updId);
}
});
}
use of com.thinkbiganalytics.metadata.api.feed.Feed in project kylo by Teradata.
the class InMemoryFeedProvider method ensureFeed.
@Override
public Feed ensureFeed(String categorySystemName, String name, String descr) {
synchronized (this.feeds) {
for (Feed feed : this.feeds.values()) {
if (feed.getName().equals(name)) {
return feed;
}
}
}
BaseFeed newFeed = new BaseFeed(name, descr);
this.feeds.put(newFeed.getId(), newFeed);
return newFeed;
}
use of com.thinkbiganalytics.metadata.api.feed.Feed in project kylo by Teradata.
the class FeedDetails method getUsedByFeeds.
public List<Feed> getUsedByFeeds() {
List<Feed> deps = new ArrayList<>();
Set<Node> depNodes = JcrPropertyUtil.getSetProperty(this.node, USED_BY_FEEDS);
for (Node depNode : depNodes) {
deps.add(new JcrFeed(depNode, this.summary.getParentFeed().getOpsAccessProvider().orElse(null)));
}
return deps;
}
use of com.thinkbiganalytics.metadata.api.feed.Feed in project kylo by Teradata.
the class FeedDetails method getDependentFeeds.
public <C extends Category> List<Feed> getDependentFeeds() {
List<Feed> deps = new ArrayList<>();
Set<Node> depNodes = JcrPropertyUtil.getSetProperty(this.node, DEPENDENTS);
for (Node depNode : depNodes) {
deps.add(new JcrFeed(depNode, this.summary.getParentFeed().getOpsAccessProvider().orElse(null)));
}
return deps;
}
Aggregations