private void registerAll() { Collection<ApplicationEntity> applicationEntities = applicationEntityService.findAll(); applicationEntities.forEach(this::register); }
@GET @Produces(MediaType.APPLICATION_JSON) public RESTResponse<Collection<ApplicationEntity>> getApplicationEntities(@QueryParam("siteId") String siteId) { return RESTResponse.async(() -> { if (siteId == null) { return entityService.findAll(); } else { return entityService.findBySiteId(siteId); } }).get(); }
@Override protected void runOneIteration() throws Exception { LOG.info("Updating application status"); try { Collection<ApplicationEntity> applicationEntities = applicationEntityService.findAll(); if (applicationEntities.size() == 0) { LOG.info("No application installed yet"); return; } for (ApplicationEntity applicationEntity : applicationEntities) { if (applicationEntity.getDescriptor().isExecutable()) { updateApplicationEntityStatus(applicationEntity); } } LOG.info("Updated {} application status", applicationEntities.size()); } catch (Exception e) { LOG.error("Failed to update application status", e); } }
private Collection<String> loadSites(String appType) { Set<String> sites = new HashSet<>(); Collection<ApplicationEntity> apps = applicationEntityService.findAll(); for (ApplicationEntity app : apps) { if (app.getDescriptor().getType().equalsIgnoreCase(appType) && app.getStatus().equals(ApplicationEntity.Status.RUNNING)) { sites.add(app.getSite().getSiteId()); } } LOG.info("Detected {} sites where MR_HISTORY_JOB_APP is Running: {}", sites.size(), sites); return sites; }
int total = 0; Map<String, StreamDesc> latestStreamIdDescMap = new HashMap<>(); for (ApplicationEntity appEntity : applicationEntityService.findAll()) { List<StreamDesc> streamDescList = appEntity.getStreams(); if (streamDescList != null && streamDescList.size() > 0) {