|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sakaiproject.search.index.impl.JDBCClusterIndexStore
public class JDBCClusterIndexStore
This is a JDBC implementation of the ClusterFilesystem. It syncronizes the local search index segments with the database, by sipping each segment and pushing it to the database. Each Segment has an extra file that contains an MD5 of the segment and a time stamp of the last update. If any segments are missing in the local segment store (including no segments at all, as with a new cluster node) the missing segments are downloaded from the JDBC store. If any of the segments on the local store are found to be dammaged they are reloaded from the database.
| Constructor Summary | |
|---|---|
JDBCClusterIndexStore()
|
|
| Method Summary | |
|---|---|
boolean |
centralIndexExists()
A low cost reliable mechanism for determining if an index exists in the cluster |
void |
dolog(String message)
|
DataSource |
getDataSource()
|
long |
getLastUpdate()
|
List<SegmentInfo> |
getLocalSegments()
get a list of local segments |
List<SegmentInfo> |
getLocalSegments(File searchDir,
List<SegmentInfo> l)
recurse into a list of segments |
void |
getLock()
if the thread already has a lock ignore get a lock on the index so that it can be updated this should block untill a lock becomes free |
SearchService |
getSearchService()
|
List<Object[]> |
getSegmentInfoList()
|
long |
getSegmentInfoList(File searchDir,
List<Object[]> seginfo)
|
String |
getSegmentName(String segmentPath)
|
String |
getSharedSegments()
|
File |
getTemporarySegment(boolean delete)
create a temporary index for indexing operations |
void |
init()
|
boolean |
isLocalSegmentsOnly()
|
boolean |
isLocalStructuredStorage()
|
boolean |
isMultipleIndexers()
can the Cluster Filesystem cope with multiple indexers running at the same time |
boolean |
isParallelIndex()
|
boolean |
isSharedStructuredStorage()
|
boolean |
isValidate()
|
SegmentInfo |
newSegment()
create a new local segment and mark its tiestamp |
void |
recoverSegment(SegmentInfo recoverSegInfo)
Recover a dammaged segment from the DB |
void |
releaseLock()
release the lock, only if there is one this should block untill a lock becomes free |
void |
removeLocalSegment(SegmentInfo rmsi)
remove a local segment |
void |
removeTemporarySegment()
removes the temporary segment |
List<SegmentInfo> |
saveAllSegments()
Forces all segments from this system into the DB, does not delete any inthe db. |
List<SegmentInfo> |
saveSegments()
save the local segments to the DB |
SegmentInfo |
saveTemporarySegment()
Save the temporary segment into a permanent segment |
void |
setAutoDdl(boolean autoDdl)
|
void |
setDataSource(DataSource dataSource)
|
void |
setLocalSegmentsOnly(boolean localSegmentsOnly)
|
void |
setLocalStructuredStorage(boolean localStructuredStorage)
|
void |
setLocation(String location)
set the location information for the cluster file store |
void |
setParallelIndex(boolean parallelIndex)
|
void |
setSearchService(SearchService searchService)
|
void |
setSharedSegments(String sharedSegments)
|
void |
setSharedStructuredStorage(boolean sharedStructuredStorage)
|
void |
setValidate(boolean validate)
|
protected void |
updateDBPatch(Connection connection)
|
protected void |
updateDBPatchBLOB(Connection connection)
updat this save this local segment into the db |
protected void |
updateDBPatchFilesystem(Connection connection)
updat this save this local segment into the db |
protected void |
updateDBSegment(Connection connection,
SegmentInfo addsi)
|
protected void |
updateDBSegmentBLOB(Connection connection,
SegmentInfo addsi)
updat this save this local segment into the db |
protected void |
updateDBSegmentFilesystem(Connection connection,
SegmentInfo addsi)
updat this save this local segment into the db |
protected void |
updateLocalPatch(Connection connection)
|
protected void |
updateLocalPatchFilesystem(Connection connection)
|
protected void |
updateLocalSegment(Connection connection,
SegmentInfo addsi)
|
protected void |
updateLocalSegmentBLOB(Connection connection,
SegmentInfo addsi)
updte a segment from the database |
protected void |
updateLocalSegmentFilesystem(Connection connection,
SegmentInfo addsi)
updte a segment from the database |
List<SegmentInfo> |
updateSegments()
Ther might need to be some locking here. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCClusterIndexStore()
| Method Detail |
|---|
public void init()
public List<SegmentInfo> updateSegments()
updateSegments in interface ClusterFilesystemlocked - A locak has been taken on the index
public List<SegmentInfo> saveSegments()
saveSegments in interface ClusterFilesystempublic List<SegmentInfo> saveAllSegments()
ClusterFilesystem
saveAllSegments in interface ClusterFilesystem
protected void updateLocalSegment(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
SQLException
IOException
protected void updateLocalSegmentBLOB(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
connection - addsi -
SQLException
IOExceptionpublic void removeLocalSegment(SegmentInfo rmsi)
removeLocalSegment in interface ClusterFilesystemrmsi -
protected void updateDBPatch(Connection connection)
throws SQLException,
IOException
SQLException
IOException
protected void updateDBPatchBLOB(Connection connection)
throws SQLException,
IOException
connection - addsi -
SQLException
IOException
protected void updateDBPatchFilesystem(Connection connection)
throws SQLException,
IOException
connection - addsi -
SQLException
IOException
protected void updateDBSegment(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
SQLException
IOException
protected void updateDBSegmentBLOB(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
connection - addsi -
SQLException
IOException
public SegmentInfo newSegment()
throws IOException
newSegment in interface ClusterFilesystemIOException
public List<SegmentInfo> getLocalSegments()
throws IOException
IOException
public List<SegmentInfo> getLocalSegments(File searchDir,
List<SegmentInfo> l)
throws IOException
searchDir - l -
IOExceptionpublic DataSource getDataSource()
public void setDataSource(DataSource dataSource)
dataSource - The dataSource to set.public void setLocation(String location)
ClusterFilesystem
setLocation in interface ClusterFilesystempublic void setAutoDdl(boolean autoDdl)
autoDdl - The autoDdl to set.public File getTemporarySegment(boolean delete)
getTemporarySegment in interface ClusterFilesystemdelete - if true the temp index will be deleted first, there is only 1 temp
index per location
public void removeTemporarySegment()
ClusterFilesystem
removeTemporarySegment in interface ClusterFilesystem
public SegmentInfo saveTemporarySegment()
throws IOException
ClusterFilesystem
saveTemporarySegment in interface ClusterFilesystemIOExceptionpublic void recoverSegment(SegmentInfo recoverSegInfo)
ClusterFilesystem
recoverSegment in interface ClusterFilesystem
protected void updateLocalPatch(Connection connection)
throws SQLException,
IOException
SQLException
IOException
protected void updateLocalPatchFilesystem(Connection connection)
throws SQLException,
IOException
SQLException
IOExceptionpublic String getSegmentName(String segmentPath)
public boolean isValidate()
public void setValidate(boolean validate)
validate - The validate to set.
protected void updateDBSegmentFilesystem(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
connection - addsi -
SQLException
IOException
protected void updateLocalSegmentFilesystem(Connection connection,
SegmentInfo addsi)
throws SQLException,
IOException
connection - addsi -
SQLException
IOExceptionpublic String getSharedSegments()
public void setSharedSegments(String sharedSegments)
public void dolog(String message)
public long getLastUpdate()
getLastUpdate in interface ClusterFilesystempublic List<Object[]> getSegmentInfoList()
getSegmentInfoList in interface ClusterFilesystem
public long getSegmentInfoList(File searchDir,
List<Object[]> seginfo)
public void getLock()
throws IOException
ClusterFilesystem
getLock in interface ClusterFilesystemIOExceptionpublic void releaseLock()
ClusterFilesystem
releaseLock in interface ClusterFilesystempublic boolean isMultipleIndexers()
ClusterFilesystem
isMultipleIndexers in interface ClusterFilesystempublic boolean isParallelIndex()
public void setParallelIndex(boolean parallelIndex)
public boolean isLocalStructuredStorage()
public void setLocalStructuredStorage(boolean localStructuredStorage)
localStructuredStorage - The localStructuredStorage to set.public boolean isSharedStructuredStorage()
public void setSharedStructuredStorage(boolean sharedStructuredStorage)
sharedStructuredStorage - The sharedStructuredStorage to set.public boolean isLocalSegmentsOnly()
public void setLocalSegmentsOnly(boolean localSegmentsOnly)
localSegmentsOnly - the localSegmentsOnly to setpublic SearchService getSearchService()
public void setSearchService(SearchService searchService)
searchService - the searchService to setpublic boolean centralIndexExists()
ClusterFilesystem
centralIndexExists in interface ClusterFilesystem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||