Class BTBasicAIProcess
- All Implemented Interfaces:
Serializable,Tool
- Direct Known Subclasses:
BTBasicClusterMapping,BTBasicPrediction,BTBasicTraining,BTPredictionAgendaAffinity,BTUpdateS3Orders
Basic AI Task with history and log functions
- Since:
- 9.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected booleanprotected BOConfParamsHistoryprotected BOElaborationHistoryprotected S3WebResourceFactoryprotected AWSRequestHeadersprotected Stringprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidImplements this method to write the specific task logic to handle the input parameter.protected voidMethod that builds all the headers for AI Api calls.protected voidprotected voidclearOldLogs(PoolKit pk) Delete the old history record for the elaboration of this configurationprotected voiddeleteFileS3(String key) protected voidprotected abstract voidelaborateTask(PoolKit pk) protected StringgetAwsUploadPath(String algorithm, String model) protected BOConfParamsHistoryprotected BOElaborationHistorygetError()protected Stringprotected abstract intbooleanprotected voidThis method must be called before calling AI Api.It composes the basic info for AI calls.voidsetAiConfiguration(BOConfigurationParams aiConfiguration) voidsetAsyncQueueMode(boolean asyncQueueMode) protected voidvoidsetResourcesFolder(String resourcesFolder) voidsetTrainingType(Long trainingType) protected StringuploadFileS3(String inputFilePath, boolean toZip, String inputFileName) Method that uploads a file to S3.protected voidwriteLogTable(String taskStatus, String log, byte[] xlsReport, byte[] xlsReport2, String htmlReport, String htmlReport2, PoolKit pk) Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Field Details
-
configurationParamsHistory
-
elaborationHistory
-
filesToDelete
-
resourcesFolder
-
factory
-
algorithmName
-
modelName
-
instanceType
-
headers
-
asyncQueueMode
protected boolean asyncQueueMode
-
-
Constructor Details
-
BTBasicAIProcess
public BTBasicAIProcess()
-
-
Method Details
-
isAsyncQueueMode
public boolean isAsyncQueueMode() -
setAsyncQueueMode
public void setAsyncQueueMode(boolean asyncQueueMode) -
prepareDataForApi
protected void prepareDataForApi()This method must be called before calling AI Api.It composes the basic info for AI calls. -
buildHeaders
protected void buildHeaders()Method that builds all the headers for AI Api calls. -
getError
-
getTrainingType
-
setTrainingType
-
getAiConfiguration
-
setAiConfiguration
-
getResourcesFolder
-
setResourcesFolder
-
body
Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<Void>- Parameters:
v- the object upon which the task will works onpk- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
checkConfiguration
- Throws:
DAValidateExceptionDAException
-
getElaborationHistory
protected BOElaborationHistory getElaborationHistory(PoolKit pk) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getConfigurationParamsHistory
protected BOConfParamsHistory getConfigurationParamsHistory(PoolKit pk) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
elaborateTask
- Throws:
DAExceptionDAValidateException
-
writeLogTable
protected void writeLogTable(String taskStatus, String log, byte[] xlsReport, byte[] xlsReport2, String htmlReport, String htmlReport2, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
deleteTemporaryFiles
protected void deleteTemporaryFiles() -
clearOldLogs
Delete the old history record for the elaboration of this configuration- Parameters:
pk- the Poolkit- Throws:
DAExceptionDAValidateException
-
getLogValidityDays
protected abstract int getLogValidityDays() -
getAwsUploadPath
- Parameters:
algorithm-model-- Returns:
-
uploadFileS3
protected String uploadFileS3(String inputFilePath, boolean toZip, String inputFileName) throws IOException Method that uploads a file to S3.- Parameters:
inputFilePath-toZip-inputFileName-- Returns:
- Throws:
IOException
-
deleteFileS3
-
getJobName
-
setJobName
protected void setJobName()
-