brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [45/50] brooklyn-library git commit: Changed PostgreSqlNode default behaviour disconnect all client connections on closure (pg_ctl -m immediate stop)
Date Mon, 01 Feb 2016 17:47:15 GMT
Changed PostgreSqlNode default behaviour disconnect all client connections on closure (pg_ctl
-m immediate stop)


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/54036402
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/54036402
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/54036402

Branch: refs/heads/0.6.0
Commit: 54036402a0303e2fdbdb61fdef68ea857ad38873
Parents: 08cbcec
Author: Martin Harris <github@nakomis.com>
Authored: Fri Nov 15 17:15:06 2013 +0000
Committer: Martin Harris <github@nakomis.com>
Committed: Fri Nov 15 17:15:06 2013 +0000

----------------------------------------------------------------------
 .../java/brooklyn/entity/database/postgresql/PostgreSqlNode.java | 4 ++++
 .../brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/54036402/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlNode.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlNode.java
b/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlNode.java
index 2778bca..b092b5a 100644
--- a/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlNode.java
+++ b/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlNode.java
@@ -32,5 +32,9 @@ public interface PostgreSqlNode extends DatabaseNode {
     @SetFromFlag("port")
     public static final PortAttributeSensorAndConfigKey POSTGRESQL_PORT =
             new PortAttributeSensorAndConfigKey("postgresql.port", "PostgreSQL port", PortRanges.fromString("5432+"));
+    
+    @SetFromFlag("disconnetOnStop")
+    public static final ConfigKey<Boolean> DISCONNECT_ON_STOP =
+    new BasicConfigKey<Boolean>(Boolean.class, "postgresql.disconnecto.on.stop", "If
true, PostgreSQL will immediately disconnet (pg_ctl -m immediate stop) all current connections
when the node is stopped", true);
 
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/54036402/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
b/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
index 8dda553..7c3f8b8 100644
--- a/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
+++ b/software/database/src/main/java/brooklyn/entity/database/postgresql/PostgreSqlSshDriver.java
@@ -169,7 +169,9 @@ public class PostgreSqlSshDriver extends AbstractSoftwareProcessSshDriver
 
     @Override
     public void stop() {
-        newScript(MutableMap.of("usePidFile", false), STOPPING).body.append(callPgctl("stop",
false)).failOnNonZeroResultCode().execute();
+        newScript(MutableMap.of("usePidFile", false), STOPPING).body.append(callPgctl(
+                (entity.getConfig(PostgreSqlNode.DISCONNECT_ON_STOP) ? "-m immediate " :
"") +
+                "stop", false)).failOnNonZeroResultCode().execute();
     }
 
     @Override


Mime
View raw message