Skip to content

Commit 8b7ce2d

Browse files
committed
MB-66724 Rename Columnar versions to Enterprise Analytics
Change-Id: Ie1aac1a71bf22967206bfd4d639e440dbe66b740 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/227834 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Matt Hall <matt.hall@couchbase.com>
1 parent 9362ceb commit 8b7ce2d

7 files changed

Lines changed: 95 additions & 87 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PROJECT(CouchbaseClient)
22
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
33

44
IF (BUILD_COLUMNAR)
5-
SET (_cli_version "${COLUMNAR_PRODUCT_VERSION}-columnar")
5+
SET (_cli_version "${COLUMNAR_PRODUCT_VERSION}-enterprise-analytics")
66
ELSE ()
77
SET (_cli_version "${PRODUCT_VERSION}")
88
ENDIF ()

cbmgr.py

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,18 @@ def force_communicate_tls(rest: ClusterManager) -> bool:
177177

178178

179179
def rest_initialiser(cluster_init_check=False, version_check=False, enterprise_check=None, credentials_required=True,
180-
columnar_check=None):
180+
enterprise_analytics_check=None):
181181
"""rest_initialiser is a decorator that does common subcommand tasks.
182182
183183
The decorator will always creates a cluster manager and assign it to the subcommand variable rest
184184
:param cluster_init_check: if true it will check if the cluster is initialized before executing the subcommand
185185
:param version_check: if true it will check if the cluster and CLI version match if they do not it prints a warning
186186
:param enterprise_check: if true it will check if the cluster is enterprise and fail if not. If it is false it does
187-
the check but it does not fail if not enterprise. If none it does not perform the check. The result of the check
188-
is stored on the instance parameter enterprise
189-
:param columnar_check: if true it will check if the cluster supports columnar and fail if not. If it is false it does
190-
the check but it does not fail if not columnar. If none it does not perform the check. The result of the check
191-
is stored on the instance parameter columnar
187+
the check but it does not fail if not enterprise. If none it does not perform the check. The result of the
188+
check is stored on the instance parameter enterprise
189+
:param enterprise_analytics_check: if true it will check if the cluster supports Enterprise Analytics and fail if
190+
not. If it is false it does the check but it does not fail if not Enterprise Analytics. If none it does not
191+
perform the check. The result of the check is stored on the instance parameter enterprise_analytics
192192
"""
193193
def inner(fn):
194194
def decorator(self, opts):
@@ -208,21 +208,21 @@ def decorator(self, opts):
208208
check_cluster_initialized(self.rest)
209209
if version_check:
210210
check_versions(self.rest)
211-
if enterprise_check is not None or columnar_check is not None:
212-
# check columnar when we check enterprise to avoid a duplicate fetch on pools
213-
enterprise, columnar, errors = self.rest.is_enterprise_columnar()
211+
if enterprise_check is not None or enterprise_analytics_check is not None:
212+
# check Enterprise Analytics when we check enterprise to avoid a duplicate fetch on pools
213+
enterprise, enterprise_analytics, errors = self.rest.get_cluster_type()
214214
_exit_if_errors(errors)
215215

216216
if enterprise_check and not enterprise:
217217
_exit_if_errors(['Command only available in enterprise edition'])
218218

219-
if columnar_check and not columnar:
220-
_exit_if_errors(['Command only available for columnar'])
219+
if enterprise_analytics_check and not enterprise_analytics:
220+
_exit_if_errors(['Command only available for Enterprise Analytics'])
221221

222222
if enterprise_check is not None:
223223
self.enterprise = enterprise
224-
if columnar_check is not None:
225-
self.columnar = columnar
224+
if enterprise_analytics_check is not None:
225+
self.enterprise_analytics = enterprise_analytics
226226

227227
return fn(self, opts)
228228
return decorator
@@ -324,13 +324,13 @@ def index_storage_mode_to_param(value, default="plasma"):
324324
return value
325325

326326

327-
def process_services(services, enterprise, columnar, cluster_version="0.0.0"):
327+
def process_services(services, enterprise, enterprise_analytics, cluster_version="0.0.0"):
328328
"""Converts services to a format Couchbase understands"""
329-
if not services and not columnar:
329+
if not services and not enterprise_analytics:
330330
services = "data"
331-
elif services and columnar:
332-
return None, ["--services cannot be specified on Columnar"]
333-
elif columnar:
331+
elif services and enterprise_analytics:
332+
return None, ["--services cannot be specified on Enterprise Analytics"]
333+
elif enterprise_analytics:
334334
return None, None
335335

336336
sep = ","
@@ -763,7 +763,7 @@ def __init__(self, deprecate_username=False, deprecate_password=False, cluster_d
763763
# Filled by the decorators
764764
self.rest = None
765765
self.enterprise = None
766-
self.columnar = None
766+
self.enterprise_analytics = None
767767

768768
self.parser = CliParser(formatter_class=CLIHelpFormatter, add_help=False, allow_abbrev=False)
769769
group = self.parser.add_argument_group("Cluster options")
@@ -911,7 +911,7 @@ def __init__(self):
911911
group.add_argument("--node-to-node-encryption", dest="encryption", metavar="<on|off>", default="off",
912912
choices=["on", "off"], help="Enable node to node encryption")
913913

914-
@rest_initialiser(enterprise_check=False, columnar_check=False)
914+
@rest_initialiser(enterprise_check=False, enterprise_analytics_check=False)
915915
def execute(self, opts):
916916
initialized, errors = self.rest.is_cluster_initialized()
917917
_exit_if_errors(errors)
@@ -921,13 +921,13 @@ def execute(self, opts):
921921
if not self.enterprise and opts.index_storage_mode == 'memopt':
922922
_exit_if_errors(["memopt option for --index-storage-setting can only be configured on enterprise edition"])
923923

924-
if not self.columnar and opts.services and "manager-only" in opts.services:
924+
if not self.enterprise_analytics and opts.services and "manager-only" in opts.services:
925925
_exit_if_errors(["Cannot initialize cluster with the manager only service"])
926926

927-
services, errors = process_services(opts.services, self.enterprise, self.columnar)
927+
services, errors = process_services(opts.services, self.enterprise, self.enterprise_analytics)
928928
_exit_if_errors(errors)
929929

930-
if not self.columnar and 'kv' not in services.split(','):
930+
if not self.enterprise_analytics and 'kv' not in services.split(','):
931931
_exit_if_errors(["Cannot set up first cluster node without the data service"])
932932

933933
if 'ipv4' in opts.ip_family:
@@ -936,7 +936,7 @@ def execute(self, opts):
936936
ip_family = 'ipv6'
937937
ip_only = True if 'only' in opts.ip_family else False
938938

939-
if not self.columnar and not opts.index_storage_mode and 'index' in services.split(','):
939+
if not self.enterprise_analytics and not opts.index_storage_mode and 'index' in services.split(','):
940940
opts.index_storage_mode = "default"
941941

942942
default = "plasma"
@@ -951,7 +951,7 @@ def execute(self, opts):
951951
_exit_if_errors(errors)
952952

953953
versionCheck = compare_versions(min_version, "7.2.3")
954-
if not self.columnar and versionCheck == -1:
954+
if not self.enterprise_analytics and versionCheck == -1:
955955
_exit_if_errors(["--cluster-init can only be used against >= 7.2.3 clusters"])
956956

957957
if not self.enterprise and opts.notifications == "0":
@@ -2489,7 +2489,8 @@ def __init__(self):
24892489
group.add_argument("--index-storage-setting", dest="index_storage_mode", metavar="<mode>",
24902490
choices=["default", "memopt"], help="The index storage mode")
24912491

2492-
@rest_initialiser(cluster_init_check=True, version_check=True, enterprise_check=False, columnar_check=False)
2492+
@rest_initialiser(cluster_init_check=True, version_check=True,
2493+
enterprise_check=False, enterprise_analytics_check=False)
24932494
def execute(self, opts):
24942495
if opts.use_client_cert:
24952496
if opts.server_username is not None or opts.server_password is not None:
@@ -2505,13 +2506,14 @@ def execute(self, opts):
25052506
min_version, error = self.rest.min_version()
25062507
_exit_if_errors(error)
25072508

2508-
opts.services, errors = process_services(opts.services, self.enterprise, self.columnar, min_version)
2509+
opts.services, errors = process_services(opts.services, self.enterprise, self.enterprise_analytics, min_version)
25092510
_exit_if_errors(errors)
25102511

25112512
settings, errors = self.rest.index_settings()
25122513
_exit_if_errors(errors)
25132514

2514-
if not self.columnar and opts.index_storage_mode is None and settings['storageMode'] == "" and "index" in opts.services:
2515+
if not self.enterprise_analytics and opts.index_storage_mode is None and settings[
2516+
'storageMode'] == "" and "index" in opts.services:
25152517
opts.index_storage_mode = "default"
25162518

25172519
# For supporting the default index backend changing from forestdb to plasma in Couchbase 5.0
@@ -4077,7 +4079,7 @@ def execute(self, opts):
40774079
_exit_if_errors(errors)
40784080

40794081
versionCheck = compare_versions(min_version, "7.2.3")
4080-
if not self.enterprise and not self.columnar and versionCheck != -1:
4082+
if not self.enterprise and not self.enterprise_analytics and versionCheck != -1:
40814083
_exit_if_errors(["Modifying notifications settings is an Enterprise Edition only feature"])
40824084

40834085
enabled = None
@@ -5670,7 +5672,7 @@ def __init__(self):
56705672
ld_group.add_argument("--link-details-path", dest="link_details_path", metavar="<path>",
56715673
help="The path to the link details JSON file")
56725674

5673-
@rest_initialiser(cluster_init_check=True, version_check=True, columnar_check=True)
5675+
@rest_initialiser(cluster_init_check=True, version_check=True, enterprise_analytics_check=True)
56745676
def execute(self, opts):
56755677
if opts.create or opts.edit:
56765678
self._set(opts)

cluster_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,18 @@ def is_cluster_initialized(self):
262262
return True, None
263263
return False, errors
264264

265-
def is_enterprise_columnar(self):
265+
def get_cluster_type(self):
266266
"""
267-
Returns a tuple of (isEnterprise, isColumnar, errors)
267+
Returns a tuple of (isEnterprise, isEnterpriseAnalytics, errors)
268268
"""
269269
data, errors = self.pools()
270270
if errors:
271271
return None, None, errors
272272

273-
# If isColumnar isn't present, then it must be a <8.0 non-Columnar cluster (MB-65393)
274-
return data["isEnterprise"], data.get("isColumnar", False), None
273+
isEnterprise = data["isEnterprise"]
274+
isEnterpriseAnalytics = "prodName" in data and data["prodName"] == "Enterprise Analytics"
275+
276+
return isEnterprise, isEnterpriseAnalytics, None
275277

276278
def get_hostnames_for_service(self, service_name):
277279
""" Gets all hostnames that run a service

test/mock_server.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ def get_pools(rest_params=None, server_args=None, path="", endpoint_match=None):
261261

262262
is_admin = True
263263
enterprise = True
264-
columnar = False
264+
enterprise_analytics = False
265265
version = '0.0.0-0000-enterprise'
266266
init = True
267267
if 'enterprise' in server_args:
268268
enterprise = server_args['enterprise']
269-
if 'columnar' in server_args:
270-
columnar = server_args['columnar']
271-
if columnar:
272-
version = '0.0.0-0000-columnar'
269+
if 'enterprise_analytics' in server_args:
270+
enterprise_analytics = server_args['enterprise_analytics']
271+
if enterprise_analytics:
272+
version = '0.0.0-0000-enterprise-analytics'
273273
if 'is_admin' in server_args:
274274
is_admin = server_args['is_admin']
275275
if "version" in server_args:
@@ -283,14 +283,15 @@ def get_pools(rest_params=None, server_args=None, path="", endpoint_match=None):
283283
'pools': [{'streamingUri': '/poolsStreaming/default?uuid=5f8b140987f4e46c950e3fa82e7fcb48',
284284
'name': 'default', 'uri': '/pools/default?uuid=5f8b140987f4e46c950e3fa82e7fcb48'}],
285285
'isEnterprise': enterprise,
286-
'isColumnar': columnar,
286+
'prodName': "Enterprise Analytics" if enterprise_analytics else None,
287287
'componentsVersion': {'kernel': '2.16.4', 'ale': version, 'ssl': '5.3.3',
288288
'os_mon': '2.2.14', 'stdlib': '1.19.4', 'inets': '5.9.8',
289289
'public_key': '0.21', 'ns_server': version, 'crypto': '3.2', 'asn1': '2.0.4',
290290
'lhttpc': '1.3.0', 'sasl': '2.3.4'}, 'implementationVersion': version,
291291
'isAdminCreds': is_admin, 'isROAdminCreds': False}
292292

293-
response_no_init = {'uuid': [], 'settings': [], 'pools': [], 'isEnterprise': enterprise, 'isColumnar': columnar,
293+
response_no_init = {'uuid': [], 'settings': [], 'pools': [], 'isEnterprise': enterprise,
294+
'prodName': "Enterprise Analytics" if enterprise_analytics else None,
294295
'componentsVersion': {'kernel': '5.4.3.2', 'ale': version, 'ssl': '8.2.6.2', 'os_mon': '2.4.4',
295296
'stdlib': '3.4.5', 'inets': '6.5.2.4', 'public_key': '1.5.2',
296297
'ns_server': version, 'crypto': '4.2.2.2', 'asn1': '5.0.5.1',

test/test_cbmgr.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,30 @@ def test_process_services(self):
2525
"error": ["The manager only service can only be used with >= 7.6.0 clusters"],
2626
"cluster_version": "7.2.0"
2727
},
28-
"ColumnarDataService": {
28+
"EnterpriseAnalyticsDataService": {
2929
"service": "data",
3030
"expected": None,
31-
"columnar": True,
32-
"error": ["--services cannot be specified on Columnar"]
31+
"enterprise_analytics": True,
32+
"error": ["--services cannot be specified on Enterprise Analytics"]
3333
},
34-
"ColumnarManagerOnly": {
34+
"EnterpriseAnalyticsManagerOnly": {
3535
"service": "manager-only",
3636
"expected": None,
37-
"columnar": True,
38-
"error": ["--services cannot be specified on Columnar"]
37+
"enterprise_analytics": True,
38+
"error": ["--services cannot be specified on Enterprise Analytics"]
3939
},
40-
"ColumnarBlankService": {
40+
"EnterpriseAnalyticsBlankService": {
4141
"service": "",
4242
"expected": None,
43-
"columnar": True
43+
"enterprise_analytics": True
4444
},
4545
}
4646

4747
for name, test in tests.items():
4848
with self.subTest(name):
4949
cluster_version = test.setdefault("cluster_version", "7.6.0")
50-
columnar = test.setdefault("columnar", False)
51-
services, err = process_services(test["service"], True, columnar, cluster_version)
50+
enterprise_analytics = test.setdefault("enterprise_analytics", False)
51+
services, err = process_services(test["service"], True, enterprise_analytics, cluster_version)
5252
self.assertEqual(err, test.setdefault("error", None))
5353
self.assertEqual(services, test["expected"])
5454

0 commit comments

Comments
 (0)