Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 5
0
 def test_valid_conf(self):
     conf = {
         'node.properties': {},
         'jvm.config': [],
         'config.properties': {
             'discovery.uri': 'http://uri'
         }
     }
     self.assertEqual(validate_presto_conf(conf), conf)
Ejemplo n.º 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
Ejemplo n.º 7
0
 def test_valid_conf(self):
     conf = {'node.properties': {}, 'jvm.config': [],
             'config.properties': {}}
     self.assertEqual(validate_presto_conf(conf), conf)
Ejemplo n.º 8
0
 def test_valid_conf(self):
     conf = {'node.properties': {}, 'jvm.config': [],
             'config.properties': {'discovery.uri': 'http://uri'}}
     self.assertEqual(validate_presto_conf(conf), conf)