Skip to content

Commit

Permalink
Remove deprecated global state. (#6655)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertnishihara committed Jan 1, 2020
1 parent 4150d44 commit 9baa002
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 60 deletions.
5 changes: 2 additions & 3 deletions python/ray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
_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,
Expand Down Expand Up @@ -136,7 +136,6 @@
__version__ = "0.9.0.dev0"

__all__ = [
"global_state",
"jobs",
"nodes",
"actors",
Expand Down
57 changes: 0 additions & 57 deletions python/ray/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,66 +1069,9 @@ def actor_checkpoint_info(self, actor_id):
}


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.
Expand Down

0 comments on commit 9baa002

Please sign in to comment.