Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reset_all_counters(self):
"""
将所有counter清零
Raises:
error.BigflowRuntimeException: 此方法不允许在 :mod:`Bigflow变换` 的用户自定义方法(UDF)中调用,否则抛出此异常
"""
if os.getenv("__PYTHON_IN_REMOTE_SIDE", None) is not None:
raise error.BigflowRuntimeException("reset_all_counters cannot be called at runtime")
requests.reset_all_counters()
def async_run(self):
"""
立刻运行Pipeline并等待作业提交完成
Raises:
BigflowRuntimeException: 若运行期出错抛出此异常
"""
raise error.BigflowRuntimeException("async_run isn't be supported in this pipeline")
def _register_extension(self, extension):
""" Experimental interface to register an extension
:param extension:
:return:
"""
from bigflow.extension import BigFlowExtension
if not isinstance(extension, BigFlowExtension):
raise error.BigflowRuntimeException("Extension must be subclass of "
"bigflow.extension.BigFlowExtension")
else:
extension.setup(self) # setup the extension
self._extensions.append(extension)
def run(self):
"""
立刻运行Pipeline并等待结束
Raises:
BigflowRuntimeException: 若运行期出错抛出此异常
"""
raise error.BigflowRuntimeException("run is not supported in this pipeline")
def reset_counter(self, name):
"""
将一个counter清零, 若 name 中不包含 group 部分, 则默认将 Flume group 下面对应的 counter 清零
Args:
name (str): counter名称,其说明请参考 :mod:`counter模块`
Raises:
error.BigflowRuntimeException: 此方法不允许在 :mod:`Bigflow变换` 的用户自定义方法(UDF)中调用,否则抛出此异常
"""
if os.getenv("__PYTHON_IN_REMOTE_SIDE", None) is not None:
raise error.BigflowRuntimeException("reset_counter cannot be called at runtime")
requests.reset_counter(name)