<commit_before>package org.kaddiya.grorchestrator.managers.impl

import com.google.inject.Inject
import com.google.inject.assistedinject.Assisted
import groovy.transform.CompileStatic
import org.kaddiya.grorchestrator.guice.factory.DockerContainerCreatorFactory
import org.kaddiya.grorchestrator.managers.DockerContainerCreator
import org.kaddiya.grorchestrator.managers.DockerContainerRunnerManager
import org.kaddiya.grorchestrator.managers.DockerRemoteAPI
import org.kaddiya.grorchestrator.models.core.Instance

/**
 * Created by Webonise on 11/07/16.
 */
@CompileStatic
class DockerContainerRunnerManagerImpl extends DockerRemoteAPI implements DockerContainerRunnerManager {

    final DockerContainerCreator containerCreator


    @Inject
    DockerContainerRunnerManagerImpl(@Assisted Instance instance, DockerContainerCreatorFactory creatorFactory) {
        super(instance)
        containerCreator = creatorFactory.create(this.instance)
    }

    @Override
    void runContainer() {

        //     this.createContainer()

        println(containerCreator.createContainer())
    }

/*    //TODO : this has to be moved to the DockerContainerCreatorImpl class and called.

    DockerContainerCreationResponse createContainer() {
        def value = this.instance.imageName + ":" + this.instance.tag

        String charset = (('A'..'Z') + ('0'..'9')).join("")
        Integer length = 9
        String randomString = RandomStringUtils.random(length, charset.toCharArray())

        println("creating a new instance with name $randomString")
        DockerContainerCreationResponse response = client.post(
                requestContentType: JSON,
                path: "/containers/create",
                query: [
                        'name': randomString
                ],
                body: ['Image': value]

        ) as DockerContainerCreationResponse
        response
    }*/


}

<commit_msg>Removed commented code<commit_after>package org.kaddiya.grorchestrator.managers.impl

import com.google.inject.Inject
import com.google.inject.assistedinject.Assisted
import groovy.transform.CompileStatic
import org.kaddiya.grorchestrator.guice.factory.DockerContainerCreatorFactory
import org.kaddiya.grorchestrator.managers.DockerContainerCreator
import org.kaddiya.grorchestrator.managers.DockerContainerRunnerManager
import org.kaddiya.grorchestrator.managers.DockerRemoteAPI
import org.kaddiya.grorchestrator.models.core.Instance

/**
 * Created by Webonise on 11/07/16.
 */
@CompileStatic
class DockerContainerRunnerManagerImpl extends DockerRemoteAPI implements DockerContainerRunnerManager {

    final DockerContainerCreator containerCreator


    @Inject
    DockerContainerRunnerManagerImpl(@Assisted Instance instance, DockerContainerCreatorFactory creatorFactory) {
        super(instance)
        containerCreator = creatorFactory.create(this.instance)
    }

    @Override
    void runContainer() {
        println(containerCreator.createContainer())
    }

}


{'fraction_non_alphanumeric': 0.07990638582413909, 'fraction_numerical': 0.0050150451354062184, 'mean_word_length': 3.857142857142857, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1469504', 'n_tokens_mistral': 852, 'n_tokens_neox': 802, 'n_words': 147}