diff --git a/python/ray/__init__.py b/python/ray/__init__.py index 52b9873f0..dee294665 100644 --- a/python/ray/__init__.py +++ b/python/ray/__init__.py @@ -102,8 +102,8 @@ from ray._raylet import ( _config = _Config() from ray.profiling import profile # noqa: E402 -from ray.state import (global_state, jobs, nodes, actors, tasks, objects, - timeline, object_transfer_timeline, cluster_resources, +from ray.state import (jobs, nodes, actors, tasks, objects, timeline, + object_transfer_timeline, cluster_resources, available_resources, errors) # noqa: E402 from ray.worker import ( LOCAL_MODE, @@ -136,7 +136,6 @@ from ray.runtime_context import _get_runtime_context # noqa: E402 __version__ = "0.9.0.dev0" __all__ = [ - "global_state", "jobs", "nodes", "actors", diff --git a/python/ray/state.py b/python/ray/state.py index 097c33e56..4ec9f4702 100644 --- a/python/ray/state.py +++ b/python/ray/state.py @@ -1069,66 +1069,9 @@ class GlobalState(object): } -class DeprecatedGlobalState(object): - """A class used to print errors when the old global state API is used.""" - - def object_table(self, object_id=None): - raise DeprecationWarning( - "ray.global_state.object_table() is deprecated. Use ray.objects() " - "instead.") - - def task_table(self, task_id=None): - raise DeprecationWarning( - "ray.global_state.task_table() is deprecated. Use ray.tasks() " - "instead.") - - def function_table(self, function_id=None): - raise DeprecationWarning( - "ray.global_state.function_table() is deprecated.") - - def client_table(self): - raise DeprecationWarning( - "ray.global_state.client_table() is deprecated. Use ray.nodes() " - "instead.") - - def profile_table(self): - raise DeprecationWarning( - "ray.global_state.profile_table() is deprecated.") - - def chrome_tracing_dump(self, filename=None): - raise DeprecationWarning( - "ray.global_state.chrome_tracing_dump() is deprecated. Use " - "ray.timeline() instead.") - - def chrome_tracing_object_transfer_dump(self, filename=None): - raise DeprecationWarning( - "ray.global_state.chrome_tracing_object_transfer_dump() is " - "deprecated. Use ray.object_transfer_timeline() instead.") - - def workers(self): - raise DeprecationWarning("ray.global_state.workers() is deprecated.") - - def cluster_resources(self): - raise DeprecationWarning( - "ray.global_state.cluster_resources() is deprecated. Use " - "ray.cluster_resources() instead.") - - def available_resources(self): - raise DeprecationWarning( - "ray.global_state.available_resources() is deprecated. Use " - "ray.available_resources() instead.") - - def error_messages(self, all_jobs=False): - raise DeprecationWarning( - "ray.global_state.error_messages() is deprecated. Use " - "ray.errors() instead.") - - state = GlobalState() """A global object used to access the cluster's global state.""" -global_state = DeprecatedGlobalState() - def jobs(): """Get a list of the jobs in the cluster.