Class ScannerImpl.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • scanFreqMS

        public ScannerImpl.Builder scanFreqMS​(long interval)
        The scanning frequency. 25ms is the minimum. Smaller intervals will be treated as 25ms
        Parameters:
        interval - a number of milliseconds >= 25
        Returns:
        This builder object for further configuration.
      • retryErroredDocsUpTo

        public ScannerImpl.Builder retryErroredDocsUpTo​(int retries)
        The number of times to retry a document that has errored out previously before ignoring it.
        Parameters:
        retries - the number of time to retry an erroring document before giving up
        Returns:
        this builder for further configuration.
      • rememberScannedIds

        public ScannerImpl.Builder rememberScannedIds​(boolean remember)
        Turn on document id based memory. When enabled this option will cause the scanner not to submit documents that have already been indexed a second time unless they have been marked dirty, the scanner's heuristics determine that the document is dirty, or hash based change detection has indicated that the document has changed.
        Parameters:
        remember - whether to track which documents have already been submitted
        Returns:
        This builder object for further configuration
      • detectChangesViaHashing

        public ScannerImpl.Builder detectChangesViaHashing​(boolean hash)
        Turn on change detection via hashing. When this feature is enabled, the raw bytes of the document and the backing multimap's contents (e.g. field data from scans of data stores such as databases) will be used to create an md5 hash which is stored and compared on subsequent scans. If the previous hash differs from the current hash, the document will be considered dirty, and eligible for reprocessing. Note that this has no effect unless rememberScannedIds(boolean) is turned on, because without that option, all documents are considered dirty every time.
        Parameters:
        hash - whether or not to perform hashing to track document changes
        Returns:
        This builder object for further configuration