@@ -24,6 +24,10 @@ class SchemeEntryType(enum.IntEnum):
24
24
SEQUENCE = 15
25
25
REPLICATION = 16
26
26
TOPIC = 17
27
+ EXTERNAL_TABLE = 18
28
+ EXTERNAL_DATA_SOURCE = 19
29
+ VIEW = 20
30
+ RESOURCE_POOL = 21
27
31
28
32
@classmethod
29
33
def _missing_ (cls , value ):
@@ -103,6 +107,38 @@ def is_directory_or_database(entry):
103
107
"""
104
108
return entry == SchemeEntryType .DATABASE or entry == SchemeEntryType .DIRECTORY
105
109
110
+ @staticmethod
111
+ def is_external_table (entry ):
112
+ """
113
+ :param entry: A scheme entry to check
114
+ :return: True if scheme entry is an external table and False otherwise
115
+ """
116
+ return entry == SchemeEntryType .EXTERNAL_TABLE
117
+
118
+ @staticmethod
119
+ def is_external_data_source (entry ):
120
+ """
121
+ :param entry: A scheme entry to check
122
+ :return: True if scheme entry is an external data source and False otherwise
123
+ """
124
+ return entry == SchemeEntryType .EXTERNAL_DATA_SOURCE
125
+
126
+ @staticmethod
127
+ def is_external_view (entry ):
128
+ """
129
+ :param entry: A scheme entry to check
130
+ :return: True if scheme entry is a view and False otherwise
131
+ """
132
+ return entry == SchemeEntryType .VIEW
133
+
134
+ @staticmethod
135
+ def is_external_resource_pool (entry ):
136
+ """
137
+ :param entry: A scheme entry to check
138
+ :return: True if scheme entry is a resource pool and False otherwise
139
+ """
140
+ return entry == SchemeEntryType .RESOURCE_POOL
141
+
106
142
107
143
class SchemeEntry (object ):
108
144
__slots__ = (
@@ -185,6 +221,30 @@ def is_coordination_node(self):
185
221
"""
186
222
return SchemeEntryType .is_coordination_node (self .type )
187
223
224
+ def is_external_table (self ):
225
+ """
226
+ :return: True if scheme entry is an external table and False otherwise
227
+ """
228
+ return SchemeEntryType .is_external_table (self .type )
229
+
230
+ def is_external_data_source (self ):
231
+ """
232
+ :return: True if scheme entry is an external data source and False otherwise
233
+ """
234
+ return SchemeEntryType .is_external_data_source (self .type )
235
+
236
+ def is_view (self ):
237
+ """
238
+ :return: True if scheme entry is a view and False otherwise
239
+ """
240
+ return SchemeEntryType .is_view (self .type )
241
+
242
+ def is_resource_pool (self ):
243
+ """
244
+ :return: True if scheme entry is a resource pool and False otherwise
245
+ """
246
+ return SchemeEntryType .is_resource_pool (self .type )
247
+
188
248
189
249
class Directory (SchemeEntry ):
190
250
__slots__ = ("children" ,)
0 commit comments