<commit_before>/*
 * Copyright (c) 2002-2017 "Neo Technology,"
 * Network Engine for Objects in Lund AB [http://neotechnology.com]
 *
 * This file is part of Neo4j.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.neo4j.driver.v1.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.neo4j.driver.internal.util.Iterables.map;

public class Neo4jSettings
{
    public static final String AUTH_ENABLED = "dbms.security.auth_enabled";
    public static final String DATA_DIR = "dbms.directories.data";
    public static final String CERT_DIR = "dbms.directories.certificates";
    public static final String IMPORT_DIR = "dbms.directories.import";
    public static final String LISTEN_ADDR = "dbms.connectors.default_listen_address"; // only valid for 3.1+
    public static final String IPV6_ENABLED_ADDR = "::";
    public static final String PAGE_CACHE_SIZE = "dbms.memory.pagecache.size";

    private static final String DEFAULT_IMPORT_DIR = "import";
    private static final String DEFAULT_CERT_DIR = "certificates";
    public static final String DEFAULT_TLS_CERT_PATH = DEFAULT_CERT_DIR + "/neo4j.cert";
    public static final String DEFAULT_TLS_KEY_PATH = DEFAULT_CERT_DIR + "/neo4j.key";
    public static final String DEFAULT_PAGE_CACHE_SIZE = "1g";

    public static final String DEFAULT_DATA_DIR = "data";


    private final Map<String, String> settings;
    private final Set<String> excludes;

    public static Neo4jSettings TEST_SETTINGS = new Neo4jSettings( map(
            CERT_DIR, DEFAULT_CERT_DIR,
            DATA_DIR, DEFAULT_DATA_DIR,
            IMPORT_DIR, DEFAULT_IMPORT_DIR,
            AUTH_ENABLED, "true",
            PAGE_CACHE_SIZE, DEFAULT_PAGE_CACHE_SIZE,
            LISTEN_ADDR, IPV6_ENABLED_ADDR ), Collections.<String>emptySet() );

    private Neo4jSettings( Map<String, String> settings, Set<String> excludes )
    {
        this.settings = settings;
        this.excludes = excludes;
    }

    public Map<String, String> propertiesMap()
    {
        return settings;
    }

    public Neo4jSettings updateWith( Neo4jSettings other )
    {<commit_msg>Use smaller page cache for test database<commit_after>/*
 * Copyright (c) 2002-2017 "Neo Technology,"
 * Network Engine for Objects in Lund AB [http://neotechnology.com]
 *
 * This file is part of Neo4j.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.neo4j.driver.v1.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.neo4j.driver.internal.util.Iterables.map;

public class Neo4jSettings
{
    public static final String AUTH_ENABLED = "dbms.security.auth_enabled";
    public static final String DATA_DIR = "dbms.directories.data";
    public static final String CERT_DIR = "dbms.directories.certificates";
    public static final String IMPORT_DIR = "dbms.directories.import";
    public static final String LISTEN_ADDR = "dbms.connectors.default_listen_address"; // only valid for 3.1+
    public static final String IPV6_ENABLED_ADDR = "::";
    public static final String PAGE_CACHE_SIZE = "dbms.memory.pagecache.size";

    private static final String DEFAULT_IMPORT_DIR = "import";
    private static final String DEFAULT_CERT_DIR = "certificates";
    public static final String DEFAULT_TLS_CERT_PATH = DEFAULT_CERT_DIR + "/neo4j.cert";
    public static final String DEFAULT_TLS_KEY_PATH = DEFAULT_CERT_DIR + "/neo4j.key";
    public static final String DEFAULT_PAGE_CACHE_SIZE = "512m";

    public static final String DEFAULT_DATA_DIR = "data";


    private final Map<String, String> settings;
    private final Set<String> excludes;

    public static Neo4jSettings TEST_SETTINGS = new Neo4jSettings( map(
            CERT_DIR, DEFAULT_CERT_DIR,
            DATA_DIR, DEFAULT_DATA_DIR,
            IMPORT_DIR, DEFAULT_IMPORT_DIR,
            AUTH_ENABLED, "true",
            PAGE_CACHE_SIZE, DEFAULT_PAGE_CACHE_SIZE,
            LISTEN_ADDR, IPV6_ENABLED_ADDR ), Collections.<String>emptySet() );

    private Neo4jSettings( Map<String, String> settings, Set<String> excludes )
    {
        this.settings = settings;
        this.excludes = excludes;
    }

    public Map<String, String> propertiesMap()
    {
        return settings;
    }

    public Neo4jSettings updateWith( Neo4jSettings other )
    {
{'fraction_non_alphanumeric': 0.0818863096326083, 'fraction_numerical': 0.010966916468652898, 'mean_word_length': 3.672929120409906, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1564193', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1562, 'n_words': 506}