You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by ugiwgh <ug...@gmail.com> on 2012/12/10 13:53:16 UTC

Stop at CallObjectMethod when daemon running

I collect hadoop job info with JNI. My program run as daemon with apr API. But it didn't go on running at the function "CallObjectMethod". Any one has this experience. Any help will be appreciated.


Following is code pieces.
-------------------------
	jmethodID get_all_jobs_id = get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
	if(get_all_jobs_id == NULL)
        {
		return false;
	}
     jclass job_status_class = create_class(env,"org/apache/hadoop/mapred/JobStatus");
    if(job_status_class == NULL)
    {
        return false;
    }
    jarray job_status_array = (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
    js_num = (*env)->GetArrayLength(env,job_status_array);
    jmethodID get_run_status_id = get_method(env,job_status_class,"getRunState","()I");

-GHui

Re: Stop at CallObjectMethod when daemon running

Posted by ugiwgh <ug...@gmail.com>.
Yes, I want to get job list.
My problem is like following. My program can run as foreground. But it 
cannot run as daemon model ( run as daemon via function fork() ) .

? 2012/12/11 3:02, Vinod Kumar Vavilapalli ??:
>
> Not familiar with your apr stuff, but you should capture 
> getJobStatus() method instead of getAllJobs(). getJobStatus() is what 
> is called for individual jobs, getAllJobs() is called only when you 
> try to list jobs.
>
> Thanks,
> +Vinod Kumar Vavilapalli
> Hortonworks Inc.
> http://hortonworks.com/
>
> On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:
>
>> I collect hadoop job info with JNI. My program run as daemon with apr 
>> API. But it didn't go on running at the function "CallObjectMethod". 
>> Any one has this experience. Any help will be appreciated.
>>
>>
>> Following is code pieces.
>> -------------------------
>> jmethodID get_all_jobs_id = 
>> get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
>> if(get_all_jobs_id == NULL)
>>        {
>> return false;
>> }
>>     jclass job_status_class = 
>> create_class(env,"org/apache/hadoop/mapred/JobStatus");
>>    if(job_status_class == NULL)
>>    {
>>        return false;
>>    }
>>    jarray job_status_array = 
>> (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>>    js_num = (*env)->GetArrayLength(env,job_status_array);
>>    jmethodID get_run_status_id = 
>> get_method(env,job_status_class,"getRunState","()I");
>>
>> -GHui
>


Re: Stop at CallObjectMethod when daemon running

Posted by ugiwgh <ug...@gmail.com>.
Yes, I want to get job list.
My problem is like following. My program can run as foreground. But it 
cannot run as daemon model ( run as daemon via function fork() ) .

? 2012/12/11 3:02, Vinod Kumar Vavilapalli ??:
>
> Not familiar with your apr stuff, but you should capture 
> getJobStatus() method instead of getAllJobs(). getJobStatus() is what 
> is called for individual jobs, getAllJobs() is called only when you 
> try to list jobs.
>
> Thanks,
> +Vinod Kumar Vavilapalli
> Hortonworks Inc.
> http://hortonworks.com/
>
> On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:
>
>> I collect hadoop job info with JNI. My program run as daemon with apr 
>> API. But it didn't go on running at the function "CallObjectMethod". 
>> Any one has this experience. Any help will be appreciated.
>>
>>
>> Following is code pieces.
>> -------------------------
>> jmethodID get_all_jobs_id = 
>> get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
>> if(get_all_jobs_id == NULL)
>>        {
>> return false;
>> }
>>     jclass job_status_class = 
>> create_class(env,"org/apache/hadoop/mapred/JobStatus");
>>    if(job_status_class == NULL)
>>    {
>>        return false;
>>    }
>>    jarray job_status_array = 
>> (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>>    js_num = (*env)->GetArrayLength(env,job_status_array);
>>    jmethodID get_run_status_id = 
>> get_method(env,job_status_class,"getRunState","()I");
>>
>> -GHui
>


Re: Stop at CallObjectMethod when daemon running

Posted by ugiwgh <ug...@gmail.com>.
Yes, I want to get job list.
My problem is like following. My program can run as foreground. But it 
cannot run as daemon model ( run as daemon via function fork() ) .

? 2012/12/11 3:02, Vinod Kumar Vavilapalli ??:
>
> Not familiar with your apr stuff, but you should capture 
> getJobStatus() method instead of getAllJobs(). getJobStatus() is what 
> is called for individual jobs, getAllJobs() is called only when you 
> try to list jobs.
>
> Thanks,
> +Vinod Kumar Vavilapalli
> Hortonworks Inc.
> http://hortonworks.com/
>
> On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:
>
>> I collect hadoop job info with JNI. My program run as daemon with apr 
>> API. But it didn't go on running at the function "CallObjectMethod". 
>> Any one has this experience. Any help will be appreciated.
>>
>>
>> Following is code pieces.
>> -------------------------
>> jmethodID get_all_jobs_id = 
>> get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
>> if(get_all_jobs_id == NULL)
>>        {
>> return false;
>> }
>>     jclass job_status_class = 
>> create_class(env,"org/apache/hadoop/mapred/JobStatus");
>>    if(job_status_class == NULL)
>>    {
>>        return false;
>>    }
>>    jarray job_status_array = 
>> (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>>    js_num = (*env)->GetArrayLength(env,job_status_array);
>>    jmethodID get_run_status_id = 
>> get_method(env,job_status_class,"getRunState","()I");
>>
>> -GHui
>


Re: Stop at CallObjectMethod when daemon running

Posted by ugiwgh <ug...@gmail.com>.
Yes, I want to get job list.
My problem is like following. My program can run as foreground. But it 
cannot run as daemon model ( run as daemon via function fork() ) .

? 2012/12/11 3:02, Vinod Kumar Vavilapalli ??:
>
> Not familiar with your apr stuff, but you should capture 
> getJobStatus() method instead of getAllJobs(). getJobStatus() is what 
> is called for individual jobs, getAllJobs() is called only when you 
> try to list jobs.
>
> Thanks,
> +Vinod Kumar Vavilapalli
> Hortonworks Inc.
> http://hortonworks.com/
>
> On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:
>
>> I collect hadoop job info with JNI. My program run as daemon with apr 
>> API. But it didn't go on running at the function "CallObjectMethod". 
>> Any one has this experience. Any help will be appreciated.
>>
>>
>> Following is code pieces.
>> -------------------------
>> jmethodID get_all_jobs_id = 
>> get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
>> if(get_all_jobs_id == NULL)
>>        {
>> return false;
>> }
>>     jclass job_status_class = 
>> create_class(env,"org/apache/hadoop/mapred/JobStatus");
>>    if(job_status_class == NULL)
>>    {
>>        return false;
>>    }
>>    jarray job_status_array = 
>> (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>>    js_num = (*env)->GetArrayLength(env,job_status_array);
>>    jmethodID get_run_status_id = 
>> get_method(env,job_status_class,"getRunState","()I");
>>
>> -GHui
>


Re: Stop at CallObjectMethod when daemon running

Posted by Vinod Kumar Vavilapalli <vi...@hortonworks.com>.
Not familiar with your apr stuff, but you should capture getJobStatus() method instead of getAllJobs(). getJobStatus() is what is called for individual jobs, getAllJobs() is called only when you try to list jobs.

Thanks,
+Vinod Kumar Vavilapalli
Hortonworks Inc.
http://hortonworks.com/

On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:

> I collect hadoop job info with JNI. My program run as daemon with apr API. But it didn't go on running at the function "CallObjectMethod". Any one has this experience. Any help will be appreciated.
> 
> 
> Following is code pieces.
> -------------------------
> 	jmethodID get_all_jobs_id = get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
> 	if(get_all_jobs_id == NULL)
>        {
> 		return false;
> 	}
>     jclass job_status_class = create_class(env,"org/apache/hadoop/mapred/JobStatus");
>    if(job_status_class == NULL)
>    {
>        return false;
>    }
>    jarray job_status_array = (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>    js_num = (*env)->GetArrayLength(env,job_status_array);
>    jmethodID get_run_status_id = get_method(env,job_status_class,"getRunState","()I");
> 
> -GHui


Re: Stop at CallObjectMethod when daemon running

Posted by Vinod Kumar Vavilapalli <vi...@hortonworks.com>.
Not familiar with your apr stuff, but you should capture getJobStatus() method instead of getAllJobs(). getJobStatus() is what is called for individual jobs, getAllJobs() is called only when you try to list jobs.

Thanks,
+Vinod Kumar Vavilapalli
Hortonworks Inc.
http://hortonworks.com/

On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:

> I collect hadoop job info with JNI. My program run as daemon with apr API. But it didn't go on running at the function "CallObjectMethod". Any one has this experience. Any help will be appreciated.
> 
> 
> Following is code pieces.
> -------------------------
> 	jmethodID get_all_jobs_id = get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
> 	if(get_all_jobs_id == NULL)
>        {
> 		return false;
> 	}
>     jclass job_status_class = create_class(env,"org/apache/hadoop/mapred/JobStatus");
>    if(job_status_class == NULL)
>    {
>        return false;
>    }
>    jarray job_status_array = (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>    js_num = (*env)->GetArrayLength(env,job_status_array);
>    jmethodID get_run_status_id = get_method(env,job_status_class,"getRunState","()I");
> 
> -GHui


Re: Stop at CallObjectMethod when daemon running

Posted by Vinod Kumar Vavilapalli <vi...@hortonworks.com>.
Not familiar with your apr stuff, but you should capture getJobStatus() method instead of getAllJobs(). getJobStatus() is what is called for individual jobs, getAllJobs() is called only when you try to list jobs.

Thanks,
+Vinod Kumar Vavilapalli
Hortonworks Inc.
http://hortonworks.com/

On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:

> I collect hadoop job info with JNI. My program run as daemon with apr API. But it didn't go on running at the function "CallObjectMethod". Any one has this experience. Any help will be appreciated.
> 
> 
> Following is code pieces.
> -------------------------
> 	jmethodID get_all_jobs_id = get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
> 	if(get_all_jobs_id == NULL)
>        {
> 		return false;
> 	}
>     jclass job_status_class = create_class(env,"org/apache/hadoop/mapred/JobStatus");
>    if(job_status_class == NULL)
>    {
>        return false;
>    }
>    jarray job_status_array = (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>    js_num = (*env)->GetArrayLength(env,job_status_array);
>    jmethodID get_run_status_id = get_method(env,job_status_class,"getRunState","()I");
> 
> -GHui


Re: Stop at CallObjectMethod when daemon running

Posted by Vinod Kumar Vavilapalli <vi...@hortonworks.com>.
Not familiar with your apr stuff, but you should capture getJobStatus() method instead of getAllJobs(). getJobStatus() is what is called for individual jobs, getAllJobs() is called only when you try to list jobs.

Thanks,
+Vinod Kumar Vavilapalli
Hortonworks Inc.
http://hortonworks.com/

On Dec 10, 2012, at 4:53 AM, ugiwgh wrote:

> I collect hadoop job info with JNI. My program run as daemon with apr API. But it didn't go on running at the function "CallObjectMethod". Any one has this experience. Any help will be appreciated.
> 
> 
> Following is code pieces.
> -------------------------
> 	jmethodID get_all_jobs_id = get_method(env,client_class,"getAllJobs","()[Lorg/apache/hadoop/mapred/JobStatus;");
> 	if(get_all_jobs_id == NULL)
>        {
> 		return false;
> 	}
>     jclass job_status_class = create_class(env,"org/apache/hadoop/mapred/JobStatus");
>    if(job_status_class == NULL)
>    {
>        return false;
>    }
>    jarray job_status_array = (*env)->CallObjectMethod(env,client_obj,get_all_jobs_id);
>    js_num = (*env)->GetArrayLength(env,job_status_array);
>    jmethodID get_run_status_id = get_method(env,job_status_class,"getRunState","()I");
> 
> -GHui