Package dk.netarkivet.wayback.indexer
Class ArchiveFile
- java.lang.Object
-
- dk.netarkivet.wayback.indexer.ArchiveFile
-
public class ArchiveFile extends Object
This class represents a file in the arcrepository which may be indexed by the indexer.
-
-
Constructor Summary
Constructors Constructor Description ArchiveFile()
Constructor, creates a new instance in the unindexed state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getFilename()
The filename is used as a natural key because it is a fundamental property of the arcrepository that filenames are unique.Date
getIndexedDate()
Returns indexedDate.int
getIndexingFailedAttempts()
Gets the number of failed indexing attempts.String
getOriginalIndexFileName()
Gets originalIndexFileName.int
hashCode()
void
index()
Indexes this file by either running a hadoop job or a batch job, depending on settings.boolean
isIndexed()
Returns true if the file has been indexed.void
setFilename(String filename)
Sets the filename.void
setIndexed(boolean indexed)
Sets whether the file has been indexed.void
setIndexedDate(Date indexedDate)
Sets indexedDate.void
setIndexingFailedAttempts(int indexingFailedAttempts)
Sets the number of failed indexing attempts.void
setOriginalIndexFileName(String originalIndexFileName)
Sets originalIndexFileName.
-
-
-
Method Detail
-
getOriginalIndexFileName
public String getOriginalIndexFileName()
Gets originalIndexFileName.- Returns:
- the originalIndexFileName
-
setOriginalIndexFileName
public void setOriginalIndexFileName(String originalIndexFileName)
Sets originalIndexFileName.- Parameters:
originalIndexFileName
- The new original index filename
-
getIndexedDate
public Date getIndexedDate()
Returns indexedDate.- Returns:
- the date indexed.
-
setIndexedDate
public void setIndexedDate(Date indexedDate)
Sets indexedDate.- Parameters:
indexedDate
- The new indexed date.
-
getFilename
public String getFilename()
The filename is used as a natural key because it is a fundamental property of the arcrepository that filenames are unique.- Returns:
- the filename.
-
setFilename
public void setFilename(String filename)
Sets the filename.- Parameters:
filename
- The new filename
-
isIndexed
public boolean isIndexed()
Returns true if the file has been indexed.- Returns:
- whether the file is indexed
-
setIndexed
public void setIndexed(boolean indexed)
Sets whether the file has been indexed.- Parameters:
indexed
- The new value of the isIndexed variable.
-
getIndexingFailedAttempts
public int getIndexingFailedAttempts()
Gets the number of failed indexing attempts.- Returns:
- the number of failed attempts
-
setIndexingFailedAttempts
public void setIndexingFailedAttempts(int indexingFailedAttempts)
Sets the number of failed indexing attempts.- Parameters:
indexingFailedAttempts
- The number of failed indexing attempts
-
index
public void index() throws IllegalState
Indexes this file by either running a hadoop job or a batch job, depending on settings.- Throws:
IllegalState
- If the indexing has already been done.
-
-