org.sakaiproject.search.index
Interface SegmentInfo

All Known Implementing Classes:
SegmentInfoImpl

public interface SegmentInfo

Represents Information about a search segment

Author:
ieb

Method Summary
 boolean checkSegmentValidity(boolean logging, String message)
          Check the validity of the segment
 void compareTo(String message, SegmentInfo recoverSegInfo)
          Compares this segment to the supplied segment, based on the in memory state of the live segment state
 void debugSegment(String string)
           
 void doFinalDelete()
          Perform a final delete removing all files from the local disk
 long getLocalSegmentLastModified()
          Get the time the segment was last modified
 long getLocalSegmentSize()
          Get the size of the segment on disk
 String getName()
          Get the name of the segment
 File getSegmentLocation()
          The File that is the segment location on the local filesystem (may not exist)
 long getSize()
          get the size of the segment.
 long getTotalSize()
          Get the size of the segment
 long getVersion()
          get the current version of the segment
 boolean isClusterSegment()
          Is the segment part of the cluster or just a stray directory.
 boolean isCreated()
          If the segment in a created state (ie not new and not deleted)
 boolean isDeleted()
          Was the segment deleted
 boolean isInDb()
          Is the segment in the DB
 boolean isLocalLock()
          Does this thread have a local lock on the segment
 void loadSize()
          calculate the total size (this is expensive)
 void lockLocalSegment()
          Perform a lock on the segment for local operations
 void setCreated()
          Mark the segment as created
 void setDeleted()
          Mark the segment as deleted for later deletion
 void setNew()
          Mark the segment as brand new
 void setTimeStamp(long l)
          Set the timestamp on th segment
 void setVersion(long newVersion)
          Set the version of the segment
 void touchSegment()
          make the segment as updated
 void unlockLocalSegment()
          Unlock the segment
 

Method Detail

isClusterSegment

boolean isClusterSegment()
Is the segment part of the cluster or just a stray directory.

Returns:

getName

String getName()
Get the name of the segment

Returns:

getVersion

long getVersion()
get the current version of the segment

Returns:

isCreated

boolean isCreated()
If the segment in a created state (ie not new and not deleted)

Returns:

getSegmentLocation

File getSegmentLocation()
The File that is the segment location on the local filesystem (may not exist)

Returns:

setDeleted

void setDeleted()
Mark the segment as deleted for later deletion


isInDb

boolean isInDb()
Is the segment in the DB

Returns:

setVersion

void setVersion(long newVersion)
Set the version of the segment

Parameters:
newVersion -

isDeleted

boolean isDeleted()
Was the segment deleted

Returns:

setTimeStamp

void setTimeStamp(long l)
                  throws IOException
Set the timestamp on th segment

Parameters:
l -
Throws:
IOException

setNew

void setNew()
Mark the segment as brand new


getLocalSegmentLastModified

long getLocalSegmentLastModified()
Get the time the segment was last modified

Returns:

getLocalSegmentSize

long getLocalSegmentSize()
Get the size of the segment on disk

Returns:

setCreated

void setCreated()
Mark the segment as created


checkSegmentValidity

boolean checkSegmentValidity(boolean logging,
                             String message)
                             throws Exception
Check the validity of the segment

Throws:
Exception

getTotalSize

long getTotalSize()
Get the size of the segment

Returns:

touchSegment

void touchSegment()
                  throws IOException
make the segment as updated

Throws:
IOException

loadSize

void loadSize()
calculate the total size (this is expensive)


getSize

long getSize()
get the size of the segment.

Returns:

doFinalDelete

void doFinalDelete()
Perform a final delete removing all files from the local disk


lockLocalSegment

void lockLocalSegment()
Perform a lock on the segment for local operations


isLocalLock

boolean isLocalLock()
Does this thread have a local lock on the segment

Returns:

unlockLocalSegment

void unlockLocalSegment()
Unlock the segment


debugSegment

void debugSegment(String string)
Parameters:
string -

compareTo

void compareTo(String message,
               SegmentInfo recoverSegInfo)
Compares this segment to the supplied segment, based on the in memory state of the live segment state

Parameters:
string -
recoverSegInfo -


Copyright © 2003-2012 Sakai Project. All Rights Reserved.