partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
read_file
read file
heron/tools/admin/src/python/standalone.py
def read_file(file_path): ''' read file ''' lines = [] with open(file_path, "r") as tf: lines = [line.strip("\n") for line in tf.readlines() if not line.startswith("#")] # filter empty lines lines = [line for line in lines if line] return lines
def read_file(file_path): ''' read file ''' lines = [] with open(file_path, "r") as tf: lines = [line.strip("\n") for line in tf.readlines() if not line.startswith("#")] # filter empty lines lines = [line for line in lines if line] return lines
[ "read", "file" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/admin/src/python/standalone.py#L739-L748
[ "def", "read_file", "(", "file_path", ")", ":", "lines", "=", "[", "]", "with", "open", "(", "file_path", ",", "\"r\"", ")", "as", "tf", ":", "lines", "=", "[", "line", ".", "strip", "(", "\"\\n\"", ")", "for", "line", "in", "tf", ".", "readlines",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
call_editor
call editor
heron/tools/admin/src/python/standalone.py
def call_editor(file_path): ''' call editor ''' EDITOR = os.environ.get('EDITOR', 'vim') with open(file_path, 'r+') as tf: call([EDITOR, tf.name])
def call_editor(file_path): ''' call editor ''' EDITOR = os.environ.get('EDITOR', 'vim') with open(file_path, 'r+') as tf: call([EDITOR, tf.name])
[ "call", "editor" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/admin/src/python/standalone.py#L750-L756
[ "def", "call_editor", "(", "file_path", ")", ":", "EDITOR", "=", "os", ".", "environ", ".", "get", "(", "'EDITOR'", ",", "'vim'", ")", "with", "open", "(", "file_path", ",", "'r+'", ")", "as", "tf", ":", "call", "(", "[", "EDITOR", ",", "tf", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_remote_home
get home directory of remote host
heron/tools/admin/src/python/standalone.py
def get_remote_home(host, cl_args): ''' get home directory of remote host ''' cmd = "echo ~" if not is_self(host): cmd = ssh_remote_execute(cmd, host, cl_args) pid = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stder...
def get_remote_home(host, cl_args): ''' get home directory of remote host ''' cmd = "echo ~" if not is_self(host): cmd = ssh_remote_execute(cmd, host, cl_args) pid = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stder...
[ "get", "home", "directory", "of", "remote", "host" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/admin/src/python/standalone.py#L809-L826
[ "def", "get_remote_home", "(", "host", ",", "cl_args", ")", ":", "cmd", "=", "\"echo ~\"", "if", "not", "is_self", "(", "host", ")", ":", "cmd", "=", "ssh_remote_execute", "(", "cmd", ",", "host", ",", "cl_args", ")", "pid", "=", "subprocess", ".", "Po...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_hostname
get host name of remote host
heron/tools/admin/src/python/standalone.py
def get_hostname(ip_addr, cl_args): ''' get host name of remote host ''' if is_self(ip_addr): return get_self_hostname() cmd = "hostname" ssh_cmd = ssh_remote_execute(cmd, ip_addr, cl_args) pid = subprocess.Popen(ssh_cmd, shell=True, stdout=subprocess....
def get_hostname(ip_addr, cl_args): ''' get host name of remote host ''' if is_self(ip_addr): return get_self_hostname() cmd = "hostname" ssh_cmd = ssh_remote_execute(cmd, ip_addr, cl_args) pid = subprocess.Popen(ssh_cmd, shell=True, stdout=subprocess....
[ "get", "host", "name", "of", "remote", "host" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/admin/src/python/standalone.py#L840-L858
[ "def", "get_hostname", "(", "ip_addr", ",", "cl_args", ")", ":", "if", "is_self", "(", "ip_addr", ")", ":", "return", "get_self_hostname", "(", ")", "cmd", "=", "\"hostname\"", "ssh_cmd", "=", "ssh_remote_execute", "(", "cmd", ",", "ip_addr", ",", "cl_args",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
is_self
check if this host is this addr
heron/tools/admin/src/python/standalone.py
def is_self(addr): ''' check if this host is this addr ''' ips = [] for i in netifaces.interfaces(): entry = netifaces.ifaddresses(i) if netifaces.AF_INET in entry: for ipv4 in entry[netifaces.AF_INET]: if "addr" in ipv4: ips.append(ipv4["addr"]) return addr in ips or addr ==...
def is_self(addr): ''' check if this host is this addr ''' ips = [] for i in netifaces.interfaces(): entry = netifaces.ifaddresses(i) if netifaces.AF_INET in entry: for ipv4 in entry[netifaces.AF_INET]: if "addr" in ipv4: ips.append(ipv4["addr"]) return addr in ips or addr ==...
[ "check", "if", "this", "host", "is", "this", "addr" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/admin/src/python/standalone.py#L884-L895
[ "def", "is_self", "(", "addr", ")", ":", "ips", "=", "[", "]", "for", "i", "in", "netifaces", ".", "interfaces", "(", ")", ":", "entry", "=", "netifaces", ".", "ifaddresses", "(", "i", ")", "if", "netifaces", ".", "AF_INET", "in", "entry", ":", "fo...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
BaseInstance.log
Log message, optionally providing a logging level It is compatible with StreamParse API. :type message: str :param message: the log message to send :type level: str :param level: the logging level, one of: trace (=debug), debug, info, warn or error (default: info)
heron/instance/src/python/basics/base_instance.py
def log(self, message, level=None): """Log message, optionally providing a logging level It is compatible with StreamParse API. :type message: str :param message: the log message to send :type level: str :param level: the logging level, one of: trace (=debug), debug, info, wa...
def log(self, message, level=None): """Log message, optionally providing a logging level It is compatible with StreamParse API. :type message: str :param message: the log message to send :type level: str :param level: the logging level, one of: trace (=debug), debug, info, wa...
[ "Log", "message", "optionally", "providing", "a", "logging", "level" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/instance/src/python/basics/base_instance.py#L74-L99
[ "def", "log", "(", "self", ",", "message", ",", "level", "=", "None", ")", ":", "if", "level", "is", "None", ":", "_log_level", "=", "logging", ".", "INFO", "else", ":", "if", "level", "==", "\"trace\"", "or", "level", "==", "\"debug\"", ":", "_log_l...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
BaseInstance.load_py_instance
Loads user defined component (spout/bolt)
heron/instance/src/python/basics/base_instance.py
def load_py_instance(self, is_spout): """Loads user defined component (spout/bolt)""" try: if is_spout: spout_proto = self.pplan_helper.get_my_spout() py_classpath = spout_proto.comp.class_name self.logger.info("Loading Spout from: %s", py_classpath) else: bolt_proto ...
def load_py_instance(self, is_spout): """Loads user defined component (spout/bolt)""" try: if is_spout: spout_proto = self.pplan_helper.get_my_spout() py_classpath = spout_proto.comp.class_name self.logger.info("Loading Spout from: %s", py_classpath) else: bolt_proto ...
[ "Loads", "user", "defined", "component", "(", "spout", "/", "bolt", ")" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/instance/src/python/basics/base_instance.py#L113-L132
[ "def", "load_py_instance", "(", "self", ",", "is_spout", ")", ":", "try", ":", "if", "is_spout", ":", "spout_proto", "=", "self", ".", "pplan_helper", ".", "get_my_spout", "(", ")", "py_classpath", "=", "spout_proto", ".", "comp", ".", "class_name", "self", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologiesHandler.get
get method
heron/tools/tracker/src/python/handlers/topologieshandler.py
def get(self): """ get method """ # Get all the values for parameter "cluster". clusters = self.get_arguments(constants.PARAM_CLUSTER) # Get all the values for parameter "environ". environs = self.get_arguments(constants.PARAM_ENVIRON) # Get role role = self.get_argument_role() ret = {}...
def get(self): """ get method """ # Get all the values for parameter "cluster". clusters = self.get_arguments(constants.PARAM_CLUSTER) # Get all the values for parameter "environ". environs = self.get_arguments(constants.PARAM_ENVIRON) # Get role role = self.get_argument_role() ret = {}...
[ "get", "method" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/tracker/src/python/handlers/topologieshandler.py#L60-L108
[ "def", "get", "(", "self", ")", ":", "# Get all the values for parameter \"cluster\".", "clusters", "=", "self", ".", "get_arguments", "(", "constants", ".", "PARAM_CLUSTER", ")", "# Get all the values for parameter \"environ\".", "environs", "=", "self", ".", "get_argume...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
dereference_symlinks
Resolve all symbolic references that `src` points to. Note that this is different than `os.path.realpath` as path components leading up to the final location may still be symbolic links.
tools/rules/pex/wrapper/pex_wrapper.py
def dereference_symlinks(src): """ Resolve all symbolic references that `src` points to. Note that this is different than `os.path.realpath` as path components leading up to the final location may still be symbolic links. """ while os.path.islink(src): src = os.path.join(os.path.dirname...
def dereference_symlinks(src): """ Resolve all symbolic references that `src` points to. Note that this is different than `os.path.realpath` as path components leading up to the final location may still be symbolic links. """ while os.path.islink(src): src = os.path.join(os.path.dirname...
[ "Resolve", "all", "symbolic", "references", "that", "src", "points", "to", ".", "Note", "that", "this", "is", "different", "than", "os", ".", "path", ".", "realpath", "as", "path", "components", "leading", "up", "to", "the", "final", "location", "may", "st...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/tools/rules/pex/wrapper/pex_wrapper.py#L27-L36
[ "def", "dereference_symlinks", "(", "src", ")", ":", "while", "os", ".", "path", ".", "islink", "(", "src", ")", ":", "src", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "src", ")", ",", "os", ".", "readlink",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ClustersHandler.get
get method
heron/tools/tracker/src/python/handlers/clustershandler.py
def get(self): """ get method """ clusters = [statemgr.name for statemgr in self.tracker.state_managers] self.write_success_response(clusters)
def get(self): """ get method """ clusters = [statemgr.name for statemgr in self.tracker.state_managers] self.write_success_response(clusters)
[ "get", "method" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/tracker/src/python/handlers/clustershandler.py#L39-L43
[ "def", "get", "(", "self", ")", ":", "clusters", "=", "[", "statemgr", ".", "name", "for", "statemgr", "in", "self", ".", "tracker", ".", "state_managers", "]", "self", ".", "write_success_response", "(", "clusters", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_cluster_role_env_topologies
Get the list of topologies given a cluster submitted by a given role under a given environment :param cluster: :param role: :param env: :return:
heron/tools/common/src/python/access/heron_api.py
def get_cluster_role_env_topologies(cluster, role, env): ''' Get the list of topologies given a cluster submitted by a given role under a given environment :param cluster: :param role: :param env: :return: ''' return _get_topologies(cluster, role=role, env=env)
def get_cluster_role_env_topologies(cluster, role, env): ''' Get the list of topologies given a cluster submitted by a given role under a given environment :param cluster: :param role: :param env: :return: ''' return _get_topologies(cluster, role=role, env=env)
[ "Get", "the", "list", "of", "topologies", "given", "a", "cluster", "submitted", "by", "a", "given", "role", "under", "a", "given", "environment", ":", "param", "cluster", ":", ":", "param", "role", ":", ":", "param", "env", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L180-L188
[ "def", "get_cluster_role_env_topologies", "(", "cluster", ",", "role", ",", "env", ")", ":", "return", "_get_topologies", "(", "cluster", ",", "role", "=", "role", ",", "env", "=", "env", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_execution_state
Get the execution state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_execution_state(cluster, environ, topology, role=None): ''' Get the execution state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role']...
def get_execution_state(cluster, environ, topology, role=None): ''' Get the execution state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role']...
[ "Get", "the", "execution", "state", "of", "a", "topology", "in", "a", "cluster", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L193-L206
[ "def", "get_execution_state", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_logical_plan
Get the logical plan state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_logical_plan(cluster, environ, topology, role=None): ''' Get the logical plan state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role']...
def get_logical_plan(cluster, environ, topology, role=None): ''' Get the logical plan state of a topology in a cluster :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role']...
[ "Get", "the", "logical", "plan", "state", "of", "a", "topology", "in", "a", "cluster", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L211-L225
[ "def", "get_logical_plan", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_comps
Get the list of component names for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_comps(cluster, environ, topology, role=None): ''' Get the list of component names for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['ro...
def get_comps(cluster, environ, topology, role=None): ''' Get the list of component names for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['ro...
[ "Get", "the", "list", "of", "component", "names", "for", "the", "topology", "from", "Heron", "Nest", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L230-L246
[ "def", "get_comps", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role", "is", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_instances
Get the list of instances for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_instances(cluster, environ, topology, role=None): ''' Get the list of instances for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role...
def get_instances(cluster, environ, topology, role=None): ''' Get the list of instances for the topology from Heron Nest :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: params['role...
[ "Get", "the", "list", "of", "instances", "for", "the", "topology", "from", "Heron", "Nest", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L250-L266
[ "def", "get_instances", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role", "is...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_physical_plan
Get the physical plan state of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_physical_plan(cluster, environ, topology, role=None): ''' Get the physical plan state of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: ...
def get_physical_plan(cluster, environ, topology, role=None): ''' Get the physical plan state of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None: ...
[ "Get", "the", "physical", "plan", "state", "of", "a", "topology", "in", "a", "cluster", "from", "tracker", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L271-L285
[ "def", "get_physical_plan", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_scheduler_location
Get the scheduler location of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_scheduler_location(cluster, environ, topology, role=None): ''' Get the scheduler location of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None:...
def get_scheduler_location(cluster, environ, topology, role=None): ''' Get the scheduler location of a topology in a cluster from tracker :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict(cluster=cluster, environ=environ, topology=topology) if role is not None:...
[ "Get", "the", "scheduler", "location", "of", "a", "topology", "in", "a", "cluster", "from", "tracker", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L290-L304
[ "def", "get_scheduler_location", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "rol...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_component_exceptionsummary
Get summary of exception for a component :param cluster: :param environ: :param topology: :param component: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_component_exceptionsummary(cluster, environ, topology, component, role=None): ''' Get summary of exception for a component :param cluster: :param environ: :param topology: :param component: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=...
def get_component_exceptionsummary(cluster, environ, topology, component, role=None): ''' Get summary of exception for a component :param cluster: :param environ: :param topology: :param component: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=...
[ "Get", "summary", "of", "exception", "for", "a", "component", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L309-L328
[ "def", "get_component_exceptionsummary", "(", "cluster", ",", "environ", ",", "topology", ",", "component", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "to...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_component_exceptions
Get exceptions for 'component' for 'topology' :param cluster: :param environ: :param topology: :param component: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_component_exceptions(cluster, environ, topology, component, role=None): ''' Get exceptions for 'component' for 'topology' :param cluster: :param environ: :param topology: :param component: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=t...
def get_component_exceptions(cluster, environ, topology, component, role=None): ''' Get exceptions for 'component' for 'topology' :param cluster: :param environ: :param topology: :param component: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=t...
[ "Get", "exceptions", "for", "component", "for", "topology", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L333-L352
[ "def", "get_component_exceptions", "(", "cluster", ",", "environ", ",", "topology", ",", "component", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_comp_instance_metrics
Get the metrics for some instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param metrics: dict of display name to cuckoo name :param instances: :param time_range: 2-tuple consisting of start and end of range :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_comp_instance_metrics(cluster, environ, topology, component, metrics, instances, time_range, role=None): ''' Get the metrics for some instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param metrics: dict of di...
def get_comp_instance_metrics(cluster, environ, topology, component, metrics, instances, time_range, role=None): ''' Get the metrics for some instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param metrics: dict of di...
[ "Get", "the", "metrics", "for", "some", "instances", "of", "a", "topology", "from", "tracker", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "metrics", ":", "dict"...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L357-L397
[ "def", "get_comp_instance_metrics", "(", "cluster", ",", "environ", ",", "topology", ",", "component", ",", "metrics", ",", "instances", ",", "time_range", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "env...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_comp_metrics
Get the metrics for all the instances of a topology from Heron Nest :param cluster: :param environ: :param topology: :param component: :param instances: :param metricnames: dict of display name to cuckoo name :param time_range: 2-tuple consisting of start and end of range :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_comp_metrics(cluster, environ, topology, component, instances, metricnames, time_range, role=None): ''' Get the metrics for all the instances of a topology from Heron Nest :param cluster: :param environ: :param topology: :param component: :param instances: :param metricnames...
def get_comp_metrics(cluster, environ, topology, component, instances, metricnames, time_range, role=None): ''' Get the metrics for all the instances of a topology from Heron Nest :param cluster: :param environ: :param topology: :param component: :param instances: :param metricnames...
[ "Get", "the", "metrics", "for", "all", "the", "instances", "of", "a", "topology", "from", "Heron", "Nest", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "instances...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L402-L439
[ "def", "get_comp_metrics", "(", "cluster", ",", "environ", ",", "topology", ",", "component", ",", "instances", ",", "metricnames", ",", "time_range", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_metrics
Get the metrics for a topology from tracker :param cluster: :param environment: :param topology: :param timerange: :param query: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_metrics(cluster, environment, topology, timerange, query, role=None): ''' Get the metrics for a topology from tracker :param cluster: :param environment: :param topology: :param timerange: :param query: :param role: :return: ''' params = dict( cluster=cluster, environ=environme...
def get_metrics(cluster, environment, topology, timerange, query, role=None): ''' Get the metrics for a topology from tracker :param cluster: :param environment: :param topology: :param timerange: :param query: :param role: :return: ''' params = dict( cluster=cluster, environ=environme...
[ "Get", "the", "metrics", "for", "a", "topology", "from", "tracker", ":", "param", "cluster", ":", ":", "param", "environment", ":", ":", "param", "topology", ":", ":", "param", "timerange", ":", ":", "param", "query", ":", ":", "param", "role", ":", ":...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L444-L471
[ "def", "get_metrics", "(", "cluster", ",", "environment", ",", "topology", ",", "timerange", ",", "query", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environment", ",", "topology", "="...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_comp_metrics_timeline
Get the minute-by-minute metrics for all instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param instances: :param metricnames: dict of display name to cuckoo name :param time_range: 2-tuple consisting of start and end of range :param role: :...
heron/tools/common/src/python/access/heron_api.py
def get_comp_metrics_timeline(cluster, environ, topology, component, instances, metricnames, time_range, role=None): ''' Get the minute-by-minute metrics for all instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param ins...
def get_comp_metrics_timeline(cluster, environ, topology, component, instances, metricnames, time_range, role=None): ''' Get the minute-by-minute metrics for all instances of a topology from tracker :param cluster: :param environ: :param topology: :param component: :param ins...
[ "Get", "the", "minute", "-", "by", "-", "minute", "metrics", "for", "all", "instances", "of", "a", "topology", "from", "tracker", ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L476-L517
[ "def", "get_comp_metrics_timeline", "(", "cluster", ",", "environ", ",", "topology", ",", "component", ",", "instances", ",", "metricnames", ",", "time_range", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_topology_info
:param cluster: :param environ: :param topology: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_topology_info(cluster, environ, topology, role=None): ''' :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology) if role is not None: params['role'] = role request_url = tornado.ht...
def get_topology_info(cluster, environ, topology, role=None): ''' :param cluster: :param environ: :param topology: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology) if role is not None: params['role'] = role request_url = tornado.ht...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L521-L539
[ "def", "get_topology_info", "(", "cluster", ",", "environ", ",", "topology", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ")", "if", "role", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_instance_pid
:param cluster: :param environ: :param topology: :param instance: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_instance_pid(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not None: ...
def get_instance_pid(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not None: ...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "instance", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L544-L564
[ "def", "get_instance_pid", "(", "cluster", ",", "environ", ",", "topology", ",", "instance", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ",",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_instance_jstack
:param cluster: :param environ: :param topology: :param instance: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_instance_jstack(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not Non...
def get_instance_jstack(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not Non...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "instance", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L569-L590
[ "def", "get_instance_jstack", "(", "cluster", ",", "environ", ",", "topology", ",", "instance", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_instance_mem_histogram
:param cluster: :param environ: :param topology: :param instance: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_instance_mem_histogram(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is ...
def get_instance_mem_histogram(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is ...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "instance", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L595-L616
[ "def", "get_instance_mem_histogram", "(", "cluster", ",", "environ", ",", "topology", ",", "instance", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topolog...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
run_instance_jmap
:param cluster: :param environ: :param topology: :param instance: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def run_instance_jmap(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not None:...
def run_instance_jmap(cluster, environ, topology, instance, role=None): ''' :param cluster: :param environ: :param topology: :param instance: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, instance=instance) if role is not None:...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "instance", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L621-L645
[ "def", "run_instance_jmap", "(", "cluster", ",", "environ", ",", "topology", ",", "instance", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "topology", ","...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_container_file_download_url
:param cluster: :param environ: :param topology: :param container: :param path: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_container_file_download_url(cluster, environ, topology, container, path, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, ...
def get_container_file_download_url(cluster, environ, topology, container, path, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, ...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "container", ":", ":", "param", "path", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L648-L673
[ "def", "get_container_file_download_url", "(", "cluster", ",", "environ", ",", "topology", ",", "container", ",", "path", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topol...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_container_file_data
:param cluster: :param environ: :param topology: :param container: :param path: :param offset: :param length: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_container_file_data(cluster, environ, topology, container, path, offset, length, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param offset: :param length: :param role: :return: ''' params = dict( cluste...
def get_container_file_data(cluster, environ, topology, container, path, offset, length, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param offset: :param length: :param role: :return: ''' params = dict( cluste...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "container", ":", ":", "param", "path", ":", ":", "param", "offset", ":", ":", "param", "length", ":", ":", "param", "role", ":", ":", "return", ...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L677-L708
[ "def", "get_container_file_data", "(", "cluster", ",", "environ", ",", "topology", ",", "container", ",", "path", ",", "offset", ",", "length", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "="...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_filestats
:param cluster: :param environ: :param topology: :param container: :param path: :param role: :return:
heron/tools/common/src/python/access/heron_api.py
def get_filestats(cluster, environ, topology, container, path, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, container=container, ...
def get_filestats(cluster, environ, topology, container, path, role=None): ''' :param cluster: :param environ: :param topology: :param container: :param path: :param role: :return: ''' params = dict( cluster=cluster, environ=environ, topology=topology, container=container, ...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "container", ":", ":", "param", "path", ":", ":", "param", "role", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L713-L735
[ "def", "get_filestats", "(", "cluster", ",", "environ", ",", "topology", ",", "container", ",", "path", ",", "role", "=", "None", ")", ":", "params", "=", "dict", "(", "cluster", "=", "cluster", ",", "environ", "=", "environ", ",", "topology", "=", "to...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.fetch
:param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return:
heron/tools/common/src/python/access/heron_api.py
def fetch(self, cluster, metric, topology, component, instance, timerange, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return: ''' components = [component] if component != "*" else (y...
def fetch(self, cluster, metric, topology, component, instance, timerange, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return: ''' components = [component] if component != "*" else (y...
[ ":", "param", "cluster", ":", ":", "param", "metric", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "instance", ":", ":", "param", "timerange", ":", ":", "param", "environ", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L742-L769
[ "def", "fetch", "(", "self", ",", "cluster", ",", "metric", ",", "topology", ",", "component", ",", "instance", ",", "timerange", ",", "environ", "=", "None", ")", ":", "components", "=", "[", "component", "]", "if", "component", "!=", "\"*\"", "else", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.fetch_max
:param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return:
heron/tools/common/src/python/access/heron_api.py
def fetch_max(self, cluster, metric, topology, component, instance, timerange, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return: ''' components = [component] if component != "*" els...
def fetch_max(self, cluster, metric, topology, component, instance, timerange, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param environ: :return: ''' components = [component] if component != "*" els...
[ ":", "param", "cluster", ":", ":", "param", "metric", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "instance", ":", ":", "param", "timerange", ":", ":", "param", "environ", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L772-L799
[ "def", "fetch_max", "(", "self", ",", "cluster", ",", "metric", ",", "topology", ",", "component", ",", "instance", ",", "timerange", ",", "environ", "=", "None", ")", ":", "components", "=", "[", "component", "]", "if", "component", "!=", "\"*\"", "else...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.fetch_backpressure
:param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param isMax: :param environ: :return:
heron/tools/common/src/python/access/heron_api.py
def fetch_backpressure(self, cluster, metric, topology, component, instance, \ timerange, is_max, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param isMax: :param environ: :return: ''' instanc...
def fetch_backpressure(self, cluster, metric, topology, component, instance, \ timerange, is_max, environ=None): ''' :param cluster: :param metric: :param topology: :param component: :param instance: :param timerange: :param isMax: :param environ: :return: ''' instanc...
[ ":", "param", "cluster", ":", ":", "param", "metric", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "param", "instance", ":", ":", "param", "timerange", ":", ":", "param", "isMax", ":", ":", "param", "environ", ":", ":", "r...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L803-L842
[ "def", "fetch_backpressure", "(", "self", ",", "cluster", ",", "metric", ",", "topology", ",", "component", ",", "instance", ",", "timerange", ",", "is_max", ",", "environ", "=", "None", ")", ":", "instances", "=", "yield", "get_instances", "(", "cluster", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.compute_max
:param multi_ts: :return:
heron/tools/common/src/python/access/heron_api.py
def compute_max(self, multi_ts): ''' :param multi_ts: :return: ''' if len(multi_ts) > 0 and len(multi_ts[0]["timeline"]) > 0: keys = multi_ts[0]["timeline"][0]["data"].keys() timelines = ([res["timeline"][0]["data"][key] for key in keys] for res in multi_ts) values = (max(v) for v ...
def compute_max(self, multi_ts): ''' :param multi_ts: :return: ''' if len(multi_ts) > 0 and len(multi_ts[0]["timeline"]) > 0: keys = multi_ts[0]["timeline"][0]["data"].keys() timelines = ([res["timeline"][0]["data"][key] for key in keys] for res in multi_ts) values = (max(v) for v ...
[ ":", "param", "multi_ts", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L845-L855
[ "def", "compute_max", "(", "self", ",", "multi_ts", ")", ":", "if", "len", "(", "multi_ts", ")", ">", "0", "and", "len", "(", "multi_ts", "[", "0", "]", "[", "\"timeline\"", "]", ")", ">", "0", ":", "keys", "=", "multi_ts", "[", "0", "]", "[", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.get_metric_response
:param timerange: :param data: :param isMax: :return:
heron/tools/common/src/python/access/heron_api.py
def get_metric_response(self, timerange, data, isMax): ''' :param timerange: :param data: :param isMax: :return: ''' if isMax: return dict( status="success", starttime=timerange[0], endtime=timerange[1], result=dict(timeline=[dict(data=data)]) ...
def get_metric_response(self, timerange, data, isMax): ''' :param timerange: :param data: :param isMax: :return: ''' if isMax: return dict( status="success", starttime=timerange[0], endtime=timerange[1], result=dict(timeline=[dict(data=data)]) ...
[ ":", "param", "timerange", ":", ":", "param", "data", ":", ":", "param", "isMax", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L858-L878
[ "def", "get_metric_response", "(", "self", ",", "timerange", ",", "data", ",", "isMax", ")", ":", "if", "isMax", ":", "return", "dict", "(", "status", "=", "\"success\"", ",", "starttime", "=", "timerange", "[", "0", "]", ",", "endtime", "=", "timerange"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronQueryHandler.get_query
:param metric: :param component: :param instance: :return:
heron/tools/common/src/python/access/heron_api.py
def get_query(self, metric, component, instance): ''' :param metric: :param component: :param instance: :return: ''' q = queries.get(metric) return q.format(component, instance)
def get_query(self, metric, component, instance): ''' :param metric: :param component: :param instance: :return: ''' q = queries.get(metric) return q.format(component, instance)
[ ":", "param", "metric", ":", ":", "param", "component", ":", ":", "param", "instance", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/heron_api.py#L881-L889
[ "def", "get_query", "(", "self", ",", "metric", ",", "component", ",", "instance", ")", ":", "q", "=", "queries", ".", "get", "(", "metric", ")", "return", "q", ".", "format", "(", "component", ",", "instance", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
to_table
normalize raw result to table
heron/tools/explorer/src/python/topologies.py
def to_table(result): ''' normalize raw result to table ''' max_count = 20 table, count = [], 0 for role, envs_topos in result.items(): for env, topos in envs_topos.items(): for topo in topos: count += 1 if count > max_count: continue else: table.append([rol...
def to_table(result): ''' normalize raw result to table ''' max_count = 20 table, count = [], 0 for role, envs_topos in result.items(): for env, topos in envs_topos.items(): for topo in topos: count += 1 if count > max_count: continue else: table.append([rol...
[ "normalize", "raw", "result", "to", "table" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/topologies.py#L43-L57
[ "def", "to_table", "(", "result", ")", ":", "max_count", "=", "20", "table", ",", "count", "=", "[", "]", ",", "0", "for", "role", ",", "envs_topos", "in", "result", ".", "items", "(", ")", ":", "for", "env", ",", "topos", "in", "envs_topos", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
show_cluster
print topologies information to stdout
heron/tools/explorer/src/python/topologies.py
def show_cluster(cl_args, cluster): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_topologies(cluster) if not result: Log.error('No topologies in cluster \'%s\'' % cluster) return False result = result[cluster] except Exception: Log.error("Fail ...
def show_cluster(cl_args, cluster): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_topologies(cluster) if not result: Log.error('No topologies in cluster \'%s\'' % cluster) return False result = result[cluster] except Exception: Log.error("Fail ...
[ "print", "topologies", "information", "to", "stdout" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/topologies.py#L61-L77
[ "def", "show_cluster", "(", "cl_args", ",", "cluster", ")", ":", "try", ":", "result", "=", "tracker_access", ".", "get_cluster_topologies", "(", "cluster", ")", "if", "not", "result", ":", "Log", ".", "error", "(", "'No topologies in cluster \\'%s\\''", "%", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
show_cluster_role
print topologies information to stdout
heron/tools/explorer/src/python/topologies.py
def show_cluster_role(cl_args, cluster, role): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_role_topologies(cluster, role) if not result: Log.error('Unknown cluster/role \'%s\'' % '/'.join([cluster, role])) return False result = result[cluster] ex...
def show_cluster_role(cl_args, cluster, role): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_role_topologies(cluster, role) if not result: Log.error('Unknown cluster/role \'%s\'' % '/'.join([cluster, role])) return False result = result[cluster] ex...
[ "print", "topologies", "information", "to", "stdout" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/topologies.py#L81-L97
[ "def", "show_cluster_role", "(", "cl_args", ",", "cluster", ",", "role", ")", ":", "try", ":", "result", "=", "tracker_access", ".", "get_cluster_role_topologies", "(", "cluster", ",", "role", ")", "if", "not", "result", ":", "Log", ".", "error", "(", "'Un...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
show_cluster_role_env
print topologies information to stdout
heron/tools/explorer/src/python/topologies.py
def show_cluster_role_env(cl_args, cluster, role, env): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_role_env_topologies(cluster, role, env) if not result: Log.error('Unknown cluster/role/env \'%s\'' % '/'.join([cluster, role, env])) return False re...
def show_cluster_role_env(cl_args, cluster, role, env): ''' print topologies information to stdout ''' try: result = tracker_access.get_cluster_role_env_topologies(cluster, role, env) if not result: Log.error('Unknown cluster/role/env \'%s\'' % '/'.join([cluster, role, env])) return False re...
[ "print", "topologies", "information", "to", "stdout" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/topologies.py#L101-L118
[ "def", "show_cluster_role_env", "(", "cl_args", ",", "cluster", ",", "role", ",", "env", ")", ":", "try", ":", "result", "=", "tracker_access", ".", "get_cluster_role_env_topologies", "(", "cluster", ",", "role", ",", "env", ")", "if", "not", "result", ":", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
run
run command
heron/tools/explorer/src/python/topologies.py
def run(command, parser, cl_args, unknown_args): """ run command """ location = cl_args['cluster/[role]/[env]'].split('/') if len(location) == 1: return show_cluster(cl_args, *location) elif len(location) == 2: return show_cluster_role(cl_args, *location) elif len(location) == 3: return show_clust...
def run(command, parser, cl_args, unknown_args): """ run command """ location = cl_args['cluster/[role]/[env]'].split('/') if len(location) == 1: return show_cluster(cl_args, *location) elif len(location) == 2: return show_cluster_role(cl_args, *location) elif len(location) == 3: return show_clust...
[ "run", "command" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/topologies.py#L121-L132
[ "def", "run", "(", "command", ",", "parser", ",", "cl_args", ",", "unknown_args", ")", ":", "location", "=", "cl_args", "[", "'cluster/[role]/[env]'", "]", ".", "split", "(", "'/'", ")", "if", "len", "(", "location", ")", "==", "1", ":", "return", "sho...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
heron_class
Execute a heron class given the args and the jars needed for class path :param class_name: :param lib_jars: :param extra_jars: :param args: :param java_defines: :return:
heron/tools/cli/src/python/execute.py
def heron_class(class_name, lib_jars, extra_jars=None, args=None, java_defines=None): ''' Execute a heron class given the args and the jars needed for class path :param class_name: :param lib_jars: :param extra_jars: :param args: :param java_defines: :return: ''' # default optional params to empty l...
def heron_class(class_name, lib_jars, extra_jars=None, args=None, java_defines=None): ''' Execute a heron class given the args and the jars needed for class path :param class_name: :param lib_jars: :param extra_jars: :param args: :param java_defines: :return: ''' # default optional params to empty l...
[ "Execute", "a", "heron", "class", "given", "the", "args", "and", "the", "jars", "needed", "for", "class", "path", ":", "param", "class_name", ":", ":", "param", "lib_jars", ":", ":", "param", "extra_jars", ":", ":", "param", "args", ":", ":", "param", ...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/execute.py#L40-L84
[ "def", "heron_class", "(", "class_name", ",", "lib_jars", ",", "extra_jars", "=", "None", ",", "args", "=", "None", ",", "java_defines", "=", "None", ")", ":", "# default optional params to empty list if not provided", "if", "extra_jars", "is", "None", ":", "extra...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
heron_tar
:param class_name: :param topology_tar: :param arguments: :param tmpdir_root: :param java_defines: :return:
heron/tools/cli/src/python/execute.py
def heron_tar(class_name, topology_tar, arguments, tmpdir_root, java_defines): ''' :param class_name: :param topology_tar: :param arguments: :param tmpdir_root: :param java_defines: :return: ''' # Extract tar to a tmp folder. tmpdir = tempfile.mkdtemp(dir=tmpdir_root, prefix='tmp') with contextli...
def heron_tar(class_name, topology_tar, arguments, tmpdir_root, java_defines): ''' :param class_name: :param topology_tar: :param arguments: :param tmpdir_root: :param java_defines: :return: ''' # Extract tar to a tmp folder. tmpdir = tempfile.mkdtemp(dir=tmpdir_root, prefix='tmp') with contextli...
[ ":", "param", "class_name", ":", ":", "param", "topology_tar", ":", ":", "param", "arguments", ":", ":", "param", "tmpdir_root", ":", ":", "param", "java_defines", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/execute.py#L86-L116
[ "def", "heron_tar", "(", "class_name", ",", "topology_tar", ",", "arguments", ",", "tmpdir_root", ",", "java_defines", ")", ":", "# Extract tar to a tmp folder.", "tmpdir", "=", "tempfile", ".", "mkdtemp", "(", "dir", "=", "tmpdir_root", ",", "prefix", "=", "'tm...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyExceptionSummaryHandler.get
:param cluster: :param environ: :param topology: :param comp_name: :return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self, cluster, environ, topology, comp_name): ''' :param cluster: :param environ: :param topology: :param comp_name: :return: ''' start_time = time.time() comp_names = [] if comp_name == "All": lplan = yield access.get_logical_plan(cluster, environ, topology) ...
def get(self, cluster, environ, topology, comp_name): ''' :param cluster: :param environ: :param topology: :param comp_name: :return: ''' start_time = time.time() comp_names = [] if comp_name == "All": lplan = yield access.get_logical_plan(cluster, environ, topology) ...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "comp_name", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L37-L82
[ "def", "get", "(", "self", ",", "cluster", ",", "environ", ",", "topology", ",", "comp_name", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "comp_names", "=", "[", "]", "if", "comp_name", "==", "\"All\"", ":", "lplan", "=", "yield", "ac...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ListTopologiesJsonHandler.get
:return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self): ''' :return: ''' # get all the topologies from heron nest topologies = yield access.get_topologies_states() result = dict() # now convert some of the fields to be displayable for cluster, cluster_value in topologies.items(): result[cluster] = dict() for envir...
def get(self): ''' :return: ''' # get all the topologies from heron nest topologies = yield access.get_topologies_states() result = dict() # now convert some of the fields to be displayable for cluster, cluster_value in topologies.items(): result[cluster] = dict() for envir...
[ ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L89-L114
[ "def", "get", "(", "self", ")", ":", "# get all the topologies from heron nest", "topologies", "=", "yield", "access", ".", "get_topologies_states", "(", ")", "result", "=", "dict", "(", ")", "# now convert some of the fields to be displayable", "for", "cluster", ",", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyLogicalPlanJsonHandler.get
:param cluster: :param environ: :param topology: :return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self, cluster, environ, topology): ''' :param cluster: :param environ: :param topology: :return: ''' start_time = time.time() lplan = yield access.get_logical_plan(cluster, environ, topology) # construct the result result = dict( status="success", messag...
def get(self, cluster, environ, topology): ''' :param cluster: :param environ: :param topology: :return: ''' start_time = time.time() lplan = yield access.get_logical_plan(cluster, environ, topology) # construct the result result = dict( status="success", messag...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L121-L141
[ "def", "get", "(", "self", ",", "cluster", ",", "environ", ",", "topology", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "lplan", "=", "yield", "access", ".", "get_logical_plan", "(", "cluster", ",", "environ", ",", "topology", ")", "# c...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyPhysicalPlanJsonHandler.get
:param cluster: :param environ: :param topology: :return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self, cluster, environ, topology): ''' :param cluster: :param environ: :param topology: :return: ''' start_time = time.time() pplan = yield access.get_physical_plan(cluster, environ, topology) result_map = dict( status="success", message="", version=...
def get(self, cluster, environ, topology): ''' :param cluster: :param environ: :param topology: :return: ''' start_time = time.time() pplan = yield access.get_physical_plan(cluster, environ, topology) result_map = dict( status="success", message="", version=...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L148-L167
[ "def", "get", "(", "self", ",", "cluster", ",", "environ", ",", "topology", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "pplan", "=", "yield", "access", ".", "get_physical_plan", "(", "cluster", ",", "environ", ",", "topology", ")", "re...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyExceptionsJsonHandler.get
:param cluster: :param environ: :param topology: :param component: :return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self, cluster, environ, topology, component): ''' :param cluster: :param environ: :param topology: :param component: :return: ''' start_time = time.time() futures = yield access.get_component_exceptions(cluster, environ, topology, component) result_map = dict( sta...
def get(self, cluster, environ, topology, component): ''' :param cluster: :param environ: :param topology: :param component: :return: ''' start_time = time.time() futures = yield access.get_component_exceptions(cluster, environ, topology, component) result_map = dict( sta...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "component", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L225-L239
[ "def", "get", "(", "self", ",", "cluster", ",", "environ", ",", "topology", ",", "component", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "futures", "=", "yield", "access", ".", "get_component_exceptions", "(", "cluster", ",", "environ", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
PidHandler.get
:param cluster: :param environ: :param topology: :param instance: :return:
heron/tools/ui/src/python/handlers/api/topology.py
def get(self, cluster, environ, topology, instance): ''' :param cluster: :param environ: :param topology: :param instance: :return: ''' pplan = yield access.get_physical_plan(cluster, environ, topology) host = pplan['stmgrs'][pplan['instances'][instance]['stmgrId']]['host'] resul...
def get(self, cluster, environ, topology, instance): ''' :param cluster: :param environ: :param topology: :param instance: :return: ''' pplan = yield access.get_physical_plan(cluster, environ, topology) host = pplan['stmgrs'][pplan['instances'][instance]['stmgrId']]['host'] resul...
[ ":", "param", "cluster", ":", ":", "param", "environ", ":", ":", "param", "topology", ":", ":", "param", "instance", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/api/topology.py#L246-L261
[ "def", "get", "(", "self", ",", "cluster", ",", "environ", ",", "topology", ",", "instance", ")", ":", "pplan", "=", "yield", "access", ".", "get_physical_plan", "(", "cluster", ",", "environ", ",", "topology", ")", "host", "=", "pplan", "[", "'stmgrs'",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
Result.add_context
Prepend msg to add some context information :param pmsg: context info :return: None
heron/tools/cli/src/python/result.py
def add_context(self, err_context, succ_context=None): """ Prepend msg to add some context information :param pmsg: context info :return: None """ self.err_context = err_context self.succ_context = succ_context
def add_context(self, err_context, succ_context=None): """ Prepend msg to add some context information :param pmsg: context info :return: None """ self.err_context = err_context self.succ_context = succ_context
[ "Prepend", "msg", "to", "add", "some", "context", "information" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/result.py#L94-L101
[ "def", "add_context", "(", "self", ",", "err_context", ",", "succ_context", "=", "None", ")", ":", "self", ".", "err_context", "=", "err_context", "self", ".", "succ_context", "=", "succ_context" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ProcessResult.renderProcessStdErr
render stderr of shelled-out process stderr could be error message of failure of invoking process or normal stderr output from successfully shelled-out process. In the first case, ``Popen'' should fail fast and we should be able to get return code immediately. We then render the failure ...
heron/tools/cli/src/python/result.py
def renderProcessStdErr(self, stderr_line): """ render stderr of shelled-out process stderr could be error message of failure of invoking process or normal stderr output from successfully shelled-out process. In the first case, ``Popen'' should fail fast and we should be able to get ...
def renderProcessStdErr(self, stderr_line): """ render stderr of shelled-out process stderr could be error message of failure of invoking process or normal stderr output from successfully shelled-out process. In the first case, ``Popen'' should fail fast and we should be able to get ...
[ "render", "stderr", "of", "shelled", "-", "out", "process", "stderr", "could", "be", "error", "message", "of", "failure", "of", "invoking", "process", "or", "normal", "stderr", "output", "from", "successfully", "shelled", "-", "out", "process", ".", "In", "t...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/result.py#L127-L143
[ "def", "renderProcessStdErr", "(", "self", ",", "stderr_line", ")", ":", "retcode", "=", "self", ".", "process", ".", "poll", "(", ")", "if", "retcode", "is", "not", "None", "and", "status_type", "(", "retcode", ")", "==", "Status", ".", "InvocationError",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
ProcessResult.renderProcessStdOut
render stdout of shelled-out process stdout always contains information Java process wants to propagate back to cli, so we do special rendering here :param stdout: all lines from shelled-out process :return:
heron/tools/cli/src/python/result.py
def renderProcessStdOut(self, stdout): """ render stdout of shelled-out process stdout always contains information Java process wants to propagate back to cli, so we do special rendering here :param stdout: all lines from shelled-out process :return: """ # since we render stdout line...
def renderProcessStdOut(self, stdout): """ render stdout of shelled-out process stdout always contains information Java process wants to propagate back to cli, so we do special rendering here :param stdout: all lines from shelled-out process :return: """ # since we render stdout line...
[ "render", "stdout", "of", "shelled", "-", "out", "process", "stdout", "always", "contains", "information", "Java", "process", "wants", "to", "propagate", "back", "to", "cli", "so", "we", "do", "special", "rendering", "here", ":", "param", "stdout", ":", "all...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/cli/src/python/result.py#L145-L169
[ "def", "renderProcessStdOut", "(", "self", ",", "stdout", ")", ":", "# since we render stdout line based on Java process return code,", "# ``status'' has to be already set", "assert", "self", ".", "status", "is", "not", "None", "# remove pending newline", "if", "self", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
StateManager.is_host_port_reachable
Returns true if the host is reachable. In some cases, it may not be reachable a tunnel must be used.
heron/statemgrs/src/python/statemanager.py
def is_host_port_reachable(self): """ Returns true if the host is reachable. In some cases, it may not be reachable a tunnel must be used. """ for hostport in self.hostportlist: try: socket.create_connection(hostport, StateManager.TIMEOUT_SECONDS) return True except: ...
def is_host_port_reachable(self): """ Returns true if the host is reachable. In some cases, it may not be reachable a tunnel must be used. """ for hostport in self.hostportlist: try: socket.create_connection(hostport, StateManager.TIMEOUT_SECONDS) return True except: ...
[ "Returns", "true", "if", "the", "host", "is", "reachable", ".", "In", "some", "cases", "it", "may", "not", "be", "reachable", "a", "tunnel", "must", "be", "used", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/statemanager.py#L86-L99
[ "def", "is_host_port_reachable", "(", "self", ")", ":", "for", "hostport", "in", "self", ".", "hostportlist", ":", "try", ":", "socket", ".", "create_connection", "(", "hostport", ",", "StateManager", ".", "TIMEOUT_SECONDS", ")", "return", "True", "except", ":...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
StateManager.pick_unused_port
Pick an unused port. There is a slight chance that this wont work.
heron/statemgrs/src/python/statemanager.py
def pick_unused_port(self): """ Pick an unused port. There is a slight chance that this wont work. """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('127.0.0.1', 0)) _, port = s.getsockname() s.close() return port
def pick_unused_port(self): """ Pick an unused port. There is a slight chance that this wont work. """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('127.0.0.1', 0)) _, port = s.getsockname() s.close() return port
[ "Pick", "an", "unused", "port", ".", "There", "is", "a", "slight", "chance", "that", "this", "wont", "work", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/statemanager.py#L102-L108
[ "def", "pick_unused_port", "(", "self", ")", ":", "s", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_STREAM", ")", "s", ".", "bind", "(", "(", "'127.0.0.1'", ",", "0", ")", ")", "_", ",", "port", "=", "s", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
StateManager.establish_ssh_tunnel
Establish an ssh tunnel for each local host and port that can be used to communicate with the state host.
heron/statemgrs/src/python/statemanager.py
def establish_ssh_tunnel(self): """ Establish an ssh tunnel for each local host and port that can be used to communicate with the state host. """ localportlist = [] for (host, port) in self.hostportlist: localport = self.pick_unused_port() self.tunnel.append(subprocess.Popen( ...
def establish_ssh_tunnel(self): """ Establish an ssh tunnel for each local host and port that can be used to communicate with the state host. """ localportlist = [] for (host, port) in self.hostportlist: localport = self.pick_unused_port() self.tunnel.append(subprocess.Popen( ...
[ "Establish", "an", "ssh", "tunnel", "for", "each", "local", "host", "and", "port", "that", "can", "be", "used", "to", "communicate", "with", "the", "state", "host", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/statemanager.py#L110-L121
[ "def", "establish_ssh_tunnel", "(", "self", ")", ":", "localportlist", "=", "[", "]", "for", "(", "host", ",", "port", ")", "in", "self", ".", "hostportlist", ":", "localport", "=", "self", ".", "pick_unused_port", "(", ")", "self", ".", "tunnel", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
StateManager.delete_topology_from_zk
Removes the topology entry from: 1. topologies list, 2. pplan, 3. execution_state, and
heron/statemgrs/src/python/statemanager.py
def delete_topology_from_zk(self, topologyName): """ Removes the topology entry from: 1. topologies list, 2. pplan, 3. execution_state, and """ self.delete_pplan(topologyName) self.delete_execution_state(topologyName) self.delete_topology(topologyName)
def delete_topology_from_zk(self, topologyName): """ Removes the topology entry from: 1. topologies list, 2. pplan, 3. execution_state, and """ self.delete_pplan(topologyName) self.delete_execution_state(topologyName) self.delete_topology(topologyName)
[ "Removes", "the", "topology", "entry", "from", ":", "1", ".", "topologies", "list", "2", ".", "pplan", "3", ".", "execution_state", "and" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/statemanager.py#L216-L225
[ "def", "delete_topology_from_zk", "(", "self", ",", "topologyName", ")", ":", "self", ".", "delete_pplan", "(", "topologyName", ")", "self", ".", "delete_execution_state", "(", "topologyName", ")", "self", ".", "delete_topology", "(", "topologyName", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.monitor
Monitor the rootpath and call the callback corresponding to the change. This monitoring happens periodically. This function is called in a seperate thread from the main thread, because it sleeps for the intervals between each poll.
heron/statemgrs/src/python/filestatemanager.py
def monitor(self): """ Monitor the rootpath and call the callback corresponding to the change. This monitoring happens periodically. This function is called in a seperate thread from the main thread, because it sleeps for the intervals between each poll. """ def trigger_watches_based_on...
def monitor(self): """ Monitor the rootpath and call the callback corresponding to the change. This monitoring happens periodically. This function is called in a seperate thread from the main thread, because it sleeps for the intervals between each poll. """ def trigger_watches_based_on...
[ "Monitor", "the", "rootpath", "and", "call", "the", "callback", "corresponding", "to", "the", "change", ".", "This", "monitoring", "happens", "periodically", ".", "This", "function", "is", "called", "in", "a", "seperate", "thread", "from", "the", "main", "thre...
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L88-L161
[ "def", "monitor", "(", "self", ")", ":", "def", "trigger_watches_based_on_files", "(", "watchers", ",", "path", ",", "directory", ",", "ProtoClass", ")", ":", "\"\"\"\n For all the topologies in the watchers, check if the data\n in directory has changed. Trigger the cal...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_topologies
get topologies
heron/statemgrs/src/python/filestatemanager.py
def get_topologies(self, callback=None): """get topologies""" if callback: self.topologies_watchers.append(callback) else: topologies_path = self.get_topologies_path() return filter(lambda f: os.path.isfile(os.path.join(topologies_path, f)), os.listdir(topologies_path))
def get_topologies(self, callback=None): """get topologies""" if callback: self.topologies_watchers.append(callback) else: topologies_path = self.get_topologies_path() return filter(lambda f: os.path.isfile(os.path.join(topologies_path, f)), os.listdir(topologies_path))
[ "get", "topologies" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L163-L170
[ "def", "get_topologies", "(", "self", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "topologies_watchers", ".", "append", "(", "callback", ")", "else", ":", "topologies_path", "=", "self", ".", "get_topologies_path", "(", ")", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_topology
get topology
heron/statemgrs/src/python/filestatemanager.py
def get_topology(self, topologyName, callback=None): """get topology""" if callback: self.topology_watchers[topologyName].append(callback) else: topology_path = self.get_topology_path(topologyName) with open(topology_path) as f: data = f.read() topology = Topology() ...
def get_topology(self, topologyName, callback=None): """get topology""" if callback: self.topology_watchers[topologyName].append(callback) else: topology_path = self.get_topology_path(topologyName) with open(topology_path) as f: data = f.read() topology = Topology() ...
[ "get", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L172-L182
[ "def", "get_topology", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "topology_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "topology_path", "=", "sel...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_packing_plan
get packing plan
heron/statemgrs/src/python/filestatemanager.py
def get_packing_plan(self, topologyName, callback=None): """ get packing plan """ if callback: self.packing_plan_watchers[topologyName].append(callback) else: packing_plan_path = self.get_packing_plan_path(topologyName) with open(packing_plan_path) as f: data = f.read() pac...
def get_packing_plan(self, topologyName, callback=None): """ get packing plan """ if callback: self.packing_plan_watchers[topologyName].append(callback) else: packing_plan_path = self.get_packing_plan_path(topologyName) with open(packing_plan_path) as f: data = f.read() pac...
[ "get", "packing", "plan" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L196-L205
[ "def", "get_packing_plan", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "packing_plan_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "packing_plan_path", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_pplan
Get physical plan of a topology
heron/statemgrs/src/python/filestatemanager.py
def get_pplan(self, topologyName, callback=None): """ Get physical plan of a topology """ if callback: self.pplan_watchers[topologyName].append(callback) else: pplan_path = self.get_pplan_path(topologyName) with open(pplan_path) as f: data = f.read() pplan = Physica...
def get_pplan(self, topologyName, callback=None): """ Get physical plan of a topology """ if callback: self.pplan_watchers[topologyName].append(callback) else: pplan_path = self.get_pplan_path(topologyName) with open(pplan_path) as f: data = f.read() pplan = Physica...
[ "Get", "physical", "plan", "of", "a", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L207-L219
[ "def", "get_pplan", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "pplan_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "pplan_path", "=", "self", "."...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_execution_state
Get execution state
heron/statemgrs/src/python/filestatemanager.py
def get_execution_state(self, topologyName, callback=None): """ Get execution state """ if callback: self.execution_state_watchers[topologyName].append(callback) else: execution_state_path = self.get_execution_state_path(topologyName) with open(execution_state_path) as f: d...
def get_execution_state(self, topologyName, callback=None): """ Get execution state """ if callback: self.execution_state_watchers[topologyName].append(callback) else: execution_state_path = self.get_execution_state_path(topologyName) with open(execution_state_path) as f: d...
[ "Get", "execution", "state" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L233-L245
[ "def", "get_execution_state", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "execution_state_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "execution_state...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_tmaster
Get tmaster
heron/statemgrs/src/python/filestatemanager.py
def get_tmaster(self, topologyName, callback=None): """ Get tmaster """ if callback: self.tmaster_watchers[topologyName].append(callback) else: tmaster_path = self.get_tmaster_path(topologyName) with open(tmaster_path) as f: data = f.read() tmaster = TMasterLocation...
def get_tmaster(self, topologyName, callback=None): """ Get tmaster """ if callback: self.tmaster_watchers[topologyName].append(callback) else: tmaster_path = self.get_tmaster_path(topologyName) with open(tmaster_path) as f: data = f.read() tmaster = TMasterLocation...
[ "Get", "tmaster" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L259-L271
[ "def", "get_tmaster", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "tmaster_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "tmaster_path", "=", "self",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
FileStateManager.get_scheduler_location
Get scheduler location
heron/statemgrs/src/python/filestatemanager.py
def get_scheduler_location(self, topologyName, callback=None): """ Get scheduler location """ if callback: self.scheduler_location_watchers[topologyName].append(callback) else: scheduler_location_path = self.get_scheduler_location_path(topologyName) with open(scheduler_location_pat...
def get_scheduler_location(self, topologyName, callback=None): """ Get scheduler location """ if callback: self.scheduler_location_watchers[topologyName].append(callback) else: scheduler_location_path = self.get_scheduler_location_path(topologyName) with open(scheduler_location_pat...
[ "Get", "scheduler", "location" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/statemgrs/src/python/filestatemanager.py#L273-L285
[ "def", "get_scheduler_location", "(", "self", ",", "topologyName", ",", "callback", "=", "None", ")", ":", "if", "callback", ":", "self", ".", "scheduler_location_watchers", "[", "topologyName", "]", ".", "append", "(", "callback", ")", "else", ":", "scheduler...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
MemoryHistogramHandler.get
get method
heron/shell/src/python/handlers/memoryhistogramhandler.py
def get(self, pid): ''' get method ''' body = utils.str_cmd(['jmap', '-histo', pid], None, None) self.content_type = 'application/json' self.write(json.dumps(body)) self.finish()
def get(self, pid): ''' get method ''' body = utils.str_cmd(['jmap', '-histo', pid], None, None) self.content_type = 'application/json' self.write(json.dumps(body)) self.finish()
[ "get", "method" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/shell/src/python/handlers/memoryhistogramhandler.py#L35-L40
[ "def", "get", "(", "self", ",", "pid", ")", ":", "body", "=", "utils", ".", "str_cmd", "(", "[", "'jmap'", ",", "'-histo'", ",", "pid", "]", ",", "None", ",", "None", ")", "self", ".", "content_type", "=", "'application/json'", "self", ".", "write", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
create_socket_options
Creates SocketOptions object from a given sys_config dict
heron/instance/src/python/network/socket_options.py
def create_socket_options(): """Creates SocketOptions object from a given sys_config dict""" sys_config = system_config.get_sys_config() opt_list = [const.INSTANCE_NETWORK_WRITE_BATCH_SIZE_BYTES, const.INSTANCE_NETWORK_WRITE_BATCH_TIME_MS, const.INSTANCE_NETWORK_READ_BATCH_SIZE_BYTES, ...
def create_socket_options(): """Creates SocketOptions object from a given sys_config dict""" sys_config = system_config.get_sys_config() opt_list = [const.INSTANCE_NETWORK_WRITE_BATCH_SIZE_BYTES, const.INSTANCE_NETWORK_WRITE_BATCH_TIME_MS, const.INSTANCE_NETWORK_READ_BATCH_SIZE_BYTES, ...
[ "Creates", "SocketOptions", "object", "from", "a", "given", "sys_config", "dict" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/instance/src/python/network/socket_options.py#L32-L52
[ "def", "create_socket_options", "(", ")", ":", "sys_config", "=", "system_config", ".", "get_sys_config", "(", ")", "opt_list", "=", "[", "const", ".", "INSTANCE_NETWORK_WRITE_BATCH_SIZE_BYTES", ",", "const", ".", "INSTANCE_NETWORK_WRITE_BATCH_TIME_MS", ",", "const", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyType.class_dict_to_specs
Takes a class `__dict__` and returns `HeronComponentSpec` entries
heronpy/api/topology.py
def class_dict_to_specs(mcs, class_dict): """Takes a class `__dict__` and returns `HeronComponentSpec` entries""" specs = {} for name, spec in class_dict.items(): if isinstance(spec, HeronComponentSpec): # Use the variable name as the specification name. if spec.name is None: ...
def class_dict_to_specs(mcs, class_dict): """Takes a class `__dict__` and returns `HeronComponentSpec` entries""" specs = {} for name, spec in class_dict.items(): if isinstance(spec, HeronComponentSpec): # Use the variable name as the specification name. if spec.name is None: ...
[ "Takes", "a", "class", "__dict__", "and", "returns", "HeronComponentSpec", "entries" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L72-L85
[ "def", "class_dict_to_specs", "(", "mcs", ",", "class_dict", ")", ":", "specs", "=", "{", "}", "for", "name", ",", "spec", "in", "class_dict", ".", "items", "(", ")", ":", "if", "isinstance", "(", "spec", ",", "HeronComponentSpec", ")", ":", "# Use the v...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyType.class_dict_to_topo_config
Takes a class `__dict__` and returns a map containing topology-wide configuration. The returned dictionary is a sanitized `dict` of type `<str -> (str|object)>`. This classmethod firsts insert default topology configuration and then overrides it with a given topology-wide configuration. Note that ...
heronpy/api/topology.py
def class_dict_to_topo_config(mcs, class_dict): """ Takes a class `__dict__` and returns a map containing topology-wide configuration. The returned dictionary is a sanitized `dict` of type `<str -> (str|object)>`. This classmethod firsts insert default topology configuration and then overr...
def class_dict_to_topo_config(mcs, class_dict): """ Takes a class `__dict__` and returns a map containing topology-wide configuration. The returned dictionary is a sanitized `dict` of type `<str -> (str|object)>`. This classmethod firsts insert default topology configuration and then overr...
[ "Takes", "a", "class", "__dict__", "and", "returns", "a", "map", "containing", "topology", "-", "wide", "configuration", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L88-L111
[ "def", "class_dict_to_topo_config", "(", "mcs", ",", "class_dict", ")", ":", "topo_config", "=", "{", "}", "# add defaults", "topo_config", ".", "update", "(", "mcs", ".", "DEFAULT_TOPOLOGY_CONFIG", ")", "for", "name", ",", "custom_config", "in", "class_dict", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyType.init_topology
Initializes a topology protobuf
heronpy/api/topology.py
def init_topology(mcs, classname, class_dict): """Initializes a topology protobuf""" if classname == 'Topology': # Base class can't initialize protobuf return heron_options = TopologyType.get_heron_options_from_env() initial_state = heron_options.get("cmdline.topology.initial.state", "RUNNIN...
def init_topology(mcs, classname, class_dict): """Initializes a topology protobuf""" if classname == 'Topology': # Base class can't initialize protobuf return heron_options = TopologyType.get_heron_options_from_env() initial_state = heron_options.get("cmdline.topology.initial.state", "RUNNIN...
[ "Initializes", "a", "topology", "protobuf" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L150-L177
[ "def", "init_topology", "(", "mcs", ",", "classname", ",", "class_dict", ")", ":", "if", "classname", "==", "'Topology'", ":", "# Base class can't initialize protobuf", "return", "heron_options", "=", "TopologyType", ".", "get_heron_options_from_env", "(", ")", "initi...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyType.get_heron_options_from_env
Retrieves heron options from the `HERON_OPTIONS` environment variable. Heron options have the following format: cmdline.topologydefn.tmpdirectory=/var/folders/tmpdir cmdline.topology.initial.state=PAUSED In this case, the returned map will contain: #!json { "cmdline...
heronpy/api/topology.py
def get_heron_options_from_env(): """Retrieves heron options from the `HERON_OPTIONS` environment variable. Heron options have the following format: cmdline.topologydefn.tmpdirectory=/var/folders/tmpdir cmdline.topology.initial.state=PAUSED In this case, the returned map will contain: ...
def get_heron_options_from_env(): """Retrieves heron options from the `HERON_OPTIONS` environment variable. Heron options have the following format: cmdline.topologydefn.tmpdirectory=/var/folders/tmpdir cmdline.topology.initial.state=PAUSED In this case, the returned map will contain: ...
[ "Retrieves", "heron", "options", "from", "the", "HERON_OPTIONS", "environment", "variable", "." ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L180-L216
[ "def", "get_heron_options_from_env", "(", ")", ":", "heron_options_raw", "=", "os", ".", "environ", ".", "get", "(", "\"HERON_OPTIONS\"", ")", "if", "heron_options_raw", "is", "None", ":", "raise", "RuntimeError", "(", "\"HERON_OPTIONS environment variable not found\"",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyBuilder.add_spec
Add specs to the topology :type specs: HeronComponentSpec :param specs: specs to add to the topology
heronpy/api/topology.py
def add_spec(self, *specs): """Add specs to the topology :type specs: HeronComponentSpec :param specs: specs to add to the topology """ for spec in specs: if not isinstance(spec, HeronComponentSpec): raise TypeError("Argument to add_spec needs to be HeronComponentSpec, given: %s" ...
def add_spec(self, *specs): """Add specs to the topology :type specs: HeronComponentSpec :param specs: specs to add to the topology """ for spec in specs: if not isinstance(spec, HeronComponentSpec): raise TypeError("Argument to add_spec needs to be HeronComponentSpec, given: %s" ...
[ "Add", "specs", "to", "the", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L344-L361
[ "def", "add_spec", "(", "self", ",", "*", "specs", ")", ":", "for", "spec", "in", "specs", ":", "if", "not", "isinstance", "(", "spec", ",", "HeronComponentSpec", ")", ":", "raise", "TypeError", "(", "\"Argument to add_spec needs to be HeronComponentSpec, given: %...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyBuilder.add_spout
Add a spout to the topology
heronpy/api/topology.py
def add_spout(self, name, spout_cls, par, config=None, optional_outputs=None): """Add a spout to the topology""" spout_spec = spout_cls.spec(name=name, par=par, config=config, optional_outputs=optional_outputs) self.add_spec(spout_spec) return spout_spec
def add_spout(self, name, spout_cls, par, config=None, optional_outputs=None): """Add a spout to the topology""" spout_spec = spout_cls.spec(name=name, par=par, config=config, optional_outputs=optional_outputs) self.add_spec(spout_spec) return spout_spec
[ "Add", "a", "spout", "to", "the", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L363-L368
[ "def", "add_spout", "(", "self", ",", "name", ",", "spout_cls", ",", "par", ",", "config", "=", "None", ",", "optional_outputs", "=", "None", ")", ":", "spout_spec", "=", "spout_cls", ".", "spec", "(", "name", "=", "name", ",", "par", "=", "par", ","...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyBuilder.add_bolt
Add a bolt to the topology
heronpy/api/topology.py
def add_bolt(self, name, bolt_cls, par, inputs, config=None, optional_outputs=None): """Add a bolt to the topology""" bolt_spec = bolt_cls.spec(name=name, par=par, inputs=inputs, config=config, optional_outputs=optional_outputs) self.add_spec(bolt_spec) return bolt_spec
def add_bolt(self, name, bolt_cls, par, inputs, config=None, optional_outputs=None): """Add a bolt to the topology""" bolt_spec = bolt_cls.spec(name=name, par=par, inputs=inputs, config=config, optional_outputs=optional_outputs) self.add_spec(bolt_spec) return bolt_spec
[ "Add", "a", "bolt", "to", "the", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L370-L375
[ "def", "add_bolt", "(", "self", ",", "name", ",", "bolt_cls", ",", "par", ",", "inputs", ",", "config", "=", "None", ",", "optional_outputs", "=", "None", ")", ":", "bolt_spec", "=", "bolt_cls", ".", "spec", "(", "name", "=", "name", ",", "par", "=",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyBuilder.set_config
Set topology-wide configuration to the topology :type config: dict :param config: topology-wide config
heronpy/api/topology.py
def set_config(self, config): """Set topology-wide configuration to the topology :type config: dict :param config: topology-wide config """ if not isinstance(config, dict): raise TypeError("Argument to set_config needs to be dict, given: %s" % str(config)) self._topology_config = config
def set_config(self, config): """Set topology-wide configuration to the topology :type config: dict :param config: topology-wide config """ if not isinstance(config, dict): raise TypeError("Argument to set_config needs to be dict, given: %s" % str(config)) self._topology_config = config
[ "Set", "topology", "-", "wide", "configuration", "to", "the", "topology" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L377-L385
[ "def", "set_config", "(", "self", ",", "config", ")", ":", "if", "not", "isinstance", "(", "config", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"Argument to set_config needs to be dict, given: %s\"", "%", "str", "(", "config", ")", ")", "self", ".", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
TopologyBuilder.build_and_submit
Builds the topology and submits to the destination
heronpy/api/topology.py
def build_and_submit(self): """Builds the topology and submits to the destination""" class_dict = self._construct_topo_class_dict() topo_cls = TopologyType(self.topology_name, (Topology,), class_dict) topo_cls.write()
def build_and_submit(self): """Builds the topology and submits to the destination""" class_dict = self._construct_topo_class_dict() topo_cls = TopologyType(self.topology_name, (Topology,), class_dict) topo_cls.write()
[ "Builds", "the", "topology", "and", "submits", "to", "the", "destination" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/topology.py#L392-L396
[ "def", "build_and_submit", "(", "self", ")", ":", "class_dict", "=", "self", ".", "_construct_topo_class_dict", "(", ")", "topo_cls", "=", "TopologyType", "(", "self", ".", "topology_name", ",", "(", "Topology", ",", ")", ",", "class_dict", ")", "topo_cls", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
fetch_url_as_json
Fetch the given url and convert the response to json. :param fetch_url: URL to fetch :param default_value: value to return in case of failure :return:
heron/tools/common/src/python/access/fetch.py
def fetch_url_as_json(fetch_url, default_value=None): ''' Fetch the given url and convert the response to json. :param fetch_url: URL to fetch :param default_value: value to return in case of failure :return: ''' # assign empty dict for optional param if default_value is None: default_value = dict()...
def fetch_url_as_json(fetch_url, default_value=None): ''' Fetch the given url and convert the response to json. :param fetch_url: URL to fetch :param default_value: value to return in case of failure :return: ''' # assign empty dict for optional param if default_value is None: default_value = dict()...
[ "Fetch", "the", "given", "url", "and", "convert", "the", "response", "to", "json", ".", ":", "param", "fetch_url", ":", "URL", "to", "fetch", ":", "param", "default_value", ":", "value", "to", "return", "in", "case", "of", "failure", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/fetch.py#L36-L79
[ "def", "fetch_url_as_json", "(", "fetch_url", ",", "default_value", "=", "None", ")", ":", "# assign empty dict for optional param", "if", "default_value", "is", "None", ":", "default_value", "=", "dict", "(", ")", "Log", ".", "debug", "(", "\"fetching url %s\"", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
create_parser
create parser
heron/tools/explorer/src/python/version.py
def create_parser(subparsers): """ create parser """ parser = subparsers.add_parser( 'version', help='Display version', usage="%(prog)s", add_help=False) args.add_titles(parser) parser.set_defaults(subcommand='version') return parser
def create_parser(subparsers): """ create parser """ parser = subparsers.add_parser( 'version', help='Display version', usage="%(prog)s", add_help=False) args.add_titles(parser) parser.set_defaults(subcommand='version') return parser
[ "create", "parser" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/explorer/src/python/version.py#L26-L35
[ "def", "create_parser", "(", "subparsers", ")", ":", "parser", "=", "subparsers", ".", "add_parser", "(", "'version'", ",", "help", "=", "'Display version'", ",", "usage", "=", "\"%(prog)s\"", ",", "add_help", "=", "False", ")", "args", ".", "add_titles", "(...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
queries_map
map from query parameter to query name
heron/tools/common/src/python/access/tracker_access.py
def queries_map(): """map from query parameter to query name""" qs = _all_metric_queries() return dict(zip(qs[0], qs[1]) + zip(qs[2], qs[3]))
def queries_map(): """map from query parameter to query name""" qs = _all_metric_queries() return dict(zip(qs[0], qs[1]) + zip(qs[2], qs[3]))
[ "map", "from", "query", "parameter", "to", "query", "name" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/tracker_access.py#L48-L51
[ "def", "queries_map", "(", ")", ":", "qs", "=", "_all_metric_queries", "(", ")", "return", "dict", "(", "zip", "(", "qs", "[", "0", "]", ",", "qs", "[", "1", "]", ")", "+", "zip", "(", "qs", "[", "2", "]", ",", "qs", "[", "3", "]", ")", ")"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_clusters
Synced API call to get all cluster names
heron/tools/common/src/python/access/tracker_access.py
def get_clusters(): """Synced API call to get all cluster names""" instance = tornado.ioloop.IOLoop.instance() # pylint: disable=unnecessary-lambda try: return instance.run_sync(lambda: API.get_clusters()) except Exception: Log.debug(traceback.format_exc()) raise
def get_clusters(): """Synced API call to get all cluster names""" instance = tornado.ioloop.IOLoop.instance() # pylint: disable=unnecessary-lambda try: return instance.run_sync(lambda: API.get_clusters()) except Exception: Log.debug(traceback.format_exc()) raise
[ "Synced", "API", "call", "to", "get", "all", "cluster", "names" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/tracker_access.py#L54-L62
[ "def", "get_clusters", "(", ")", ":", "instance", "=", "tornado", ".", "ioloop", ".", "IOLoop", ".", "instance", "(", ")", "# pylint: disable=unnecessary-lambda", "try", ":", "return", "instance", ".", "run_sync", "(", "lambda", ":", "API", ".", "get_clusters"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_logical_plan
Synced API call to get logical plans
heron/tools/common/src/python/access/tracker_access.py
def get_logical_plan(cluster, env, topology, role): """Synced API call to get logical plans""" instance = tornado.ioloop.IOLoop.instance() try: return instance.run_sync(lambda: API.get_logical_plan(cluster, env, topology, role)) except Exception: Log.debug(traceback.format_exc()) raise
def get_logical_plan(cluster, env, topology, role): """Synced API call to get logical plans""" instance = tornado.ioloop.IOLoop.instance() try: return instance.run_sync(lambda: API.get_logical_plan(cluster, env, topology, role)) except Exception: Log.debug(traceback.format_exc()) raise
[ "Synced", "API", "call", "to", "get", "logical", "plans" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/tracker_access.py#L65-L72
[ "def", "get_logical_plan", "(", "cluster", ",", "env", ",", "topology", ",", "role", ")", ":", "instance", "=", "tornado", ".", "ioloop", ".", "IOLoop", ".", "instance", "(", ")", "try", ":", "return", "instance", ".", "run_sync", "(", "lambda", ":", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_topology_info
Synced API call to get topology information
heron/tools/common/src/python/access/tracker_access.py
def get_topology_info(*args): """Synced API call to get topology information""" instance = tornado.ioloop.IOLoop.instance() try: return instance.run_sync(lambda: API.get_topology_info(*args)) except Exception: Log.debug(traceback.format_exc()) raise
def get_topology_info(*args): """Synced API call to get topology information""" instance = tornado.ioloop.IOLoop.instance() try: return instance.run_sync(lambda: API.get_topology_info(*args)) except Exception: Log.debug(traceback.format_exc()) raise
[ "Synced", "API", "call", "to", "get", "topology", "information" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/tracker_access.py#L75-L82
[ "def", "get_topology_info", "(", "*", "args", ")", ":", "instance", "=", "tornado", ".", "ioloop", ".", "IOLoop", ".", "instance", "(", ")", "try", ":", "return", "instance", ".", "run_sync", "(", "lambda", ":", "API", ".", "get_topology_info", "(", "*",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
get_component_metrics
Synced API call to get component metrics
heron/tools/common/src/python/access/tracker_access.py
def get_component_metrics(component, cluster, env, topology, role): """Synced API call to get component metrics""" all_queries = metric_queries() try: result = get_topology_metrics(cluster, env, topology, component, [], all_queries, [0, -1], role) return result["metrics"]...
def get_component_metrics(component, cluster, env, topology, role): """Synced API call to get component metrics""" all_queries = metric_queries() try: result = get_topology_metrics(cluster, env, topology, component, [], all_queries, [0, -1], role) return result["metrics"]...
[ "Synced", "API", "call", "to", "get", "component", "metrics" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/common/src/python/access/tracker_access.py#L95-L104
[ "def", "get_component_metrics", "(", "component", ",", "cluster", ",", "env", ",", "topology", ",", "role", ")", ":", "all_queries", "=", "metric_queries", "(", ")", "try", ":", "result", "=", "get_topology_metrics", "(", "cluster", ",", "env", ",", "topolog...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
configure
Configure logger which dumps log on terminal :param level: logging level: info, warning, verbose... :type level: logging level :param logfile: log file name, default to None :type logfile: string :return: None :rtype: None
heron/common/src/python/utils/log.py
def configure(level=logging.INFO, logfile=None): """ Configure logger which dumps log on terminal :param level: logging level: info, warning, verbose... :type level: logging level :param logfile: log file name, default to None :type logfile: string :return: None :rtype: None """ # Remove all the exi...
def configure(level=logging.INFO, logfile=None): """ Configure logger which dumps log on terminal :param level: logging level: info, warning, verbose... :type level: logging level :param logfile: log file name, default to None :type logfile: string :return: None :rtype: None """ # Remove all the exi...
[ "Configure", "logger", "which", "dumps", "log", "on", "terminal" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/common/src/python/utils/log.py#L36-L68
[ "def", "configure", "(", "level", "=", "logging", ".", "INFO", ",", "logfile", "=", "None", ")", ":", "# Remove all the existing StreamHandlers to avoid duplicate", "for", "handler", "in", "Log", ".", "handlers", ":", "if", "isinstance", "(", "handler", ",", "lo...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
init_rotating_logger
Initializes a rotating logger It also makes sure that any StreamHandler is removed, so as to avoid stdout/stderr constipation issues
heron/common/src/python/utils/log.py
def init_rotating_logger(level, logfile, max_files, max_bytes): """Initializes a rotating logger It also makes sure that any StreamHandler is removed, so as to avoid stdout/stderr constipation issues """ logging.basicConfig() root_logger = logging.getLogger() log_format = "[%(asctime)s] [%(levelname)s] ...
def init_rotating_logger(level, logfile, max_files, max_bytes): """Initializes a rotating logger It also makes sure that any StreamHandler is removed, so as to avoid stdout/stderr constipation issues """ logging.basicConfig() root_logger = logging.getLogger() log_format = "[%(asctime)s] [%(levelname)s] ...
[ "Initializes", "a", "rotating", "logger" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/common/src/python/utils/log.py#L71-L91
[ "def", "init_rotating_logger", "(", "level", ",", "logfile", ",", "max_files", ",", "max_bytes", ")", ":", "logging", ".", "basicConfig", "(", ")", "root_logger", "=", "logging", ".", "getLogger", "(", ")", "log_format", "=", "\"[%(asctime)s] [%(levelname)s] %(fil...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
set_logging_level
simply set verbose level based on command-line args :param cl_args: CLI arguments :type cl_args: dict :return: None :rtype: None
heron/common/src/python/utils/log.py
def set_logging_level(cl_args): """simply set verbose level based on command-line args :param cl_args: CLI arguments :type cl_args: dict :return: None :rtype: None """ if 'verbose' in cl_args and cl_args['verbose']: configure(logging.DEBUG) else: configure(logging.INFO)
def set_logging_level(cl_args): """simply set verbose level based on command-line args :param cl_args: CLI arguments :type cl_args: dict :return: None :rtype: None """ if 'verbose' in cl_args and cl_args['verbose']: configure(logging.DEBUG) else: configure(logging.INFO)
[ "simply", "set", "verbose", "level", "based", "on", "command", "-", "line", "args" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/common/src/python/utils/log.py#L93-L104
[ "def", "set_logging_level", "(", "cl_args", ")", ":", "if", "'verbose'", "in", "cl_args", "and", "cl_args", "[", "'verbose'", "]", ":", "configure", "(", "logging", ".", "DEBUG", ")", "else", ":", "configure", "(", "logging", ".", "INFO", ")" ]
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_spout
Returns Spout protobuf message
heronpy/api/component/component_spec.py
def _get_spout(self): """Returns Spout protobuf message""" spout = topology_pb2.Spout() spout.comp.CopyFrom(self._get_base_component()) # Add output streams self._add_out_streams(spout) return spout
def _get_spout(self): """Returns Spout protobuf message""" spout = topology_pb2.Spout() spout.comp.CopyFrom(self._get_base_component()) # Add output streams self._add_out_streams(spout) return spout
[ "Returns", "Spout", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L73-L80
[ "def", "_get_spout", "(", "self", ")", ":", "spout", "=", "topology_pb2", ".", "Spout", "(", ")", "spout", ".", "comp", ".", "CopyFrom", "(", "self", ".", "_get_base_component", "(", ")", ")", "# Add output streams", "self", ".", "_add_out_streams", "(", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_bolt
Returns Bolt protobuf message
heronpy/api/component/component_spec.py
def _get_bolt(self): """Returns Bolt protobuf message""" bolt = topology_pb2.Bolt() bolt.comp.CopyFrom(self._get_base_component()) # Add streams self._add_in_streams(bolt) self._add_out_streams(bolt) return bolt
def _get_bolt(self): """Returns Bolt protobuf message""" bolt = topology_pb2.Bolt() bolt.comp.CopyFrom(self._get_base_component()) # Add streams self._add_in_streams(bolt) self._add_out_streams(bolt) return bolt
[ "Returns", "Bolt", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L82-L90
[ "def", "_get_bolt", "(", "self", ")", ":", "bolt", "=", "topology_pb2", ".", "Bolt", "(", ")", "bolt", ".", "comp", ".", "CopyFrom", "(", "self", ".", "_get_base_component", "(", ")", ")", "# Add streams", "self", ".", "_add_in_streams", "(", "bolt", ")"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_base_component
Returns Component protobuf message
heronpy/api/component/component_spec.py
def _get_base_component(self): """Returns Component protobuf message""" comp = topology_pb2.Component() comp.name = self.name comp.spec = topology_pb2.ComponentObjectSpec.Value("PYTHON_CLASS_NAME") comp.class_name = self.python_class_path comp.config.CopyFrom(self._get_comp_config()) return ...
def _get_base_component(self): """Returns Component protobuf message""" comp = topology_pb2.Component() comp.name = self.name comp.spec = topology_pb2.ComponentObjectSpec.Value("PYTHON_CLASS_NAME") comp.class_name = self.python_class_path comp.config.CopyFrom(self._get_comp_config()) return ...
[ "Returns", "Component", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L92-L99
[ "def", "_get_base_component", "(", "self", ")", ":", "comp", "=", "topology_pb2", ".", "Component", "(", ")", "comp", ".", "name", "=", "self", ".", "name", "comp", ".", "spec", "=", "topology_pb2", ".", "ComponentObjectSpec", ".", "Value", "(", "\"PYTHON_...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_comp_config
Returns component-specific Config protobuf message It first adds ``topology.component.parallelism``, and is overriden by a user-defined component-specific configuration, specified by spec().
heronpy/api/component/component_spec.py
def _get_comp_config(self): """Returns component-specific Config protobuf message It first adds ``topology.component.parallelism``, and is overriden by a user-defined component-specific configuration, specified by spec(). """ proto_config = topology_pb2.Config() # first add parallelism key...
def _get_comp_config(self): """Returns component-specific Config protobuf message It first adds ``topology.component.parallelism``, and is overriden by a user-defined component-specific configuration, specified by spec(). """ proto_config = topology_pb2.Config() # first add parallelism key...
[ "Returns", "component", "-", "specific", "Config", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L101-L131
[ "def", "_get_comp_config", "(", "self", ")", ":", "proto_config", "=", "topology_pb2", ".", "Config", "(", ")", "# first add parallelism", "key", "=", "proto_config", ".", "kvs", ".", "add", "(", ")", "key", ".", "key", "=", "TOPOLOGY_COMPONENT_PARALLELISM", "...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._sanitize_config
Checks whether ``custom_config`` is sane and returns a sanitized dict <str -> (str|object)> It checks if keys are all strings and sanitizes values of a given dictionary as follows: - If string, number or boolean is given as a value, it is converted to string. For string and number (int, float), it is co...
heronpy/api/component/component_spec.py
def _sanitize_config(custom_config): """Checks whether ``custom_config`` is sane and returns a sanitized dict <str -> (str|object)> It checks if keys are all strings and sanitizes values of a given dictionary as follows: - If string, number or boolean is given as a value, it is converted to string. ...
def _sanitize_config(custom_config): """Checks whether ``custom_config`` is sane and returns a sanitized dict <str -> (str|object)> It checks if keys are all strings and sanitizes values of a given dictionary as follows: - If string, number or boolean is given as a value, it is converted to string. ...
[ "Checks", "whether", "custom_config", "is", "sane", "and", "returns", "a", "sanitized", "dict", "<str", "-", ">", "(", "str|object", ")", ">" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L134-L164
[ "def", "_sanitize_config", "(", "custom_config", ")", ":", "if", "not", "isinstance", "(", "custom_config", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"Component-specific configuration must be given as a dict type, given: %s\"", "%", "str", "(", "type", "(", ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._add_in_streams
Adds inputs to a given protobuf Bolt message
heronpy/api/component/component_spec.py
def _add_in_streams(self, bolt): """Adds inputs to a given protobuf Bolt message""" if self.inputs is None: return # sanitize inputs and get a map <GlobalStreamId -> Grouping> input_dict = self._sanitize_inputs() for global_streamid, gtype in input_dict.items(): in_stream = bolt.inputs....
def _add_in_streams(self, bolt): """Adds inputs to a given protobuf Bolt message""" if self.inputs is None: return # sanitize inputs and get a map <GlobalStreamId -> Grouping> input_dict = self._sanitize_inputs() for global_streamid, gtype in input_dict.items(): in_stream = bolt.inputs....
[ "Adds", "inputs", "to", "a", "given", "protobuf", "Bolt", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L166-L187
[ "def", "_add_in_streams", "(", "self", ",", "bolt", ")", ":", "if", "self", ".", "inputs", "is", "None", ":", "return", "# sanitize inputs and get a map <GlobalStreamId -> Grouping>", "input_dict", "=", "self", ".", "_sanitize_inputs", "(", ")", "for", "global_strea...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._sanitize_inputs
Sanitizes input fields and returns a map <GlobalStreamId -> Grouping>
heronpy/api/component/component_spec.py
def _sanitize_inputs(self): """Sanitizes input fields and returns a map <GlobalStreamId -> Grouping>""" ret = {} if self.inputs is None: return if isinstance(self.inputs, dict): # inputs are dictionary, must be either <HeronComponentSpec -> Grouping> or # <GlobalStreamId -> Grouping> ...
def _sanitize_inputs(self): """Sanitizes input fields and returns a map <GlobalStreamId -> Grouping>""" ret = {} if self.inputs is None: return if isinstance(self.inputs, dict): # inputs are dictionary, must be either <HeronComponentSpec -> Grouping> or # <GlobalStreamId -> Grouping> ...
[ "Sanitizes", "input", "fields", "and", "returns", "a", "map", "<GlobalStreamId", "-", ">", "Grouping", ">" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L190-L232
[ "def", "_sanitize_inputs", "(", "self", ")", ":", "ret", "=", "{", "}", "if", "self", ".", "inputs", "is", "None", ":", "return", "if", "isinstance", "(", "self", ".", "inputs", ",", "dict", ")", ":", "# inputs are dictionary, must be either <HeronComponentSpe...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._add_out_streams
Adds outputs to a given protobuf Bolt or Spout message
heronpy/api/component/component_spec.py
def _add_out_streams(self, spbl): """Adds outputs to a given protobuf Bolt or Spout message""" if self.outputs is None: return # sanitize outputs and get a map <stream_id -> out fields> output_map = self._sanitize_outputs() for stream_id, out_fields in output_map.items(): out_stream = ...
def _add_out_streams(self, spbl): """Adds outputs to a given protobuf Bolt or Spout message""" if self.outputs is None: return # sanitize outputs and get a map <stream_id -> out fields> output_map = self._sanitize_outputs() for stream_id, out_fields in output_map.items(): out_stream = ...
[ "Adds", "outputs", "to", "a", "given", "protobuf", "Bolt", "or", "Spout", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L234-L245
[ "def", "_add_out_streams", "(", "self", ",", "spbl", ")", ":", "if", "self", ".", "outputs", "is", "None", ":", "return", "# sanitize outputs and get a map <stream_id -> out fields>", "output_map", "=", "self", ".", "_sanitize_outputs", "(", ")", "for", "stream_id",...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._sanitize_outputs
Sanitizes output fields and returns a map <stream_id -> list of output fields>
heronpy/api/component/component_spec.py
def _sanitize_outputs(self): """Sanitizes output fields and returns a map <stream_id -> list of output fields>""" ret = {} if self.outputs is None: return if not isinstance(self.outputs, (list, tuple)): raise TypeError("Argument to outputs must be either list or tuple, given: %s" ...
def _sanitize_outputs(self): """Sanitizes output fields and returns a map <stream_id -> list of output fields>""" ret = {} if self.outputs is None: return if not isinstance(self.outputs, (list, tuple)): raise TypeError("Argument to outputs must be either list or tuple, given: %s" ...
[ "Sanitizes", "output", "fields", "and", "returns", "a", "map", "<stream_id", "-", ">", "list", "of", "output", "fields", ">" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L247-L273
[ "def", "_sanitize_outputs", "(", "self", ")", ":", "ret", "=", "{", "}", "if", "self", ".", "outputs", "is", "None", ":", "return", "if", "not", "isinstance", "(", "self", ".", "outputs", ",", "(", "list", ",", "tuple", ")", ")", ":", "raise", "Typ...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec.get_out_streamids
Returns a set of output stream ids registered for this component
heronpy/api/component/component_spec.py
def get_out_streamids(self): """Returns a set of output stream ids registered for this component""" if self.outputs is None: return set() if not isinstance(self.outputs, (list, tuple)): raise TypeError("Argument to outputs must be either list or tuple, given: %s" % str(typ...
def get_out_streamids(self): """Returns a set of output stream ids registered for this component""" if self.outputs is None: return set() if not isinstance(self.outputs, (list, tuple)): raise TypeError("Argument to outputs must be either list or tuple, given: %s" % str(typ...
[ "Returns", "a", "set", "of", "output", "stream", "ids", "registered", "for", "this", "component" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L275-L288
[ "def", "get_out_streamids", "(", "self", ")", ":", "if", "self", ".", "outputs", "is", "None", ":", "return", "set", "(", ")", "if", "not", "isinstance", "(", "self", ".", "outputs", ",", "(", "list", ",", "tuple", ")", ")", ":", "raise", "TypeError"...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_stream_id
Returns a StreamId protobuf message
heronpy/api/component/component_spec.py
def _get_stream_id(comp_name, stream_id): """Returns a StreamId protobuf message""" proto_stream_id = topology_pb2.StreamId() proto_stream_id.id = stream_id proto_stream_id.component_name = comp_name return proto_stream_id
def _get_stream_id(comp_name, stream_id): """Returns a StreamId protobuf message""" proto_stream_id = topology_pb2.StreamId() proto_stream_id.id = stream_id proto_stream_id.component_name = comp_name return proto_stream_id
[ "Returns", "a", "StreamId", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L299-L304
[ "def", "_get_stream_id", "(", "comp_name", ",", "stream_id", ")", ":", "proto_stream_id", "=", "topology_pb2", ".", "StreamId", "(", ")", "proto_stream_id", ".", "id", "=", "stream_id", "proto_stream_id", ".", "component_name", "=", "comp_name", "return", "proto_s...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
HeronComponentSpec._get_stream_schema
Returns a StreamSchema protobuf message
heronpy/api/component/component_spec.py
def _get_stream_schema(fields): """Returns a StreamSchema protobuf message""" stream_schema = topology_pb2.StreamSchema() for field in fields: key = stream_schema.keys.add() key.key = field key.type = topology_pb2.Type.Value("OBJECT") return stream_schema
def _get_stream_schema(fields): """Returns a StreamSchema protobuf message""" stream_schema = topology_pb2.StreamSchema() for field in fields: key = stream_schema.keys.add() key.key = field key.type = topology_pb2.Type.Value("OBJECT") return stream_schema
[ "Returns", "a", "StreamSchema", "protobuf", "message" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L307-L315
[ "def", "_get_stream_schema", "(", "fields", ")", ":", "stream_schema", "=", "topology_pb2", ".", "StreamSchema", "(", ")", "for", "field", "in", "fields", ":", "key", "=", "stream_schema", ".", "keys", ".", "add", "(", ")", "key", ".", "key", "=", "field...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
GlobalStreamId.component_id
Returns component_id of this GlobalStreamId Note that if HeronComponentSpec is specified as componentId and its name is not yet available (i.e. when ``name`` argument was not given in ``spec()`` method in Bolt or Spout), this property returns a message with uuid. However, this is provided only for safety ...
heronpy/api/component/component_spec.py
def component_id(self): """Returns component_id of this GlobalStreamId Note that if HeronComponentSpec is specified as componentId and its name is not yet available (i.e. when ``name`` argument was not given in ``spec()`` method in Bolt or Spout), this property returns a message with uuid. However, thi...
def component_id(self): """Returns component_id of this GlobalStreamId Note that if HeronComponentSpec is specified as componentId and its name is not yet available (i.e. when ``name`` argument was not given in ``spec()`` method in Bolt or Spout), this property returns a message with uuid. However, thi...
[ "Returns", "component_id", "of", "this", "GlobalStreamId" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heronpy/api/component/component_spec.py#L344-L365
[ "def", "component_id", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "_component_id", ",", "HeronComponentSpec", ")", ":", "if", "self", ".", "_component_id", ".", "name", "is", "None", ":", "# HeronComponentSpec instance's name attribute might not be...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac
valid
BaseHandler.write_error
:param status_code: :param kwargs: :return:
heron/tools/ui/src/python/handlers/base.py
def write_error(self, status_code, **kwargs): ''' :param status_code: :param kwargs: :return: ''' if "exc_info" in kwargs: exc_info = kwargs["exc_info"] error = exc_info[1] errormessage = "%s: %s" % (status_code, error) self.render("error.html", errormessage=errormessage...
def write_error(self, status_code, **kwargs): ''' :param status_code: :param kwargs: :return: ''' if "exc_info" in kwargs: exc_info = kwargs["exc_info"] error = exc_info[1] errormessage = "%s: %s" % (status_code, error) self.render("error.html", errormessage=errormessage...
[ ":", "param", "status_code", ":", ":", "param", "kwargs", ":", ":", "return", ":" ]
apache/incubator-heron
python
https://github.com/apache/incubator-heron/blob/ad10325a0febe89ad337e561ebcbe37ec5d9a5ac/heron/tools/ui/src/python/handlers/base.py#L31-L45
[ "def", "write_error", "(", "self", ",", "status_code", ",", "*", "*", "kwargs", ")", ":", "if", "\"exc_info\"", "in", "kwargs", ":", "exc_info", "=", "kwargs", "[", "\"exc_info\"", "]", "error", "=", "exc_info", "[", "1", "]", "errormessage", "=", "\"%s:...
ad10325a0febe89ad337e561ebcbe37ec5d9a5ac