Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ydb/scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class SchemeEntryType(enum.IntEnum):
EXTERNAL_DATA_SOURCE = 19
VIEW = 20
RESOURCE_POOL = 21
TRANSFER = 23
SYS_VIEW = 24

@classmethod
def _missing_(cls, value):
Expand Down Expand Up @@ -147,6 +149,14 @@ def is_topic(entry):
"""
return entry == SchemeEntryType.TOPIC

@staticmethod
def is_sysview(entry):
"""
:param entry: A scheme entry to check
:return: True if scheme entry is a system view and False otherwise
"""
return entry == SchemeEntryType.SYS_VIEW


class SchemeEntry(object):
__slots__ = (
Expand Down Expand Up @@ -253,6 +263,12 @@ def is_resource_pool(self):
"""
return SchemeEntryType.is_resource_pool(self.type)

def is_sysview(self):
"""
:return: True if scheme entry is a system view and False otherwise
"""
return SchemeEntryType.is_sysview(self.type)


class Directory(SchemeEntry):
__slots__ = ("children",)
Expand Down
Loading