IndexRepositorySpy (Apache Geode 1.8.0)
Date: 2018-11-29

org.apache.geode.cache.lucene.test

## Class IndexRepositorySpy

- java.lang.Object
- - org.apache.geode.cache.lucene.internal.IndexRepositoryFactory
  - - org.apache.geode.cache.lucene.test.IndexRepositorySpy

-     public class IndexRepositorySpy
      extends org.apache.geode.cache.lucene.internal.IndexRepositoryFactory

- - ### Field Summary

    - ### Fields inherited from class org.apache.geode.cache.lucene.internal.IndexRepositoryFactory

      `APACHE_GEODE_INDEX_COMPLETE, FILE_REGION_LOCK_FOR_BUCKET_ID`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeWriteIndexRepository(java.util.function.Consumer<java.lang.Object> action)` Add a callback that runs before a call to `IndexRepository.create(Object, Object)`, `IndexRepository.update(Object, Object)` or `IndexRepository.delete(Object)`
    `org.apache.geode.cache.lucene.internal.repository.IndexRepository` | `computeIndexRepository(java.lang.Integer bucketId, LuceneSerializer serializer, org.apache.geode.cache.lucene.internal.InternalLuceneIndex index, org.apache.geode.internal.cache.PartitionedRegion userRegion, org.apache.geode.cache.lucene.internal.repository.IndexRepository oldRepository, org.apache.geode.cache.lucene.internal.PartitionedRepositoryManager partitionedRepositoryManager)`
    `static <T> java.util.function.Consumer<T>` | `doAfterN(java.util.function.Consumer<T> consumer, int times)` Return a consumer that will invoke the passed in consumer only after it has been called exactly N times.
    `static <T> java.util.function.Consumer<T>` | `doOnce(java.util.function.Consumer<T> consumer)` Return a consumer that will invoke the passed in consumer only once
    `static IndexRepositorySpy` | `injectSpy()`
    `static void` | `remove()`

    - ### Methods inherited from class org.apache.geode.cache.lucene.internal.IndexRepositoryFactory

      `getMatchingBucket`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### injectSpy

          public static IndexRepositorySpy injectSpy()

    - #### remove

          public static void remove()

    - #### computeIndexRepository

          public org.apache.geode.cache.lucene.internal.repository.IndexRepository computeIndexRepository(java.lang.Integer bucketId,
                                                                                                          LuceneSerializer serializer,
                                                                                                          org.apache.geode.cache.lucene.internal.InternalLuceneIndex index,
                                                                                                          org.apache.geode.internal.cache.PartitionedRegion userRegion,
                                                                                                          org.apache.geode.cache.lucene.internal.repository.IndexRepository oldRepository,
                                                                                                          org.apache.geode.cache.lucene.internal.PartitionedRepositoryManager partitionedRepositoryManager)
                                                                                                   throws java.io.IOException

      Overrides:
        `computeIndexRepository` in class `org.apache.geode.cache.lucene.internal.IndexRepositoryFactory`
      Throws:
        `java.io.IOException`

    - #### beforeWriteIndexRepository

          public void beforeWriteIndexRepository(java.util.function.Consumer<java.lang.Object> action)

      Add a callback that runs before a call to `IndexRepository.create(Object, Object)`, `IndexRepository.update(Object, Object)` or `IndexRepository.delete(Object)`

    - #### doOnce

          public static <T> java.util.function.Consumer<T> doOnce(java.util.function.Consumer<T> consumer)

      Return a consumer that will invoke the passed in consumer only once

    - #### doAfterN

          public static <T> java.util.function.Consumer<T> doAfterN(java.util.function.Consumer<T> consumer,
                                                                    int times)

      Return a consumer that will invoke the passed in consumer only after it has been called exactly N times.