private Map<String, Object> getAppConfig(String site, String appType) { ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); } }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); } }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType){ ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Map<String, Object> getAppConfig(String site, String appType) { ApplicationEntity entity = entityService.getBySiteIdAndAppType(site, appType); return entity.getConfiguration(); }
private Topology createTopologyMeta(ApplicationEntity applicationEntity) { return UnitTopologyRunner.buildTopologyMetadata(applicationEntity.getAppId(),ConfigFactory.parseMap(applicationEntity.getConfiguration())); } }
this.metadata = metadata; this.runtime = ExecutionRuntimeManager.getInstance().getRuntime(application.getEnvironmentType(), serverConfig); Map<String, Object> executionConfig = new HashMap<>(metadata.getConfiguration()); if (executionConfig == null) { executionConfig = Collections.emptyMap();
@Override public void register(ApplicationEntity appEntity) { if (environment == null) { LOG.warn("Environment is null, can not register"); return; } ApplicationProvider<?> appProvider = applicationProviderService.getApplicationProviderByType(appEntity.getDescriptor().getType()); Optional<HealthCheck> applicationHealthCheck = appProvider.getManagedHealthCheck( ConfigFactory.parseMap(appEntity.getContext()) .withFallback(config) .withFallback(ConfigFactory.parseMap(appEntity.getConfiguration())) ); if (!applicationHealthCheck.isPresent()) { LOG.warn("Application {} does not implement HealthCheck", appEntity.getAppId()); return; } this.environment.healthChecks().register(appEntity.getAppId(), applicationHealthCheck.get()); currentInjector.injectMembers(applicationHealthCheck.get()); synchronized (lock) { if (!appHealthChecks.containsKey(appEntity.getAppId())) { appHealthChecks.put(appEntity.getAppId(), applicationHealthCheck); LOG.info("Successfully register health check for {}", appEntity.getAppId()); } } }
parameterIndex++; if (entity.getConfiguration() != null && !entity.getConfiguration().isEmpty()) { statement.setString(parameterIndex, JSONObject.toJSONString(entity.getConfiguration())); parameterIndex++;
/** * Update mutable fields from another ApplicationEntity. */ public void updateMutable(ApplicationEntity entityToUpdate) { this.ensureDefault(); this.setJarPath(entityToUpdate.getJarPath()); this.setMode(entityToUpdate.getMode()); this.setConfiguration(entityToUpdate.getConfiguration()); }
updateSql += "appstatus = ?, "; if (entity.getConfiguration() != null && !entity.getConfiguration().isEmpty()) { updateSql += "configuration = ?, ";
private void fillApplicationDesc(List<ApplicationEntity> entities) { for (ApplicationEntity entity : entities) { entity.setDescriptor(applicationProviderService.getApplicationDescByType(entity.getDescriptor().getType())); if (entity.getDescriptor().getStreams() == null) { continue; } List<StreamDesc> streamDescToInstall = entity.getDescriptor().getStreams().stream().map((streamDefinition -> { StreamDefinition copied = streamDefinition.copy(); copied.setSiteId(entity.getSite().getSiteId()); copied.setStreamId(StreamIdConversions.formatSiteStreamId(entity.getSite().getSiteId(), copied.getStreamId())); Config effectiveConfig = ConfigFactory.parseMap(new HashMap<>(entity.getConfiguration())) .withFallback(config).withFallback(ConfigFactory.parseMap(entity.getContext())); ExecutionRuntime runtime = ExecutionRuntimeManager.getInstance().getRuntime( applicationProviderService.getApplicationProviderByType(entity.getDescriptor().getType()).getApplication().getEnvironmentType(), config); StreamSinkConfig streamSinkConfig = runtime.environment() .stream().getSinkConfig(StreamIdConversions.parseStreamTypeId(copied.getSiteId(), copied.getStreamId()), effectiveConfig); StreamDesc streamDesc = new StreamDesc(); streamDesc.setSchema(copied); streamDesc.setSinkConfig(streamSinkConfig); streamDesc.setStreamId(copied.getStreamId()); streamDesc.getSchema().setDataSource(entity.getAppId()); return streamDesc; })).collect(Collectors.toList()); entity.setStreams(streamDescToInstall); } }