<commit_before>package com.joyent.manta.cosbench.config;

import com.intel.cosbench.config.Config;
import com.intel.cosbench.log.LogFactory;
import com.intel.cosbench.log.Logger;
import com.joyent.manta.config.ConfigContext;
import com.joyent.manta.config.EncryptionAuthenticationMode;
import com.joyent.manta.config.MapConfigContext;
import org.bouncycastle.util.encoders.Base64;

/**
 * Cosbench specific implementation of {@link ConfigContext} that allows us to
 * connect Cosbench config seamlessly.
 *
 * @author <a href="https://github.com/dekobon"><NAME></a>
 */
public class CosbenchMantaConfigContext implements ConfigContext {
    /**
     * Logger instance.
     */
    private static Logger logger = LogFactory.getSystemLogger();

    /**
     * Embedded Cosbench config reference.
     */
    private final Config config;

    /**
     * Default constructor that wraps a Cosbench config instance.
     *
     * @param config cosbench config instance
     */
    public CosbenchMantaConfigContext(final Config config) {
        this.config = config;
    }

    @Override
    public String getMantaURL() {
        return safeGetString(MapConfigContext.MANTA_URL_KEY, "Couldn't get url from COSBench config");
    }

    @Override
    public String getMantaUser() {
        return safeGetString(MapConfigContext.MANTA_USER_KEY, "Couldn't get username from COSBench config");
    }

    @Override
    public String getMantaKeyId() {
        return safeGetString(MapConfigContext.MANTA_KEY_ID_KEY, "Couldn't get fingerprint from COSBench config");
    }

    @Override
    public String getMantaKeyPath() {
        return safeGetString(MapConfigContext.MANTA_KEY_PATH_KEY, "Couldn't get key_path from COSBench config");
    }

    @Override
    public String getPrivateKeyContent() {
        return safeGetString(MapConfigContext.MANTA_PRIVATE_KEY_CONTENT_KEY,
                "Couldn't get private_key from COSBench config");
    }

    @Override
    public String getPassword() {
        return safeGetString(MapConfigContext.MANTA_PASSWORD_KEY, "Couldn't get password from COSBench config");
    }

    @Override
    public Integer getTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_TIMEOUT_KEY, "Couldn't get timeout from COSBench config");
    }

    @Override
    public Integer getRetries() {
        return safeGetInteger(MapConfigContext.MANTA_RETRIES_KEY, "Couldn't get retries from COSBench config");
    }

    @Override
    public Integer getMaximumConnections() {
        return safeGetInteger(MapConfigContext.MANTA_MAX_CONNS_KEY,
                "Couldn't get maximum connections from COSBench config");
    }

    @Override
    public Integer getHttpBufferSize() {
        return safeGetInteger(MapConfigContext.MANTA_HTTP_BUFFER_SIZE_KEY,
                "Couldn't get http buffer size from COSBench config");
    }

    @Override
    public String getHttpsProtocols() {
        return safeGetString(MapConfigContext.MANTA_HTTPS_PROTOCOLS_KEY,
                "Couldn't get http protocols from COSBench config");
    }

    @Override
    public String getHttpsCipherSuites() {
        return safeGetString(MapConfigContext.MANTA_HTTPS_CIPHERS_KEY,
                "Couldn't get http ciphers from COSBench config");
    }

    @Override
    public Boolean noAuth() {
        return safeGetBoolean(MapConfigContext.MANTA_NO_AUTH_KEY, "Couldn't get no auth setting from COSBench config");
    }

    @Override
    public Boolean disableNativeSignatures() {
        return safeGetBoolean(MapConfigContext.MANTA_NO_NATIVE_SIGS_KEY,
                "Couldn't get disable native signature generation setting from COSBench config");
    }

    @Override
    public Integer getTcpSocketTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_TCP_SOCKET_TIMEOUT_KEY,
                "Couldn't get TCP socket timeout from COSBench config");
    }

    @Override
    public Integer getConnectionRequestTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_CONNECTION_REQUEST_TIMEOUT_KEY,
                "Couldn't get connection request timeout from COSBench config");
    }

    @Override
    public Integer getExpectContinueTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_CONNECTION_REQUEST_TIMEOUT_KEY,
                "Couldn't get expect continue timeout from COSBench config");
    }

    @Override
    public Boolean verifyUploads() {
        return safeGetBoolean(MapConfigContext.MANTA_VERIFY_UPLOADS_KEY,
                "Couldn't get verify uploads flag from COSBench config");
    }

    @Override
    public Integer getUploadBufferSize() {
        return safeGetInteger(MapConfigContext.MANTA_UPLOAD_BUFFER_SIZE_KEY,
                "Couldn't get upload buffer size from COSBench config");
    }

    @Override
    public Integer getSkipDirectoryDepth() {
        return safeGetInteger(MapConfigContext.MANTA_SKIP_DIRECTORY_DEPTH_KEY,
                "Couldn't get skip directory depth from COSBench config");
    }

    @Override
    public Boolean isClientEncryptionEnabled() {
        return safeGetBoolean(MapConfigContext.MANTA_CLIENT_ENCRYPTION_ENABLED_KEY,
                "Couldn't get encryption enabled boolean flag");
    }

    @Override
    public Boolean permitUnencryptedDownloads() {
        return safeGetBoolean(MapConfigContext.MANTA_PERMIT_UNENCRYPTED_DOWNLOADS_KEY,
                "Couldn't get permit unencrypted downloads boolean flag");
    }

    @Override
    public String getEncryptionKeyId() {
        return safeGetString(MapConfigContext.MANTA_ENCRYPTION_KEY_ID_KEY, "Couldn't get encryption key id");
    }

    @Override
    public String getEncryptionAlgorithm() {
        return safeGetString(MapConfigContext.MANTA_ENCRYPTION_ALGORITHM_KEY, "Could'nt get encryption algorithm");
    }

    @Override<commit_msg>CosbenchMantaConfigContext implements instead of extending so we have to update every config that's added<commit_after>package com.joyent.manta.cosbench.config;

import com.intel.cosbench.config.Config;
import com.intel.cosbench.log.LogFactory;
import com.intel.cosbench.log.Logger;
import com.joyent.manta.config.ConfigContext;
import com.joyent.manta.config.EncryptionAuthenticationMode;
import com.joyent.manta.config.MapConfigContext;
import com.joyent.manta.config.MetricReporterMode;
import org.bouncycastle.util.encoders.Base64;

/**
 * Cosbench specific implementation of {@link ConfigContext} that allows us to
 * connect Cosbench config seamlessly.
 *
 * @author <a href="https://github.com/dekobon"><NAME></a>
 */
public class CosbenchMantaConfigContext implements ConfigContext {
    /**
     * Logger instance.
     */
    private static Logger logger = LogFactory.getSystemLogger();

    /**
     * Embedded Cosbench config reference.
     */
    private final Config config;

    /**
     * Default constructor that wraps a Cosbench config instance.
     *
     * @param config cosbench config instance
     */
    public CosbenchMantaConfigContext(final Config config) {
        this.config = config;
    }

    @Override
    public String getMantaURL() {
        return safeGetString(MapConfigContext.MANTA_URL_KEY, "Couldn't get url from COSBench config");
    }

    @Override
    public String getMantaUser() {
        return safeGetString(MapConfigContext.MANTA_USER_KEY, "Couldn't get username from COSBench config");
    }

    @Override
    public String getMantaKeyId() {
        return safeGetString(MapConfigContext.MANTA_KEY_ID_KEY, "Couldn't get fingerprint from COSBench config");
    }

    @Override
    public String getMantaKeyPath() {
        return safeGetString(MapConfigContext.MANTA_KEY_PATH_KEY, "Couldn't get key_path from COSBench config");
    }

    @Override
    public String getPrivateKeyContent() {
        return safeGetString(MapConfigContext.MANTA_PRIVATE_KEY_CONTENT_KEY,
                "Couldn't get private_key from COSBench config");
    }

    @Override
    public String getPassword() {
        return safeGetString(MapConfigContext.MANTA_PASSWORD_KEY, "Couldn't get password from COSBench config");
    }

    @Override
    public Integer getTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_TIMEOUT_KEY, "Couldn't get timeout from COSBench config");
    }

    @Override
    public Integer getRetries() {
        return safeGetInteger(MapConfigContext.MANTA_RETRIES_KEY, "Couldn't get retries from COSBench config");
    }

    @Override
    public Integer getMaximumConnections() {
        return safeGetInteger(MapConfigContext.MANTA_MAX_CONNS_KEY,
                "Couldn't get maximum connections from COSBench config");
    }

    @Override
    public Integer getHttpBufferSize() {
        return safeGetInteger(MapConfigContext.MANTA_HTTP_BUFFER_SIZE_KEY,
                "Couldn't get http buffer size from COSBench config");
    }

    @Override
    public String getHttpsProtocols() {
        return safeGetString(MapConfigContext.MANTA_HTTPS_PROTOCOLS_KEY,
                "Couldn't get http protocols from COSBench config");
    }

    @Override
    public String getHttpsCipherSuites() {
        return safeGetString(MapConfigContext.MANTA_HTTPS_CIPHERS_KEY,
                "Couldn't get http ciphers from COSBench config");
    }

    @Override
    public Boolean noAuth() {
        return safeGetBoolean(MapConfigContext.MANTA_NO_AUTH_KEY, "Couldn't get no auth setting from COSBench config");
    }

    @Override
    public Boolean disableNativeSignatures() {
        return safeGetBoolean(MapConfigContext.MANTA_NO_NATIVE_SIGS_KEY,
                "Couldn't get disable native signature generation setting from COSBench config");
    }

    @Override
    public Integer getTcpSocketTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_TCP_SOCKET_TIMEOUT_KEY,
                "Couldn't get TCP socket timeout from COSBench config");
    }

    @Override
    public Integer getConnectionRequestTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_CONNECTION_REQUEST_TIMEOUT_KEY,
                "Couldn't get connection request timeout from COSBench config");
    }

    @Override
    public Integer getExpectContinueTimeout() {
        return safeGetInteger(MapConfigContext.MANTA_CONNECTION_REQUEST_TIMEOUT_KEY,
                "Couldn't get expect continue timeout from COSBench config");
    }

    @Override
    public Boolean verifyUploads() {
        return safeGetBoolean(MapConfigContext.MANTA_VERIFY_UPLOADS_KEY,
                "Couldn't get verify uploads flag from COSBench config");
    }

    @Override
    public Integer getUploadBufferSize() {
        return safeGetInteger(MapConfigContext.MANTA_UPLOAD_BUFFER_SIZE_KEY,
                "Couldn't get upload buffer size from COSBench config");
    }

    @Override
    public Integer getSkipDirectoryDepth() {
        return safeGetInteger(MapConfigContext.MANTA_SKIP_DIRECTORY_DEPTH_KEY,
                "Couldn't get skip directory depth from COSBench config");
    }

    @Override
    public Integer downloadContinuations() {
        return safeGetInteger(MapConfigContext.MANTA_DOWNLOAD_CONTINUATIONS_KEY,
                              "Couldn't get download continuation count");
    }

    @Override
    public MetricReporterMode getMetricReporterMode() {
        return safeGetEnum(MapConfigContext.MANTA_METRIC_REPORTER_MODE_KEY,
                           "Couldn't get metric reporter mode",
                           MetricReporterMode.class);
    }

    @Override
    public Integer getMetricReporterOutputInterval() {
        return safeGetInteger(MapConfigContext.MANTA_METRIC_REPORTER_OUTPUT_INTERVAL_KEY,
                              "Couldn't get metric reporter output interval");
    }

    @Override
    public Boolean isClientEncryptionEnabled() {
        return safeGetBoolean(MapConfigContext.MANTA_CLIENT_ENCRYPTION_ENABLED_KEY,
                "Couldn't get encryption enabled boolean flag");
    }

    @Override
    public Boolean permitUnencryptedDownloads() {
        return safeGetBoolean(MapConfigContext.MANTA_PERMIT_UNENCRYPTED_DOWNLOADS_KEY,
                "Couldn't get permit unencrypted downloads boolean flag");
    }

    @Override
    public String getEncryptionKeyId() {
        return safeGetString(MapConfigContext.MANTA_ENCRYPTION_KEY_ID_KEY, "Couldn't get encryption key id");
    }

    @Override
    public String getEncryptionAlgorithm() {
        return safeGetString(MapConfigContext.MANTA_ENCRYPTION_ALGORITHM_KEY, "Could'nt get encryption algorithm");
    }

    @Override
{'fraction_non_alphanumeric': 0.07121780046255682, 'fraction_numerical': 0.0003190047053194035, 'mean_word_length': 3.279863481228669, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7252809', 'n_tokens_mistral': 3601, 'n_tokens_neox': 3482, 'n_words': 813}