SMILA (incubation) API documentation

org.eclipse.smila.bulkbuilder
Interface BulkbuilderService

All Known Implementing Classes:
BulkbuilderServiceBase, BulkbuilderServiceImpl

public interface BulkbuilderService

Manager of index update operations (add, delete, update records).


Method Summary
 WorkflowRunInfo addRecord(java.lang.String jobName, Record record)
          add a record to a bulk to insert it to the given job.
 WorkflowRunInfo addToMicroBulk(java.lang.String jobName, Record record, java.lang.String microBulkId)
          Adds a record to a micro bulk with the given id.
 WorkflowRunInfo commitJob(java.lang.String jobName)
          commit the job with the given job name.
 WorkflowRunInfo deleteRecord(java.lang.String jobName, Record record)
          add a record to a bulk to delete it from the given job.
 WorkflowRunInfo finishMicroBulk(java.lang.String jobName, java.lang.String microBulkId)
          Finishes the micro bulk with the given id.
 void removeMicroBulk(java.lang.String microBulkId)
          Remove the micro bulk with the given id.
 

Method Detail

addRecord

WorkflowRunInfo addRecord(java.lang.String jobName,
                          Record record)
                          throws BulkbuilderException,
                                 InvalidRecordException
add a record to a bulk to insert it to the given job. Create a new bulk if none is open. Finish it and create a task for it if the maximum bulk size is exceeded. If record is null an IllegalArgumentException is thrown.

Parameters:
jobName - job name
record - record to add.
Returns:
Id of job and workflow run to which the records was added.
Throws:
BulkbuilderException - error writing the record.
InvalidRecordException - record does not conform to schema.

deleteRecord

WorkflowRunInfo deleteRecord(java.lang.String jobName,
                             Record record)
                             throws BulkbuilderException,
                                    InvalidRecordException
add a record to a bulk to delete it from the given job. Create a new bulk if none is open. Finish it and create a task for it if the maximum bulk size is exceeded. If record is null an IllegalArgumentException is thrown.

Parameters:
jobName - job name
record - record to add.
Returns:
Id of job and workflow run to which the records was added.
Throws:
BulkbuilderException - error writing the record.
InvalidRecordException - record does not conform to schema.

commitJob

WorkflowRunInfo commitJob(java.lang.String jobName)
                          throws BulkbuilderException
commit the job with the given job name.

Parameters:
jobName - job name
Returns:
Id of job and workflow run to which the records was added.
Throws:
BulkbuilderException - error committing the job

addToMicroBulk

WorkflowRunInfo addToMicroBulk(java.lang.String jobName,
                               Record record,
                               java.lang.String microBulkId)
                               throws BulkbuilderException,
                                      InvalidRecordException
Adds a record to a micro bulk with the given id.

Parameters:
jobName - the job name
record - The record
microBulkId - The id of the micro bulk
Returns:
The workflow run info.
Throws:
BulkbuilderException - error writing the record.
InvalidRecordException - record does not conform to schema.

finishMicroBulk

WorkflowRunInfo finishMicroBulk(java.lang.String jobName,
                                java.lang.String microBulkId)
                                throws BulkbuilderException
Finishes the micro bulk with the given id. This also removes the micro bulk after successful processing.

Parameters:
jobName - the job name
microBulkId - The id
Returns:
the workflow run info
Throws:
BulkbuilderException - error writing the micro bulk.

removeMicroBulk

void removeMicroBulk(java.lang.String microBulkId)
Remove the micro bulk with the given id.

Parameters:
microBulkId - The micro bulk to remove

SMILA (incubation) API documentation