Class IndexGeneratorTimerTask
java.lang.Object
java.util.TimerTask
edu.ucsb.nceas.metacat.index.queue.IndexGeneratorTimerTask
- All Implemented Interfaces:
Runnable
A timer to regenerate failed index tasks or index tasks in a given time frame.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel()
Overwrite and do nothingprotected static org.dataone.service.types.v2.SystemMetadata
Get the SystemMetadata for the specified id from the distributed Map.void
Build the index for the docs which have been modified since the specified date.void
Build the index for the docs which have been modified between the specified dates.protected static void
Put the ids into the index queuevoid
indexAll()
Build the index for all documents.static boolean
isResourceMap
(org.dataone.service.types.v1.ObjectFormatIdentifier formatId) If the specified ObjectFormatIdentifier is a resroucemap namespace.void
run()
protected static void
submitIndex
(String id) Submit the index task to the queue for the given idMethods inherited from class java.util.TimerTask
scheduledExecutionTime
-
Field Details
-
WAITTIME
public static final int WAITTIME- See Also:
-
MAXWAITNUMBER
public static final int MAXWAITNUMBER- See Also:
-
-
Constructor Details
-
IndexGeneratorTimerTask
public IndexGeneratorTimerTask()Constructor- Parameters:
solrIndex
-systemMetadataListener
-
-
-
Method Details
-
indexAll
public void indexAll() throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.apache.solr.client.solrj.SolrServerException, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserExceptionBuild the index for all documents.- Throws:
org.apache.solr.client.solrj.SolrServerException
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.InvalidRequest
IndexEventLogException
IllegalAccessException
InstantiationException
ClassNotFoundException
ParserConfigurationException
SAXException
IOException
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotFound
XPathExpressionException
org.dspace.foresite.OREParserException
-
index
public void index(Date since) throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.apache.solr.client.solrj.SolrServerException, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserException Build the index for the docs which have been modified since the specified date.- Parameters:
since
-- Throws:
org.apache.solr.client.solrj.SolrServerException
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.InvalidRequest
IndexEventLogException
IllegalAccessException
InstantiationException
ClassNotFoundException
ParserConfigurationException
SAXException
IOException
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotFound
XPathExpressionException
org.dspace.foresite.OREParserException
-
index
public void index(Date since, Date until) throws org.apache.solr.client.solrj.SolrServerException, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserException Build the index for the docs which have been modified between the specified dates.- Parameters:
since
- the start dateuntil
- the end date- Throws:
org.apache.solr.client.solrj.SolrServerException
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.InvalidRequest
IndexEventLogException
IllegalAccessException
InstantiationException
ClassNotFoundException
ParserConfigurationException
SAXException
IOException
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotFound
XPathExpressionException
org.dspace.foresite.OREParserException
-
index
Put the ids into the index queue- Parameters:
metacatIds
- the list of ids will be put into the index queue
-
submitIndex
Submit the index task to the queue for the given id- Parameters:
id
- the id will be submitted- Throws:
Exception
-
run
public void run() -
isResourceMap
public static boolean isResourceMap(org.dataone.service.types.v1.ObjectFormatIdentifier formatId) If the specified ObjectFormatIdentifier is a resroucemap namespace.- Parameters:
formatId
- the given format id
-
getSystemMetadata
protected static org.dataone.service.types.v2.SystemMetadata getSystemMetadata(String id) throws org.dataone.service.exceptions.ServiceFailure Get the SystemMetadata for the specified id from the distributed Map. The null maybe is returned if there is no system metadata found.- Parameters:
id
- the specified id.- Returns:
- the SystemMetadata associated with the id.
- Throws:
org.dataone.service.exceptions.ServiceFailure
-
cancel
public boolean cancel()Overwrite and do nothing
-