Class DataSourceIncrementalService
java.lang.Object
fr.paris.lutece.plugins.elasticdata.service.DataSourceIncrementalService
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreate incremental task.static intdeleteByQuery(DataSource dataSource, List<String> listIdResource) Delete a documents by Querystatic List<IndexerAction>getIndexerAction(String strIdDataSource) Load the data of all the datasource indexerAction objects and returns them as a liststatic intinsertObjects(fr.paris.lutece.plugins.libraryelastic.util.Elastic elastic, DataSource dataSource, Iterator<DataObject> iterateDataObjects) Insert a list of object in bulk modestatic voidprocessAsynchronouslyIncrementalIndexing(DataSource dataSource) Insert Incremental data sourcestatic StringInsert Incremental data sourcesstatic voidprocessIncrementalIndexing(DataSource dataSource) process the incremental indexing of a data sourcestatic intprocessIncrementalIndexing(DataSource dataSource, List<String> listIdResource, int nIdTask) Process incremental indexing of a data source according to the taskstatic intupdateObjects(fr.paris.lutece.plugins.libraryelastic.util.Elastic elastic, DataSource dataSource, Iterator<DataObject> iterateDataObjects) update a list of object
-
Method Details
-
processIncrementalIndexing
Insert Incremental data sources- Returns:
- The logs of the process
-
processAsynchronouslyIncrementalIndexing
Insert Incremental data source- Parameters:
dataSource- the data source
-
processIncrementalIndexing
public static void processIncrementalIndexing(DataSource dataSource) throws fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException process the incremental indexing of a data source- Parameters:
dataSource- the data source- Throws:
fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException- If an error occurs accessing to ElasticSearch
-
processIncrementalIndexing
public static int processIncrementalIndexing(DataSource dataSource, List<String> listIdResource, int nIdTask) throws fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException Process incremental indexing of a data source according to the task- Parameters:
dataSource- the datasourcelistIdResource- the list of resource idnIdTask- the task id- Returns:
- the total count of documents processed
- Throws:
fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException- If an error occurs accessing to ElasticSearch
-
insertObjects
public static int insertObjects(fr.paris.lutece.plugins.libraryelastic.util.Elastic elastic, DataSource dataSource, Iterator<DataObject> iterateDataObjects) throws fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException Insert a list of object in bulk mode- Parameters:
elastic- The Elastic ServerdataSource- The data sourceiterateDataObjects- The iterator of objects- Returns:
- the number of documents posted
- Throws:
fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException- If a problem occurs connecting the server
-
updateObjects
public static int updateObjects(fr.paris.lutece.plugins.libraryelastic.util.Elastic elastic, DataSource dataSource, Iterator<DataObject> iterateDataObjects) throws fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException update a list of object- Parameters:
elastic- The Elastic ServerdataSource- The data sourceiterateDataObjects- The iterator of objects- Returns:
- the number of documents posted
- Throws:
fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException- If a problem occurs connecting the server
-
deleteByQuery
public static int deleteByQuery(DataSource dataSource, List<String> listIdResource) throws fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException Delete a documents by Query- Parameters:
dataSource- The data sourcelistIdResource- The list of resource identifiers- Throws:
fr.paris.lutece.plugins.libraryelastic.util.ElasticClientException- Exception If an error occurs accessing to ElasticSearch
-
addTask
Create incremental task. The queue holds a single action per resource and data source (unique key of the table): when an action is already queued, possibly by another thread or another instance at the same time, the new task is merged into it.- Parameters:
strIdDataSource- the datasource idstrIdResource- the resource idnIdTask- the task id
-
getIndexerAction
Load the data of all the datasource indexerAction objects and returns them as a list- Parameters:
strIdDataSource- the identifier of data source- Returns:
- The list which contains the data of all the indexerAction objects
-