|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.search.index.impl.SegmentInfoImpl
public class SegmentInfoImpl
segment info contains information on the segment, name, version, in db
| Field Summary | |
|---|---|
static String |
DELETED_FILE
|
static String |
NEW_FILE
|
static int |
STATE_CREATED
|
static int |
STATE_DELETED
|
static int |
STATE_NEW
|
static String |
TIMESTAMP_FILE
|
| Method Summary | |
|---|---|
boolean |
checkSegmentValidity(boolean logging,
String message)
get the checksum out of the segment by the segment name |
void |
compareTo(String message,
SegmentInfo compare)
Compares this segment to the supplied segment, based on the in memory state of the live segment state |
void |
debugSegment(String message)
|
static void |
deleteAll(File f)
delete all files under this file and including this file |
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) |
static File |
getSegmentLocation(String name,
boolean structured,
String searchIndexDirectory)
|
long |
getSize()
get the size of the segment. |
int |
getState()
|
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 |
boolean |
isNew()
|
void |
loadSize()
calculate the total size (this is expensive) |
void |
lockLocalSegment()
Perform a lock on the segment for local operations |
static SegmentInfo |
newLocalSegmentInfo(File file,
boolean localStructuredStorage,
String searchIndexDirectory)
|
static SegmentInfo |
newLocalSegmentInfo(SegmentInfo recoverSegInfo)
Create a new copy of the segment refreshing from the local disk. |
static SegmentInfo |
newSharedSegmentInfo(String name,
long version,
boolean localStructuredStorage,
String searchIndexDirectory)
|
void |
setCreated()
Mark the segment as created |
void |
setDeleted()
Mark the segment as deleted for later deletion |
void |
setInDb(boolean b)
|
void |
setNew()
Mark the segment as brand new |
void |
setState(int state)
|
void |
setTimeStamp(long l)
set the timestamp in the segment |
void |
setVersion(long l)
Set the version of the segment |
String |
toString()
|
void |
touchSegment()
make the segment as updated |
void |
unlockLocalSegment()
Unlock the segment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TIMESTAMP_FILE
public static final String NEW_FILE
public static final String DELETED_FILE
public static final int STATE_NEW
public static final int STATE_CREATED
public static final int STATE_DELETED
| Method Detail |
|---|
public String toString()
toString in class Object
public static SegmentInfo newSharedSegmentInfo(String name,
long version,
boolean localStructuredStorage,
String searchIndexDirectory)
public static SegmentInfo newLocalSegmentInfo(File file,
boolean localStructuredStorage,
String searchIndexDirectory)
public static SegmentInfo newLocalSegmentInfo(SegmentInfo recoverSegInfo)
recoverSegInfo -
public void setInDb(boolean b)
public String getName()
SegmentInfo
getName in interface SegmentInfopublic boolean isInDb()
SegmentInfo
isInDb in interface SegmentInfopublic long getVersion()
SegmentInfo
getVersion in interface SegmentInfopublic void setVersion(long l)
SegmentInfo
setVersion in interface SegmentInfopublic void setState(int state)
public int getState()
public File getSegmentLocation()
SegmentInfo
getSegmentLocation in interface SegmentInfo
public static File getSegmentLocation(String name,
boolean structured,
String searchIndexDirectory)
public void setNew()
SegmentInfo
setNew in interface SegmentInfopublic void setCreated()
SegmentInfo
setCreated in interface SegmentInfopublic void setDeleted()
SegmentInfo
setDeleted in interface SegmentInfopublic boolean isNew()
public boolean isCreated()
SegmentInfo
isCreated in interface SegmentInfopublic boolean isDeleted()
SegmentInfo
isDeleted in interface SegmentInfo
public void setTimeStamp(long l)
throws IOException
setTimeStamp in interface SegmentInfol -
IOExceptionpublic boolean isClusterSegment()
SegmentInfo
isClusterSegment in interface SegmentInfo
public boolean checkSegmentValidity(boolean logging,
String message)
checkSegmentValidity in interface SegmentInfosegmentName -
Exception
IOExceptionpublic long getLocalSegmentLastModified()
SegmentInfo
getLocalSegmentLastModified in interface SegmentInfopublic long getLocalSegmentSize()
SegmentInfo
getLocalSegmentSize in interface SegmentInfopublic long getTotalSize()
SegmentInfo
getTotalSize in interface SegmentInfo
public void touchSegment()
throws IOException
SegmentInfo
touchSegment in interface SegmentInfoIOExceptionpublic long getSize()
SegmentInfo
getSize in interface SegmentInfopublic void loadSize()
SegmentInfo
loadSize in interface SegmentInfopublic void doFinalDelete()
SegmentInfo
doFinalDelete in interface SegmentInfopublic static void deleteAll(File f)
f - public boolean isLocalLock()
SegmentInfo
isLocalLock in interface SegmentInfopublic void lockLocalSegment()
SegmentInfo
lockLocalSegment in interface SegmentInfopublic void unlockLocalSegment()
SegmentInfo
unlockLocalSegment in interface SegmentInfopublic void debugSegment(String message)
debugSegment in interface SegmentInfo
public void compareTo(String message,
SegmentInfo compare)
SegmentInfo
compareTo in interface SegmentInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||