<commit_before>#include "bulkDataDistributerCb.h"

BulkDataDistributerCb::BulkDataDistributerCb()
{
    ACS_TRACE("BulkDataCallback::BulkDataCallback");

    state_m = CB_UNS; 
    substate_m = CB_SUB_UNS;

    dim_m = 0;
    count_m = 0;

    loop_m = 5;
    waitPeriod_m.set(0L, 400000L);

    frameCount_m = 0;

    timeout_m = false;

    working_m = false;
}


BulkDataDistributerCb::BulkDataDistributerCb(TAO_StreamCtrl * stream_p)
{
    ACS_TRACE("BulkDataDistributerCb::BulkDataDistributerCb"); 
}


BulkDataDistributerCb::~BulkDataDistributerCb()
{
    ACS_TRACE("BulkDataCallback::~BulkDataCallback"); 
}


int BulkDataDistributerCb::handle_start(void)
{
    //ACS_TRACE("BulkDataDistributerCb::handle_start");
    
    //cout << "BulkDataDistributerCb::handle_start - state_m: " << state_m << endl;
    
    timeout_m = false;
    
    state_m = CB_UNS;
    substate_m = CB_SUB_UNS;
    
    frameCount_m = 1; // we need to wait for one frame before doing anything else  
    
    return 0;
}


int BulkDataDistributerCb::handle_stop (void)
{
    //ACS_TRACE("BulkDataDistributerCb::handle_stop");

    int locLoop;

    locLoop = loop_m;
    while ( (frameCount_m != 0) && locLoop > 0)  
	{
	  ACE_OS::sleep(waitPeriod_m);
	  locLoop--; 
	} // we didn't receive the first frame yet

    //cout << "CCCCCCCCCCCCCCCCC enter stop state " << state_m << " " << substate_m << endl;

    if(state_m == CB_UNS)
	{ <commit_msg>waitPeriod_m variable of the Distributor callback set to 0.1 ms<commit_after>#include "bulkDataDistributerCb.h"

BulkDataDistributerCb::BulkDataDistributerCb()
{
    ACS_TRACE("BulkDataCallback::BulkDataCallback");

    state_m = CB_UNS; 
    substate_m = CB_SUB_UNS;

    dim_m = 0;
    count_m = 0;

    //loop_m = 5;
    loop_m = 1000;
    //waitPeriod_m.set(0L, 400000L);
    waitPeriod_m.set(0L, 100L); // set to 0.1 ms to improve Distributor performance

    frameCount_m = 0;

    timeout_m = false;

    working_m = false;
}


BulkDataDistributerCb::BulkDataDistributerCb(TAO_StreamCtrl * stream_p)
{
    ACS_TRACE("BulkDataDistributerCb::BulkDataDistributerCb"); 
}


BulkDataDistributerCb::~BulkDataDistributerCb()
{
    ACS_TRACE("BulkDataCallback::~BulkDataCallback"); 
}


int BulkDataDistributerCb::handle_start(void)
{
    //ACS_TRACE("BulkDataDistributerCb::handle_start");
    
    //cout << "BulkDataDistributerCb::handle_start - state_m: " << state_m << endl;
    
    timeout_m = false;
    
    state_m = CB_UNS;
    substate_m = CB_SUB_UNS;
    
    frameCount_m = 1; // we need to wait for one frame before doing anything else  
    
    return 0;
}


int BulkDataDistributerCb::handle_stop (void)
{
    //ACS_TRACE("BulkDataDistributerCb::handle_stop");

    int locLoop;

    locLoop = loop_m;
    while ( (frameCount_m != 0) && locLoop > 0)  
	{
	ACE_OS::sleep(waitPeriod_m);
	locLoop--; 
	} // we didn't receive the first frame yet
    if ( locLoop == 0 ) // TBD error handling has to be done
	{
	ACS_SHORT_LOG((LM_WARNING,"BulkDataDistributerCb::handle_stop timeout expired"));
	}

    //cout << "CCCCCCCCCCCCCCCCC enter stop state " << state_m << " " << substate_m << endl;

    if(state_m == CB_UNS)
	{ 
{'fraction_non_alphanumeric': 0.11919064179576351, 'fraction_numerical': 0.013594688586784698, 'mean_word_length': 3.5921625544267055, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1369237', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1204, 'n_words': 210}