hibernate/hibernate-search — pull request #681 by gustavonalle (2014-10-16 23:24:18+00:00)
Title: HSEARCH-1693 Time based commit for async indexing

https://hibernate.atlassian.net/browse/HSEARCH-1693

Introduced a new abstraction called ```CommitPolicy``` which is responsible for commit handling for the async index scenario (and potentially for the sync case). One of the implementations is ```ScheduledCommitPolicy``` that commits at configured intervals, governed by the property ```"hibernate.search.default.refresh_interval"```

Some perf results on Infinispan, multiple threads doing PUT on indexed caches without and with several async indexing options [1]

Test base parameters:
```
MERGE_FACTOR = "3";
OBJECT_COUNT = 100000;
NUMBER_OF_THREADS = 10;
TX_ENABLED = false;
```

Total number of entities indexed = 100k * 10 = 1M

Scenario | load time T (seconds) | docs indexed after T
----- | ----- | -----
Indexing disabled | 50 | 0
Async Indexing | 12092 | 549485
Async Indexing (queueSize = 10000) | 11576 | 542795
__Async Commit Interval 500ms__ | 81 | 999699
__Async Commit Interval 1000ms__ | 75 | 999991

[1] https://github.com/infinispan/infinispan/blob/master/query/src/test/java/org/infinispan/query/backend/MergeTest.java

@Sanne please check if the idea of reducing commits for the sync case is compatible with this abstraction

Is property name ```"hibernate.search.default.refresh_interval"``` adequate?