test_class.declarator: indexDefinitionMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ElasticIndexDefinition indexDefinitionMock;
test_class.type: ElasticIndexDefinition
test_class.var_name: indexDefinitionMock
test_class.declarator: definitionNodeStateMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NodeState definitionNodeStateMock;
test_class.type: NodeState
test_class.var_name: definitionNodeStateMock
test_class.declarator: elasticConnectionMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ElasticConnection elasticConnectionMock;
test_class.type: ElasticConnection
test_class.var_name: elasticConnectionMock
test_class.declarator: definitionBuilder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NodeBuilder definitionBuilder;
test_class.type: NodeBuilder
test_class.var_name: definitionBuilder
test_class.declarator: commitInfo
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CommitInfo commitInfo;
test_class.type: CommitInfo
test_class.var_name: commitInfo
test_class.file: oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandlerTest.java
test_class.identifier: ElasticBulkProcessorHandlerTest
test_case.body: @Test
      public void defaultModeWithCommitInfoOverride() {
          when(definitionNodeStateMock.getProperty(eq("async"))).thenReturn(null);
          when(commitInfo.getInfo()).thenReturn(Collections.singletonMap("sync-mode", "rt"));
  
          ElasticBulkProcessorHandler bulkProcessorHandler = ElasticBulkProcessorHandler
                  .getBulkProcessorHandler(elasticConnectionMock, indexDefinitionMock, definitionBuilder, commitInfo);
  
          assertThat(bulkProcessorHandler, instanceOf(ElasticBulkProcessorHandler.RealTimeBulkProcessorHandler.class));
      }
test_case.class_method_signature: ElasticBulkProcessorHandlerTest.defaultModeWithCommitInfoOverride()
test_case.full_signature: @Test public void defaultModeWithCommitInfoOverride()
test_case.identifier: defaultModeWithCommitInfoOverride
test_case.invocations: thenReturn when getProperty eq thenReturn when getInfo singletonMap getBulkProcessorHandler assertThat instanceOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void defaultModeWithCommitInfoOverride()
focal_class.declarator: LOG = LoggerFactory.getLogger(ElasticBulkProcessorHandler.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(ElasticBulkProcessorHandler.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: FAILED_DOC_COUNT_FOR_STATUS_NODE = Integer.getInteger("oak.failedDocStatusLimit", 10000)
focal_class.modifier: private final
focal_class.original_string: private final int FAILED_DOC_COUNT_FOR_STATUS_NODE = Integer.getInteger("oak.failedDocStatusLimit", 10000);
focal_class.type: int
focal_class.var_name: FAILED_DOC_COUNT_FOR_STATUS_NODE
focal_class.declarator: SYNC_MODE_PROPERTY = "sync-mode"
focal_class.modifier: private static final
focal_class.original_string: private static final String SYNC_MODE_PROPERTY = "sync-mode";
focal_class.type: String
focal_class.var_name: SYNC_MODE_PROPERTY
focal_class.declarator: SYNC_RT_MODE = "rt"
focal_class.modifier: private static final
focal_class.original_string: private static final String SYNC_RT_MODE = "rt";
focal_class.type: String
focal_class.var_name: SYNC_RT_MODE
focal_class.declarator: waitForESAcknowledgement = true
focal_class.modifier: private static
focal_class.original_string: private static boolean waitForESAcknowledgement = true;
focal_class.type: boolean
focal_class.var_name: waitForESAcknowledgement
focal_class.declarator: elasticConnection
focal_class.modifier: protected final
focal_class.original_string: protected final ElasticConnection elasticConnection;
focal_class.type: ElasticConnection
focal_class.var_name: elasticConnection
focal_class.declarator: indexDefinition
focal_class.modifier: protected final
focal_class.original_string: protected final ElasticIndexDefinition indexDefinition;
focal_class.type: ElasticIndexDefinition
focal_class.var_name: indexDefinition
focal_class.declarator: definitionBuilder
focal_class.modifier: private final
focal_class.original_string: private final NodeBuilder definitionBuilder;
focal_class.type: NodeBuilder
focal_class.var_name: definitionBuilder
focal_class.declarator: bulkProcessor
focal_class.modifier: protected final
focal_class.original_string: protected final BulkProcessor bulkProcessor;
focal_class.type: BulkProcessor
focal_class.var_name: bulkProcessor
focal_class.declarator: phaser = new Phaser(1)
focal_class.modifier: private final
focal_class.original_string: private final Phaser phaser = new Phaser(1);
focal_class.type: Phaser
focal_class.var_name: phaser
focal_class.declarator: ioException
focal_class.modifier: private volatile
focal_class.original_string: private volatile IOException ioException;
focal_class.type: IOException
focal_class.var_name: ioException
focal_class.declarator: updatesMap = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentHashMap<Long, Boolean> updatesMap = new ConcurrentHashMap<>();
focal_class.type: ConcurrentHashMap<Long, Boolean>
focal_class.var_name: updatesMap
focal_class.declarator: totalOperations
focal_class.modifier: protected
focal_class.original_string: protected long totalOperations;
focal_class.type: long
focal_class.var_name: totalOperations
focal_class.file: oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java
focal_class.identifier: ElasticBulkProcessorHandler
focal_class.class_method_signature: ElasticBulkProcessorHandler.ElasticBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                          @NotNull ElasticIndexDefinition indexDefinition,
                                          @NotNull NodeBuilder definitionBuilder)
focal_class.full_signature: private  ElasticBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                          @NotNull ElasticIndexDefinition indexDefinition,
                                          @NotNull NodeBuilder definitionBuilder)
focal_class.identifier: ElasticBulkProcessorHandler
focal_class.modifiers: private
focal_class.parameters: (@NotNull ElasticConnection elasticConnection,
                                          @NotNull ElasticIndexDefinition indexDefinition,
                                          @NotNull NodeBuilder definitionBuilder)
focal_class.signature:  ElasticBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                          @NotNull ElasticIndexDefinition indexDefinition,
                                          @NotNull NodeBuilder definitionBuilder)
focal_class.class_method_signature: ElasticBulkProcessorHandler.getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_class.full_signature: public static ElasticBulkProcessorHandler getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_class.identifier: getBulkProcessorHandler
focal_class.modifiers: public static
focal_class.parameters: (@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_class.return: ElasticBulkProcessorHandler
focal_class.signature: ElasticBulkProcessorHandler getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_class.class_method_signature: ElasticBulkProcessorHandler.initBulkProcessor()
focal_class.full_signature: private BulkProcessor initBulkProcessor()
focal_class.identifier: initBulkProcessor
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: BulkProcessor
focal_class.signature: BulkProcessor initBulkProcessor()
focal_class.class_method_signature: ElasticBulkProcessorHandler.requestConsumer()
focal_class.full_signature: protected BiConsumer<BulkRequest, ActionListener<BulkResponse>> requestConsumer()
focal_class.identifier: requestConsumer
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: BiConsumer<BulkRequest, ActionListener<BulkResponse>>
focal_class.signature: BiConsumer<BulkRequest, ActionListener<BulkResponse>> requestConsumer()
focal_class.class_method_signature: ElasticBulkProcessorHandler.add(DocWriteRequest<?> request)
focal_class.full_signature: public void add(DocWriteRequest<?> request)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (DocWriteRequest<?> request)
focal_class.return: void
focal_class.signature: void add(DocWriteRequest<?> request)
focal_class.class_method_signature: ElasticBulkProcessorHandler.close()
focal_class.full_signature: public boolean close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean close()
focal_method.body: public static ElasticBulkProcessorHandler getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo) {
          PropertyState async = indexDefinition.getDefinitionNodeState().getProperty("async");
  
          if (async != null) {
              Iterable<String> opt = async.getValue(Type.STRINGS);
  
              // Check if this indexing call is a part of async cycle or a commit hook
              // In case it's from async cycle - commit info will have a indexingCheckpointTime key.
              // Otherwise it's part of commit hook based indexing due to async property having a value nrt
              if (!commitInfo.getInfo().containsKey(IndexConstants.CHECKPOINT_CREATION_TIME)) {
                  waitForESAcknowledgement = false;
              }
              return new ElasticBulkProcessorHandler(elasticConnection, indexDefinition, definitionBuilder);
          }
  
          // commit-info has priority over configuration in index definition
          String syncMode = null;
          if (commitInfo != null) {
              syncMode = (String) commitInfo.getInfo().get(SYNC_MODE_PROPERTY);
          }
  
          if (syncMode == null) {
              PropertyState syncModeProp = indexDefinition.getDefinitionNodeState().getProperty("sync-mode");
              if (syncModeProp != null) {
                  syncMode = syncModeProp.getValue(Type.STRING);
              }
          }
  
          if (SYNC_RT_MODE.equals(syncMode)) {
              return new RealTimeBulkProcessorHandler(elasticConnection, indexDefinition, definitionBuilder);
          }
  
          return new ElasticBulkProcessorHandler(elasticConnection, indexDefinition, definitionBuilder);
      }
focal_method.class_method_signature: ElasticBulkProcessorHandler.getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_method.full_signature: public static ElasticBulkProcessorHandler getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_method.identifier: getBulkProcessorHandler
focal_method.invocations: getProperty getDefinitionNodeState getValue containsKey getInfo get getInfo getProperty getDefinitionNodeState getValue equals
focal_method.modifiers: public static
focal_method.parameters: (@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)
focal_method.return: ElasticBulkProcessorHandler
focal_method.signature: ElasticBulkProcessorHandler getBulkProcessorHandler(@NotNull ElasticConnection elasticConnection,
                                                                        @NotNull ElasticIndexDefinition indexDefinition,
                                                                        @NotNull NodeBuilder definitionBuilder, CommitInfo commitInfo)