Repository: madlib
Updated Branches:
  refs/heads/master 85d09e675 -> 2cde01d1f


Control: Add minor comments to context managers


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

Branch: refs/heads/master
Commit: 2cde01d1ff011c47a1e6f03007e0ada5395617f4
Parents: 85d09e6
Author: Rahul Iyer <[email protected]>
Authored: Thu Sep 13 14:43:09 2018 -0700
Committer: Rahul Iyer <[email protected]>
Committed: Thu Sep 13 14:43:13 2018 -0700

----------------------------------------------------------------------
 src/ports/postgres/modules/utilities/control.py_in | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/2cde01d1/src/ports/postgres/modules/utilities/control.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/utilities/control.py_in 
b/src/ports/postgres/modules/utilities/control.py_in
index 7900086..d147103 100644
--- a/src/ports/postgres/modules/utilities/control.py_in
+++ b/src/ports/postgres/modules/utilities/control.py_in
@@ -100,6 +100,10 @@ class HashaggControl(ContextDecorator):
     """
     @brief: A wrapper that enables/disables the hashagg and then sets it back
         to the original value on exit
+
+    This context manager should be used at the top-level and any exception
+    raised from this should be re-raised (if caught) to ensure the transaction
+    does not commit.
     """
 
     def __init__(self, enable=True):
@@ -134,6 +138,10 @@ class MinWarning(ContextDecorator):
 
     """
     @brief A wrapper for setting the level of logs going into client
+
+    This context manager should be used at the top-level and any exception
+    raised from this should be re-raised (if caught) to ensure the transaction
+    does not commit.
     """
 
     def __init__(self, warningLevel='error'):
@@ -163,6 +171,10 @@ class AOControl(ContextDecorator):
 
     """
     @brief: A wrapper that enables/disables the AO storage option
+
+    This context manager should be used at the top-level and any exception
+    raised from this should be re-raised (if caught) to ensure the transaction
+    does not commit.
     """
 
     def __init__(self, enable=False):
@@ -192,7 +204,7 @@ class AOControl(ContextDecorator):
                 "show 
gp_default_storage_options")[0]["gp_default_storage_options"]
             self._parse_gp_default_storage_options(_storage_options_str)
 
-            # Set APPENDONLY=False after backing up existing value
+            # Set APPENDONLY=<enable> after backing up existing value
             self.was_ao_enabled = self.storage_options_dict['appendonly']
             self.storage_options_dict['appendonly'] = self.to_enable
             plpy.execute("set gp_default_storage_options={0}".

Reply via email to