public interface IPunchPlatformProperties extends ISettingsMap
Say your punchplatform.properties contains :
"zookeeper" : {
"clusters" : {
"common" : {
"hosts" : ["localhost"],
"cluster_port" : 2181
}
}
}
To retrieve that file content, and extract some properties, do as follows:
import org.punch.platform.env.IKeys.*;
...
IPlatform platform = PlatformProvider.getPlatform();
IPunchPlatformProperties properties = platform.getPlatformProperties();
PunchPlatformProperties properties = PunchEnvironment.getPunchPlatformProperties();
int clusterPort = properties
.childAsMap(ZOOKEEPER)
.childAsMap(CLUSTERS)
.childAsMap(COMMON)
.getAsRequiredInteger(CLUSTER_PORT);
Besides giving you access to the properties, this class also defines all the
key names you can rely on.
In addition, you are provided with a few specific helper access method. Checkout out the doc below.
asFlatValuesMap, asFlatValuesMap, asFlatValuesMapIgnoreSettingsList, asHjsonString, asJsonString, asJsonString, asKvString, asListFlatValuesMapIgnoreSettingsList, asYamlString, childAsJson, childAsListOfString, childAsMapEntries, childAsMapValues, childAsRawContent, childAsRequiredListOfString, childAsRequiredString, childAsString, childAsStringContent, childAsTarGz, childFileAsMap, childIsDir, childIsFile, getAsBoolean, getAsBoolean, getAsDouble, getAsInteger, getAsInteger, getAsIsoDateTime, getAsLong, getAsLong, getAsMsDuration, getAsRequiredBoolean, getAsRequiredDouble, getAsRequiredInteger, getAsRequiredIsoDateTime, getAsRequiredLong, getAsRequiredObject, getAsRequiredObjectOfClass, getAsRequiredSettingsList, getAsRequiredSettingsMap, getAsRequiredString, getAsRequiredTimeValue, getAsRequiredZonedDateTime, getAsSettingsList, getAsSettingsList, getAsSettingsListOrEmpty, getAsSettingsMap, getAsSettingsMap, getAsString, getAsString, getAsTimeValue, getCreateAsListOfMap, getCreateMap, getDeepCopy, getMapOrEmpty, getNestedProperty, getOrCreateNestedSettingsMap, getOriginatorName, getRequiredNestedProperty, getStringOrFail, getStringOrFail, getTimeValueMs, overrideWith, putUsingDottedPath, putUsingSlashPath, removeUsingDottedPath, removeUsingSlashPath, setNestedProperty, setOriginatorName, setPropertyIfMissing
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
String getPlanSchedulerInstallDir()
String getZkConnectionString(String zkClusterKey)
zkClusterKey
- the zookeeper cluster key.org.apache.http.HttpHost[] getStormUAdminUrl(String name)
name
- the name of a storm clusterList<String> getStormSupervisors(String stormClusterName)
stormClusterName
- the name of a storm clusterList<String> getStormNimbusNodes(String stormClusterName)
stormClusterName
- the name of a storm clusterorg.apache.http.HttpHost[] getElasticsearchHttpHosts(String clusterName, boolean ssl)
clusterName
- the name of an elasticsearch clusterssl
- https if true, else httporg.apache.http.HttpHost[] getElasticsearchHttpHostsForMonitoring(String clusterName, boolean ssl)
clusterName
- the name of an elasticsearch clusterssl
- set true to use https scheme, false to use httpList<String> getElasticsearchClusterNames()
org.apache.http.HttpHost[] getSparkHttpHosts(String clusterName)
clusterName
- the name of an spark clusterString getSparkInstallDir()
ISettingsMap getCreateSparkCluster(String clusterName)
clusterName
- the name of an spark clusterString getZkConnectionStringForKafkaCluster(String kafkaClusterName)
kafkaClusterName
- the target kafka cluster nameIKafkaCluster getKafkaCluster(String clusterName)
clusterName
- as appearing in the list of keys in the 'kafka.clusters' platform settingIllegalArgumentException
- if no cluster with provided section name can be found in the platform settingsIZookeeperCluster getZookeeperCluster(String zkClusterName)
zkClusterName
- as appearing in the list of keys in the 'zookeeper.clusters' platform settingIllegalArgumentException
- if no cluster with provided section name can be found in the platform settingsList<IShivaCluster> getShivaClusters()
IShivaCluster getShivaCluster(String shivaClusterName) throws ConfigurationException
shivaClusterName
- the target shiva cluster nameMissingPlatformPropertiesConfigurationException
PlatformPropertiesConfigurationException
ConfigurationException
Set<String> getShivaClusterNames()
ISettingsMap getGatewayConfiguration()
List<IKafkaCluster> getKafkaClusters()
Set<String> getKafkaClusterNames()
List<IZookeeperCluster> getZookeeperClusters()
Set<String> getZookeeperClusterNames()
org.apache.http.HttpHost[] getPlatformEsCluster()
String getPlatformEsIndexPrefix()
String getPlatformId()
String getApplicationControlTopic() throws ConfigurationException
MissingKafkaTopicConfigurationException
ConfigurationException
String getApplicationControlKafkaClusterName() throws ConfigurationException
MissingKafkaClusterConfigurationException
ConfigurationException
String getApplicationControlKafkaClusterBootstrapUrl() throws ConfigurationException
ConfigurationException
ISettingsMap getResourceManagerConfiguration()
List<ISettingsMap> getReporters(List<String> reporterId)
ISettingsMap getCreateElasticsearchCluster(String esCluster)
esCluster
- the Elasticsearch cluster nameISettingsMap getCreateZookeeperCluster(String zkCluster)
zkCluster
- the Zookeeper cluster nameISettingsMap getCreateStormCluster(String cluster)
cluster
- the Storm cluster nameISettingsMap getCreateKafkaCluster(String cluster)
cluster
- the Kafka cluster nameISettingsMap getCreateKubernetesCluster(String cluster)
cluster
- the Kubernetes cluster nameISettingsMap getCreateShivaCluster(String cluster)
cluster
- the Shiva cluster nameISettingsMap getOrCreate(String... tree)
tree
- the list of map nodesorg.apache.http.HttpHost[] getCephAdminApiHosts(String clusterName)
clusterName
- the name of an Ceph clusterSet<String> getCephClusterNames()
ISettingsMap getCreateCephCluster(String clusterName)
clusterName
- the name of a Ceph clusterString getKafkaBootstrapServer(String targetDataKafkaClusterName) throws ConfigurationException
targetDataKafkaClusterName
- the target kafka cluster nameConfigurationException
ISettingsMap asSettingsMap()
int getStormNimbusPort(String cluster)
ISettingsMap getCreateMinioCluster(String clusterName)
clusterName
- the name of a minio clusterSet<String> getClickhouseClusterNames()
ISettingsMap getCreateClickhouseCluster(String clusterName)
clusterName
- the name of a Clickhouse clusterSet<String> getGatewayClusterNames()
ISettingsMap getCreateGatewayCluster(String clusterName)
clusterName
- the name of a Gateway clusterSecurityImpl getSecuritySectionForCommands()
String sparkMaster(String clusterName) throws ConfigurationException
- spark://localhost:7077
- spark://server1:7077,server1:7077
clusterName
- specified in your punchplatform propertiesConfigurationException
boolean clusterExists(EClusterType eClusterType, String name)
eClusterType
- a cluster typename
- a cluster nameCopyright © 2014–2022. All rights reserved.