Skip to content

Commit 083a2fd

Browse files
Frozen code removed from compatbility tool
1 parent ca3bda9 commit 083a2fd

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

bin/toolkit-compat-tool.py

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -50,56 +50,11 @@
5050
parser.add_option("--file", help='Schema file to run compatability script against')
5151

5252

53-
# The function checks if the system_schema is part of the schema exported and tracks the frozen type in system_schema
54-
55-
def frozen_counter(cluster_schema):
56-
frozen_in_system_schema = 0
57-
system_schema_keyspace_tables = ['system_schema.tables', 'system_schema.functions', 'system_schema.triggers', 'system_schema.aggregates', 'system_schema.views', 'system_schema.indexes', 'system_schema.keyspaces', 'system_schema.types','system.paxos_repair_history','system.top_partitions','system_auth.network_permissions','system_views.clients','system_views.repair_jobs','system_views.repair_participates','system_views.repair_sessions','system_views.repair_validations','system_views.repairs','system_views.streaming']
58-
for item in system_schema_keyspace_tables:
59-
occurances = re.findall( item, cluster_schema, re.IGNORECASE)
60-
if len(occurances) > 0:
61-
if item == 'system_schema.tables':
62-
frozen_in_system_schema = frozen_in_system_schema + 5
63-
elif item == 'system_schema.functions':
64-
frozen_in_system_schema = frozen_in_system_schema + 2
65-
elif item == 'system_schema.triggers':
66-
frozen_in_system_schema = frozen_in_system_schema + 1
67-
elif item == 'system_schema.aggregates':
68-
frozen_in_system_schema = frozen_in_system_schema + 1
69-
elif item == 'system_schema.views':
70-
frozen_in_system_schema = frozen_in_system_schema + 4
71-
elif item == 'system_schema.indexes':
72-
frozen_in_system_schema = frozen_in_system_schema + 1
73-
elif item == 'system_schema.keyspaces':
74-
frozen_in_system_schema = frozen_in_system_schema + 1
75-
elif item == 'system_schema.types':
76-
frozen_in_system_schema = frozen_in_system_schema + 2
77-
elif item == 'system.paxos_repair_history':
78-
frozen_in_system_schema = frozen_in_system_schema + 2
79-
elif item == 'system.top_partitions':
80-
frozen_in_system_schema = frozen_in_system_schema + 2
81-
elif item == 'system_auth.network_permissions':
82-
frozen_in_system_schema = frozen_in_system_schema + 1
83-
elif item == 'system_views.clients':
84-
frozen_in_system_schema = frozen_in_system_schema + 1
85-
elif item == 'system_views.repair_jobs':
86-
frozen_in_system_schema = frozen_in_system_schema + 2
87-
elif item == 'system_views.repair_participates':
88-
frozen_in_system_schema = frozen_in_system_schema + 3
89-
elif item == 'system_views.repair_sessions':
90-
frozen_in_system_schema = frozen_in_system_schema + 4
91-
elif item == 'system_views.repair_validations':
92-
frozen_in_system_schema = frozen_in_system_schema + 1
93-
elif item == 'system_views.repairs':
94-
frozen_in_system_schema = frozen_in_system_schema + 11
95-
elif item == 'system_views.streaming':
96-
frozen_in_system_schema = frozen_in_system_schema + 1
97-
return frozen_in_system_schema
9853

9954
# The function checks the schema and provides the compatability
10055
def schema_check(cluster_schema):
10156

102-
api_features = ['CREATE INDEX', 'CREATE TYPE', 'CREATE TRIGGER', 'CREATE FUNCTION', 'CREATE AGGREGATE', 'CREATE MATERIALIZED VIEW', 'frozen<', 'cdc = true']
57+
api_features = ['CREATE INDEX', 'CREATE TYPE', 'CREATE TRIGGER', 'CREATE FUNCTION', 'CREATE AGGREGATE', 'CREATE MATERIALIZED VIEW', 'cdc = true']
10358
unsupported_features_List = {}
10459
unsupported_features_message = {}
10560

@@ -109,7 +64,6 @@ def schema_check(cluster_schema):
10964
unsupported_features_message['CREATE FUNCTION'] = 'User Defined function'
11065
unsupported_features_message['CREATE AGGREGATE'] = 'Aggregators'
11166
unsupported_features_message['CREATE MATERIALIZED VIEW'] = 'Materialized View'
112-
unsupported_features_message['frozen<'] = 'Frozen Data type'
11367
unsupported_features_message['cdc = true'] = 'Change Data Capture'
11468

11569
for item in api_features:
@@ -122,16 +76,10 @@ def schema_check(cluster_schema):
12276

12377
elif len(unsupported_features_List) > 0:
12478
print("")
125-
print('The following {} unsupported features were found. Some of these features have workarounds. Please contact Amazon Keyspaces team - mbh@amazon.com, kanvesky@amazon.com and nkantam@amazon.com to know about Workaround information'.format(len(unsupported_features_List)))
79+
print('The following {} unsupported features were found. Some of these features have workarounds. Please contact AWS Account team or Amazon Keyspaces team through AWS support to know about Workaround information'.format(len(unsupported_features_List)))
12680
for item in unsupported_features_List.keys():
12781
print("")
128-
if item == 'frozen<':
129-
frozen_system = frozen_counter(cluster_schema)
130-
frozen_non_system_keyspaces = unsupported_features_List[item] - frozen_system
131-
if frozen_non_system_keyspaces > 0:
132-
print(" {} | found {} time(s)".format(unsupported_features_message[item], frozen_non_system_keyspaces))
133-
else:
134-
print(" {} | found {} time(s)".format(unsupported_features_message[item], unsupported_features_List[item]))
82+
print(" {} | found {} time(s)".format(unsupported_features_message[item], unsupported_features_List[item]))
13583

13684
optvalues = optparse.Values()
13785
(options, arguments) = parser.parse_args(sys.argv[1:], values=optvalues)

0 commit comments

Comments
 (0)