Class RealTimeGetComponent

    • Constructor Detail

      • RealTimeGetComponent

        public RealTimeGetComponent()
    • Method Detail

      • getInputDocumentFromTlog

        public static SolrInputDocument getInputDocumentFromTlog​(SolrCore core,
                                                                 org.apache.lucene.util.BytesRef idBytes,
                                                                 AtomicLong versionReturned,
                                                                 Set<String> onlyTheseNonStoredDVs,
                                                                 boolean resolveFullDocument)
        returns the SolrInputDocument from the current tlog, or DELETED if it has been deleted, or null if there is no record of it in the current update log. If null is returned, it could still be in the latest index.
        Parameters:
        versionReturned - If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.
        resolveFullDocument - In case the document is fetched from the tlog, it could only be a partial document if the last update was an in-place update. In that case, should this partial document be resolved to a full document (by following back prevPointer/prevVersion)?
      • getInputDocument

        public static SolrInputDocument getInputDocument​(SolrCore core,
                                                         org.apache.lucene.util.BytesRef idBytes)
                                                  throws IOException
        Obtains the latest document for a given id from the tlog or index (if not found in the tlog). NOTE: This method uses the effective value for avoidRetrievingStoredFields param as false and for nonStoredDVs as null in the call to @see getInputDocument(SolrCore, BytesRef, AtomicLong, boolean, Set, boolean), so as to retrieve all stored and non-stored DV fields from all documents. Also, it uses the effective value of resolveFullDocument param as true, i.e. it resolves any partial documents (in-place updates), in case the document is fetched from the tlog, to a full document.
        Throws:
        IOException
      • getInputDocument

        public static SolrInputDocument getInputDocument​(SolrCore core,
                                                         org.apache.lucene.util.BytesRef idBytes,
                                                         AtomicLong versionReturned,
                                                         boolean avoidRetrievingStoredFields,
                                                         Set<String> onlyTheseNonStoredDVs,
                                                         boolean resolveFullDocument)
                                                  throws IOException
        Obtains the latest document for a given id from the tlog or through the realtime searcher (if not found in the tlog).
        Parameters:
        versionReturned - If a non-null AtomicLong is passed in, it is set to the version of the update returned from the TLog.
        avoidRetrievingStoredFields - Setting this to true avoids fetching stored fields through the realtime searcher, however has no effect on documents obtained from the tlog. Non-stored docValues fields are populated anyway, and are not affected by this parameter. Note that if the id field is a stored field, it will not be populated if this parameter is true and the document is obtained from the index.
        onlyTheseNonStoredDVs - If not-null, populate only these DV fields in the document fetched through the realtime searcher. If this is null, decorate all non-stored DVs (that are not targets of copy fields) from the searcher.
        resolveFullDocument - In case the document is fetched from the tlog, it could only be a partial document if the last update was an in-place update. In that case, should this partial document be resolved to a full document (by following back prevPointer/prevVersion)?
        Throws:
        IOException
      • toSolrDoc

        public static SolrDocument toSolrDoc​(SolrInputDocument sdoc,
                                             IndexSchema schema)
        Converts a SolrInputDocument to SolrDocument, using an IndexSchema instance.
        WARNING: This API is experimental and might change in incompatible ways in the next release.
      • processSyncWithLeader

        public void processSyncWithLeader​(ResponseBuilder rb,
                                          int nVersions,
                                          String syncWithLeader,
                                          List<Long> versions)