Class SolrInformationServer

  • All Implemented Interfaces:
    InformationServer, org.alfresco.solr.InformationServerCollectionProvider

    public class SolrInformationServer
    extends java.lang.Object
    implements InformationServer
    This is the Apache Solr implementation of the information server (index).
    Since:
    5.0
    Author:
    Ahmed Owian
    • Constructor Detail

      • SolrInformationServer

        public SolrInformationServer​(AlfrescoCoreAdminHandler adminHandler,
                                     org.apache.solr.core.SolrCore core,
                                     org.alfresco.solr.client.SOLRAPIClient repositoryClient,
                                     SolrContentStore solrContentStore)
    • Method Detail

      • cascadeTrackingEnabled

        public boolean cascadeTrackingEnabled()
        Check if cascade tracking is enabled.
        Specified by:
        cascadeTrackingEnabled in interface InformationServer
        Returns:
        true if cascade tracking is enabled (note that this is the default behaviour if not specified in the properties file).
      • addFTSStatusCounts

        public void addFTSStatusCounts​(org.apache.solr.common.util.NamedList<java.lang.Object> report)
        Specified by:
        addFTSStatusCounts in interface InformationServer
      • checkAclInIndex

        public org.alfresco.solr.AclReport checkAclInIndex​(java.lang.Long aclid,
                                                           org.alfresco.solr.AclReport aclReport)
        Specified by:
        checkAclInIndex in interface InformationServer
      • reportIndexTransactions

        public org.alfresco.solr.tracker.IndexHealthReport reportIndexTransactions​(java.lang.Long minTxId,
                                                                                   org.alfresco.solr.adapters.IOpenBitSet txIdsInDb,
                                                                                   long maxTxId)
        Specified by:
        reportIndexTransactions in interface InformationServer
      • reportAclTransactionsInIndex

        public org.alfresco.solr.tracker.IndexHealthReport reportAclTransactionsInIndex​(java.lang.Long minAclTxId,
                                                                                        org.alfresco.solr.adapters.IOpenBitSet aclTxIdsInDb,
                                                                                        long maxAclTxId)
        Specified by:
        reportAclTransactionsInIndex in interface InformationServer
      • commit

        public void commit()
                    throws java.io.IOException
        Specified by:
        commit in interface InformationServer
        Throws:
        java.io.IOException
      • hardCommit

        public void hardCommit()
                        throws java.io.IOException
        Specified by:
        hardCommit in interface InformationServer
        Throws:
        java.io.IOException
      • commit

        public boolean commit​(boolean openSearcher)
                       throws java.io.IOException
        Specified by:
        commit in interface InformationServer
        Throws:
        java.io.IOException
      • deleteByAclChangeSetId

        public void deleteByAclChangeSetId​(java.lang.Long aclChangeSetId)
                                    throws java.io.IOException
        Specified by:
        deleteByAclChangeSetId in interface InformationServer
        Throws:
        java.io.IOException
      • deleteByAclId

        public void deleteByAclId​(java.lang.Long aclId)
                           throws java.io.IOException
        Specified by:
        deleteByAclId in interface InformationServer
        Throws:
        java.io.IOException
      • deleteByNodeId

        public void deleteByNodeId​(java.lang.Long nodeId)
                            throws java.io.IOException
        Specified by:
        deleteByNodeId in interface InformationServer
        Throws:
        java.io.IOException
      • deleteByTransactionId

        public void deleteByTransactionId​(java.lang.Long transactionId)
                                   throws java.io.IOException
        Specified by:
        deleteByTransactionId in interface InformationServer
        Throws:
        java.io.IOException
      • getCoreStats

        public java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>> getCoreStats()
                                                                                                      throws java.io.IOException
        Specified by:
        getCoreStats in interface InformationServer
        Throws:
        java.io.IOException
      • getDictionaryService

        public org.alfresco.repo.dictionary.DictionaryComponent getDictionaryService​(java.lang.String alternativeDictionary)
        Specified by:
        getDictionaryService in interface InformationServer
      • getTxDocsSize

        public int getTxDocsSize​(java.lang.String targetTxId,
                                 java.lang.String targetTxCommitTime)
        Specified by:
        getTxDocsSize in interface InformationServer
      • getAclTxDocsSize

        public int getAclTxDocsSize​(java.lang.String aclTxId,
                                    java.lang.String aclTxCommitTime)
        Specified by:
        getAclTxDocsSize in interface InformationServer
      • getErrorDocIds

        public java.util.Set<java.lang.Long> getErrorDocIds()
                                                     throws java.io.IOException
        Specified by:
        getErrorDocIds in interface InformationServer
        Throws:
        java.io.IOException
      • getM2Model

        public org.alfresco.repo.dictionary.M2Model getM2Model​(org.alfresco.service.namespace.QName modelQName)
        Specified by:
        getM2Model in interface InformationServer
      • getModelErrors

        public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getModelErrors()
        Specified by:
        getModelErrors in interface InformationServer
      • getOpenBitSetInstance

        public org.alfresco.solr.adapters.IOpenBitSet getOpenBitSetInstance()
        Specified by:
        getOpenBitSetInstance in interface org.alfresco.solr.InformationServerCollectionProvider
      • getSimpleOrderedMapInstance

        public <T> org.alfresco.solr.adapters.ISimpleOrderedMap<T> getSimpleOrderedMapInstance()
        Specified by:
        getSimpleOrderedMapInstance in interface org.alfresco.solr.InformationServerCollectionProvider
      • indexAcl

        public long indexAcl​(java.util.List<org.alfresco.solr.client.AclReaders> aclReaderList,
                             boolean overwrite)
                      throws java.io.IOException
        Specified by:
        indexAcl in interface InformationServer
        Throws:
        java.io.IOException
      • indexAclTransaction

        public void indexAclTransaction​(org.alfresco.solr.client.AclChangeSet changeSet,
                                        boolean overwrite)
                                 throws java.io.IOException
        Specified by:
        indexAclTransaction in interface InformationServer
        Throws:
        java.io.IOException
      • capIndex

        public void capIndex​(long dbid)
                      throws java.io.IOException
        Specified by:
        capIndex in interface InformationServer
        Throws:
        java.io.IOException
      • maintainCap

        public void maintainCap​(long dbid)
                         throws java.io.IOException
        Specified by:
        maintainCap in interface InformationServer
        Throws:
        java.io.IOException
      • indexNode

        public void indexNode​(org.alfresco.solr.client.Node node,
                              boolean overwrite)
                       throws java.io.IOException,
                              org.json.JSONException
        Specified by:
        indexNode in interface InformationServer
        Throws:
        java.io.IOException
        org.json.JSONException
      • getCascadeNodes

        public java.util.List<org.alfresco.solr.client.NodeMetaData> getCascadeNodes​(java.util.List<java.lang.Long> txnIds)
                                                                              throws java.io.IOException,
                                                                                     org.json.JSONException
        Specified by:
        getCascadeNodes in interface InformationServer
        Throws:
        java.io.IOException
        org.json.JSONException
      • cascadeNodes

        public void cascadeNodes​(java.util.List<org.alfresco.solr.client.NodeMetaData> nodeMetaDatas,
                                 boolean overwrite)
                          throws java.io.IOException,
                                 org.json.JSONException
        Specified by:
        cascadeNodes in interface InformationServer
        Throws:
        java.io.IOException
        org.json.JSONException
      • updateContentToIndexAndCache

        public void updateContentToIndexAndCache​(long dbId,
                                                 java.lang.String tenant)
                                          throws java.lang.Exception
        Specified by:
        updateContentToIndexAndCache in interface InformationServer
        Throws:
        java.lang.Exception
      • indexNodes

        public void indexNodes​(java.util.List<org.alfresco.solr.client.Node> nodes,
                               boolean overwrite)
                        throws java.io.IOException,
                               org.json.JSONException
        Specified by:
        indexNodes in interface InformationServer
        Throws:
        java.io.IOException
        org.json.JSONException
      • updateTransaction

        public void updateTransaction​(org.alfresco.solr.client.Transaction txn)
                               throws java.io.IOException
        Specified by:
        updateTransaction in interface InformationServer
        Throws:
        java.io.IOException
      • indexTransaction

        public void indexTransaction​(org.alfresco.solr.client.Transaction info,
                                     boolean overwrite)
                              throws java.io.IOException
        Specified by:
        indexTransaction in interface InformationServer
        Throws:
        java.io.IOException
      • getCascades

        public java.util.List<org.alfresco.solr.client.Transaction> getCascades​(int num)
                                                                         throws java.io.IOException
        Specified by:
        getCascades in interface InformationServer
        Throws:
        java.io.IOException
      • txnInIndex

        public boolean txnInIndex​(long txnId,
                                  boolean populateCache)
                           throws java.io.IOException
        Specified by:
        txnInIndex in interface InformationServer
        Throws:
        java.io.IOException
      • aclChangeSetInIndex

        public boolean aclChangeSetInIndex​(long changeSetId,
                                           boolean populateCache)
                                    throws java.io.IOException
        Specified by:
        aclChangeSetInIndex in interface InformationServer
        Throws:
        java.io.IOException
      • putModel

        public boolean putModel​(org.alfresco.repo.dictionary.M2Model model)
        Specified by:
        putModel in interface InformationServer
      • rollback

        public void rollback()
                      throws java.io.IOException
        Specified by:
        rollback in interface InformationServer
        Throws:
        java.io.IOException
      • reindexNodeByQuery

        public void reindexNodeByQuery​(java.lang.String query)
                                throws java.io.IOException,
                                       org.json.JSONException
        Specified by:
        reindexNodeByQuery in interface InformationServer
        Throws:
        java.io.IOException
        org.json.JSONException
      • getProps

        public java.util.Properties getProps()
      • updatePathRelatedFields

        protected void updatePathRelatedFields​(org.alfresco.solr.client.NodeMetaData nodeMetaData,
                                               org.apache.solr.common.SolrInputDocument doc)
      • getDocListSize

        public int getDocListSize​(java.lang.String query)
      • flushContentStore

        public void flushContentStore()
                               throws java.io.IOException
        Specified by:
        flushContentStore in interface InformationServer
        Throws:
        java.io.IOException