Package org.elasticsearch.hadoop.cfg

Examples of org.elasticsearch.hadoop.cfg.PropertiesSettings


    public void testHostWithoutAPortFallingBackToDefault() throws Exception {
        Properties props = new Properties();
        props.setProperty("es.nodes", "localhost");
        props.setProperty("es.port", "9800");

        PropertiesSettings settings = new PropertiesSettings(props);
        List<String> nodes = SettingsUtils.discoveredOrDeclaredNodes(settings);
        assertThat(nodes.size(), equalTo(1));
        assertThat("localhost:9800", equalTo(nodes.get(0)));
    }
View Full Code Here


        Properties props = new Properties();
        props.setProperty("es.nodes", "localhost");
        props.setProperty("es.port", "9800");
        props.setProperty("es.nodes.discovery", "false");

        PropertiesSettings settings = new PropertiesSettings(props);
        List<String> nodes = SettingsUtils.discoveredOrDeclaredNodes(settings);
        assertThat(nodes.size(), equalTo(1));
        assertThat("localhost:9800", equalTo(nodes.get(0)));
    }
View Full Code Here

        Properties props = new Properties();
        props.setProperty("es.nodes", "localhost:9800");
        props.setProperty("es.port", "9300");
        props.setProperty("es.nodes.discovery", "false");

        PropertiesSettings settings = new PropertiesSettings(props);
        List<String> nodes = SettingsUtils.discoveredOrDeclaredNodes(settings);
        assertThat(nodes.size(), equalTo(1));
        assertThat("localhost:9800", equalTo(nodes.get(0)));
    }
View Full Code Here

        return new FieldAlias(SettingsUtils.aliases(settings.getProperty(MAPPING_NAMES)));
    }

    static String asProjection(Schema schema, Properties props) {
        List<String> fields = new ArrayList<String>();
        addField(schema, fields, alias(new PropertiesSettings(props)), null);

        return StringUtils.concatenate(fields, ",");
    }
View Full Code Here

        }
    }

    static String asProjection(RequiredFieldList list, Properties props) {
        List<String> fields = new ArrayList<String>();
        FieldAlias alias = alias(new PropertiesSettings(props));
        for (RequiredField field : list.getFields()) {
            addField(field, fields, alias, "");
        }

        return StringUtils.concatenateAndUriEncode(fields, ",");
View Full Code Here

                        .append("],shard=").append(shardId).append("]");
            return builder.toString();
        }

        public Settings settings() {
            return new PropertiesSettings(new Properties()).load(serializedSettings);
        }
View Full Code Here

    @Test
    public void testFieldMap() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }
View Full Code Here

    @Test
    public void testFieldMapWithColumns() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        tableProperties.put(HiveConstants.COLUMNS, "id,name,timestamp,foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }
View Full Code Here

    @Test
    public void testColumnToAlias() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo, date:&foo");
        tableProperties.put(HiveConstants.COLUMNS, "id,name,timestamp,foo,date");
        Collection<String> columnToAlias = HiveUtils.columnToAlias(new PropertiesSettings(tableProperties));
        assertEquals(5, columnToAlias.size());
        Iterator<String> iterator = columnToAlias.iterator();
        assertEquals("id", iterator.next());
        assertEquals("name", iterator.next());
        assertEquals("@timestamp", iterator.next());
View Full Code Here

    private PropertiesSettings cfg;
  private CommonsHttpTransport transport;

    @Before
    public void setup() {
        cfg = new PropertiesSettings();
        cfg.setPort(SSL_PORT);
    cfg.setProperty(ES_NET_USE_SSL, "true");
    cfg.setProperty(ES_NET_SSL_CERT_ALLOW_SELF_SIGNED, "true");
    cfg.setProperty(ES_NET_SSL_TRUST_STORE_LOCATION, "ssl/client.jks");
    cfg.setProperty(ES_NET_SSL_TRUST_STORE_PASS, "testpass");
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.cfg.PropertiesSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.