Class BulkIndexingSession
java.lang.Object
com.flowable.indexing.job.history.async.BulkIndexingSession
- All Implemented Interfaces:
org.flowable.common.engine.impl.interceptor.Session
public class BulkIndexingSession
extends java.lang.Object
implements org.flowable.common.engine.impl.interceptor.Session
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<BulkIndexRequestInterceptor>
bulkIndexRequestInterceptors
protected BulkRequest
bulkRequest
protected org.flowable.common.engine.impl.interceptor.CommandContext
commandContext
protected ElasticsearchCompatibility
elasticsearchCompatibility
protected com.fasterxml.jackson.databind.ObjectMapper
objectMapper
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
registeredFullIndexes
protected org.elasticsearch.client.RestHighLevelClient
restClient
-
Constructor Summary
Constructors Constructor Description BulkIndexingSession(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.elasticsearch.client.RestHighLevelClient restClient, ElasticsearchCompatibility elasticsearchCompatibility, java.util.List<BulkIndexRequestInterceptor> bulkIndexRequestInterceptors)
-
Method Summary
Modifier and Type Method Description void
close()
protected void
ensureBulkRequestInitialized()
org.elasticsearch.action.bulk.BulkResponse
executeBulkRequest()
void
flush()
BulkRequest
getBulkRequest()
void
indexData(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)
void
indexDataWithExternalVersion(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, long version)
boolean
isFullIndexRegistered(java.lang.String type, java.lang.String id)
protected <Resp> Resp
parseEntity(org.apache.http.HttpEntity entity, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,Resp,java.io.IOException> entityParser)
void
registerFullIndex(java.lang.String type, java.lang.String id)
void
retryFailedBulkRequest(com.fasterxml.jackson.databind.node.ObjectNode actionNode, com.fasterxml.jackson.databind.node.ObjectNode sourceNode)
void
upsertData(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)
void
upsertDataWithScript(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode upsertDocNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode)
-
Field Details
-
commandContext
protected org.flowable.common.engine.impl.interceptor.CommandContext commandContext -
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
restClient
protected org.elasticsearch.client.RestHighLevelClient restClient -
elasticsearchCompatibility
-
bulkIndexRequestInterceptors
-
bulkRequest
-
registeredFullIndexes
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> registeredFullIndexes
-
-
Constructor Details
-
BulkIndexingSession
public BulkIndexingSession(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.elasticsearch.client.RestHighLevelClient restClient, ElasticsearchCompatibility elasticsearchCompatibility, java.util.List<BulkIndexRequestInterceptor> bulkIndexRequestInterceptors)
-
-
Method Details
-
upsertData
public void upsertData(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode) -
upsertDataWithScript
public void upsertDataWithScript(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode upsertDocNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode) -
indexData
public void indexData(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode) -
indexDataWithExternalVersion
public void indexDataWithExternalVersion(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, long version) -
registerFullIndex
public void registerFullIndex(java.lang.String type, java.lang.String id) -
isFullIndexRegistered
public boolean isFullIndexRegistered(java.lang.String type, java.lang.String id) -
retryFailedBulkRequest
public void retryFailedBulkRequest(com.fasterxml.jackson.databind.node.ObjectNode actionNode, com.fasterxml.jackson.databind.node.ObjectNode sourceNode) -
executeBulkRequest
public org.elasticsearch.action.bulk.BulkResponse executeBulkRequest() throws java.io.IOException- Throws:
java.io.IOException
-
parseEntity
protected <Resp> Resp parseEntity(org.apache.http.HttpEntity entity, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,Resp,java.io.IOException> entityParser) throws java.io.IOException- Throws:
java.io.IOException
-
ensureBulkRequestInitialized
protected void ensureBulkRequestInitialized() -
flush
public void flush()- Specified by:
flush
in interfaceorg.flowable.common.engine.impl.interceptor.Session
-
close
public void close()- Specified by:
close
in interfaceorg.flowable.common.engine.impl.interceptor.Session
-
getBulkRequest
-