<commit_before>/**
 * Copyright 2015 Palantir Technologies
 *
 * Licensed under the BSD-3 License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://opensource.org/licenses/BSD-3-Clause
 *
 * 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 com.palantir.atlasdb.keyvalue.dbkvs;

import org.immutables.value.Value;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.palantir.atlasdb.spi.KeyValueServiceConfig;
import com.palantir.nexus.db.pool.config.ConnectionConfig;

@JsonDeserialize(as = ImmutablePostgresDdlConfig.class)
@JsonSerialize(as = ImmutablePostgresDdlConfig.class)
@JsonTypeName(DbKeyValueServiceConfig.TYPE)
@Value.Immutable
public abstract class DbKeyValueServiceConfig implements KeyValueServiceConfig {

    public static final String TYPE = "relational";

    public abstract DdlConfig ddl();

    public abstract ConnectionConfig connection();

    @Override
    public final String type() {
        return TYPE;
    }

}<commit_msg>force agreement of ddl and connection config type<commit_after>/**
 * Copyright 2015 Palantir Technologies
 *
 * Licensed under the BSD-3 License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://opensource.org/licenses/BSD-3-Clause
 *
 * 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 com.palantir.atlasdb.keyvalue.dbkvs;

import org.immutables.value.Value;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.base.Preconditions;
import com.palantir.atlasdb.spi.KeyValueServiceConfig;
import com.palantir.nexus.db.pool.config.ConnectionConfig;

@JsonDeserialize(as = ImmutablePostgresDdlConfig.class)
@JsonSerialize(as = ImmutablePostgresDdlConfig.class)
@JsonTypeName(DbKeyValueServiceConfig.TYPE)
@Value.Immutable
public abstract class DbKeyValueServiceConfig implements KeyValueServiceConfig {

    public static final String TYPE = "relational";

    public abstract DdlConfig ddl();

    public abstract ConnectionConfig connection();

    @Override
    public final String type() {
        return TYPE;
    }

    @Value.Check
    protected final void check() {
        Preconditions.checkArgument(ddl().type().equals(connection().type()),
                "ddl config (%s) and connection config (%s) must be for the same physical store",
                ddl().type(), connection().type());
    }

}
{'fraction_non_alphanumeric': 0.08439201451905626, 'fraction_numerical': 0.003629764065335753, 'mean_word_length': 4.530100334448161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '684571', 'n_tokens_mistral': 915, 'n_tokens_neox': 868, 'n_words': 287}