public abstract class GenericMultiThreadedConnector<SKey extends com.exalead.papi.framework.source.adapter.Key> extends Connector
class
Modifier and Type | Class and Description |
---|---|
protected class |
GenericMultiThreadedConnector.EnumeratesFolderDeletionHelperClient |
Connector.ConnectorNameThreadFactory
Modifier and Type | Field and Description |
---|---|
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
addDocumentOperationBuilderForFirstAdd
The OperationBuilder used to create DeleteOperation during Index Enumeration
|
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
addDocumentOperationBuilderForNotModified |
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
addDocumentOperationBuilderForUpdate |
protected static java.lang.String |
DEFAULT_LAST_UPDATE_CHECKPOINT_BEGIN |
protected static java.lang.String |
DEFAULT_LAST_UPDATE_CHECKPOINT_END |
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
deletedDocumentOperationBuilder |
protected boolean |
doDelete |
protected com.exalead.papi.framework.pipeline.OperationPipelinesManager<SKey> |
enumeratedPipelinesManager |
protected boolean |
isUpdate |
protected java.lang.String |
last_update_checkpoint_begin |
protected java.lang.String |
last_update_checkpoint_end |
protected boolean |
neverSendDeletes |
protected com.exalead.concurrent.ConcurrentProcessingQuota |
processingQuota |
protected boolean |
pushFolder |
com.exalead.papi.framework.source.adapter.SourceAdapterManager<SKey> |
sourceAdapterManager |
com.exalead.papi.framework.connectors.enumerable.SourceEnumerator<SKey> |
sourceEnumerator |
protected java.util.List<SKey> |
startKeys |
protected boolean |
syncEnumeratedError |
com.exalead.papi.framework.callbacks.SynchronizerCallbackContainer<SKey> |
synchronizerCallbackContainer |
protected java.util.concurrent.ThreadFactory |
threadFactory |
config, DEFAULT_SCAN_MODE, papi
Constructor and Description |
---|
GenericMultiThreadedConnector(GenericMultiThreadedConnectorConfig config) |
GenericMultiThreadedConnector(PushAPI papi,
GenericMultiThreadedConnectorConfig config)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDocumentOperationToEnumeratedOperationPipeline(com.exalead.papi.framework.operations.DocumentOperation<SKey> op)
Add a document operation to the pipeline manager
|
void |
addFolderOperationToEnumeratedOperationPipeline(com.exalead.papi.framework.operations.FolderOperation<SKey> op)
Add a folder operation to the pipeline manager
|
protected void |
addRootKeyInPipelineManager(SKey root,
com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> opBuilder,
com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> opBuilderUpdate,
com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> operationBuilderNotModified)
Add root key to operation (called by initializePipelinesManager())
|
void |
addSynchronizerCallback(com.exalead.papi.framework.callbacks.SynchronizerCallback<SKey> cb)
Add a new SynchronizerCallback which will be used during synchronization, allowing to execute specific operations
|
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
buildAddDocumentOperationBuilderForFirstSync() |
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> |
buildAddDocumentOperationBuilderForUpdate()
Get AddDocumentOperationBuilder
|
protected com.exalead.papi.framework.operations.builders.enumerated.DeletedDocumentOperationBuilder<SKey> |
buildDeletedDocumentOperationBuilder() |
com.exalead.papi.framework.operations.folder.FolderDeletionHelper |
buildDeletionHelper(com.exalead.papi.framework.operations.folder.FolderDeletionHelper.FolderDeletionHelperClient client,
java.lang.String rootPathUri)
Returns this connector's deletion helper implementation provided this connector is in update mode
|
protected abstract com.exalead.papi.framework.source.adapter.SourceAdapter<SKey> |
buildSourceAdapter()
This method return a SourceAdapter implementation
|
protected abstract com.exalead.papi.framework.connectors.enumerable.SourceEnumerator<SKey> |
buildSourceEnumerator()
This method return a SourceEnumerator implementation
|
protected java.util.List<com.exalead.papi.framework.source.adapter.SpecializedSourceAdapter<SKey>> |
buildSpecializedSourceAdapters()
Get SpecializedSourceAdapters
|
protected SKey |
buildStartKeyFromConf(java.lang.String configFolder,
boolean isFolder)
Call to transform Folder Name (from RootFolders) to FolderKey Override this function if the Document URI and root folder URI do not
share the same logic.
|
void |
callBeforeDestruction()
Override this method to do some task before the destruction of the
connector
|
Document |
fetch(java.lang.String uri)
This method is used to retrieve document from the source when CloudView
product needs it.
|
protected java.util.Iterator<com.exalead.papi.framework.connectors.journalized.UpdateItem> |
getActionToUpdate()
Override default operations executed for an update (that is, adding root keys to the list of operations to be executed) Default
implementation is to return null (ie.
|
GenericMultiThreadedConnectorConfig |
getConnectorConfig()
Return the connector's configuration.
|
PushAPI |
getCurrentPAPI() |
java.util.concurrent.ThreadFactory |
getDefaultThreadFactory() |
MetaContainer |
getDocumentSecurityTokens(java.lang.String uri)
This method is used to retrieve security tokens of a document.
|
abstract SKey |
getKeyFromUri(java.lang.String uri)
Get a Key, given the document URI.
|
int |
getNbThreadsPerEnumeratedDocumentOperationPipeline()
Number of threads processing documents inside the pipeline manager
|
int |
getNbThreadsPerEnumeratedFolderOperationPipeline()
Number of threads processing folders inside the pipeline manager
|
protected long |
handleRootDeletes()
Add root keys to operation
|
void |
init()
Initialization method called by connector framework after construction
|
protected void |
initializePipelinesManager(boolean forUpdate)
Add root keys to operation
|
boolean |
isdoDelete()
Do deletes for document that do not exist anymore
|
boolean |
isPushFolder()
Should folders be pushed as regular documents too ?
|
boolean |
isSynchronizeSourceEnumeratorsError()
Has en an error occurred during synchronization ?
|
boolean |
isUpdate()
The current synchronization job is an update of a previous synchronization job
|
protected void |
processActionToUpdate(java.util.Iterator<com.exalead.papi.framework.connectors.journalized.UpdateItem> items)
Execute a list of UpdateItem Called if getActionToUpdate() returned a non-null list
|
com.exalead.concurrent.ConcurrentProcessingQuotaWorker |
registerDocInProgress(Document doc)
Register a document in processing, for quota handling.
|
com.exalead.concurrent.ConcurrentProcessingQuotaWorker |
registerWorkInProgress(long size)
Register a worker in processing, for quota handling.
|
void |
removeSynchronizerCallback(com.exalead.papi.framework.callbacks.SynchronizerCallback<SKey> cb)
Remove a SynchronizerCallback previously added by a call to addSynchronizerCallback()
|
void |
scan(PushAPI papi,
java.lang.String mode,
java.lang.Object modeConfig)
This method is used to push (or synchronize) all documents from the source
to CloudView product.
|
void |
setCurrentPAPI(PushAPI newPAPI) |
void |
setNbThreadsPerEnumeratedDocumentOperationPipeline(int nb)
Set the number of threads processing documents inside the pipeline manager
|
void |
setNbThreadsPerEnumeratedFolderOperationPipeline(int nb)
Set the number of threads processing folders inside the pipeline manager
|
void |
setNbThreadsPerEnumeratedOperationPipeline(int nb)
Set the number of threads processing documents or folders inside the pipeline manager
|
void |
setSynchronizeSourceEnumeratorsError(boolean value)
Called when an error occurred during synchronization
|
void |
terminateThreads()
Terminate all threads used by the pipeline manager
|
checkAbortingOperation, checkAbortingOperation, checkDataSourceAvailability, checkSecurityTokens, fetch, getConnectorName, getEndpointBuilder, getLogger, getLogger, getScanModes, getState, getState, getStatus, getStatus, getStatusException, init, onScanAborted, onScanAborted, onScanResumed, onScanResumed, onScanSuspended, onScanSuspended, scratch, selfAbortScan, selfAbortScan, synchronizeDocuments
protected java.util.concurrent.ThreadFactory threadFactory
protected static final java.lang.String DEFAULT_LAST_UPDATE_CHECKPOINT_BEGIN
protected static final java.lang.String DEFAULT_LAST_UPDATE_CHECKPOINT_END
protected volatile boolean syncEnumeratedError
protected volatile boolean pushFolder
protected final boolean neverSendDeletes
protected com.exalead.papi.framework.pipeline.OperationPipelinesManager<SKey extends com.exalead.papi.framework.source.adapter.Key> enumeratedPipelinesManager
protected volatile boolean doDelete
protected volatile boolean isUpdate
protected java.util.List<SKey extends com.exalead.papi.framework.source.adapter.Key> startKeys
protected java.lang.String last_update_checkpoint_begin
protected java.lang.String last_update_checkpoint_end
protected com.exalead.concurrent.ConcurrentProcessingQuota processingQuota
public com.exalead.papi.framework.connectors.enumerable.SourceEnumerator<SKey extends com.exalead.papi.framework.source.adapter.Key> sourceEnumerator
public com.exalead.papi.framework.source.adapter.SourceAdapterManager<SKey extends com.exalead.papi.framework.source.adapter.Key> sourceAdapterManager
public com.exalead.papi.framework.callbacks.SynchronizerCallbackContainer<SKey extends com.exalead.papi.framework.source.adapter.Key> synchronizerCallbackContainer
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey extends com.exalead.papi.framework.source.adapter.Key> addDocumentOperationBuilderForFirstAdd
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey extends com.exalead.papi.framework.source.adapter.Key> addDocumentOperationBuilderForUpdate
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey extends com.exalead.papi.framework.source.adapter.Key> addDocumentOperationBuilderForNotModified
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey extends com.exalead.papi.framework.source.adapter.Key> deletedDocumentOperationBuilder
@Deprecated public GenericMultiThreadedConnector(PushAPI papi, GenericMultiThreadedConnectorConfig config) throws java.lang.Exception
java.lang.Exception
public GenericMultiThreadedConnector(GenericMultiThreadedConnectorConfig config) throws java.lang.Exception
java.lang.Exception
public void init() throws java.lang.Exception
Connector
public GenericMultiThreadedConnectorConfig getConnectorConfig()
Connector
getConnectorConfig
in class Connector
public java.util.concurrent.ThreadFactory getDefaultThreadFactory()
protected abstract com.exalead.papi.framework.source.adapter.SourceAdapter<SKey> buildSourceAdapter() throws java.lang.Exception
java.lang.Exception
protected abstract com.exalead.papi.framework.connectors.enumerable.SourceEnumerator<SKey> buildSourceEnumerator() throws java.lang.Exception
java.lang.Exception
protected SKey buildStartKeyFromConf(java.lang.String configFolder, boolean isFolder) throws java.lang.Exception
configFolder
- The configuration root folderjava.lang.Exception
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> buildAddDocumentOperationBuilderForUpdate()
protected com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> buildAddDocumentOperationBuilderForFirstSync()
protected com.exalead.papi.framework.operations.builders.enumerated.DeletedDocumentOperationBuilder<SKey> buildDeletedDocumentOperationBuilder()
public com.exalead.papi.framework.operations.folder.FolderDeletionHelper buildDeletionHelper(com.exalead.papi.framework.operations.folder.FolderDeletionHelper.FolderDeletionHelperClient client, java.lang.String rootPathUri) throws PushAPIException
client
- handles the actual deletes of the documents.rootPathUri
- the folder root keyisUpdate()
nullPushAPIException
public abstract SKey getKeyFromUri(java.lang.String uri) throws java.io.IOException
java.io.IOException
protected java.util.List<com.exalead.papi.framework.source.adapter.SpecializedSourceAdapter<SKey>> buildSpecializedSourceAdapters()
public boolean isPushFolder()
public void setSynchronizeSourceEnumeratorsError(boolean value)
public boolean isSynchronizeSourceEnumeratorsError()
public boolean isdoDelete()
public boolean isUpdate()
public void addSynchronizerCallback(com.exalead.papi.framework.callbacks.SynchronizerCallback<SKey> cb)
SynchronizerCallback
public void removeSynchronizerCallback(com.exalead.papi.framework.callbacks.SynchronizerCallback<SKey> cb)
protected java.util.Iterator<com.exalead.papi.framework.connectors.journalized.UpdateItem> getActionToUpdate()
protected void processActionToUpdate(java.util.Iterator<com.exalead.papi.framework.connectors.journalized.UpdateItem> items) throws java.lang.Exception
java.lang.Exception
public void scan(PushAPI papi, java.lang.String mode, java.lang.Object modeConfig) throws java.lang.Exception
Connector
scan
in class Connector
papi
- PushAPI used to dialog with CloudViewmode
- Type of scan to perform. Is always Connector.DEFAULT_SCAN_MODE
unless
the connector declares additional scan modes with ConnectorCapabilities
annotation.modeConfig
- Optional configuration given to the scanMode, according to ScanModeDefinition
annotation.java.lang.Exception
- Upon errorpublic Document fetch(java.lang.String uri) throws java.lang.Exception
Connector
public MetaContainer getDocumentSecurityTokens(java.lang.String uri) throws java.io.IOException
Connector
getDocumentSecurityTokens
in class Connector
uri
- Uri of documentjava.io.IOException
protected long handleRootDeletes() throws PushAPIException
PushAPIException
protected void initializePipelinesManager(boolean forUpdate) throws java.lang.Exception
java.lang.Exception
protected void addRootKeyInPipelineManager(SKey root, com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> opBuilder, com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> opBuilderUpdate, com.exalead.papi.framework.operations.builders.enumerated.EnumerableOperationBuilder<SKey> operationBuilderNotModified) throws java.lang.Exception
java.lang.Exception
public void terminateThreads() throws java.lang.Exception
java.lang.Exception
public void callBeforeDestruction() throws java.lang.Exception
Connector
callBeforeDestruction
in class Connector
java.lang.Exception
public void addFolderOperationToEnumeratedOperationPipeline(com.exalead.papi.framework.operations.FolderOperation<SKey> op) throws java.lang.Exception
java.lang.Exception
public void addDocumentOperationToEnumeratedOperationPipeline(com.exalead.papi.framework.operations.DocumentOperation<SKey> op) throws java.lang.Exception
java.lang.Exception
public int getNbThreadsPerEnumeratedFolderOperationPipeline()
public int getNbThreadsPerEnumeratedDocumentOperationPipeline()
public void setNbThreadsPerEnumeratedFolderOperationPipeline(int nb)
public void setNbThreadsPerEnumeratedDocumentOperationPipeline(int nb)
public void setNbThreadsPerEnumeratedOperationPipeline(int nb)
public com.exalead.concurrent.ConcurrentProcessingQuotaWorker registerWorkInProgress(long size)
public com.exalead.concurrent.ConcurrentProcessingQuotaWorker registerDocInProgress(Document doc)
public PushAPI getCurrentPAPI()
public void setCurrentPAPI(PushAPI newPAPI)
Copyright © 2021 Dassault Systèmes, All Rights Reserved.