Skip to content

Commit 8408c05

Browse files
author
Anton Petrov
committed
Remove pseudo distributed toggle
- The same functionality can be achieved by using the node-scheduler.include-coordinator property. Removing the pseudo distributed toggle simplifies setup.
1 parent 9c82c98 commit 8408c05

File tree

6 files changed

+6
-76
lines changed

6 files changed

+6
-76
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $ ambari-server restart
5757

5858
## Supported topologies
5959

60-
The following two screens will allow you to assign the Presto processes among the nodes in your cluster.
60+
The following two screens will allow you to assign the Presto processes among the nodes in your cluster. Unfortunately, once you pick a topology for Presto and finish the installation process it is impossible to tweak the topology.
6161

6262
Presto is composed of a coordinator and worker processes. The same code runs all nodes because the same Presto server RPM is installed for both workers and coordinator. It is the configuration on each node that determines how a particular node will behave. Presto can run in pseudo-distributed mode, where a single Presto process on one node acts as both coordinator and worker, or in distributed mode, where the Presto coordinator runs on one node and the Presto workers run on other nodes.
6363

@@ -67,7 +67,7 @@ The client component of Presto is the `presto-cli` executable JAR. You should pl
6767

6868
### Pseudo-distributed
6969

70-
Pick a node for the Presto coordinator and *do not assign any Presto workers*. On the configuration screen that follows, you must also enable pseudo-distributed mode by clicking the toggle. If you assign Presto workers to nodes and enable the pseudo-distributed toggle, the installation will fail.
70+
Pick a node for the Presto coordinator and *do not assign any Presto workers*. On the configuration screen that follows, you must also enable `node-scheduler.include-coordinator` by clicking the toggle.
7171

7272
### Distributed
7373

configuration/config.properties.xml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -113,29 +113,4 @@
113113
</property>
114114
-->
115115

116-
<property>
117-
<name>pseudo.distributed.enabled</name>
118-
<value>false</value>
119-
<description>
120-
Run Presto in pseudo-distributed mode. Coordinator and worker run in
121-
a single process on a single node. If this option is selected the only
122-
component that needs to be assigned to a node is the coordinator.
123-
</description>
124-
<display-name>Pseudo Distributed Mode</display-name>
125-
<value-attributes>
126-
<type>value-list</type>
127-
<entries>
128-
<entry>
129-
<value>true</value>
130-
<label>Enabled</label>
131-
</entry>
132-
<entry>
133-
<value>false</value>
134-
<label>Disabled</label>
135-
</entry>
136-
</entries>
137-
<selection-cardinality>1</selection-cardinality>
138-
</value-attributes>
139-
</property>
140-
141116
</configuration>

package/scripts/presto_coordinator.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,11 @@ def configure(self, env):
6868
for key, value in config_properties.iteritems():
6969
if key == 'query.queue-config-file' and value.strip() == '':
7070
continue
71-
# Ignore as it's not an actual config property, just
72-
# the user visible equivalent to node-scheduler.include-coordinator
73-
if key == 'pseudo.distributed.enabled' or key == 'node-scheduler.include-coordinator':
74-
continue
7571
if key in memory_configs:
7672
value += 'GB'
7773
f.write(key_val_template.format(key, value))
7874
f.write(key_val_template.format('coordinator', 'true'))
7975
f.write(key_val_template.format('discovery-server.enabled', 'true'))
80-
if (config_properties['pseudo.distributed.enabled'] and
81-
'presto_worker_hosts' in host_info.keys()):
82-
raise RuntimeError('You cannot specify worker nodes in pseudo distributed mode')
83-
elif config_properties['pseudo.distributed.enabled']:
84-
f.write(key_val_template.format(
85-
'node-scheduler.include-coordinator', 'true'))
86-
else:
87-
f.write(key_val_template.format('node-scheduler.include-coordinator',
88-
str(config_properties['node-scheduler.include-coordinator'])))
8976

9077
create_connectors(node_properties, connectors_to_add)
9178
delete_connectors(node_properties, connectors_to_delete)

package/scripts/presto_worker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ def configure(self, env):
5858
for key, value in config_properties.iteritems():
5959
if key == 'query.queue-config-file' and value.strip() == '':
6060
continue
61-
if key == 'pseudo.distributed.enabled':
62-
continue
6361
if key in memory_configs:
6462
value += 'GB'
6563
f.write(key_val_template.format(key, value))

tests/test_coordinator.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,9 @@
2828

2929
class TestCoordinator(unittest.TestCase):
3030

31-
dummy_config_properties = {'pseudo.distributed.enabled': False,
32-
'query.queue-config-file': '',
31+
dummy_config_properties = {'query.queue-config-file': '',
3332
'http-server.http.port': '8081',
34-
'node-scheduler.include-coordinator': True}
35-
36-
pseudo_distributed_config_properties = {'pseudo.distributed.enabled': True,
37-
'node-scheduler.include-coordinator': False}
38-
39-
minimal_config_properties = {'pseudo.distributed.enabled': False,
40-
'node-scheduler.include-coordinator': False}
33+
'node-scheduler.include-coordinator': 'true'}
4134

4235
for memory_config in memory_configs:
4336
dummy_config_properties[memory_config] = '123'
@@ -114,7 +107,7 @@ def test_start_smoketests_presto(
114107
assert smoketest_presto_mock.called
115108

116109
@patch('package.scripts.presto_coordinator.create_connectors')
117-
@patch('package.scripts.params.config_properties', new=minimal_config_properties)
110+
@patch('package.scripts.params.config_properties', new={})
118111
def test_assert_constant_properties(self, create_connectors_mock):
119112
config = collect_config_vars_written_out(self.mock_env, Coordinator())
120113

@@ -132,32 +125,19 @@ def test_configure_ignore_empty_queue_config_file(self, create_connectors_mock):
132125

133126
@patch('package.scripts.params.host_info', new={'presto_coordinator_hosts': ['master']})
134127
@patch('package.scripts.presto_coordinator.create_connectors')
135-
@patch('package.scripts.params.config_properties', new=pseudo_distributed_config_properties)
128+
@patch('package.scripts.params.config_properties', new=dummy_config_properties)
136129
def test_configure_pseudo_distributed(self, create_connectors_mock):
137130
config = collect_config_vars_written_out(self.mock_env, Coordinator())
138131

139132
assert 'node-scheduler.include-coordinator=true\n' in config
140133

141-
@patch('package.scripts.presto_coordinator.create_connectors')
142-
@patch('package.scripts.params.config_properties', new=dummy_config_properties)
143-
def test_user_set_coordinator_as_worker(self, create_connectors_mock):
144-
config = collect_config_vars_written_out(self.mock_env, Coordinator())
145-
146-
assert 'node-scheduler.include-coordinator=True\n' in config
147-
148134
@patch('package.scripts.presto_coordinator.create_connectors')
149135
@patch('package.scripts.params.config_properties', new=dummy_config_properties)
150136
def test_memory_settings_have_units(self, create_connectos_mock):
151137
config = collect_config_vars_written_out(self.mock_env, Coordinator())
152138

153139
assert_memory_configs_properly_formatted(config)
154140

155-
@patch('package.scripts.presto_coordinator.create_connectors')
156-
@patch('package.scripts.params.host_info', new={'presto_worker_hosts': ['slave1']})
157-
@patch('package.scripts.params.config_properties', new=pseudo_distributed_config_properties)
158-
def test_pseudo_distributed_topology_enforced(self, create_connectors_mock):
159-
TestCase.assertRaises(self, RuntimeError, collect_config_vars_written_out, self.mock_env, Coordinator())
160-
161141
def assert_memory_configs_properly_formatted(configs_to_test):
162142
import re
163143
from package.scripts.params import memory_configs

themes/theme.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@
130130
"config": "config.properties/discovery.uri",
131131
"subsection-name": "subsection-general-config"
132132
},
133-
{
134-
"config": "config.properties/pseudo.distributed.enabled",
135-
"subsection-name": "subsection-general-config"
136-
},
137133
{
138134
"config": "jvm.config/jvm.config",
139135
"subsection-name": "subsection-jvm-config"
@@ -211,12 +207,6 @@
211207
"type": "text-area"
212208
}
213209
},
214-
{
215-
"config": "config.properties/pseudo.distributed.enabled",
216-
"widget": {
217-
"type": "toggle"
218-
}
219-
},
220210
{
221211
"config": "jvm.config/jvm.config",
222212
"widget": {

0 commit comments

Comments
 (0)