You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2017/08/16 08:45:44 UTC
[11/13] ambari git commit: AMBARI-21723. Redundant type arguments
(Java 8)
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
index 16c6c16..7d8c683 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
@@ -792,7 +792,7 @@ public class Users {
// make sure user entities are refreshed so that membership is updated
userEntity = userDAO.findByPK(userEntity.getUserId());
- usersToGroups.put(userEntity.getUserName(), new HashSet<String>());
+ usersToGroups.put(userEntity.getUserName(), new HashSet<>());
for (MemberEntity memberEntity : userEntity.getMemberEntities()) {
usersToGroups.get(userEntity.getUserName()).add(memberEntity.getGroup().getGroupName());
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/serveraction/AbstractServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/AbstractServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/AbstractServerAction.java
index 9d1c992..64f84b6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/AbstractServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/AbstractServerAction.java
@@ -167,7 +167,7 @@ public abstract class AbstractServerAction implements ServerAction {
* @return the (assumed read-only) configurations value from the ExecutionCommand
*/
protected Map<String, Map<String, String>> getConfigurations() {
- return (executionCommand == null) ? Collections.<String, Map<String, String>>emptyMap() : executionCommand.getConfigurations();
+ return (executionCommand == null) ? Collections.emptyMap() : executionCommand.getConfigurations();
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java
index 1d979d0..8749f81 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandler.java
@@ -441,10 +441,10 @@ public abstract class KerberosOperationHandler {
*/
protected Keytab mergeKeytabs(Keytab keytab, Keytab updates) {
List<KeytabEntry> keytabEntries = (keytab == null)
- ? Collections.<KeytabEntry>emptyList()
+ ? Collections.emptyList()
: new ArrayList<>(keytab.getEntries());
List<KeytabEntry> updateEntries = (updates == null)
- ? Collections.<KeytabEntry>emptyList()
+ ? Collections.emptyList()
: new ArrayList<>(updates.getEntries());
List<KeytabEntry> mergedEntries = new ArrayList<>();
@@ -802,7 +802,7 @@ public abstract class KerberosOperationHandler {
encryptionTypes = ENCRYPTION_TYPE_TRANSLATION_MAP.get(name.toLowerCase());
}
- return (encryptionTypes == null) ? Collections.<EncryptionType>emptySet() : encryptionTypes;
+ return (encryptionTypes == null) ? Collections.emptySet() : encryptionTypes;
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AutoSkipFailedSummaryAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AutoSkipFailedSummaryAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AutoSkipFailedSummaryAction.java
index e34fbe1..664cb2c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AutoSkipFailedSummaryAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AutoSkipFailedSummaryAction.java
@@ -184,7 +184,7 @@ public class AutoSkipFailedSummaryAction extends AbstractServerAction {
failures = new ArrayList<>();
hostComponents.put(hostName, failures);
- publishedHostComponents.put(hostName, new HashSet<Role>());
+ publishedHostComponents.put(hostName, new HashSet<>());
}
Set<Role> publishedHostComponentsOnHost = publishedHostComponents.get(hostName);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
index 2b4398b..74120b6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
@@ -34,7 +34,6 @@ import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.state.ComponentInfo;
import org.apache.ambari.server.state.CustomCommandDefinition;
-import org.apache.ambari.server.state.PropertyInfo;
import org.apache.ambari.server.state.QuickLinksConfigurationInfo;
import org.apache.ambari.server.state.ServiceInfo;
import org.apache.ambari.server.state.ServicePropertyInfo;
@@ -217,7 +216,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
|| serviceInfo.getRequiredServices().size() == 0) {
serviceInfo.setRequiredServices(parent.getRequiredServices() != null ?
parent.getRequiredServices() :
- Collections.<String>emptyList());
+ Collections.emptyList());
}
if (serviceInfo.isRestartRequiredAfterChange() == null) {
@@ -426,7 +425,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
for (String excludedType : serviceInfo.getExcludedConfigTypes()) {
if (! configurationModules.containsKey(excludedType)) {
ConfigurationInfo configInfo = new ConfigurationInfo(
- Collections.<PropertyInfo>emptyList(), Collections.<String, String>emptyMap());
+ Collections.emptyList(), Collections.emptyMap());
ConfigurationModule config = new ConfigurationModule(excludedType, configInfo);
config.setDeleted(true);
@@ -545,7 +544,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
//currently there is no way to remove an inherited config dependency
List<String> configDependencies = serviceInfo.getConfigDependencies();
List<String> parentConfigDependencies = parent.getConfigDependencies() != null ?
- parent.getConfigDependencies() : Collections.<String>emptyList();
+ parent.getConfigDependencies() : Collections.emptyList();
if (configDependencies == null) {
serviceInfo.setConfigDependencies(parentConfigDependencies);
@@ -570,7 +569,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
ServiceModule parent, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
throws AmbariException {
serviceInfo.getProperties().clear();
- serviceInfo.setAllConfigAttributes(new HashMap<String, Map<String, Map<String, String>>>());
+ serviceInfo.setAllConfigAttributes(new HashMap<>());
Collection<ConfigurationModule> mergedModules = mergeChildModules(
allStacks, commonServices, extensions, configurationModules, parent.configurationModules);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
index 57f7cb4..245e623 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
@@ -250,7 +250,7 @@ public class StackManager {
private void createLinks() {
LOG.info("Creating links");
Collection<ExtensionInfo> extensions = getExtensions();
- Set<String> names = new HashSet<String>();
+ Set<String> names = new HashSet<>();
for(ExtensionInfo extension : extensions){
names.add(extension.getName());
}
@@ -270,7 +270,7 @@ public class StackManager {
*/
private void createLinksForExtension(String name) {
Collection<ExtensionInfo> collection = getExtensions(name);
- List<ExtensionInfo> extensions = new ArrayList<ExtensionInfo>(collection.size());
+ List<ExtensionInfo> extensions = new ArrayList<>(collection.size());
extensions.addAll(collection);
try {
helper.createExtensionLinks(this, extensions);
@@ -316,11 +316,11 @@ public class StackManager {
* @return A map of all stacks with the name as the key.
*/
public Map<String, List<StackInfo>> getStacksByName() {
- Map<String, List<StackInfo>> stacks = new HashMap<String, List<StackInfo>>();
+ Map<String, List<StackInfo>> stacks = new HashMap<>();
for (StackInfo stack: stackMap.values()) {
List<StackInfo> list = stacks.get(stack.getName());
if (list == null) {
- list = new ArrayList<StackInfo>();
+ list = new ArrayList<>();
stacks.put(stack.getName(), list);
}
list.add(stack);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index d73387d..ff1d378 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -240,7 +240,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
}
// Generate list of services that have no config types
- List<String> servicesWithNoConfigs = new ArrayList<String>();
+ List<String> servicesWithNoConfigs = new ArrayList<>();
for(ServiceModule serviceModule: serviceModules.values()){
if (!serviceModule.hasConfigs()){
servicesWithNoConfigs.add(serviceModule.getId());
@@ -678,7 +678,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
StackModule parent, Map<String,StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
throws AmbariException {
stackInfo.getProperties().clear();
- stackInfo.setAllConfigAttributes(new HashMap<String, Map<String, Map<String, String>>>());
+ stackInfo.setAllConfigAttributes(new HashMap<>());
Collection<ConfigurationModule> mergedModules = mergeChildModules(
allStacks, commonServices, extensions, configurationModules, parent.configurationModules);
@@ -1162,7 +1162,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
// Uniqueness is checked for each os type
for (String osType: serviceReposByOsType.keySet()) {
- List<RepositoryInfo> stackReposForOsType = stackReposByOsType.containsKey(osType) ? stackReposByOsType.get(osType) : Collections.<RepositoryInfo>emptyList();
+ List<RepositoryInfo> stackReposForOsType = stackReposByOsType.containsKey(osType) ? stackReposByOsType.get(osType) : Collections.emptyList();
List<RepositoryInfo> serviceReposForOsType = serviceReposByOsType.get(osType);
Set<String> stackRepoNames = ImmutableSet.copyOf(Lists.transform(stackReposForOsType, RepositoryInfo.GET_REPO_NAME_FUNCTION));
Set<String> stackRepoUrls = ImmutableSet.copyOf(Lists.transform(stackReposForOsType, RepositoryInfo.SAFE_GET_BASE_URL_FUNCTION));
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
index b508cd7..dd127d3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
@@ -332,7 +332,7 @@ public class RoleGraph {
* when Ambari supports mpacks, custom services and service level role command order.
* */
public void breakCycleGraph() throws AmbariException{
- List<String> edges = new ArrayList<String>();
+ List<String> edges = new ArrayList<>();
for (String role : graph.keySet()){
RoleGraphNode fromNode = graph.get(role);
String fnRole = fromNode.getRole().name();
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 6b82273..cb98dd2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -399,7 +399,7 @@ public class ConfigHelper {
for (Entry<String, Map<String, String>> attributesEntry : sourceAttributesMap.entrySet()) {
String attributeName = attributesEntry.getKey();
if (!targetAttributesMap.containsKey(attributeName)) {
- targetAttributesMap.put(attributeName, new TreeMap<String, String>());
+ targetAttributesMap.put(attributeName, new TreeMap<>());
}
for (Entry<String, String> attributesValue : attributesEntry.getValue().entrySet()) {
targetAttributesMap.get(attributeName).put(attributesValue.getKey(), attributesValue.getValue());
@@ -411,7 +411,7 @@ public class ConfigHelper {
public void applyCustomConfig(Map<String, Map<String, String>> configurations,
String type, String name, String value, Boolean deleted) {
if (!configurations.containsKey(type)) {
- configurations.put(type, new HashMap<String, String>());
+ configurations.put(type, new HashMap<>());
}
String nameToUse = deleted ? DELETED + name : name;
Map<String, String> properties = configurations.get(type);
@@ -1070,7 +1070,7 @@ public class ConfigHelper {
String authenticatedUserName, String serviceVersionNote) throws AmbariException {
createConfigType(cluster, stackId, controller, configType, properties,
- new HashMap<String, Map<String, String>>(), authenticatedUserName, serviceVersionNote);
+ new HashMap<>(), authenticatedUserName, serviceVersionNote);
}
public void createConfigType(Cluster cluster, StackId stackId,
@@ -1109,13 +1109,13 @@ public class ConfigHelper {
Map<String, String> properties = entry.getValue();
Config baseConfig = createConfig(cluster, stackId, controller, type, FIRST_VERSION_TAG,
- properties, Collections.<String, Map<String, String>> emptyMap());
+ properties, Collections.emptyMap());
if (null != baseConfig) {
try {
String service = cluster.getServiceForConfigTypes(Collections.singleton(type));
if (!serviceMapped.containsKey(service)) {
- serviceMapped.put(service, new HashSet<Config>());
+ serviceMapped.put(service, new HashSet<>());
}
serviceMapped.get(service).add(baseConfig);
} catch (Exception e) {
@@ -1208,7 +1208,7 @@ public class ConfigHelper {
String type = ConfigHelper.fileNameToConfigType(stackDefaultProperty.getFilename());
if (!defaultPropertiesByType.containsKey(type)) {
- defaultPropertiesByType.put(type, new HashMap<String, String>());
+ defaultPropertiesByType.put(type, new HashMap<>());
}
defaultPropertiesByType.get(type).put(stackDefaultProperty.getName(),
@@ -1240,7 +1240,7 @@ public class ConfigHelper {
String type = ConfigHelper.fileNameToConfigType(stackDefaultProperty.getFilename());
if (!defaultPropertiesByType.containsKey(type)) {
- defaultPropertiesByType.put(type, new HashMap<String, String>());
+ defaultPropertiesByType.put(type, new HashMap<>());
}
defaultPropertiesByType.get(type).put(stackDefaultProperty.getName(),
@@ -1256,7 +1256,7 @@ public class ConfigHelper {
String type = ConfigHelper.fileNameToConfigType(serviceDefaultProperty.getFilename());
if (!defaultPropertiesByType.containsKey(type)) {
- defaultPropertiesByType.put(type, new HashMap<String, String>());
+ defaultPropertiesByType.put(type, new HashMap<>());
}
defaultPropertiesByType.get(type).put(serviceDefaultProperty.getName(),
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
index cfcadd4..44d76af 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
@@ -286,7 +286,7 @@ public class ConfigImpl implements Config {
public Map<String, String> getProperties() {
propertyLock.readLock().lock();
try {
- return properties == null ? new HashMap<String, String>() : new HashMap<>(properties);
+ return properties == null ? new HashMap<>() : new HashMap<>(properties);
} finally {
propertyLock.readLock().unlock();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
index bb24c8d..cf55660 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
@@ -117,7 +117,7 @@ public class ConfigMergeHelper {
twv.savedValue = savedVal.trim();
if (!result.containsKey(entry.getKey())) {
- result.put(entry.getKey(), new HashMap<String, ThreeWayValue>());
+ result.put(entry.getKey(), new HashMap<>());
}
result.get(entry.getKey()).put(prop, twv);
@@ -152,7 +152,7 @@ public class ConfigMergeHelper {
twv.savedValue = (null == savedVal) ? null : savedVal.trim();
if (!result.containsKey(entry.getKey())) {
- result.put(entry.getKey(), new HashMap<String, ThreeWayValue>());
+ result.put(entry.getKey(), new HashMap<>());
}
result.get(entry.getKey()).put(prop, twv);
@@ -168,7 +168,7 @@ public class ConfigMergeHelper {
String type = ConfigHelper.fileNameToConfigType(pi.getFilename());
if (!map.containsKey(type)) {
- map.put(type, new HashMap<String, String>());
+ map.put(type, new HashMap<>());
}
map.get(type).put(pi.getName(), pi.getValue());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index 325434e..573a197 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -186,7 +186,7 @@ public class ServiceInfo implements Validable{
private List<ServicePropertyInfo> servicePropertyList = Lists.newArrayList();
@XmlTransient
- private Map<String, String> servicePropertyMap = ImmutableMap.copyOf(ensureMandatoryServiceProperties(Maps.<String, String>newHashMap()));
+ private Map<String, String> servicePropertyMap = ImmutableMap.copyOf(ensureMandatoryServiceProperties(Maps.newHashMap()));
/**
*
@@ -633,7 +633,7 @@ public class ServiceInfo implements Validable{
*/
public synchronized Map<String, Map<String, Map<String, String>>> getConfigTypeAttributes() {
Map<String, Map<String, Map<String, String>>> tmpConfigTypes = configTypes == null ?
- new HashMap<String, Map<String, Map<String, String>>>() : configTypes;
+ new HashMap<>() : configTypes;
for(String excludedtype : excludedConfigTypes){
tmpConfigTypes.remove(excludedtype);
@@ -726,7 +726,7 @@ public class ServiceInfo implements Validable{
type = type.substring(0, idx);
if (!configLayout.containsKey(type))
- configLayout.put(type, new HashSet<String>());
+ configLayout.put(type, new HashSet<>());
configLayout.get(type).add(pi.getName());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index 1494488..149579f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -85,7 +85,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
/**
* List of services withnot configurations
* */
- private List<String> servicesWithNoConfigs = new ArrayList<String>();
+ private List<String> servicesWithNoConfigs = new ArrayList<>();
public String getMinJdk() {
return minJdk;
@@ -247,7 +247,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
*/
public synchronized Map<String, Map<String, Map<String, String>>> getConfigTypeAttributes() {
return configTypes == null ?
- Collections.<String, Map<String, Map<String, String>>>emptyMap() :
+ Collections.emptyMap() :
Collections.unmodifiableMap(configTypes);
}
@@ -344,7 +344,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
isActive(), getParentStackVersion(), getConfigTypeAttributes(),
(stackDescriptorFileFilePath == null) ? null : new File(stackDescriptorFileFilePath),
serviceDescriptorFiles,
- null == upgradePacks ? Collections.<String>emptySet() : upgradePacks.keySet(),
+ null == upgradePacks ? Collections.emptySet() : upgradePacks.keySet(),
isValid(), getErrors(), getMinJdk(), getMaxJdk());
}
@@ -515,7 +515,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
Set<PropertyInfo.PropertyType> types = propertyInfo.getPropertyTypes();
for (PropertyInfo.PropertyType propertyType : types) {
if (!propertiesTypes.containsKey(propertyType))
- propertiesTypes.put(propertyType, new HashSet<String>());
+ propertiesTypes.put(propertyType, new HashSet<>());
propertiesTypes.get(propertyType).add(propertyInfo.getName());
}
}
@@ -551,10 +551,10 @@ public class StackInfo implements Comparable<StackInfo>, Validable {
String hidden = pi.getPropertyValueAttributes().getHidden();
if(hidden != null){
if(!result.containsKey(propertyConfigType)){
- result.put(propertyConfigType, new HashMap<String, Map<String, String>>());
+ result.put(propertyConfigType, new HashMap<>());
}
if(!result.get(propertyConfigType).containsKey("hidden")){
- result.get(propertyConfigType).put("hidden", new HashMap<String, String>());
+ result.get(propertyConfigType).put("hidden", new HashMap<>());
}
result.get(propertyConfigType).get("hidden").put(propertyName, hidden);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
index b3f482c..9e66399 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
@@ -81,7 +81,7 @@ public class AggregateDefinitionMapping {
Long id = Long.valueOf(clusterId);
if (!m_aggregateMap.containsKey(id)) {
- m_aggregateMap.put(id, new HashMap<String, AlertDefinition>());
+ m_aggregateMap.put(id, new HashMap<>());
}
Map<String, AlertDefinition> map = m_aggregateMap.get(id);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index c191358..84b411c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -378,16 +378,14 @@ public class ClusterImpl implements Cluster {
/* get all the service component hosts **/
Service service = serviceKV.getValue();
if (!serviceComponentHosts.containsKey(service.getName())) {
- serviceComponentHosts.put(service.getName(),
- new ConcurrentHashMap<String, ConcurrentMap<String, ServiceComponentHost>>());
+ serviceComponentHosts.put(service.getName(), new ConcurrentHashMap<>());
}
for (Entry<String, ServiceComponent> svcComponent : service.getServiceComponents().entrySet()) {
ServiceComponent comp = svcComponent.getValue();
String componentName = svcComponent.getKey();
if (!serviceComponentHosts.get(service.getName()).containsKey(componentName)) {
- serviceComponentHosts.get(service.getName()).put(componentName,
- new ConcurrentHashMap<String, ServiceComponentHost>());
+ serviceComponentHosts.get(service.getName()).put(componentName, new ConcurrentHashMap<>());
}
// Get Service Host Components
@@ -395,8 +393,7 @@ public class ClusterImpl implements Cluster {
String hostname = svchost.getKey();
ServiceComponentHost svcHostComponent = svchost.getValue();
if (!serviceComponentHostsByHost.containsKey(hostname)) {
- serviceComponentHostsByHost.put(hostname,
- new CopyOnWriteArrayList<ServiceComponentHost>());
+ serviceComponentHostsByHost.put(hostname, new CopyOnWriteArrayList<>());
}
List<ServiceComponentHost> compList = serviceComponentHostsByHost.get(hostname);
@@ -640,13 +637,11 @@ public class ClusterImpl implements Cluster {
}
if (!serviceComponentHosts.containsKey(serviceName)) {
- serviceComponentHosts.put(serviceName,
- new ConcurrentHashMap<String, ConcurrentMap<String, ServiceComponentHost>>());
+ serviceComponentHosts.put(serviceName, new ConcurrentHashMap<>());
}
if (!serviceComponentHosts.get(serviceName).containsKey(componentName)) {
- serviceComponentHosts.get(serviceName).put(componentName,
- new ConcurrentHashMap<String, ServiceComponentHost>());
+ serviceComponentHosts.get(serviceName).put(componentName, new ConcurrentHashMap<>());
}
if (serviceComponentHosts.get(serviceName).get(componentName).containsKey(
@@ -657,8 +652,7 @@ public class ClusterImpl implements Cluster {
}
if (!serviceComponentHostsByHost.containsKey(hostname)) {
- serviceComponentHostsByHost.put(hostname,
- new CopyOnWriteArrayList<ServiceComponentHost>());
+ serviceComponentHostsByHost.put(hostname, new CopyOnWriteArrayList<>());
}
if (LOG.isDebugEnabled()) {
@@ -1162,7 +1156,7 @@ public class ClusterImpl implements Cluster {
clusterGlobalLock.writeLock().lock();
try {
if (!allConfigs.containsKey(config.getType())) {
- allConfigs.put(config.getType(), new ConcurrentHashMap<String, Config>());
+ allConfigs.put(config.getType(), new ConcurrentHashMap<>());
}
allConfigs.get(config.getType()).put(config.getTag(), config);
@@ -1624,8 +1618,7 @@ public class ClusterImpl implements Cluster {
Set<ServiceConfigVersionResponse> responses = getActiveServiceConfigVersionSet();
for (ServiceConfigVersionResponse response : responses) {
if (map.get(response.getServiceName()) == null) {
- map.put(response.getServiceName(),
- new ArrayList<ServiceConfigVersionResponse>());
+ map.put(response.getServiceName(), new ArrayList<>());
}
map.get(response.getServiceName()).add(response);
}
@@ -1745,7 +1738,7 @@ public class ClusterImpl implements Cluster {
* @return serviceConfigVersionResponse
*/
private ServiceConfigVersionResponse getServiceConfigVersionResponseWithConfig(ServiceConfigVersionResponse serviceConfigVersionResponse, ServiceConfigEntity serviceConfigEntity) {
- serviceConfigVersionResponse.setConfigurations(new ArrayList<ConfigurationResponse>());
+ serviceConfigVersionResponse.setConfigurations(new ArrayList<>());
List<ClusterConfigEntity> clusterConfigEntities = serviceConfigEntity.getClusterConfigEntities();
for (ClusterConfigEntity clusterConfigEntity : clusterConfigEntities) {
Config config = allConfigs.get(clusterConfigEntity.getType()).get(
@@ -1807,7 +1800,7 @@ public class ClusterImpl implements Cluster {
Collection<String> configTypes = serviceConfigTypes.get(serviceName);
List<ClusterConfigEntity> enabledConfigs = clusterDAO.getEnabledConfigsByTypes(clusterId, configTypes);
List<ClusterConfigEntity> serviceConfigEntities = serviceConfigEntity.getClusterConfigEntities();
- ArrayList<ClusterConfigEntity> duplicatevalues = new ArrayList<ClusterConfigEntity>(serviceConfigEntities);
+ ArrayList<ClusterConfigEntity> duplicatevalues = new ArrayList<>(serviceConfigEntities);
duplicatevalues.retainAll(enabledConfigs);
enabledConfigs.removeAll(duplicatevalues);
serviceConfigEntities.removeAll(duplicatevalues);
@@ -1967,7 +1960,7 @@ public class ClusterImpl implements Cluster {
Map<Long, Map<String, DesiredConfig>> desiredConfigsByHost = new HashMap<>();
for (Long hostId : hostIds) {
- desiredConfigsByHost.put(hostId, new HashMap<String, DesiredConfig>());
+ desiredConfigsByHost.put(hostId, new HashMap<>());
}
for (HostConfigMapping mappingEntity : mappingEntities) {
@@ -2169,7 +2162,7 @@ public class ClusterImpl implements Cluster {
//todo: in what conditions is AmbariException thrown?
throw new RuntimeException("Unable to get hosts for cluster: " + clusterName, e);
}
- return hosts == null ? Collections.<Host>emptyList() : hosts.values();
+ return hosts == null ? Collections.emptyList() : hosts.values();
}
private ClusterHealthReport getClusterHealthReport(
@@ -2310,7 +2303,7 @@ public class ClusterImpl implements Cluster {
Map<String, Object> attributes =
(Map<String, Object>) getSessionManager().getAttribute(getClusterSessionAttributeName());
- return attributes == null ? Collections.<String, Object>emptyMap() : attributes;
+ return attributes == null ? Collections.emptyMap() : attributes;
}
/**
@@ -2521,7 +2514,7 @@ public class ClusterImpl implements Cluster {
for (ClusterConfigEntity entity : clusterEntity.getClusterConfigEntities()) {
if (!allConfigs.containsKey(entity.getType())) {
- allConfigs.put(entity.getType(), new ConcurrentHashMap<String, Config>());
+ allConfigs.put(entity.getType(), new ConcurrentHashMap<>());
}
Config config = configFactory.createExisting(this, entity);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
index 26efc84..5ac1ac3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
@@ -177,7 +177,7 @@ public class ClustersImpl implements Clusters {
Cluster currentCluster = clusterFactory.create(clusterEntity);
clusters.put(clusterEntity.getClusterName(), currentCluster);
clustersById.put(currentCluster.getClusterId(), currentCluster);
- clusterHostMap.put(currentCluster.getClusterName(), Collections.newSetFromMap(new ConcurrentHashMap<Host, Boolean>()));
+ clusterHostMap.put(currentCluster.getClusterName(), Collections.newSetFromMap(new ConcurrentHashMap<>()));
}
for (HostEntity hostEntity : hostEntities) {
@@ -243,7 +243,7 @@ public class ClustersImpl implements Clusters {
clusters.put(clusterName, cluster);
clustersById.put(cluster.getClusterId(), cluster);
clusterHostMap.put(clusterName,
- Collections.newSetFromMap(new ConcurrentHashMap<Host, Boolean>()));
+ Collections.newSetFromMap(new ConcurrentHashMap<>()));
cluster.setCurrentStackVersion(stackId);
}
@@ -370,7 +370,7 @@ public class ClustersImpl implements Clusters {
HostEntity hostEntity = new HostEntity();
hostEntity.setHostName(hostname);
- hostEntity.setClusterEntities(new ArrayList<ClusterEntity>());
+ hostEntity.setClusterEntities(new ArrayList<>());
// not stored to DB
Host host = hostFactory.create(hostEntity);
@@ -378,7 +378,7 @@ public class ClustersImpl implements Clusters {
List<DiskInfo> emptyDiskList = new CopyOnWriteArrayList<>();
host.setDisksInfo(emptyDiskList);
host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, ""));
- host.setHostAttributes(new ConcurrentHashMap<String, String>());
+ host.setHostAttributes(new ConcurrentHashMap<>());
host.setState(HostState.INIT);
// the hosts by ID map is updated separately since the host has not yet
@@ -386,7 +386,7 @@ public class ClustersImpl implements Clusters {
hosts.put(hostname, host);
hostClusterMap.put(hostname,
- Collections.newSetFromMap(new ConcurrentHashMap<Cluster, Boolean>()));
+ Collections.newSetFromMap(new ConcurrentHashMap<>()));
if (LOG.isDebugEnabled()) {
LOG.debug("Adding a host to Clusters, hostname={}", hostname);
@@ -424,7 +424,7 @@ public class ClustersImpl implements Clusters {
for (String clusterName : hostClusterNames) {
if (clusterName != null && !clusterName.isEmpty()) {
if (!clusterHosts.containsKey(clusterName)) {
- clusterHosts.put(clusterName, new HashSet<String>());
+ clusterHosts.put(clusterName, new HashSet<>());
}
clusterHosts.get(clusterName).add(hostname);
}
@@ -774,7 +774,7 @@ public class ClustersImpl implements Clusters {
@Override
public Map<String, Object> getSessionAttributes(String name) {
Cluster cluster = findCluster(name);
- return cluster == null ? Collections.<String, Object>emptyMap() : cluster.getSessionAttributes();
+ return cluster == null ? Collections.emptyMap() : cluster.getSessionAttributes();
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
index 73267b6..d1fbf1d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
@@ -124,10 +124,10 @@ public class ConfigGroupImpl implements ConfigGroup {
configGroupEntity.setDescription(description);
configGroupEntity.setServiceName(serviceName);
- m_hosts = hosts == null ? new ConcurrentHashMap<Long, Host>()
+ m_hosts = hosts == null ? new ConcurrentHashMap<>()
: new ConcurrentHashMap<>(hosts);
- m_configurations = configurations == null ? new ConcurrentHashMap<String, Config>()
+ m_configurations = configurations == null ? new ConcurrentHashMap<>()
: new ConcurrentHashMap<>(configurations);
// save the entity and grab the ID
@@ -364,8 +364,7 @@ public class ConfigGroupImpl implements ConfigGroup {
// Delete existing mappings and create new ones
configGroupHostMappingDAO.removeAllByGroup(configGroupEntity.getGroupId());
- configGroupEntity.setConfigGroupHostMappingEntities(
- new HashSet<ConfigGroupHostMappingEntity>());
+ configGroupEntity.setConfigGroupHostMappingEntities(new HashSet<>());
if (hosts != null && !hosts.isEmpty()) {
configGroupEntity = persistHostMapping(hosts.values(), configGroupEntity);
@@ -408,8 +407,7 @@ public class ConfigGroupImpl implements ConfigGroup {
void persistConfigMapping(ClusterEntity clusterEntity, ConfigGroupEntity configGroupEntity,
Map<String, Config> configurations) throws AmbariException {
configGroupConfigMappingDAO.removeAllByGroup(configGroupEntity.getGroupId());
- configGroupEntity.setConfigGroupConfigMappingEntities(
- new HashSet<ConfigGroupConfigMappingEntity>());
+ configGroupEntity.setConfigGroupConfigMappingEntities(new HashSet<>());
if (configurations != null && !configurations.isEmpty()) {
for (Entry<String, Config> entry : configurations.entrySet()) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
index 3ceaa48..274a425 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
@@ -1049,7 +1049,7 @@ public class HostImpl implements Host {
}
}
- Map<Long, ConfigGroup> configGroups = (cluster == null) ? new HashMap<Long, ConfigGroup>() : cluster.getConfigGroupsByHostname(getHostName());
+ Map<Long, ConfigGroup> configGroups = (cluster == null) ? new HashMap<>() : cluster.getConfigGroupsByHostname(getHostName());
if (configGroups != null && !configGroups.isEmpty()) {
for (ConfigGroup configGroup : configGroups.values()) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
index 38100ac..7f53daa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
@@ -185,15 +185,15 @@ public abstract class AbstractKerberosDescriptor {
}
public static <T> Collection<T> nullToEmpty(Collection<T> collection) {
- return collection == null ? Collections.<T>emptyList() : collection;
+ return collection == null ? Collections.emptyList() : collection;
}
public static <T> List<T> nullToEmpty(List<T> list) {
- return list == null ? Collections.<T>emptyList() : list;
+ return list == null ? Collections.emptyList() : list;
}
public static <K,V> Map<K,V> nullToEmpty(Map<K,V> collection) {
- return collection == null ? Collections.<K,V>emptyMap() : collection;
+ return collection == null ? Collections.emptyMap() : collection;
}
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
index 0777327..771a23c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
@@ -275,7 +275,7 @@ public class KerberosServiceDescriptor extends AbstractKerberosDescriptorContain
public List<KerberosIdentityDescriptor> getComponentIdentities(String componentName) {
return getComponent(componentName) != null
? nullToEmpty(getComponent(componentName).getIdentities())
- : Collections.<KerberosIdentityDescriptor>emptyList();
+ : Collections.emptyList();
}
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/DefaultQuickLinkVisibilityController.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/DefaultQuickLinkVisibilityController.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/DefaultQuickLinkVisibilityController.java
index 730f01b..d0b0442 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/DefaultQuickLinkVisibilityController.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/DefaultQuickLinkVisibilityController.java
@@ -91,17 +91,17 @@ public class DefaultQuickLinkVisibilityController implements QuickLinkVisibility
}
else {
FilterEvaluator componentEvaluator = componentRules.get(ServiceComponent.of(service, quickLink.getComponentName()));
- return componentEvaluator != null ? componentEvaluator.isVisible(quickLink) : Optional.<Boolean>absent();
+ return componentEvaluator != null ? componentEvaluator.isVisible(quickLink) : Optional.absent();
}
}
private Optional<Boolean> evaluateServiceRules(@Nonnull String service, @Nonnull Link quickLink) {
return serviceRules.containsKey(service) ?
- serviceRules.get(service).isVisible(quickLink) : Optional.<Boolean>absent();
+ serviceRules.get(service).isVisible(quickLink) : Optional.absent();
}
static <T> List<T> nullToEmptyList(@Nullable List<T> items) {
- return items != null ? items : Collections.<T>emptyList();
+ return items != null ? items : Collections.emptyList();
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
index 45d8e8e..3ef3991 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
@@ -132,7 +132,7 @@ public class VersionDefinitionXml {
if (availableServices.isEmpty()) {
// !!! populate available services from the manifest
for (ManifestService ms : manifests.values()) {
- addToAvailable(ms, stack, Collections.<String>emptySet());
+ addToAvailable(ms, stack, Collections.emptySet());
}
} else {
for (AvailableServiceReference ref : availableServices) {
@@ -193,7 +193,7 @@ public class VersionDefinitionXml {
String name = manifest.serviceName;
if (!manifestVersions.containsKey(name)) {
- manifestVersions.put(manifest.serviceName, new TreeSet<String>());
+ manifestVersions.put(manifest.serviceName, new TreeSet<>());
}
manifestVersions.get(manifest.serviceName).add(manifest.version);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
index 73a661d..c7de5d0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
@@ -197,7 +197,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
*/
public AlertNoticeDispatchService() {
m_executor = new ThreadPoolExecutor(0, 2, 5L, TimeUnit.MINUTES,
- new LinkedBlockingQueue<Runnable>(), new AlertDispatchThreadFactory(),
+ new LinkedBlockingQueue<>(), new AlertDispatchThreadFactory(),
new ThreadPoolExecutor.CallerRunsPolicy());
GsonBuilder gsonBuilder = new GsonBuilder();
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
index db02e95..1320a43 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigUpgradePack.java
@@ -122,7 +122,7 @@ public class ConfigUpgradePack {
for (ConfigUpgradePack configUpgradePack : cups) {
for (AffectedService service : configUpgradePack.services) {
if (! mergedServiceMap.containsKey(service.name)) {
- mergedServiceMap.put(service.name, new HashMap<String, AffectedComponent>());
+ mergedServiceMap.put(service.name, new HashMap<>());
}
Map<String, AffectedComponent> mergedComponentMap = mergedServiceMap.get(service.name);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
index b0d961c..c0483e8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
@@ -229,6 +229,6 @@ public class OsFamily {
*/
public Map<String, String> getAliases() {
return (null == jsonOsFamily || null == jsonOsFamily.getAliases()) ?
- Collections.<String, String>emptyMap() : jsonOsFamily.getAliases();
+ Collections.emptyMap() : jsonOsFamily.getAliases();
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
index 7ad0257..65038e2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
@@ -244,7 +244,7 @@ public class ClusterGrouping extends Grouping {
return new StageWrapper(
StageWrapper.Type.SERVER_SIDE_ACTION,
execution.title,
- new TaskWrapper(null, null, Collections.<String>emptySet(), task));
+ new TaskWrapper(null, null, Collections.emptySet(), task));
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
index 18f8cce..f8daf82 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
@@ -208,7 +208,7 @@ public class ColocatedGrouping extends Grouping {
StageWrapper wrapper = new StageWrapper(
StageWrapper.Type.SERVER_SIDE_ACTION,
"Validate Partial " + upgradeContext.getDirection().getText(true),
- new TaskWrapper(null, null, Collections.<String>emptySet(), task));
+ new TaskWrapper(null, null, Collections.emptySet(), task));
results.add(wrapper);
}
@@ -277,7 +277,7 @@ public class ColocatedGrouping extends Grouping {
List<TaskWrapper> tasks = new ArrayList<>();
Set<String> displays = new HashSet<>();
for (String service : serviceChecks) {
- tasks.add(new TaskWrapper(service, "", Collections.<String>emptySet(), new ServiceCheckTask()));
+ tasks.add(new TaskWrapper(service, "", Collections.emptySet(), new ServiceCheckTask()));
displays.add(service);
}
@@ -309,7 +309,7 @@ public class ColocatedGrouping extends Grouping {
for (String host : tw.getHosts()) {
if (!compLocations.containsKey(host)) {
- compLocations.put(host, new HashSet<String>());
+ compLocations.put(host, new HashSet<>());
}
compLocations.get(host).add(tw.getComponent());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
index bfa0b5b..a2257d9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
@@ -266,7 +266,7 @@ public class Grouping {
List<String> displays = new ArrayList<>();
for (String service : m_servicesToCheck) {
tasks.add(new TaskWrapper(
- service, "", Collections.<String>emptySet(), new ServiceCheckTask()));
+ service, "", Collections.emptySet(), new ServiceCheckTask()));
displays.add(upgradeContext.getServiceDisplay(service));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java
index dd2dd02..acf0639 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/HostOrderGrouping.java
@@ -280,7 +280,7 @@ public class HostOrderGrouping extends Grouping {
}
StageWrapper manualWrapper = new StageWrapper(StageWrapper.Type.SERVER_SIDE_ACTION, "Manual Confirmation",
- new TaskWrapper(null, null, Collections.<String>emptySet(), mt));
+ new TaskWrapper(null, null, Collections.emptySet(), mt));
wrappers.add(manualWrapper);
@@ -319,7 +319,7 @@ public class HostOrderGrouping extends Grouping {
StageWrapper wrapper = new StageWrapper(StageWrapper.Type.SERVICE_CHECK,
String.format("Service Check %s", upgradeContext.getServiceDisplay(serviceName)),
- new TaskWrapper(serviceName, "", Collections.<String>emptySet(), new ServiceCheckTask()));
+ new TaskWrapper(serviceName, "", Collections.emptySet(), new ServiceCheckTask()));
wrappers.add(wrapper);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
index bf47af0..60ad446 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
@@ -268,7 +268,7 @@ public class RepositoryVersionHelper {
}
List<ServiceOsSpecific.Package> packagesForService = amc.getPackagesForServiceHost(info,
- new HashMap<String, String>(), osFamily);
+ new HashMap<>(), osFamily);
List<String> blacklistedPackagePrefixes = configuration.get().getRollingUpgradeSkipPackagesPrefixes();
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
index 44c8ae1..9c47e5d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
@@ -279,7 +279,7 @@ public class ServiceCheckGrouping extends Grouping {
ServiceCheckStageWrapper(String service, String serviceDisplay, boolean priority) {
super(StageWrapper.Type.SERVICE_CHECK,
String.format("Service Check %s", serviceDisplay),
- new TaskWrapper(service, "", Collections.<String>emptySet(), new ServiceCheckTask()));
+ new TaskWrapper(service, "", Collections.emptySet(), new ServiceCheckTask()));
this.service = service;
this.priority = priority;
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
index 70589ec..79147aa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
@@ -78,7 +78,7 @@ public class StageWrapper {
public StageWrapper(Type type, String text, Map<String, String> params, List<TaskWrapper> tasks) {
this.type = type;
this.text = text;
- this.params = (params == null ? Collections.<String, String>emptyMap() : params);
+ this.params = (params == null ? Collections.emptyMap() : params);
this.tasks = tasks;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java
index 7fd8938..94e51d1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapperBuilder.java
@@ -154,7 +154,7 @@ public abstract class StageWrapperBuilder {
skippedFailedCheck.messages.add(AUTO_SKIPPED_MESSAGE);
TaskWrapper skippedFailedTaskWrapper = new TaskWrapper(null, null,
- Collections.<String> emptySet(), skippedFailedCheck);
+ Collections.emptySet(), skippedFailedCheck);
StageWrapper skippedFailedStageWrapper = new StageWrapper(
StageWrapper.Type.SERVER_SIDE_ACTION, "Verifying Skipped Failures",
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapper.java
index 8a87ff1..56047d7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapper.java
@@ -75,7 +75,7 @@ public class TaskWrapper {
component = c;
this.hosts = hosts;
- this.params = (params == null) ? new HashMap<String, String>() : params;
+ this.params = (params == null) ? new HashMap<>() : params;
this.tasks = tasks;
// !!! FIXME there should only be one task
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
index 7fcc778..8c83ed6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java
@@ -622,7 +622,7 @@ public class BlueprintImpl implements Blueprint {
* @return set of repositories
* */
private void processRepoSettings(){
- repoSettings = new ArrayList<RepositorySetting>();
+ repoSettings = new ArrayList<>();
if (setting != null){
Set<HashMap<String, String>> settingValue = setting.getSettingValue(Setting.SETTING_NAME_REPOSITORY_SETTINGS);
for (Map<String, String> setting : settingValue) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
index 28752c4..7bd377f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java
@@ -82,7 +82,7 @@ public class ClusterConfigurationRequest {
this.stackAdvisorBlueprintProcessor = stackAdvisorBlueprintProcessor;
removeOrphanConfigTypes();
if (setInitial) {
- setConfigurationsOnCluster(clusterTopology, TopologyManager.INITIAL_CONFIG_TAG, Collections.<String>emptySet());
+ setConfigurationsOnCluster(clusterTopology, TopologyManager.INITIAL_CONFIG_TAG, Collections.emptySet());
}
}
@@ -240,7 +240,7 @@ public class ClusterConfigurationRequest {
Collection<String> components = blueprint.getComponents(service);
serviceComponents.put(service,
(components == null)
- ? Collections.<String>emptySet()
+ ? Collections.emptySet()
: new HashSet<>(blueprint.getComponents(service)));
}
}
@@ -304,7 +304,7 @@ public class ClusterConfigurationRequest {
Configuration clusterConfiguration = clusterTopology.getConfiguration();
Map<String, Map<String, String>> existingConfigurations = clusterConfiguration.getFullProperties();
- existingConfigurations.put(CLUSTER_HOST_INFO, new HashMap<String, String>());
+ existingConfigurations.put(CLUSTER_HOST_INFO, new HashMap<>());
// apply Kerberos specific configurations
Map<String, Map<String, String>> updatedConfigs = AmbariContext.getController().getKerberosHelper()
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java
index 983e83e..28b62bc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/Configuration.java
@@ -123,7 +123,7 @@ public class Configuration {
}
Map<String, Map<String, String>> mergedProperties = parentConfiguration == null ?
- new HashMap<String, Map<String, String>>() :
+ new HashMap<>() :
new HashMap<>(parentConfiguration.getFullProperties(--depthLimit));
for (Map.Entry<String, Map<String, String>> entry : properties.entrySet()) {
@@ -158,7 +158,7 @@ public class Configuration {
*/
public Map<String, Map<String, Map<String, String>>> getFullAttributes() {
Map<String, Map<String, Map<String, String>>> mergedAttributeMap = parentConfiguration == null ?
- new HashMap<String, Map<String, Map<String, String>>>() :
+ new HashMap<>() :
new HashMap<>(parentConfiguration.getFullAttributes());
for (Map.Entry<String, Map<String, Map<String, String>>> typeEntry : attributes.entrySet()) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java
index c8a655a..9aeadd1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java
@@ -206,7 +206,7 @@ public class HostGroupImpl implements HostGroup {
public Collection<String> getComponents(String service) {
return componentsForService.containsKey(service) ?
new HashSet<>(componentsForService.get(service)) :
- Collections.<String>emptySet();
+ Collections.emptySet();
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
index 2c4e25e..7045912 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
@@ -191,7 +191,7 @@ public class HostRequest implements Comparable<HostRequest> {
InstallHostTask installTask = new InstallHostTask(topology, this, skipFailure);
topologyTasks.add(installTask);
- logicalTaskMap.put(installTask, new HashMap<String, Long>());
+ logicalTaskMap.put(installTask, new HashMap<>());
boolean skipStartTaskCreate = topology.getProvisionAction().equals(INSTALL_ONLY);
boolean skipInstallTaskCreate = topology.getProvisionAction().equals(START_ONLY);
@@ -200,7 +200,7 @@ public class HostRequest implements Comparable<HostRequest> {
if (!skipStartTaskCreate) {
startTask = new StartHostTask(topology, this, skipFailure);
topologyTasks.add(startTask);
- logicalTaskMap.put(startTask, new HashMap<String, Long>());
+ logicalTaskMap.put(startTask, new HashMap<>());
} else {
LOG.info("Skipping Start task creation since provision action = " + topology.getProvisionAction());
}
@@ -256,14 +256,14 @@ public class HostRequest implements Comparable<HostRequest> {
topologyTasks.add(new RegisterWithConfigGroupTask(topology, this));
InstallHostTask installTask = new InstallHostTask(topology, this, skipFailure);
topologyTasks.add(installTask);
- logicalTaskMap.put(installTask, new HashMap<String, Long>());
+ logicalTaskMap.put(installTask, new HashMap<>());
boolean skipStartTaskCreate = topology.getProvisionAction().equals(INSTALL_ONLY);
if (!skipStartTaskCreate) {
StartHostTask startTask = new StartHostTask(topology, this, skipFailure);
topologyTasks.add(startTask);
- logicalTaskMap.put(startTask, new HashMap<String, Long>());
+ logicalTaskMap.put(startTask, new HashMap<>());
}
AmbariContext ambariContext = topology.getAmbariContext();
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java
index 2f08115..b63bbad 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java
@@ -506,7 +506,7 @@ public class LogicalRequest extends Request {
String hostGroupName = hostGroupEntity.getName();
if ( !reservedHostNamesByHostGroups.containsKey(hostGroupName) )
- reservedHostNamesByHostGroups.put(hostGroupName, new HashSet<String>());
+ reservedHostNamesByHostGroups.put(hostGroupName, new HashSet<>());
for (TopologyHostInfoEntity hostInfoEntity: hostGroupEntity.getTopologyHostInfoEntities()) {
if (StringUtils.isNotEmpty(hostInfoEntity.getFqdn())) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
index e64a16e..0273564 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/PersistedStateImpl.java
@@ -208,7 +208,7 @@ public class PersistedStateImpl implements PersistedState {
clusterTopology.setProvisionAction(entity.getProvisionAction());
}
topologyRequests.put(replayedRequest.getClusterId(), clusterTopology);
- allRequests.put(clusterTopology, new ArrayList<LogicalRequest>());
+ allRequests.put(clusterTopology, new ArrayList<>());
} catch (InvalidTopologyException e) {
throw new RuntimeException("Failed to construct cluster topology while replaying request: " + e, e);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
index 02c53cb..5b58e1d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
@@ -391,8 +391,8 @@ public class TopologyManager {
properties.put(CredentialResourceProvider.CREDENTIAL_KEY_PROPERTY_ID, credential.getKey());
properties.put(CredentialResourceProvider.CREDENTIAL_TYPE_PROPERTY_ID, credential.getType().name());
- org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.<String>emptySet(),
- Collections.singleton(properties), Collections.<String, String>emptyMap(), null);
+ org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.emptySet(),
+ Collections.singleton(properties), Collections.emptyMap(), null);
try {
RequestStatus status = provider.createResources(request);
@@ -443,7 +443,7 @@ public class TopologyManager {
requestInfoProps.put(org.apache.ambari.server.controller.spi.Request.REQUEST_INFO_BODY_PROPERTY,
"{\"" + ArtifactResourceProvider.ARTIFACT_DATA_PROPERTY + "\": " + descriptor + "}");
- org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.<String>emptySet(),
+ org.apache.ambari.server.controller.spi.Request request = new RequestImpl(Collections.emptySet(),
Collections.singleton(properties), requestInfoProps, null);
try {
@@ -745,7 +745,7 @@ public class TopologyManager {
public Collection<HostRoleCommand> getTasks(long requestId) {
ensureInitialized();
LogicalRequest request = allRequests.get(requestId);
- return request == null ? Collections.<HostRoleCommand>emptyList() : request.getCommands();
+ return request == null ? Collections.emptyList() : request.getCommands();
}
public Collection<HostRoleCommand> getTasks(Collection<Long> requestIds) {
@@ -761,7 +761,7 @@ public class TopologyManager {
public Map<Long, HostRoleCommandStatusSummaryDTO> getStageSummaries(Long requestId) {
ensureInitialized();
LogicalRequest request = allRequests.get(requestId);
- return request == null ? Collections.<Long, HostRoleCommandStatusSummaryDTO>emptyMap() :
+ return request == null ? Collections.emptyMap() :
request.getStageSummaries();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredConfigPropertiesValidator.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredConfigPropertiesValidator.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredConfigPropertiesValidator.java
index 4315bf2..4022fcb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredConfigPropertiesValidator.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredConfigPropertiesValidator.java
@@ -179,7 +179,7 @@ public class RequiredConfigPropertiesValidator implements TopologyValidator {
}
if (!missing.containsKey(hostGroup)) {
- missing.put(hostGroup, new TreeSet<String>());
+ missing.put(hostGroup, new TreeSet<>());
}
missing.get(hostGroup).addAll(values);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 1d277a7..1f10d7e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -397,17 +397,17 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog {
// Do nothing
} else if (upgradeBehavior.isDelete()) {
if (!toRemoveProperties.containsKey(configType)) {
- toRemoveProperties.put(configType, new HashSet<String>());
+ toRemoveProperties.put(configType, new HashSet<>());
}
toRemoveProperties.get(configType).add(property.getName());
} else if (upgradeBehavior.isUpdate()) {
if (!toUpdateProperties.containsKey(configType)) {
- toUpdateProperties.put(configType, new HashSet<String>());
+ toUpdateProperties.put(configType, new HashSet<>());
}
toUpdateProperties.get(configType).add(property.getName());
} else if (upgradeBehavior.isAdd()) {
if (!toAddProperties.containsKey(configType)) {
- toAddProperties.put(configType, new HashSet<String>());
+ toAddProperties.put(configType, new HashSet<>());
}
toAddProperties.get(configType).add(property.getName());
}
@@ -426,7 +426,7 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog {
for (Entry<String, Set<String>> toRemove : toRemoveProperties.entrySet()) {
String newPropertyKey = toRemove.getKey();
- updateConfigurationPropertiesWithValuesFromXml(newPropertyKey, Collections.<String>emptySet(), toRemove.getValue(), false, true);
+ updateConfigurationPropertiesWithValuesFromXml(newPropertyKey, Collections.emptySet(), toRemove.getValue(), false, true);
}
}
}
@@ -626,7 +626,7 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog {
protected void removeConfigurationPropertiesFromCluster(Cluster cluster, String configType, Set<String> removePropertiesList)
throws AmbariException {
- updateConfigurationPropertiesForCluster(cluster, configType, new HashMap<String, String>(), removePropertiesList, false, true);
+ updateConfigurationPropertiesForCluster(cluster, configType, new HashMap<>(), removePropertiesList, false, true);
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
index 9409f70..b6287e6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
@@ -271,7 +271,7 @@ public class StageUtils {
}
public static Map<String, String> getCommandParamsStage(ActionExecutionContext actionExecContext, String requestContext) throws AmbariException {
- Map<String, String> commandParams = actionExecContext.getParameters() != null ? actionExecContext.getParameters() : new TreeMap<String, String>();
+ Map<String, String> commandParams = actionExecContext.getParameters() != null ? actionExecContext.getParameters() : new TreeMap<>();
if (StringUtils.isNotEmpty(requestContext) && requestContext.toLowerCase().contains("rolling-restart")) {
commandParams.put("rolling_restart", "true");
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
index f6a8789..da4e469 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewContextImpl.java
@@ -339,7 +339,7 @@ public class ViewContextImpl implements ViewContext, ViewController {
@Override
public Collection<ViewDefinition> getViewDefinitions() {
- return Collections.<ViewDefinition>unmodifiableCollection(viewRegistry.getDefinitions());
+ return Collections.unmodifiableCollection(viewRegistry.getDefinitions());
}
@Override
@@ -348,7 +348,7 @@ public class ViewContextImpl implements ViewContext, ViewController {
for (ViewEntity viewEntity : viewRegistry.getDefinitions()) {
instanceDefinitions.addAll(viewRegistry.getInstanceDefinitions(viewEntity));
}
- return Collections.<ViewInstanceDefinition>unmodifiableCollection(instanceDefinitions);
+ return Collections.unmodifiableCollection(instanceDefinitions);
}
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
index a13b01e..f3ba720 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java
@@ -294,7 +294,7 @@ public class ViewDataMigrationContextImpl implements ViewDataMigrationContext {
for (ViewInstanceDataEntity entity : instanceDefinition.getData()) {
if (!instanceDataByUser.containsKey(entity.getUser())) {
- instanceDataByUser.put(entity.getUser(), new HashMap<String, String>());
+ instanceDataByUser.put(entity.getUser(), new HashMap<>());
}
instanceDataByUser.get(entity.getUser()).put(entity.getName(), entity.getValue());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java
index 349b647..4b3b8fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java
@@ -324,13 +324,13 @@ public class ViewURLStreamProvider implements org.apache.ambari.view.URLStreamPr
String[] hostAndPort = hostPortStr.trim().split(":");
if (hostAndPort.length == 1) {
if (!allowed.containsKey(hostAndPort[0])) {
- allowed.put(hostAndPort[0], new HashSet<String>());
+ allowed.put(hostAndPort[0], new HashSet<>());
}
allowed.get(hostAndPort[0]).add("*");
LOG.debug("Allow proxy to host {} and all ports.", hostAndPort[0]);
} else {
if (!allowed.containsKey(hostAndPort[0])) {
- allowed.put(hostAndPort[0], new HashSet<String>());
+ allowed.put(hostAndPort[0], new HashSet<>());
}
allowed.get(hostAndPort[0]).add(hostAndPort[1]);
LOG.debug("Allow proxy to host {} and port {}", hostAndPort[0], hostAndPort[1]);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/InstanceConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/InstanceConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/InstanceConfig.java
index b61ea4e..40f33e3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/InstanceConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/InstanceConfig.java
@@ -136,7 +136,7 @@ public class InstanceConfig {
* @return the instance properties
*/
public List<PropertyConfig> getProperties() {
- return properties == null ? Collections.<PropertyConfig>emptyList() : properties;
+ return properties == null ? Collections.emptyList() : properties;
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/PersistenceConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/PersistenceConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/PersistenceConfig.java
index c4b32a4..7af1100 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/PersistenceConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/PersistenceConfig.java
@@ -41,6 +41,6 @@ public class PersistenceConfig {
* @return the entity configurations
*/
public List<EntityConfig> getEntities() {
- return entities == null ? Collections.<EntityConfig>emptyList() : entities;
+ return entities == null ? Collections.emptyList() : entities;
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ResourceConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ResourceConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ResourceConfig.java
index 4457491..6e9bb26 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ResourceConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ResourceConfig.java
@@ -128,7 +128,7 @@ public class ResourceConfig {
* @return the sub-resource names
*/
public List<String> getSubResourceNames() {
- return subResourceNames == null ? Collections.<String>emptyList() : subResourceNames;
+ return subResourceNames == null ? Collections.emptyList() : subResourceNames;
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
index 9fa0c80..91ee03d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
@@ -409,7 +409,7 @@ public class ViewConfig {
* @return the list of parameters
*/
public List<ParameterConfig> getParameters() {
- return parameters == null ? Collections.<ParameterConfig>emptyList() : parameters;
+ return parameters == null ? Collections.emptyList() : parameters;
}
/**
@@ -418,7 +418,7 @@ public class ViewConfig {
* @return return the list of resources
*/
public List<ResourceConfig> getResources() {
- return resources == null ? Collections.<ResourceConfig>emptyList() : resources;
+ return resources == null ? Collections.emptyList() : resources;
}
/**
@@ -436,7 +436,7 @@ public class ViewConfig {
* @return the list of view instances
*/
public List<InstanceConfig> getInstances() {
- return instances == null ? Collections.<InstanceConfig>emptyList() : instances;
+ return instances == null ? Collections.emptyList() : instances;
}
/**
@@ -454,7 +454,7 @@ public class ViewConfig {
* @return the list of custom permissions
*/
public List<PermissionConfig> getPermissions() {
- return permissions == null ? Collections.<PermissionConfig>emptyList() : permissions;
+ return permissions == null ? Collections.emptyList() : permissions;
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ab8d58ba/ambari-server/src/main/java/org/apache/ambari/server/view/events/EventImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/events/EventImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/view/events/EventImpl.java
index 4c52d6b..05bdd16 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/events/EventImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/events/EventImpl.java
@@ -80,7 +80,7 @@ public class EventImpl implements Event {
this.id = id;
this.viewSubject = viewSubject;
this.viewInstanceSubject = viewInstanceSubject;
- this.properties = properties == null ? Collections.<String, String>emptyMap() :
+ this.properties = properties == null ? Collections.emptyMap() :
Collections.unmodifiableMap(properties);
}