You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by me...@apache.org on 2014/08/28 22:25:42 UTC
[2/2] git commit: continuation of Merging Merge branch
'4.0.0-grouping' of https://git-wip-us.apache.org/repos/asf/stratos into
4.0.0-grouping
continuation of Merging Merge branch '4.0.0-grouping' of https://git-wip-us.apache.org/repos/asf/stratos into 4.0.0-grouping
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/feeca27a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/feeca27a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/feeca27a
Branch: refs/heads/4.0.0-grouping
Commit: feeca27a82fbc82be22a02ab4540b7b62d75436a
Parents: 7578e26
Author: Martin Eppel <me...@cisco..com>
Authored: Thu Aug 28 13:23:54 2014 -0700
Committer: Martin Eppel <me...@cisco..com>
Committed: Thu Aug 28 13:23:54 2014 -0700
----------------------------------------------------------------------
.../git/impl/GitBasedArtifactRepository.java | 47 --
.../publisher/HealthStatisticsReader.java | 113 +++--
.../stratos/cli/RestCommandLineService.java | 18 +-
.../stratos/cli/commands/SubscribeCommand.java | 116 +----
.../rest/endpoint/services/ServiceUtils.java | 20 +-
.../distribution/src/main/bin/stratos.sh | 4 -
.../conf/templates/jndi.properties.template | 3 +-
.../distribution/src/main/conf/mincheck.drl | 8 +-
.../main/resources/CloudControllerService.wsdl | 438 +++++++++----------
9 files changed, 307 insertions(+), 460 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
index 49338a6..839a34b 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/artifact/deployment/synchronizer/git/impl/GitBasedArtifactRepository.java
@@ -438,54 +438,7 @@ public class GitBasedArtifactRepository {
}
}
- /* public boolean checkout(RepositoryInformation repositoryInformation) {
-
- if (log.isDebugEnabled()) {
-<<<<<<< HEAD
- log.debug("Artifact checkout will be done by thread " + Thread.currentThread().getName() + " - " +
- Thread.currentThread().getId());
- }
-
- int tenantId = Integer.parseInt(repositoryInformation.getTenantId());
-
- // if context for tenant is not initialized
- if(tenantToRepoContextMap.get(tenantId) == null) {
- initGitContext(repositoryInformation);
- }
-
- RepositoryContext gitRepoCtx = retrieveCachedGitContext(tenantId);
-
- if (gitRepoCtx == null) { // to handle super tenant scenario
- log.info("No git repository context information found for deployment synchronizer");
-=======
- log.debug("Artifact checkout done by thread " + Thread.currentThread().getName() + " - " +
- Thread.currentThread().getId());
- }
-
- int tenantId = Integer.parseInt(repositoryInformation.getTenantId());
-
- // if context for tenant is not initialized
- if (tenantToRepoContextMap.get(tenantId) == null)
- initGitContext(repositoryInformation);
-
-
- RepositoryContext gitRepoCtx = retrieveCachedGitContext(tenantId);
- if (gitRepoCtx == null) { //to handle super tenant scenario
- // if(log.isDebugEnabled())
- log.info("No git repository context information found for deployment synchronizer");
->>>>>>> 400
-
- return true;
- }
-
- synchronized (gitRepoCtx) {
- if (!gitRepoCtx.cloneExists())
- cloneRepository(gitRepoCtx);
-
- return pullArtifacts(gitRepoCtx);
- }
- } */
public boolean checkout (RepositoryInformation repositoryInformation) throws Exception {
int tenantId = Integer.parseInt(repositoryInformation.getTenantId());
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsReader.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsReader.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsReader.java
index 87a0e5a..c7c7e52 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsReader.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsReader.java
@@ -29,27 +29,31 @@ import org.apache.stratos.cartridge.agent.util.CartridgeAgentUtils;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.management.ManagementFactory;
-import java.io.IOException;
import java.util.Scanner;
/**
* Health statistics reader.
*/
-public class HealthStatisticsReader {
+public class HealthStatisticsReader implements IHealthStatisticsReader {
+
private static final int MB = 1024 * 1024;
private static final Log log = LogFactory.getLog(HealthStatisticsReader.class);
+
+ public boolean init() {
+ return true;
+ }
public static double getMemoryConsumption() {
- double totalMemory = 0, usedMemory = 0;
-
- if (isWindows()) {
- OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
- totalMemory = (double)(osBean.getTotalPhysicalMemorySize()/ MB);
- usedMemory = (double)((totalMemory - (osBean.getFreePhysicalMemorySize() / MB) ));
- } else {
- String fName = "/proc/meminfo";
- try {
- FileInputStream f = new FileInputStream(fName);
+ double totalMemory = 0, usedMemory = 0;
+
+ if (isWindows()) {
+ OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+ totalMemory = (double)(osBean.getTotalPhysicalMemorySize()/ MB);
+ usedMemory = (double)((totalMemory - (osBean.getFreePhysicalMemorySize() / MB) ));
+ } else {
+ String fName = "/proc/meminfo";
+ try {
+ FileInputStream f = new FileInputStream(fName);
/* $ cat /proc/meminfo
* MemTotal: 2056964 kB
@@ -57,59 +61,80 @@ public class HealthStatisticsReader {
* Buffers: 9776 kB
* Cached: 127220 kB
*/
- Scanner scanner = new Scanner(f).useDelimiter("\\D+");
- try {
- long memTotal = scanner.nextLong();
- long memFree = scanner.nextLong();
- long buffers = scanner.nextLong();
- long cached = scanner.nextLong();
-
- totalMemory = memTotal;
- usedMemory = memTotal - (memFree + buffers + cached);
- } catch (Exception ex) {
- log.error("Could not calculate memory usage.", ex);
- } finally {
- scanner.close();
- }
- } catch (IOException ex) {
- log.error("Could not calculate memory usage.", ex);
- }
- }
-
+ Scanner scanner = new Scanner(f).useDelimiter("\\D+");
+ try {
+ long memTotal = scanner.nextLong();
+ long memFree = scanner.nextLong();
+ long buffers = scanner.nextLong();
+ long cached = scanner.nextLong();
+
+ totalMemory = memTotal;
+ usedMemory = memTotal - (memFree + buffers + cached);
+ } catch (Exception ex) {
+ log.error("Could not calculate memory usage.", ex);
+ } finally {
+ scanner.close();
+ }
+ } catch (IOException ex) {
+ log.error("Could not calculate memory usage.", ex);
+ }
+ }
+
if(log.isDebugEnabled()) {
- log.debug("Calculating memory consumption: [totalMemory] "+totalMemory+" [usedMemory] "+usedMemory);
+ log.debug("Calculating memory consumption: [totalMemory] "+totalMemory+" [usedMemory] "+usedMemory);
}
double memoryConsumption = (usedMemory / totalMemory) * 100;
if(log.isDebugEnabled()) {
- log.debug("Calculating memory consumption: [percentage] "+memoryConsumption);
+ log.debug("Calculating memory consumption: [percentage] "+memoryConsumption);
}
return memoryConsumption;
}
public static double getLoadAverage() {
- double loadAvg = (double)ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
- // assume system cores = available cores to JVM
- int cores = ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors();
-
+ double loadAvg = (double)ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
+ // assume system cores = available cores to JVM
+ int cores = ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors();
+
+ if(log.isDebugEnabled()) {
+ log.debug("Calculating load average consumption: [loadAverage] "+loadAvg+" [cores] "+cores);
+ }
+
+ double loadAvgPercentage = (loadAvg/cores) * 100;
if(log.isDebugEnabled()) {
- log.debug("Calculating load average consumption: [loadAverage] "+loadAvg+" [cores] "+cores);
+ log.debug("Calculating load average consumption: [percentage] "+loadAvgPercentage);
}
-
+ return loadAvgPercentage;
+ }
+
+ public CartridgeStatistics getCartridgeStatistics() throws IOException {
+ OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
+ double totalMemory = (double)(osBean.getTotalPhysicalMemorySize()/ MB);
+ double usedMemory = (double)((totalMemory - (osBean.getFreePhysicalMemorySize() / MB) ));
+ double loadAvg = (double)osBean.getSystemLoadAverage();
+ // assume system cores = available cores to JVM
+ int cores = osBean.getAvailableProcessors();
+ double memoryConsumption = (usedMemory / totalMemory) * 100;
double loadAvgPercentage = (loadAvg/cores) * 100;
+
if(log.isDebugEnabled()) {
- log.debug("Calculating load average consumption: [percentage] "+loadAvgPercentage);
+ log.debug("Memory consumption: [totalMemory] "+totalMemory+"Mb [usedMemory] "+usedMemory+"Mb: "+memoryConsumption+"%");
+ log.debug("Processor consumption: [loadAverage] "+loadAvg+" [cores] "+cores+": "+loadAvgPercentage+"%");
}
- return loadAvgPercentage;
+
+ return (new CartridgeStatistics(memoryConsumption, loadAvgPercentage));
}
+
public static boolean allPortsActive() {
return CartridgeAgentUtils.checkPortsActive(CartridgeAgentConfiguration.getInstance().getListenAddress(),
- CartridgeAgentConfiguration.getInstance().getPorts());
+ CartridgeAgentConfiguration.getInstance().getPorts());
}
-
+
private static boolean isWindows() {
String os = System.getProperty("os.name").toLowerCase();
return os.indexOf("win") >= 0;
}
-}
+ public void delete() {
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index f10f860..89d623b 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -904,23 +904,7 @@ public class RestCommandLineService {
DefaultHttpClient httpClient = new DefaultHttpClient();
CartridgeInfoBean cartridgeInfoBean = new CartridgeInfoBean();
-<<<<<<< HEAD
- cartridgeInfoBean.setCartridgeType(null);
- cartridgeInfoBean.setAlias(null);
- cartridgeInfoBean.setRepoURL(null);
- cartridgeInfoBean.setPrivateRepo(false);
- cartridgeInfoBean.setRepoUsername(null);
- cartridgeInfoBean.setRepoPassword(null);
- cartridgeInfoBean.setAutoscalePolicy(null);
- cartridgeInfoBean.setDeploymentPolicy(null);
- cartridgeInfoBean.setSize(size);
-
- cartridgeInfoBean.setRemoveOnTermination(remoOnTermination);
- cartridgeInfoBean.setPersistanceRequired(persistanceMapping);
- cartridgeInfoBean.setCommitsEnabled(enableCommits);
-
-=======
->>>>>>> master
+
GsonBuilder gsonBuilder = new GsonBuilder();
Gson gson = gsonBuilder.create();
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
index dab2685..2825e30 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
@@ -34,11 +34,8 @@ import org.apache.stratos.cli.StratosCommandContext;
import org.apache.stratos.cli.exception.CommandException;
import org.apache.stratos.cli.utils.CliConstants;
-<<<<<<< HEAD
-import static org.apache.stratos.cli.utils.CommandLineUtils.mergeOptionArrays;
-=======
import java.util.ArrayList;
->>>>>>> master
+import static org.apache.stratos.cli.utils.CommandLineUtils.mergeOptionArrays;
public class SubscribeCommand implements Command<StratosCommandContext> {
@@ -116,17 +113,6 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
upstreamCommitsEnabledOption.setOptionalArg(true);
options.addOption(upstreamCommitsEnabledOption);
-<<<<<<< HEAD
- public int execute(StratosCommandContext context, String[] args, Option[] already_parsed_opts) throws CommandException {
- if (logger.isDebugEnabled()) {
- logger.debug("Executing {} command...", getName());
- }
- if (args != null && args.length > 0) {
- String[] remainingArgs = null;
- String type = null;
- String alias = null;
- String policy = null;
-=======
return options;
}
@@ -142,7 +128,7 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
return "[Cartridge type] [Cartridge alias]";
}
- public int execute(StratosCommandContext context, String[] args) throws CommandException {
+ public int execute(StratosCommandContext context, String[] args, Option[] already_parsed_opts) throws CommandException {
if (logger.isDebugEnabled()) {
logger.debug("Executing {} command...", getName());
}
@@ -151,7 +137,6 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
String type = null;
String alias = null;
String policy = null;
->>>>>>> master
String asPolicy = null;
String depPolicy = null;
String repoURL = null, username = "", password = "";
@@ -169,6 +154,8 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
try {
commandLine = parser.parse(options, args);
remainingArgs = commandLine.getArgs();
+ //merge newly discovered options with previously discovered ones.
+ Options opts = mergeOptionArrays(already_parsed_opts, commandLine.getOptions());
if (remainingArgs != null && remainingArgs.length == 2) {
// Get type
type = remainingArgs[0];
@@ -178,43 +165,13 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
return CliConstants.BAD_ARGS_CODE;
}
-<<<<<<< HEAD
- final CommandLineParser parser = new GnuParser();
- CommandLine commandLine;
- try {
- commandLine = parser.parse(options, args);
- remainingArgs = commandLine.getArgs();
- //merge newly discovered options with previously discovered ones.
- Options opts = mergeOptionArrays(already_parsed_opts, commandLine.getOptions());
- if (remainingArgs != null && remainingArgs.length == 2) {
- // Get type
- type = remainingArgs[0];
- alias = remainingArgs[1];
- } else {
- context.getStratosApplication().printUsage(getName());
- return CliConstants.BAD_ARGS_CODE;
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("Subscribing to {} cartridge with alias {}", type, alias);
- }
-
- //if (opts.hasOption(CliConstants.POLICY_OPTION)) {
- // if (logger.isTraceEnabled()) {
- // logger.trace("Policy option is passed");
- // }
- // policy = opts.getOptionValue(CliConstants.POLICY_OPTION);
- //}
- if (opts.hasOption(CliConstants.AUTOSCALING_POLICY_OPTION)) {
-=======
// This will check the subscribe cartridge type is multi tenant or single tenant
isMultiTenant = RestCommandLineService.getInstance().isMultiTenant(type);
if (logger.isDebugEnabled()) {
logger.debug("Subscribing to {} cartridge with alias {}", type, alias);
}
- if (commandLine.hasOption(CliConstants.AUTOSCALING_POLICY_OPTION)) {
->>>>>>> master
+ if (opts.hasOption(CliConstants.AUTOSCALING_POLICY_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("Autoscaling policy option is passed");
}
@@ -226,29 +183,13 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
}
depPolicy = opts.getOption(CliConstants.DEPLOYMENT_POLICY_OPTION).getValue();
}
-<<<<<<< HEAD
if (opts.hasOption(CliConstants.REPO_URL_OPTION)) {
- if (logger.isTraceEnabled()) {
- logger.trace("RepoURL option is passed");
- }
- repoURL = opts.getOption(CliConstants.REPO_URL_OPTION).getValue();
- }
- //if (opts.hasOption(CliConstants.PRIVATE_REPO_OPTION)) {
- // if (logger.isTraceEnabled()) {
- // logger.trace("privateRepo option is passed");
- // }
- // privateRepo = true;
- //}
- if (opts.hasOption(CliConstants.VOLUME_SIZE_OPTION)) {
-=======
- if (commandLine.hasOption(CliConstants.REPO_URL_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("RepoURL option is passed");
}
- repoURL = commandLine.getOptionValue(CliConstants.REPO_URL_OPTION);
+ repoURL = opts.getOption(CliConstants.REPO_URL_OPTION).getValue();
}
- if (commandLine.hasOption(CliConstants.VOLUME_SIZE_OPTION)) {
->>>>>>> master
+ if (opts.hasOption(CliConstants.VOLUME_SIZE_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("Volume size option is passed");
@@ -256,28 +197,16 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
size = opts.getOption(CliConstants.VOLUME_SIZE_OPTION).getValue();
}
-<<<<<<< HEAD
if (opts.hasOption(CliConstants.VOLUME_ID_OPTION)) {
-=======
- if (commandLine.hasOption(CliConstants.VOLUME_ID_OPTION)) {
->>>>>>> master
if (logger.isTraceEnabled()) {
logger.trace("Volume id option is passed");
}
-<<<<<<< HEAD
volumeID = opts.getOption(CliConstants.VOLUME_ID_OPTION).getValue();
}
if (opts.hasOption(CliConstants.REMOVE_ON_TERMINATION_OPTION)) {
-=======
- volumeID = commandLine.getOptionValue(CliConstants.VOLUME_ID_OPTION);
- }
-
-
- if (commandLine.hasOption(CliConstants.REMOVE_ON_TERMINATION_OPTION)) {
->>>>>>> master
if (logger.isTraceEnabled()) {
logger.trace("Remove on termination option is passed");
@@ -318,45 +247,24 @@ public class SubscribeCommand implements Command<StratosCommandContext> {
}
}
- if (commandLine.hasOption(CliConstants.USERNAME_OPTION)) {
+ if (opts.hasOption(CliConstants.USERNAME_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("Username option is passed");
}
- username = commandLine.getOptionValue(CliConstants.USERNAME_OPTION);
+ username = opts.getOption(CliConstants.USERNAME_OPTION).getValue();
}
- if (commandLine.hasOption(CliConstants.PASSWORD_OPTION)) {
+ if (opts.hasOption(CliConstants.PASSWORD_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("Password option is passed");
}
- password = commandLine.getOptionValue(CliConstants.PASSWORD_OPTION);
+ password = opts.getOption(CliConstants.PASSWORD_OPTION).getValue();
}
- if (commandLine.hasOption(CliConstants.ENABLE_COMMITS_OPTION)) {
+ if (opts.hasOption(CliConstants.ENABLE_COMMITS_OPTION)) {
if (logger.isTraceEnabled()) {
logger.trace("Upstream git commits are enabled");
}
commitsEnabled = true;
}
-<<<<<<< HEAD
- if (opts.hasOption(CliConstants.USERNAME_OPTION)) {
- if (logger.isTraceEnabled()) {
- logger.trace("Username option is passed");
- }
- username = opts.getOption(CliConstants.USERNAME_OPTION).getValue();
- }
- if (opts.hasOption(CliConstants.PASSWORD_OPTION)) {
- if (logger.isTraceEnabled()) {
- logger.trace("Password option is passed");
- }
- password = opts.getOption(CliConstants.PASSWORD_OPTION).getValue();
- }
- if (opts.hasOption(CliConstants.ENABLE_COMMITS_OPTION)) {
- if (logger.isTraceEnabled()) {
- logger.trace("Upstream git commits are enabled");
- }
- commitsEnabled = true;
- }
-=======
->>>>>>> master
if ( ! isMultiTenant && depPolicy == null) {
System.out.println("Deployment policy is required.");
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index a2c2491..5f6f7f5 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -25,20 +25,17 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceUnregisteredCartridgeExceptionException;
-import org.apache.stratos.cloud.controller.stub.pojo.CartridgeConfig;
-import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo;
import org.apache.stratos.cloud.controller.stub.pojo.CompositeApplicationDefinition;
-import org.apache.stratos.cloud.controller.stub.pojo.Property;
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPartitionExceptionException;
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPolicyExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeDefinitionExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeTypeExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCompositeApplicationDefinitionExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidIaasProviderExceptionException;
-import org.apache.stratos.manager.composite.application.beans.CompositeAppDefinition;
-import org.apache.stratos.manager.composite.application.CompositeApplicationManager;
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeConfig;
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo;
+import org.apache.stratos.manager.composite.application.beans.CompositeAppDefinition;
+import org.apache.stratos.manager.composite.application.CompositeApplicationManager;
import org.apache.stratos.cloud.controller.stub.pojo.Property;
import org.apache.stratos.manager.client.AutoscalerServiceClient;
import org.apache.stratos.manager.client.CloudControllerServiceClient;
@@ -1174,11 +1171,6 @@ public class ServiceUtils {
}
/*
-<<<<<<< HEAD
- if (cartridgeInfoBean.getPersistence() != null) {
-
-=======
->>>>>>> master
if (cartridgeInfoBean.isPersistanceRequired()) {
if (cartridgeInfoBean.getPersistence() != null) {
// Add persistence related properties to PersistenceContext
@@ -1285,10 +1277,6 @@ public class ServiceUtils {
subscriptionData.setTenantAdminUsername(userName);
subscriptionData.setRepositoryType("git");
//subscriptionData.setPayloadProperties(props);
-<<<<<<< HEAD
- //subscriptionData.setProperties(props);
-=======
->>>>>>> master
subscriptionData.setPrivateRepository(false);
cartridgeSubscription =
@@ -1299,10 +1287,6 @@ public class ServiceUtils {
Properties lbProperties = new Properties();
lbProperties.setPayloadProperties(props);
-<<<<<<< HEAD
- lbProperties.setProperties(props);
-=======
->>>>>>> master
cartridgeSubsciptionManager.registerCartridgeSubscription(cartridgeSubscription, lbProperties);
if(log.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh b/products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh
index 491d52e..2636e74 100644
--- a/products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh
+++ b/products/cartridge-agent/modules/distribution/src/main/bin/stratos.sh
@@ -49,9 +49,6 @@ properties="-Dmb.ip=MB-IP
-Dmonitoring.server.secure.port=MONITORING-SERVER-SECURE-PORT
-Dmonitoring.server.admin.username=MONITORING-SERVER-ADMIN-USERNAME
-Dmonitoring.server.admin.password=MONITORING-SERVER-ADMIN-PASSWORD
-<<<<<<< HEAD
- -DAPP_PATH=APP-PATH"
-=======
-Dlog.file.paths=LOG_FILE_PATHS
-DAPP_PATH=APP_PATH
-Dsuper.tenant.repository.path=/repository/deployment/server/
@@ -73,7 +70,6 @@ properties="-Dmb.ip=MB-IP
-Dextension.artifacts.copy=artifacts-copy.sh
-Dextension.tenant.subscribed=tenant-subscribed.sh
-Dextension.tenant.unsubscribed=tenant-unsubscribed.sh"
->>>>>>> master
# Uncomment below line to enable remote debugging
#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/products/cartridge-agent/modules/distribution/src/main/conf/templates/jndi.properties.template
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/conf/templates/jndi.properties.template b/products/cartridge-agent/modules/distribution/src/main/conf/templates/jndi.properties.template
index 1ff5b1f..588d47a 100644
--- a/products/cartridge-agent/modules/distribution/src/main/conf/templates/jndi.properties.template
+++ b/products/cartridge-agent/modules/distribution/src/main/conf/templates/jndi.properties.template
@@ -24,5 +24,4 @@
connectionfactoryName=TopicConnectionFactory
connectionfactory.topicConnectionfactory=tcp://$mb_ip:$mb_port
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-=======
->>>>>>> master
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/feeca27a/products/stratos/modules/distribution/src/main/conf/mincheck.drl
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/conf/mincheck.drl b/products/stratos/modules/distribution/src/main/conf/mincheck.drl
index e1f3770..ed331cf 100755
--- a/products/stratos/modules/distribution/src/main/conf/mincheck.drl
+++ b/products/stratos/modules/distribution/src/main/conf/mincheck.drl
@@ -48,12 +48,12 @@ global org.apache.stratos.messaging.domain.topology.Topology $topology;
global java.util.Map partitionCtxts;
global java.lang.String clusterId;
global java.lang.String lbRef;
+global java.lang.Boolean isPrimary;
+global Integer primaryMemberCount;
global java.lang.String serviceId;
global org.apache.stratos.autoscaler.policy.model.AutoscalePolicy autoscalePolicy;
-global java.lang.Boolean isPrimary;
-global Integer primaryMemberCount;
rule "Minimum Rule"
dialect "mvel"
@@ -62,12 +62,10 @@ dialect "mvel"
eval(log.debug("Running minimum rule: [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId()))
eval(log.debug("[min-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Non terminated member count: " + $ctxt.getNonTerminatedMemberCount()))
eval(log.debug("[min-check] [network-partition] " + $ctxt.getNetworkPartitionId() + " [partition] " + $ctxt.getPartitionId() + " Minimum member count: " + $ctxt.getMinimumMemberCount()))
- eval($ctxt.getNonTerminatedMemberCount() < $ctxt.getMinimumMemberCount())
+ eval ( (isPrimary && (primaryMemberCount < $ctxt.getMinimumMemberCount() )) || ( !isPrimary && ($ctxt.getNonTerminatedMemberCount() < $ctxt.getMinimumMemberCount() )) )
eval(log.debug("Grouping ... checking startup dependencies for " + clusterId))
eval($ctxt.checkStartupDependencies(serviceId, clusterId))
eval(log.debug("startup dependencies successfully checked for" + clusterId))
-
- eval ( (isPrimary && (primaryMemberCount < $ctxt.getMinimumMemberCount() )) || ( !isPrimary && ($ctxt.getNonTerminatedMemberCount() < $ctxt.getMinimumMemberCount() )) )
then
if (isPrimary){
log.debug("[min-check] true [primary] true [primary member count] " + primaryMemberCount);