Java Code Examples for org.apache.commons.configuration.Configuration#getBoolean()
The following examples show how to use
org.apache.commons.configuration.Configuration#getBoolean() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Neo4JGraphFactory.java From neo4j-gremlin-bolt with Apache License 2.0 | 6 votes |
public static Graph open(Configuration configuration) { if (configuration == null) throw Graph.Exceptions.argumentCanNotBeNull("configuration"); try { // graph name String graphName = configuration.getString(Neo4JGraphConfigurationBuilder.Neo4JGraphNameConfigurationKey); // create driver instance Driver driver = createDriverInstance(configuration); // create providers Neo4JElementIdProvider<?> vertexIdProvider = loadProvider(driver, configuration.getString(Neo4JGraphConfigurationBuilder.Neo4JVertexIdProviderClassNameConfigurationKey)); Neo4JElementIdProvider<?> edgeIdProvider = loadProvider(driver, configuration.getString(Neo4JGraphConfigurationBuilder.Neo4JEdgeIdProviderClassNameConfigurationKey)); // readonly boolean readonly = configuration.getBoolean(Neo4JGraphConfigurationBuilder.Neo4JReadonlyConfigurationKey); // database String database = configuration.getString(Neo4JGraphConfigurationBuilder.Neo4JDatabaseConfigurationKey, null); // check a read partition is required if (graphName != null) return new Neo4JGraph(new AnyLabelReadPartition(graphName), new String[]{graphName}, driver, database, vertexIdProvider, edgeIdProvider, configuration, readonly); // no graph name return new Neo4JGraph(new NoReadPartition(), new String[]{}, driver, database, vertexIdProvider, edgeIdProvider, configuration, readonly); } catch (Throwable ex) { // throw runtime exception throw new RuntimeException("Error creating Graph instance from configuration", ex); } }
Example 2
Source File: AtlasAuthenticationProvider.java From atlas with Apache License 2.0 | 6 votes |
@PostConstruct void setAuthenticationMethod() { try { Configuration configuration = ApplicationProperties.get(); this.fileAuthenticationMethodEnabled = configuration.getBoolean(FILE_AUTH_METHOD, true); this.pamAuthenticationEnabled = configuration.getBoolean(PAM_AUTH_METHOD, false); this.keycloakAuthenticationEnabled = configuration.getBoolean(KEYCLOAK_AUTH_METHOD, false); boolean ldapAuthenticationEnabled = configuration.getBoolean(LDAP_AUTH_METHOD, false); if (ldapAuthenticationEnabled) { this.ldapType = configuration.getString(LDAP_TYPE, "NONE"); } else { this.ldapType = "NONE"; } } catch (Exception e) { LOG.error("Error while getting atlas.login.method application properties", e); } }
Example 3
Source File: AtlasSecurityConfig.java From atlas with Apache License 2.0 | 6 votes |
@Inject public AtlasSecurityConfig(AtlasKnoxSSOAuthenticationFilter ssoAuthenticationFilter, AtlasCSRFPreventionFilter atlasCSRFPreventionFilter, AtlasAuthenticationFilter atlasAuthenticationFilter, AtlasAuthenticationProvider authenticationProvider, AtlasAuthenticationSuccessHandler successHandler, AtlasAuthenticationFailureHandler failureHandler, AtlasAuthenticationEntryPoint atlasAuthenticationEntryPoint, Configuration configuration, StaleTransactionCleanupFilter staleTransactionCleanupFilter, ActiveServerFilter activeServerFilter) { this.ssoAuthenticationFilter = ssoAuthenticationFilter; this.csrfPreventionFilter = atlasCSRFPreventionFilter; this.atlasAuthenticationFilter = atlasAuthenticationFilter; this.authenticationProvider = authenticationProvider; this.successHandler = successHandler; this.failureHandler = failureHandler; this.atlasAuthenticationEntryPoint = atlasAuthenticationEntryPoint; this.configuration = configuration; this.staleTransactionCleanupFilter = staleTransactionCleanupFilter; this.activeServerFilter = activeServerFilter; this.keycloakEnabled = configuration.getBoolean(AtlasAuthenticationProvider.KEYCLOAK_AUTH_METHOD, false); }
Example 4
Source File: AtlasTopicCreator.java From incubator-atlas with Apache License 2.0 | 6 votes |
/** * Create an Atlas topic. * * The topic will get created based on following conditions: * {@link #ATLAS_NOTIFICATION_CREATE_TOPICS_KEY} is set to true. * The topic does not already exist. * Note that despite this, there could be multiple topic creation calls that happen in parallel because hooks * run in a distributed fashion. Exceptions are caught and logged by this method to prevent the startup of * the hooks from failing. * @param atlasProperties {@link Configuration} containing properties to be used for creating topics. * @param topicNames list of topics to create */ public void createAtlasTopic(Configuration atlasProperties, String... topicNames) { if (atlasProperties.getBoolean(ATLAS_NOTIFICATION_CREATE_TOPICS_KEY, true)) { if (!handleSecurity(atlasProperties)) { return; } ZkUtils zkUtils = createZkUtils(atlasProperties); for (String topicName : topicNames) { try { LOG.warn("Attempting to create topic {}", topicName); if (!ifTopicExists(topicName, zkUtils)) { createTopic(atlasProperties, topicName, zkUtils); } else { LOG.warn("Ignoring call to create topic {}, as it already exists.", topicName); } } catch (Throwable t) { LOG.error("Failed while creating topic {}", topicName, t); } } zkUtils.close(); } else { LOG.info("Not creating topics {} as {} is false", StringUtils.join(topicNames, ","), ATLAS_NOTIFICATION_CREATE_TOPICS_KEY); } }
Example 5
Source File: ExecutionMonitor.java From steady with Apache License 2.0 | 6 votes |
/** * <p>Constructor for ExecutionMonitor.</p> */ public ExecutionMonitor() { try { final Application app_ctx = CoreConfiguration.getAppContext(); final Configuration cfg = VulasConfiguration.getGlobal().getConfiguration(); // Always create and register shutdown uploader this.shutdownUploader = new UploadScheduler(this); Runtime.getRuntime().addShutdownHook(new Thread(this.shutdownUploader, "vulas-shutdown-trace-upload")); // Configure uploader: Create and start periodic uploader according to configuration if(cfg.getBoolean(CoreConfiguration.MONI_PERIODIC_UPL_ENABLED, true)) this.enablePeriodicUpload(cfg.getInt(CoreConfiguration.MONI_PERIODIC_UPL_INTERVAL, 300000), cfg.getInt(CoreConfiguration.MONI_PERIODIC_UPL_BATCH_SIZE, 1000)); // Goal execution this.exe = new TestGoal(); this.exe.setGoalClient(GoalClient.AGENT); this.startGoal(); } catch(ConfigurationException ce) { ExecutionMonitor.getLog().error(ce.getMessage()); } catch(GoalConfigurationException gce) { ExecutionMonitor.getLog().error(gce.getMessage()); } }
Example 6
Source File: CejshConfig.java From proarc with GNU General Public License v3.0 | 5 votes |
public static CejshConfig from(Configuration conf) { CejshConfig cc = new CejshConfig(); cc.setCejshXslUrl(conf.getString(PROP_MODS_XSL_URL, null)); // cc.setJournalUrl(conf.getString(PROP_JOURNALS_URL, null)); try { boolean debug = conf.getBoolean(PROP_DEBUG, Boolean.FALSE); cc.setLogLevel(debug ? Level.INFO : Level.FINE); } catch (ConversionException ex) { LOG.log(Level.SEVERE, PROP_DEBUG, ex); } return cc; }
Example 7
Source File: ValidatePublish.java From juddi with Apache License 2.0 | 5 votes |
public void validateTModelInstanceInfo(org.uddi.api_v3.TModelInstanceInfo tmodelInstInfo, Configuration config, boolean isRoot) throws DispositionReportFaultMessage { // tModel Instance Info can't be null if (tmodelInstInfo == null) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NullInput")); } // TModel key is required if (tmodelInstInfo.getTModelKey() == null || tmodelInstInfo.getTModelKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NoTModelKey")); } // Per section 4.4: keys must be case-folded tmodelInstInfo.setTModelKey((tmodelInstInfo.getTModelKey().toLowerCase())); boolean checkRef = false; try { checkRef = config.getBoolean(Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY, false); } catch (Exception ex) { log.warn("Error caught reading " + Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY + " from config file", ex); } if (checkRef && !isRoot) { this.verifyTModelKeyExists(tmodelInstInfo.getTModelKey()); } validateInstanceDetails(tmodelInstInfo.getInstanceDetails()); if (log.isDebugEnabled()) { log.debug("validateTModelInstanceInfo"); } validateKeyLength(tmodelInstInfo.getTModelKey()); validateDescriptions(tmodelInstInfo.getDescription()); }
Example 8
Source File: UserDao.java From atlas with Apache License 2.0 | 5 votes |
void loadFileLoginsDetails() { userLogins.clear(); InputStream inStr = null; try { Configuration configuration = ApplicationProperties.get(); v1ValidationEnabled = configuration.getBoolean("atlas.authentication.method.file.v1-validation.enabled", true); v2ValidationEnabled = configuration.getBoolean("atlas.authentication.method.file.v2-validation.enabled", true); inStr = ApplicationProperties.getFileAsInputStream(configuration, "atlas.authentication.method.file.filename", DEFAULT_USER_CREDENTIALS_PROPERTIES); userLogins.load(inStr); } catch (IOException | AtlasException e) { LOG.error("Error while reading user.properties file", e); throw new RuntimeException(e); } finally { if (inStr != null) { try { inStr.close(); } catch (Exception excp) { // ignore } } } }
Example 9
Source File: SetDateBolt.java From cognition with Apache License 2.0 | 5 votes |
@Override public void configure(Configuration conf) { dateFormat = conf.getString(DATE_FORMAT); dateFields = new ArrayList<>(); conf.getList(DATE_FIELD).forEach(x -> dateFields.add(x.toString())); _updateIndexField = conf.getBoolean(UPDATE_INDEX_FIELD, false); Validate.notEmpty(dateFields); Validate.notBlank(dateFormat); }
Example 10
Source File: Services.java From atlas with Apache License 2.0 | 5 votes |
@Inject public Services(List<Service> services, Configuration configuration) { this.services = services; this.dataMigrationClassName = configuration.getString("atlas.migration.class.name", DATA_MIGRATION_CLASS_NAME_DEFAULT); this.servicesEnabled = configuration.getBoolean(ATLAS_SERVICES_ENABLED, true); this.migrationDirName = configuration.getString(ATLAS_MIGRATION_MODE_FILENAME); this.migrationEnabled = StringUtils.isNotEmpty(migrationDirName); }
Example 11
Source File: Install.java From juddi with Apache License 2.0 | 5 votes |
/** * Checks if there is a database with a root publisher. If it is not * found an * * @param config * @return true if it finds a database with the root publisher in it. * @throws ConfigurationException */ protected static boolean alreadyInstalled(Configuration config) throws ConfigurationException { String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER); log.info("Checking if jUDDI is seeded by searching for root publisher " + rootPublisherStr); org.apache.juddi.model.Publisher publisher = null; int numberOfTries = 0; while (numberOfTries++ < 100) { EntityManager em = PersistenceManager.getEntityManager(); EntityTransaction tx = em.getTransaction(); try { tx.begin(); publisher = em.find(org.apache.juddi.model.Publisher.class, rootPublisherStr); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } em.close(); } if (publisher != null) { return true; } if (config.getBoolean(Property.JUDDI_LOAD_INSTALL_DATA, Property.DEFAULT_LOAD_INSTALL_DATA)) { log.debug("Install data not yet installed."); return false; } else { try { log.info("Install data not yet installed."); log.info("Going to sleep and retry..."); Thread.sleep(1000l); } catch (InterruptedException e) { log.error(e.getMessage(), e); } } } throw new ConfigurationException("Could not load the Root node data. Please check for errors."); }
Example 12
Source File: ValidatePublish.java From juddi with Apache License 2.0 | 5 votes |
private void validateSignaturesBinding(BindingTemplate bindingTemplate, Configuration config) throws FatalErrorException { boolean shouldcheck = config.getBoolean(Property.JUDDI_REJECT_ENTITIES_WITH_INVALID_SIG_ENABLE, false); initDigSig(config); if (shouldcheck && !bindingTemplate.getSignature().isEmpty() && ds != null) { AtomicReference<String> outmsg = new AtomicReference<String>(); boolean ok = ds.verifySignedUddiEntity(bindingTemplate, outmsg); if (!ok) { throw new FatalErrorException(new ErrorMessage("errors.digitalsignature.validationfailure", bindingTemplate.getBindingKey() + " " + outmsg.get())); } } }
Example 13
Source File: AbstractNotification.java From incubator-atlas with Apache License 2.0 | 4 votes |
public AbstractNotification(Configuration applicationProperties) throws AtlasException { this.embedded = applicationProperties.getBoolean(PROPERTY_EMBEDDED, false); this.isHAEnabled = HAConfiguration.isHAEnabled(applicationProperties); }
Example 14
Source File: Install.java From juddi with Apache License 2.0 | 4 votes |
protected static void install(Configuration config) throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException, XMLStreamException { EntityManager em = PersistenceManager.getEntityManager(); EntityTransaction tx = em.getTransaction(); UddiEntityPublisher rootPublisher = null; try { tx.begin(); boolean seedAlways = config.getBoolean("juddi.seed.always", false); boolean alreadyInstalled = alreadyInstalled(config); if (!seedAlways && alreadyInstalled) { throw new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled")); } String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER); String fileRootTModelKeygen = rootPublisherStr + FILE_TMODELKEYGEN; TModel rootTModelKeyGen = (TModel) buildInstallEntity(fileRootTModelKeygen, "org.uddi.api_v3", config); String fileRootBusinessEntity = rootPublisherStr + FILE_BUSINESSENTITY; org.uddi.api_v3.BusinessEntity rootBusinessEntity = (org.uddi.api_v3.BusinessEntity) buildInstallEntity(fileRootBusinessEntity, "org.uddi.api_v3", config); String rootPartition = getRootPartition(rootTModelKeyGen); //JUDDI-645 String nodeId = config.getString(Property.JUDDI_NODE_ID, getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition)); //getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition); String rootbizkey = getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition); String fileRootPublisher = rootPublisherStr + FILE_PUBLISHER; String fileReplicationConfig = rootPublisherStr + FILE_REPLICATION_CONFIG; org.uddi.repl_v3.ReplicationConfiguration replicationCfg = (org.uddi.repl_v3.ReplicationConfiguration) buildInstallEntityAlt(fileReplicationConfig, org.uddi.repl_v3.ReplicationConfiguration.class, config); if (!alreadyInstalled) { log.info("Loading the root Publisher from file " + fileRootPublisher); rootPublisher = installPublisher(em, fileRootPublisher, config); installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId); rootBusinessEntity.setBusinessKey(rootbizkey); installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config, nodeId); installReplicationConfiguration(em, replicationCfg, config, nodeId); } else { log.debug("juddi.seed.always reapplies all seed files except for the root data."); } List<String> juddiPublishers = getPublishers(config); for (String publisherStr : juddiPublishers) { String filePublisher = publisherStr + FILE_PUBLISHER; String fileTModelKeygen = publisherStr + FILE_TMODELKEYGEN; TModel tModelKeyGen = (TModel) buildInstallEntity(fileTModelKeygen, "org.uddi.api_v3", config); String fileBusinessEntity = publisherStr + FILE_BUSINESSENTITY; org.uddi.api_v3.BusinessEntity businessEntity = (org.uddi.api_v3.BusinessEntity) buildInstallEntity(fileBusinessEntity, "org.uddi.api_v3", config); UddiEntityPublisher publisher = installPublisher(em, filePublisher, config); if (publisher == null) { throw new ConfigurationException("File " + filePublisher + " not found."); } else { if (tModelKeyGen != null) { installPublisherKeyGen(em, tModelKeyGen, publisher, nodeId); } if (businessEntity != null) { installBusinessEntity(false, em, businessEntity, publisher, null, config, nodeId); } String fileTModels = publisherStr + FILE_TMODELS; installSaveTModel(em, fileTModels, publisher, nodeId, config); } } tx.commit(); } catch (DispositionReportFaultMessage dr) { log.error(dr.getMessage(), dr); tx.rollback(); throw dr; } catch (JAXBException je) { log.error(je.getMessage(), je); tx.rollback(); throw je; } catch (IOException ie) { log.error(ie.getMessage(), ie); tx.rollback(); throw ie; } catch (XMLStreamException ex) { log.error(ex.getMessage(), ex); tx.rollback(); throw ex; } finally { if (tx.isActive()) { tx.rollback(); } em.close(); } }
Example 15
Source File: AuthenticationUtil.java From incubator-atlas with Apache License 2.0 | 4 votes |
public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf) { return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); }
Example 16
Source File: MinionStarter.java From incubator-pinot with Apache License 2.0 | 4 votes |
/** * Starts the Pinot Minion instance. * <p>Should be called after all classes of task executor get registered. */ @Override public void start() throws Exception { LOGGER.info("Starting Pinot minion: {}", _instanceId); Utils.logVersions(); MinionContext minionContext = MinionContext.getInstance(); // Initialize data directory LOGGER.info("Initializing data directory"); File dataDir = new File(_config .getString(CommonConstants.Helix.Instance.DATA_DIR_KEY, CommonConstants.Minion.DEFAULT_INSTANCE_DATA_DIR)); if (dataDir.exists()) { FileUtils.forceDelete(dataDir); } FileUtils.forceMkdir(dataDir); minionContext.setDataDir(dataDir); // Initialize metrics LOGGER.info("Initializing metrics"); MetricsHelper.initializeMetrics(_config); MetricsRegistry metricsRegistry = new MetricsRegistry(); MetricsHelper.registerMetricsRegistry(metricsRegistry); MinionMetrics minionMetrics = new MinionMetrics(_config .getString(CommonConstants.Minion.CONFIG_OF_METRICS_PREFIX_KEY, CommonConstants.Minion.CONFIG_OF_METRICS_PREFIX), metricsRegistry); minionMetrics.initializeGlobalMeters(); minionContext.setMinionMetrics(minionMetrics); // Start all components LOGGER.info("Initializing PinotFSFactory"); Configuration pinotFSConfig = _config.subset(CommonConstants.Minion.PREFIX_OF_CONFIG_OF_PINOT_FS_FACTORY); PinotFSFactory.init(pinotFSConfig); LOGGER.info("Initializing segment fetchers for all protocols"); Configuration segmentFetcherFactoryConfig = _config.subset(CommonConstants.Minion.PREFIX_OF_CONFIG_OF_SEGMENT_FETCHER_FACTORY); SegmentFetcherFactory.init(segmentFetcherFactoryConfig); LOGGER.info("Initializing pinot crypter"); Configuration pinotCrypterConfig = _config.subset(CommonConstants.Minion.PREFIX_OF_CONFIG_OF_PINOT_CRYPTER); PinotCrypterFactory.init(pinotCrypterConfig); // Need to do this before we start receiving state transitions. LOGGER.info("Initializing ssl context for segment uploader"); Configuration httpsConfig = _config.subset(CommonConstants.Minion.PREFIX_OF_CONFIG_OF_SEGMENT_UPLOADER).subset(HTTPS_PROTOCOL); if (httpsConfig.getBoolean(HTTPS_ENABLED, false)) { SSLContext sslContext = new ClientSSLContextGenerator(httpsConfig.subset(CommonConstants.PREFIX_OF_SSL_SUBSET)).generate(); minionContext.setSSLContext(sslContext); } // Join the Helix cluster LOGGER.info("Joining the Helix cluster"); _helixManager.getStateMachineEngine().registerStateModelFactory("Task", new TaskStateModelFactory(_helixManager, new TaskFactoryRegistry(_taskExecutorFactoryRegistry, _eventObserverFactoryRegistry).getTaskFactoryRegistry())); _helixManager.connect(); addInstanceTagIfNeeded(); minionContext.setHelixPropertyStore(_helixManager.getHelixPropertyStore()); // Initialize health check callback LOGGER.info("Initializing health check callback"); ServiceStatus.setServiceStatusCallback(_instanceId, new ServiceStatus.ServiceStatusCallback() { @Override public ServiceStatus.Status getServiceStatus() { // TODO: add health check here minionMetrics.addMeteredGlobalValue(MinionMeter.HEALTH_CHECK_GOOD_CALLS, 1L); return ServiceStatus.Status.GOOD; } @Override public String getStatusDescription() { return ServiceStatus.STATUS_DESCRIPTION_NONE; } }); LOGGER.info("Pinot minion started"); }
Example 17
Source File: Resources.java From es6draft with MIT License | 4 votes |
/** * Returns {@code true} if the test suite is enabled. */ public static boolean isEnabled(Configuration configuration) { return !configuration.getBoolean("skip", false); }
Example 18
Source File: ValidatePublish.java From juddi with Apache License 2.0 | 4 votes |
/** * * @param kr * @param config * @param isRoot true during install time, otherwise false * @throws DispositionReportFaultMessage */ public void validateKeyedReference(KeyedReference kr, Configuration config, boolean isRoot) throws DispositionReportFaultMessage { if (log.isDebugEnabled()) { log.debug("validateKeyedReference"); } String tmodelKey = kr.getTModelKey(); if (tmodelKey == null || tmodelKey.length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoTModelKey")); } // Per section 4.4: keys must be case-folded tmodelKey = tmodelKey.toLowerCase(); kr.setTModelKey(tmodelKey); validateKeyLength(tmodelKey); if (kr.getKeyValue() == null || kr.getKeyValue().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoKeyValue")); } validateKeyValue(kr.getKeyValue()); validateKeyName(kr.getKeyName()); boolean checkRef = false; try { checkRef = config.getBoolean(Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY, false); } catch (Exception ex) { log.warn("Error caught reading " + Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY + " from config file", ex); } if (checkRef && !isRoot) { this.verifyTModelKeyExists(tmodelKey); } String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER); // Per section 6.2.2.1 of the specification, no publishers (except the root) are allowed to use the node categorization tmodelKey if (Constants.NODE_CATEGORY_TMODEL.equalsIgnoreCase(kr.getTModelKey())) { if (!rootPublisherStr.equals(publisher.getAuthorizedName())) { throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NodeCategoryTModel", Constants.NODE_CATEGORY_TMODEL)); } } }
Example 19
Source File: ProblemEvaluator.java From KEEL with GNU General Public License v3.0 | 3 votes |
/** * <p> * Configuration parameters for NeuralNetEvaluator are: * * <ul> * <li> * <code>train-data: complex</code> * Train data set used in individuals evaluation. * <ul> * <li> * <code>train-data[@file-name] String </code> * File name of train data * </li> * </ul> * </li> * <li> * <code>test-data: complex</code> * Test data set used in individuals evaluation. * <ul> * <li> * <code>test-data[@file-name] String </code> * File name of test data * </li> * </ul> * </li> * <li> * <code>[@normalize-data]: boolean (default = false)</code> * If this parameter is set to <code>true</code> data sets values are * normalizated after reading their contents * </li> * <li> * <code>[input-interval] (complex)</code> * Input interval of normalization. * </li> * <li> * <code>[output-interval] (complex)</code> * Output interval of normalization. * </li> * </ul> * <p> * @param settings Configuration object from which the properties are read */ public void configure(Configuration settings) { // Set trainData unscaledTrainData = new DoubleTransposedDataSet(); unscaledTrainData.configure(settings.subset("train-data")); // Set testData unscaledTestData = new DoubleTransposedDataSet(); unscaledTestData.configure(settings.subset("test-data")); // Set normalizer normalizer = new Normalizer(); // Set dataNormalized dataNormalized = settings.getBoolean("[@normalize-data]", false); // Set dataNormalized logTransformation = settings.getBoolean("[@log-input-data]", false); if(dataNormalized){ // Normalization Input Interval Interval interval = new Interval(); // Configure interval interval.configure(settings.subset("input-interval")); // Set interval setInputInterval(interval); // Normalization Output Interval interval = new Interval(); // Configure range interval.configure(settings.subset("output-interval")); // Set interval setOutputInterval(interval); } }
Example 20
Source File: HAConfiguration.java From atlas with Apache License 2.0 | 3 votes |
/** * Get the web server address that a server instance with the passed ID is bound to. * * This method uses the property {@link SecurityProperties#TLS_ENABLED} to determine whether * the URL is http or https. * * @param configuration underlying configuration * @param serverId serverId whose host:port property is picked to build the web server address. * @return */ public static String getBoundAddressForId(Configuration configuration, String serverId) { String hostPort = configuration.getString(ATLAS_SERVER_ADDRESS_PREFIX +serverId); boolean isSecure = configuration.getBoolean(SecurityProperties.TLS_ENABLED); String protocol = (isSecure) ? "https://" : "http://"; return protocol + hostPort; }