Exemple #1
0
 def validate(conf):
     validate_presto_conf(conf)
     if 'coordinator' not in conf['config.properties']:
         raise ConfigurationError('Must specify coordinator=true in '
                                  'coordinator\'s config.properties')
     if conf['config.properties']['coordinator'] != 'true':
         raise ConfigurationError('Coordinator cannot be false in the '
                                  'coordinator\'s config.properties.')
     return conf
Exemple #2
0
 def validate(conf):
     validate_presto_conf(conf)
     if 'coordinator' not in conf['config.properties']:
         raise ConfigurationError('Must specify coordinator=true in '
                                  'coordinator\'s config.properties')
     if conf['config.properties']['coordinator'] != 'true':
         raise ConfigurationError('Coordinator cannot be false in the '
                                  'coordinator\'s config.properties.')
     return conf
Exemple #3
0
def validate(conf):
    validate_presto_conf(conf)
    if conf["config.properties"]["coordinator"] != "false":
        raise ConfigurationError("Coordinator must be false in the " "worker's config.properties")
    uri = urlparse.urlparse(conf["config.properties"]["discovery.uri"])
    if islocalhost(uri.hostname) and len(env.roledefs["all"]) > 1:
        raise ConfigurationError(
            "discovery.uri should not be localhost in a "
            "multi-node cluster, but found " + urlparse.urlunparse(uri) + ".  You may have encountered this error by "
            "choosing a coordinator that is localhost and a worker that "
            "is not.  The default discovery-uri is "
            "http://<coordinator>:8080"
        )
    return conf
Exemple #4
0
def validate(conf):
    validate_presto_conf(conf)
    if conf['config.properties']['coordinator'] != 'false':
        raise ConfigurationError('Coordinator must be false in the '
                                 'worker\'s config.properties')
    uri = urlparse.urlparse(conf['config.properties']['discovery.uri'])
    if islocalhost(uri.hostname) and len(env.roledefs['all']) > 1:
        raise ConfigurationError(
            'discovery.uri should not be localhost in a '
            'multi-node cluster, but found ' + urlparse.urlunparse(uri) +
            '.  You may have encountered this error by '
            'choosing a coordinator that is localhost and a worker that '
            'is not.  The default discovery-uri is '
            'http://<coordinator>:8080')
    return conf
 def test_valid_conf(self):
     conf = {
         'node.properties': {},
         'jvm.config': [],
         'config.properties': {
             'discovery.uri': 'http://uri'
         }
     }
     self.assertEqual(validate_presto_conf(conf), conf)
Exemple #6
0
def validate(conf):
    validate_presto_conf(conf)
    if conf["config.properties"]["coordinator"] != "true":
        raise ConfigurationError("Coordinator cannot be false in the "
                                 "coordinator's config.properties.")
    return conf
 def test_valid_conf(self):
     conf = {'node.properties': {}, 'jvm.config': [],
             'config.properties': {}}
     self.assertEqual(validate_presto_conf(conf), conf)
 def test_valid_conf(self):
     conf = {'node.properties': {}, 'jvm.config': [],
             'config.properties': {'discovery.uri': 'http://uri'}}
     self.assertEqual(validate_presto_conf(conf), conf)