Updated Branches: refs/heads/master 92ba82da2 -> 3894880e6
Changed data type of in_flight_request_count to double in in_flight_requests stream Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/3894880e Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/3894880e Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/3894880e Branch: refs/heads/master Commit: 3894880e6ccefb5028fc7408819e4d1783c3c36c Parents: 92ba82d Author: Imesh Gunaratne <[email protected]> Authored: Wed Dec 25 02:32:48 2013 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Wed Dec 25 02:32:48 2013 +0530 ---------------------------------------------------------------------- .../git/impl/GitBasedArtifactRepository.java | 23 +++++++++----------- .../WSO2CEPInFlightRequestPublisher.java | 4 ++-- .../ClusterCreatedMessageProcessor.java | 10 ++++----- .../streamdefinitions/stream-manager-config.xml | 2 +- 4 files changed, 17 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/3894880e/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 21aaa64..fcd6a83 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 @@ -69,7 +69,7 @@ public class GitBasedArtifactRepository { /* if (tenantId == GitDeploymentSynchronizerConstants.SUPER_TENANT_ID) return;*/ - log.info("In init git context............"); + log.info("Initializing git context."); int tenantId = Integer.parseInt(repositoryInformation.getTenantId()); String gitLocalRepoPath = repositoryInformation.getRepoPath(); @@ -162,7 +162,7 @@ public class GitBasedArtifactRepository { */ private static void cacheGitRepoContext(int tenantId, RepositoryContext gitRepoCtx) { - log.info("caching repo context...."); + log.info("caching repo context"); tenantToRepoContextMap.put(tenantId, gitRepoCtx); } @@ -186,11 +186,8 @@ public class GitBasedArtifactRepository { * */ public static boolean commit() { - - // foreach tenant's local path check for commit // TODO implement later, this is applicable for management node. - //log.info(" In commit.... map count : " + tenantToRepoContextMap.size()); - + for (Entry<Integer, RepositoryContext> tenantMap : tenantToRepoContextMap .entrySet()) { @@ -369,9 +366,9 @@ public class GitBasedArtifactRepository { } public static boolean checkout(RepositoryInformation repositoryInformation) { - - log.info("In checkout............"); - + if(log.isInfoEnabled()) { + log.info("Executing checkout"); + } int tenantId = Integer.parseInt(repositoryInformation.getTenantId()); // if context for tenant is not initialized @@ -382,7 +379,7 @@ public class GitBasedArtifactRepository { 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 "); + log.info("No git repository context information found for deployment synchronizer"); return true; } @@ -425,8 +422,9 @@ public class GitBasedArtifactRepository { * @return true if success, else false */ private static boolean pullArtifacts (RepositoryContext gitRepoCtx) { - - log.info("Pulling artifacts....."); + if(log.isInfoEnabled()) { + log.info("Pulling artifacts"); + } PullCommand pullCmd = gitRepoCtx.getGit().pull(); if(!gitRepoCtx.getKeyBasedAuthentication()) { @@ -466,7 +464,6 @@ public class GitBasedArtifactRepository { e.printStackTrace(); return false; } - return true; } http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/3894880e/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/publisher/WSO2CEPInFlightRequestPublisher.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/publisher/WSO2CEPInFlightRequestPublisher.java b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/publisher/WSO2CEPInFlightRequestPublisher.java index 7e52ba0..519a687 100644 --- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/publisher/WSO2CEPInFlightRequestPublisher.java +++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/statistics/publisher/WSO2CEPInFlightRequestPublisher.java @@ -47,7 +47,7 @@ public class WSO2CEPInFlightRequestPublisher extends WSO2CEPStatisticsPublisher // Payload definition payloadData.add(new Attribute("cluster_id", AttributeType.STRING)); payloadData.add(new Attribute("network_partition_id", AttributeType.STRING)); - payloadData.add(new Attribute("in_flight_request_count", AttributeType.INT)); + payloadData.add(new Attribute("in_flight_request_count", AttributeType.DOUBLE)); streamDefinition.setPayloadData(payloadData); return streamDefinition; } catch (Exception e) { @@ -71,7 +71,7 @@ public class WSO2CEPInFlightRequestPublisher extends WSO2CEPStatisticsPublisher // Payload values payload.add(clusterId); payload.add(networkPartitionId); - payload.add(inFlightRequestCount); + payload.add((double)inFlightRequestCount); super.publish(payload.toArray()); } } http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/3894880e/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java index 89b51d4..24f4314 100644 --- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java +++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterCreatedMessageProcessor.java @@ -73,16 +73,14 @@ public class ClusterCreatedMessageProcessor extends MessageProcessor { return false; } } - + + // Validate event properties Cluster cluster = event.getCluster(); - if(cluster == null) { - String msg = "Cluster object of Cluster Created Event is null."; + String msg = "Cluster object of cluster created event is null."; log.error(msg); throw new RuntimeException(msg); } - - // Validate event properties if (cluster.getHostNames().isEmpty()) { throw new RuntimeException("Host name/s not found in cluster created event"); } @@ -106,7 +104,7 @@ public class ClusterCreatedMessageProcessor extends MessageProcessor { // Apply changes to the topology service.addCluster(cluster); if (log.isInfoEnabled()) { - log.info("Cluster created: "+cluster.toString()); + log.info(String.format("Cluster created: %s", cluster.toString())); } // Notify event listeners http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/3894880e/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml ---------------------------------------------------------------------- diff --git a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml index 7aa5bfb..8010362 100755 --- a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml +++ b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml @@ -10,7 +10,7 @@ <payloadData> <property name="cluster_id" type="String"/> <property name="network_partition_id" type="String"/> - <property name="in_flight_request_count" type="int"/> + <property name="in_flight_request_count" type="double"/> </payloadData> </streamDefinition>
