protectedStringfilename;// the database's file name
protectedkelondroRAentryFile;// the database file
protectedkelondroRAentryFile;// the database file
privateintoverhead;// OHBYTEC + 4 * OHHANDLEC = size of additional control bytes
privateintoverhead;// OHBYTEC + 4 * OHHANDLEC = size of additional control bytes
privateintrecordsize;// (overhead + sum(all: COLWIDTHS)) = the overall size of a record
privateintrecordsize;// (overhead + sum(all: COLWIDTHS)) = the overall size of a record
@ -429,15 +429,15 @@ public class kelondroRecords {
// the parentNode can be given if an auto-fix in the following case is wanted
// the parentNode can be given if an auto-fix in the following case is wanted
if(handle.index>USEDC+FREEC){
if(handle.index>USEDC+FREEC){
if(parentNode==null){
if(parentNode==null){
thrownewIllegalArgumentException("INTERNAL ERROR: node handle index exceeds size. No auto-fix node was submitted. This is a serious failure.");
thrownewkelondroException(filename,"INTERNAL ERROR: node handle index exceeds size. No auto-fix node was submitted. This is a serious failure.");
}else{
}else{
try{
try{
Handle[]handles=parentNode.getOHHandle();
Handle[]handles=parentNode.getOHHandle();
handles[referenceInParent]=null;
handles[referenceInParent]=null;
parentNode.setOHHandle(handles);
parentNode.setOHHandle(handles);
thrownewIllegalArgumentException("INTERNAL ERROR: node handle index exceeds size. The bad node has been auto-fixed");
thrownewkelondroException(filename,"INTERNAL ERROR: node handle index exceeds size. The bad node has been auto-fixed");
}catch(IOExceptionee){
}catch(IOExceptionee){
thrownewIllegalArgumentException("INTERNAL ERROR: node handle index exceeds size. It was tried to fix the bad node, but failed with an IOException: "+ee.getMessage());
thrownewkelondroException(filename,"INTERNAL ERROR: node handle index exceeds size. It was tried to fix the bad node, but failed with an IOException: "+ee.getMessage());
}
}
}
}
}
}
@ -451,13 +451,13 @@ public class kelondroRecords {
}
}
protectedHandlehandle(){
protectedHandlehandle(){
// if this entry has an index, return it
// if this entry has an index, return it
if(this.handle.index==NUL)thrownewIllegalStateException("the entry has no index assigned");
if(this.handle.index==NUL)thrownewkelondroException(filename,"the entry has no index assigned");
@ -154,10 +160,10 @@ public class plasmaWordIndexFileCache {
row[1][0]=(byte)entries;
row[1][0]=(byte)entries;
try{
try{
indexCache.put(row);
indexCache.put(row);
}catch(IllegalArgumentException e){
}catch(kelondroException e){
// this is a very bad case; a database inconsistency occurred
// this is a very bad case; a database inconsistency occurred
deleteComplete(wordHash);
deleteComplete(wordHash);
System.out.println("fatal error in plasmaWordIndexFileCacle.addEntriesToIndex: write to word hash file "+wordHash+" failed - "+e.getMessage());
System.out.println("fatal error in plasmaWordIndexFileCacle.addEntriesToIndex: write to word hash file "+wordHash+" failed - "+e.getMessage()+" - index deleted.");