SMILA 1.0 API documentation

org.eclipse.smila.importing.worker
Class WorkerUsingDeltaService

java.lang.Object
  extended by org.eclipse.smila.importing.worker.WorkerUsingDeltaService
All Implemented Interfaces:
Worker
Direct Known Subclasses:
DeltaCheckerWorker, UpdatePusherWorker

public abstract class WorkerUsingDeltaService
extends java.lang.Object
implements Worker

base class for worker accessing a DeltaService. Provides service reference handling and methods to invoke the DeltaService methods and measure the durations of the calls in the task context counters.


Constructor Summary
WorkerUsingDeltaService()
           
 
Method Summary
 State checkDeltaStateTimed(java.lang.String jobRunId, Record record, java.lang.String deltaHash, TaskContext taskContext)
          invoke DeltaService.checkState(String, String, String, String) and measure time as duration checkDeltaState.
 void deleteDeltaEntryTimed(java.lang.String sourceId, DeltaService.EntryId entryId, TaskContext taskContext)
          invoke DeltaService#deleteEntry(String, String) and measure time as duration deleteDeltaEntry.
protected  java.lang.String getCompoundId(Record record)
          get value of attribute ImportingConstants.ATTRIBUTE_COMPOUNDID.
protected static DeltaImportStrategy getDeltaImportStrategy(AnyMap taskParameters)
          get deltaImportStrategy parameter from task parameters.
protected  DeltaImportStrategy getDeltaImportStrategy(TaskContext taskContext)
          get deltaImportStrategy parameter from task context.
protected  java.lang.String getJobRunId(TaskContext taskContext)
          get job run id from task.
protected  java.lang.String getRequiredParameter(TaskContext taskContext, java.lang.String parameter)
          get a string parameter.
 java.util.Collection<DeltaService.EntryId> getUnvisitedEntriesTimed(java.lang.String jobRunId, java.lang.String sourceAndShardPrefix, TaskContext taskContext)
          invoke DeltaService.getUnvisitedEntries(String, String) and measure time as duration getUnvisitedRecords.
protected  boolean isCompound(Record record)
          check if attribute ImportingConstants.ATTRIBUTE_COMPOUNDFLAG is set to true.
 void markAsUpdatedTimed(java.lang.String jobRunId, Record record, java.lang.String deltaHash, TaskContext taskContext)
          invoke DeltaService.markAsUpdated(String, String, String, String) and measure time as duration markAsUpdated.
 void markCompoundElementsVisitedTimed(java.lang.String jobRunId, Record record, TaskContext taskContext)
          invoke DeltaService.markCompoundElementsVisited(String, String, String) and measure time as duration markCompoundElementsVisited.
 void setDeltaService(DeltaService service)
          DS service reference bind method.
 void unsetDeltaService(DeltaService service)
          DS service reference unbind method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.smila.taskworker.Worker
getName, perform
 

Constructor Detail

WorkerUsingDeltaService

public WorkerUsingDeltaService()
Method Detail

getJobRunId

protected java.lang.String getJobRunId(TaskContext taskContext)
get job run id from task.

Throws:
java.lang.IllegalArgumentException - if not set.

getRequiredParameter

protected java.lang.String getRequiredParameter(TaskContext taskContext,
                                                java.lang.String parameter)
get a string parameter.

Throws:
java.lang.IllegalArgumentException - if not set.

getDeltaImportStrategy

protected DeltaImportStrategy getDeltaImportStrategy(TaskContext taskContext)
get deltaImportStrategy parameter from task context. Fall back to DeltaImportStrategy.FULL if parameter is not set or value is invalid.


getDeltaImportStrategy

protected static DeltaImportStrategy getDeltaImportStrategy(AnyMap taskParameters)
get deltaImportStrategy parameter from task parameters. Fall back to DeltaImportStrategy.FULL if parameter is not set or value is invalid.


getCompoundId

protected java.lang.String getCompoundId(Record record)
get value of attribute ImportingConstants.ATTRIBUTE_COMPOUNDID.


isCompound

protected boolean isCompound(Record record)
check if attribute ImportingConstants.ATTRIBUTE_COMPOUNDFLAG is set to true.


checkDeltaStateTimed

public State checkDeltaStateTimed(java.lang.String jobRunId,
                                  Record record,
                                  java.lang.String deltaHash,
                                  TaskContext taskContext)
                           throws DeltaException
invoke DeltaService.checkState(String, String, String, String) and measure time as duration checkDeltaState.

Throws:
DeltaException

markCompoundElementsVisitedTimed

public void markCompoundElementsVisitedTimed(java.lang.String jobRunId,
                                             Record record,
                                             TaskContext taskContext)
                                      throws DeltaException
invoke DeltaService.markCompoundElementsVisited(String, String, String) and measure time as duration markCompoundElementsVisited.

Throws:
DeltaException

markAsUpdatedTimed

public void markAsUpdatedTimed(java.lang.String jobRunId,
                               Record record,
                               java.lang.String deltaHash,
                               TaskContext taskContext)
                        throws DeltaException
invoke DeltaService.markAsUpdated(String, String, String, String) and measure time as duration markAsUpdated.

Throws:
DeltaException

getUnvisitedEntriesTimed

public java.util.Collection<DeltaService.EntryId> getUnvisitedEntriesTimed(java.lang.String jobRunId,
                                                                           java.lang.String sourceAndShardPrefix,
                                                                           TaskContext taskContext)
                                                                    throws DeltaException
invoke DeltaService.getUnvisitedEntries(String, String) and measure time as duration getUnvisitedRecords.

Throws:
DeltaException

deleteDeltaEntryTimed

public void deleteDeltaEntryTimed(java.lang.String sourceId,
                                  DeltaService.EntryId entryId,
                                  TaskContext taskContext)
                           throws DeltaException
invoke DeltaService#deleteEntry(String, String) and measure time as duration deleteDeltaEntry.

Throws:
DeltaException

setDeltaService

public void setDeltaService(DeltaService service)
DS service reference bind method.


unsetDeltaService

public void unsetDeltaService(DeltaService service)
DS service reference unbind method.


SMILA 1.0 API documentation