python/ray/state.py
def workers(self):
        """Get a dictionary mapping worker ID to worker information."""
        self._check_connected()

        # Get all data in worker table
        worker_table = self.global_state_accessor.get_worker_table()
        workers_data = {}
        for i in range(len(worker_table)):
            worker_table_data = gcs_utils.WorkerTableData.FromString(worker_table[i])
            if (
                worker_table_data.is_alive
                and worker_table_data.worker_type == gcs_utils.WORKER
            ):
                worker_id = binary_to_hex(worker_table_data.worker_address.worker_id)
                worker_info = worker_table_data.worker_info

                workers_data[worker_id] = {
                    "node_ip_address": decode(worker_info[b"node_ip_address"]),
                    "plasma_store_socket": decode(worker_info[b"plasma_store_socket"]),
                }
                if b"stderr_file" in worker_info:
                    workers_data[worker_id]["stderr_file"] = decode(
                        worker_info[b"stderr_file"]
                    )
                if b"stdout_file" in worker_info:
                    workers_data[worker_id]["stdout_file"] = decode(
                        worker_info[b"stdout_file"]
                    )
        return workers_data
Get a dictionary mapping worker ID to worker information.
Get a dictionary mapping worker ID to worker information.
Get a dictionary mapping worker ID to worker information .
def workers(self):
        self._check_connected()
        worker_table = self.global_state_accessor.get_worker_table()
        workers_data = {}
        for i in range(len(worker_table)):
            worker_table_data = gcs_utils.WorkerTableData.FromString(worker_table[i])
            if (
                worker_table_data.is_alive
                and worker_table_data.worker_type == gcs_utils.WORKER
            ):
                worker_id = binary_to_hex(worker_table_data.worker_address.worker_id)
                worker_info = worker_table_data.worker_info
                workers_data[worker_id] = {
                    "node_ip_address": decode(worker_info[b"node_ip_address"]),
                    "plasma_store_socket": decode(worker_info[b"plasma_store_socket"]),
                }
                if b"stderr_file" in worker_info:
                    workers_data[worker_id]["stderr_file"] = decode(
                        worker_info[b"stderr_file"]
                    )
                if b"stdout_file" in worker_info:
                    workers_data[worker_id]["stdout_file"] = decode(
                        worker_info[b"stdout_file"]
                    )
        return workers_data
def workers ( self ) : self . _check_connected ( ) worker_table = self . global_state_accessor . get_worker_table ( ) workers_data = { } for i in range ( len ( worker_table ) ) : worker_table_data = gcs_utils . WorkerTableData . FromString ( worker_table [ i ] ) if ( worker_table_data . is_alive and worker_table_data . worker_type == gcs_utils . WORKER ) : worker_id = binary_to_hex ( worker_table_data . worker_address . worker_id ) worker_info = worker_table_data . worker_info workers_data [ worker_id ] = { "node_ip_address" : decode ( worker_info [ b"node_ip_address" ] ) , "plasma_store_socket" : decode ( worker_info [ b"plasma_store_socket" ] ) , } if b"stderr_file" in worker_info : workers_data [ worker_id ] [ "stderr_file" ] = decode ( worker_info [ b"stderr_file" ] ) if b"stdout_file" in worker_info : workers_data [ worker_id ] [ "stdout_file" ] = decode ( worker_info [ b"stdout_file" ] ) return workers_data
Get a dictionary mapping worker ID to worker information.
Get a dictionary mapping worker ID to worker information .
"""Get a dictionary mapping worker ID to worker information.""" # Get all data in worker table
self