@ -59,7 +59,7 @@ public class kelondroCollectionIndex {
private final int keylength ;
private final File path ;
private final String filenameStub ;
private final File commonsPath 1 ;
private final File commonsPath ;
private final int loadfactor ;
private Map < String , kelondroFixedWidthArray > arrays ; // Map of (partitionNumber"-"chunksize)/kelondroFixedWidthArray - Objects
private final kelondroRow payloadrow ; // definition of the payload (chunks inside the collections)
@ -123,11 +123,11 @@ public class kelondroCollectionIndex {
this . loadfactor = loadfactor ;
this . maxPartitions = maxpartitions ;
File cop = new File ( path , filenameStub + "." + fillZ ( Integer . toHexString ( rowdef . objectsize ) . toUpperCase ( ) , 4 ) + ".commons" ) ;
this . commonsPath 1 = ( useCommons ) ? cop : null ;
if ( this . commonsPath 1 = = null ) {
this . commonsPath = ( useCommons ) ? cop : null ;
if ( this . commonsPath = = null ) {
serverFileUtils . deleteDirectory ( cop ) ;
} else {
this . commonsPath 1 . mkdirs ( ) ;
this . commonsPath . mkdirs ( ) ;
}
final File f = new File ( path , filenameStub + ".index" ) ;
@ -645,12 +645,12 @@ public class kelondroCollectionIndex {
serverLog . logInfo ( "kelondroCollectionIndex" , "shrinked common word " + new String ( key ) + "; old size = " + oldsize + ", new size = " + collection . size ( ) + ", maximum size = " + targetSize + ", newcommon size = " + newcommon . size ( ) + ", first newcommon = " + firstnewcommon ) ;
// finally dump the removed entries to a file
if ( commonsPath 1 ! = null ) {
if ( commonsPath ! = null ) {
newcommon . sort ( ) ;
final SimpleDateFormat formatter = new SimpleDateFormat ( "yyyyMMddHHmmss" ) ;
formatter . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) ) ;
final String filename = serverCodings . encodeHex ( kelondroBase64Order . enhancedCoder . decode ( new String ( key ) , "de.anomic.kelondro.kelondroCollectionIndex.shrinkCollection(...)" ) ) + "_" + formatter . format ( new Date ( ) ) + ".collection" ;
final File storagePath = new File ( commonsPath 1 , filename . substring ( 0 , 2 ) ) ; // make a subpath
final File storagePath = new File ( commonsPath , filename . substring ( 0 , 2 ) ) ; // make a subpath
storagePath . mkdirs ( ) ;
final File file = new File ( storagePath , filename ) ;
try {