[JDEV] Scaling 1.4.2 with xdb_file... And the patch
ralphs at blueairnetworks.com
Thu Feb 27 17:06:39 CST 2003
Mike Prince wrote:
> I've included the patched xdb_file for those stuck in 1.4.2 land and are
> so inclined. To use the patch just drop in it and compile. It WILL NOT
> reorg your existing file store (you'll have to write a script to move
> the files around). The new directory is arranged as
> ./spool/hostname/m/me/mike.xml where the first fanout directory under
> hostname is the first character of the username, and the second fanout
> directory is the first and the last characters of the username. Pretty
Great, though a diff would be perferable - in case one has other changes
in the xdb_file.c!
Here's a little one-liner shell script you can use to re-arrange all the
data files in your spool directory. It should be run from the spool
directory (ie. "cd /var/spool/jabber" or wherever).
ls *.xml | perl -n -e 'chomp; /^(.)(.)/; mkdir $1 unless -d $1;
mkdir "$1/$1$2\n" unless -d "$1/$1$2"; rename $_, "$1/$1$2/$_";'
To "undo" you can simply swap the order of the arguments to rename.
More information about the JDev