com.poscoict.app.job
Class GlueJobStatusCheck

java.lang.Object
  extended by com.poscoict.app.job.GlueJobStatusCheck
Direct Known Subclasses:
PoscoJobStatusCheck

public abstract class GlueJobStatusCheck
extends Object

Job ½ÇÇà¿©ºÎ È®ÀÎ Util.

 »ç¿ë¿¹#1
 
 String JobKey = ... ;//sample1.job001
 GlueJobDefinition jobDefinition = ...; //new GlueJobDefinition( "-1", JobKey );
 String serverAddress = ...; //http://192.168.41.141:8805
 GlueJobEventSender sender = ...;// GlueStaticContext.getBeanFactory().getBeanObject( "jobEventSender", GlueJobEventSender.class );
 String historyId = sender.sendJobEvent( def, serverAddress + "/scheduler" );
 
 String status = GlueJobStatusCheck.getJobStatus(serverAddress, historyId, JobKey );
 
 
 
 »ç¿ë¿¹#2
 
 String JobKey = ... ;//sample1.job001
 String serverAddress = ...; //http://192.168.41.141:8805
 String ids = GlueJobStatusCheck.getJobHistoryIdsByJobKey(serverAddress, JobKey );
 String[] historyIds = ids.split( "," );
 for( String historyId : historyIds ){
     String status = GlueJobStatusCheck.getJobStatus(serverAddress, historyId, JobKey );
 }
 
 

See Also:
HttpClient, PostMethod

Constructor Summary
GlueJobStatusCheck()
           
 
Method Summary
static String getJobHistoryIdsByJobKey(String url, String jobKey)
           
static String getJobHistoryIdsByJobKey(String url, String jobKey, String ip)
           
static String getJobHistoryIdsByJobKey(String url, String jobKey, String ip, int retryCount)
           
static String getJobStatus(String url, String requestId, String jobKey)
           
static String getJobStatus(String url, String requestId, String jobKey, String ip)
           
static String getJobStatus(String url, String requestId, String jobKey, String ip, int retryCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueJobStatusCheck

public GlueJobStatusCheck()
Method Detail

getJobStatus

public static String getJobStatus(String url,
                                  String requestId,
                                  String jobKey)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ
requestId - Job History ID. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ. requestId °¡ À¯È¿ÇÑÁö üũÇϴµ¥ »ç¿ëµÊ.
Returns:
COMPLETE,STOPPED,ERROR,MISFIRED,RUNNING µîÀÇ STATUS °ª.

getJobStatus

public static String getJobStatus(String url,
                                  String requestId,
                                  String jobKey,
                                  String ip)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ.
requestId - Job History ID. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ. requestId °¡ À¯È¿ÇÑÁö üũÇϴµ¥ »ç¿ëµÊ.
ip - LocalHost ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
Returns:
COMPLETE,STOPPED,ERROR,MISFIRED,RUNNING µîÀÇ STATUS °ª.

getJobStatus

public static String getJobStatus(String url,
                                  String requestId,
                                  String jobKey,
                                  String ip,
                                  int retryCount)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ.
requestId - Job History ID. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ. requestId °¡ À¯È¿ÇÑÁö üũÇϴµ¥ »ç¿ëµÊ.
ip - LocalHost ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
retryCount - HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà ½ÇÆнà Àç½Ãµµ Ƚ¼öÀÓ.
Returns:
COMPLETE,STOPPED,ERROR,MISFIRED,RUNNING µîÀÇ STATUS °ª.

getJobHistoryIdsByJobKey

public static String getJobHistoryIdsByJobKey(String url,
                                              String jobKey)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
Returns:
½ÇÇàÁßÀ̰ųª ´ë±âÁßÀÎ Job Histroy ID. 2°³ ÀÌ»óÀÏ°æ¿ì Äĸ¶(,)·Î ±¸ºÐÇÔ.

getJobHistoryIdsByJobKey

public static String getJobHistoryIdsByJobKey(String url,
                                              String jobKey,
                                              String ip)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
ip - LocalHost ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
Returns:
½ÇÇàÁßÀ̰ųª ´ë±âÁßÀÎ Job Histroy ID. 2°³ ÀÌ»óÀÏ°æ¿ì Äĸ¶(,)·Î ±¸ºÐÇÔ.

getJobHistoryIdsByJobKey

public static String getJobHistoryIdsByJobKey(String url,
                                              String jobKey,
                                              String ip,
                                              int retryCount)
Parameters:
url - GlueJobScheduler Server ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà URLÀÓ.
jobKey - JobKey. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
ip - LocalHost ÁÖ¼Ò. ³»ºÎÀûÀ¸·Î NameValuePair À¸·Î »ý¼ºµÇ¼­ setRequestBody()·Î Àü´ÞµÊ.
retryCount - HttpClient ¸¦ ÅëÇØ PostMethod ½ÇÇà ½ÇÆнà Àç½Ãµµ Ƚ¼öÀÓ.
Returns:
½ÇÇàÁßÀ̰ųª ´ë±âÁßÀÎ Job Histroy ID. 2°³ ÀÌ»óÀÏ°æ¿ì Äĸ¶(,)·Î ±¸ºÐÇÔ.


Copyright © 2017–2019 POSCO ICT. All rights reserved.