Repository: stratos
Updated Branches:
  refs/heads/master d5f11fc22 -> 238c3c48c


Adding queue to executer service


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2f2debf5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2f2debf5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2f2debf5

Branch: refs/heads/master
Commit: 2f2debf5b60d08e21edabd7aa04b5af32955468c
Parents: 3ab657a
Author: gayangunarathne <[email protected]>
Authored: Thu Aug 20 21:10:48 2015 +0530
Committer: gayangunarathne <[email protected]>
Committed: Thu Aug 20 21:10:48 2015 +0530

----------------------------------------------------------------------
 .../common/threading/StratosThreadPool.java     | 12 ++-
 .../application-policy-3.json.orig              | 18 ----
 ...-G123-1-application-update-test-v1.json.orig | 91 --------------------
 .../application.json.orig                       | 89 -------------------
 4 files changed, 11 insertions(+), 199 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
 
b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
index c72499f..45da339 100644
--- 
a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
+++ 
b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
@@ -51,9 +51,19 @@ public class StratosThreadPool {
             synchronized (executorServiceMapLock) {
                 if (executorService == null) {
                     final BlockingQueue<Runnable> queue = new 
ArrayBlockingQueue(threadPoolSize);
-                    executorService =new ThreadPoolExecutor(threadPoolSize, 
1000,
+                    ThreadPoolExecutor threadPool=new 
ThreadPoolExecutor(threadPoolSize, 1000,
                             0L, TimeUnit.MILLISECONDS,
                             queue);// 
Executors.newFixedThreadPool(threadPoolSize);
+                    threadPool.setRejectedExecutionHandler(new 
RejectedExecutionHandler() {
+                        public void rejectedExecution(Runnable r, 
ThreadPoolExecutor executor) {
+                            try {
+                                executor.getQueue().put(r);
+                            } catch (InterruptedException e) {
+                                log.error("Failed to add the rejected jobs to 
executor service blocking queue",e);
+                            }
+                        }
+                    });
+                    executorService=threadPool;
                     executorServiceMap.put(identifier, executorService);
                     log.info(String.format("Thread pool created: [type] 
Executor Service [id] %s [size] %d", identifier, threadPoolSize));
                 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
 
b/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
deleted file mode 100644
index a461844..0000000
--- 
a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json.orig
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-    "id": "application-policy-3",
-    "algorithm": "one-after-another",
-    "networkPartitions": [
-        "network-partition-9",
-        "network-partition-10"
-    ],
-    "properties": [
-        {
-            "name": "key-1",
-            "value": "network-partition-9|network-partition-10"
-        },
-        {
-            "name": "key-2",
-            "value": "value-2"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
 
b/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
deleted file mode 100644
index b3ba80e..0000000
--- 
a/products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json.orig
+++ /dev/null
@@ -1,91 +0,0 @@
-{
-    "alias": "g-sc-G123-1-application-update-test",
-    "applicationId": "g-sc-G123-1-application-update-test",
-    "components": {
-        "cartridges": [],
-        "groups": [
-            {
-                "name": "G1-application-update-test",
-                "groupMaxInstances": 1,
-                "groupMinInstances": 1,
-                "alias": "group1-application-update-test",
-                "cartridges": [
-                    {
-                        "cartridgeMin": 2,
-                        "cartridgeMax": 3,
-                        "type": "c1-application-update-test",
-                        "subscribableInfo": {
-                            "alias": "c1-1x0-application-update-test",
-                            "deploymentPolicy": 
"deployment-policy-application-update-test",
-                            "artifactRepository": {
-                                "repoUsername": "user",
-                                "repoUrl": 
"http://stratos.apache.org:10080/git/default.git";,
-                                "privateRepo": true,
-                                "repoPassword": "c-policy"
-                            },
-                            "autoscalingPolicy": 
"autoscaling-policy-application-update-test"
-                        }
-                    }
-                ],
-                "groups": [
-                    {
-                        "name": "G2-application-update-test",
-                        "groupMaxInstances": 1,
-                        "groupMinInstances": 1,
-                        "alias": "group2-application-update-test",
-                        "cartridges": [
-                            {
-                                "cartridgeMin": 2,
-                                "cartridgeMax": 4,
-                                "type": "c2-application-update-test",
-                                "subscribableInfo": {
-                                    "alias": "c2-1x0-application-update-test",
-                                    "deploymentPolicy": 
"deployment-policy-application-update-test",
-                                    "artifactRepository": {
-                                        "repoUsername": "user",
-                                        "repoUrl": 
"http://stratos.apache.org:10080/git/default.git";,
-                                        "privateRepo": true,
-                                        "repoPassword": "c-policy"
-                                    },
-                                    "autoscalingPolicy": 
"autoscaling-policy-application-update-test"
-                                }
-                            }
-                        ],
-                        "groups": [
-                            {
-                                "name": "G3-application-update-test",
-                                "groupMaxInstances": 3,
-                                "groupMinInstances": 2,
-<<<<<<< 
HEAD:products/stratos/modules/integration/src/test/resources/sample-applications-test/applications/g-sc-G123-1-v1.json
-                                "deploymentPolicy": "deployment-policy-1",
-                                "alias": "group3",
-=======
-                                "deploymentPolicy": 
"deployment-policy-application-update-test",
-                                "alias": "group3-application-update-test",
->>>>>>> f78ab82... Restructuring the integration test and adding more test 
cases:products/stratos/modules/integration/src/test/resources/application-update-test/applications/g-sc-G123-1-application-update-test-v1.json
-                                "cartridges": [
-                                    {
-                                        "cartridgeMin": 2,
-                                        "cartridgeMax": 3,
-                                        "type": "c3-application-update-test",
-                                        "subscribableInfo": {
-                                            "alias": 
"c3-1x0-application-update-test",
-                                            "artifactRepository": {
-                                                "repoUsername": "user",
-                                                "repoUrl": 
"http://stratos.apache.org:10080/git/default.git";,
-                                                "privateRepo": true,
-                                                "repoPassword": "c-policy"
-                                            },
-                                            "autoscalingPolicy": 
"autoscaling-policy-application-update-test"
-                                        }
-                                    }
-                                ],
-                                "groups": []
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/2f2debf5/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
 
b/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
deleted file mode 100644
index b28c017..0000000
--- 
a/products/stratos/modules/integration/src/test/resources/group-startup-order-test/startup-order-termination-behavior/application.json.orig
+++ /dev/null
@@ -1,89 +0,0 @@
-{
-    "alias": "sub-G1-G2-G3-1-G4",
-    "applicationId": "sub-G1-G2-G3-1-G4",
-    "components": {
-        "cartridges": [],
-        "groups": [
-            {
-                "name": "G1",
-                "groupMaxInstances": 1,
-                "groupMinInstances": 1,
-                "alias": "group1",
-                "cartridges": [
-                    {
-                        "cartridgeMin": 1,
-                        "cartridgeMax": 1,
-                        "type": "c1",
-                        "subscribableInfo": {
-                            "alias": "c1-1x0",
-                            "deploymentPolicy": "static-1",
-                            "artifactRepository": {
-                                "repoUsername": "user",
-                                "repoUrl": 
"http://octl.qmog.cisco.com:10080/git/default.git";,
-                                "privateRepo": true,
-                                "repoPassword": "c-policy"
-                            },
-                            "autoscalingPolicy": "economyPolicy"
-                        }
-                    }
-
-                ],
-                "groups": [
-                    {
-                        "name": "G2",
-                        "groupMaxInstances": 1,
-                        "groupMinInstances": 1,
-                        "alias": "group2",
-                        "cartridges": [
-                            {
-                                "cartridgeMin": 1,
-                                "cartridgeMax": 1,
-                                "type": "c2",
-                                "subscribableInfo": {
-                                    "alias": "c2-1x0",
-                                    "deploymentPolicy": "static-1",
-                                    "artifactRepository": {
-                                        "repoUsername": "user",
-                                        "repoUrl": 
"http://octl.qmog.cisco.com:10080/git/default.git";,
-                                        "privateRepo": true,
-                                        "repoPassword": "c-policy"
-                                    },
-                                    "autoscalingPolicy": "economyPolicy"
-                                }
-                            }
-                        ],
-                        "groups": [
-                            {
-                                "name": "G3",
-                                "groupMaxInstances": 1,
-                                "groupMinInstances": 1,
-                                "alias": "group3",
-                                "cartridges": [
-                                    {
-                                        "cartridgeMin": 1,
-                                        "cartridgeMax": 1,
-                                        "type": "c3",
-                                        "subscribableInfo": {
-                                            "alias": "c3-1x1",
-                                            "deploymentPolicy": "static-1",
-                                            "artifactRepository": {
-                                                "repoUsername": "user",
-                                                "repoUrl": 
"http://octl.qmog.cisco.com:10080/git/default.git";,
-                                                "privateRepo": true,
-                                                "repoPassword": "c-policy"
-                                            },
-                                            "autoscalingPolicy": 
"economyPolicy"
-                                        }
-                                    }
-                                ],
-                                "groups": []
-                            }
-                        ]
-                    }
-
-                ]
-            }
-        ]
-    }
-}
-

Reply via email to