2012-11-08 16:52:37 +00:00
|
|
|
#
|
|
|
|
# Dedupe, Delta et al.
|
|
|
|
#
|
|
|
|
echo "#################################################"
|
|
|
|
echo "# Test Deduplication, Delta Encoding and LZP"
|
|
|
|
echo "#################################################"
|
|
|
|
|
|
|
|
for algo in lzfx lz4 adapt
|
|
|
|
do
|
2013-01-02 17:26:21 +00:00
|
|
|
for tf in `cat files.lst`
|
2012-11-08 16:52:37 +00:00
|
|
|
do
|
2013-01-02 17:26:21 +00:00
|
|
|
rm -f ${tf}.*
|
2013-09-01 09:32:28 +00:00
|
|
|
for feat in "-D" "-D -B3 -L" "-D -B4 -E" "-D -B0 -EE" "-D -B5 -EE -L" "-D -B2" "-P" "-D -P" "-D -L -P" \
|
2013-04-26 13:02:00 +00:00
|
|
|
"-G -D" "-G -F" "-G -L -P" "-G -B2"
|
2012-11-08 16:52:37 +00:00
|
|
|
do
|
2013-09-01 09:32:28 +00:00
|
|
|
for seg in 2m 11m
|
2012-11-08 16:52:37 +00:00
|
|
|
do
|
|
|
|
cmd="../../pcompress -c ${algo} -l 3 -s ${seg} $feat ${tf}"
|
|
|
|
echo "Running $cmd"
|
|
|
|
eval $cmd
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
2013-01-02 18:57:18 +00:00
|
|
|
echo "FATAL: Compression errored."
|
|
|
|
rm -f ${tf}.pz
|
|
|
|
continue
|
2012-11-08 16:52:37 +00:00
|
|
|
fi
|
|
|
|
cmd="../../pcompress -d ${tf}.pz ${tf}.1"
|
|
|
|
echo "Running $cmd"
|
|
|
|
eval $cmd
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
2013-01-02 18:57:18 +00:00
|
|
|
echo "FATAL: Decompression errored."
|
|
|
|
rm -f ${tf}.pz ${tf}.1
|
|
|
|
continue
|
2012-11-08 16:52:37 +00:00
|
|
|
fi
|
|
|
|
|
2012-11-09 14:35:13 +00:00
|
|
|
diff ${tf} ${tf}.1 > /dev/null
|
|
|
|
if [ $? -ne 0 ]
|
2012-11-08 16:52:37 +00:00
|
|
|
then
|
2012-12-08 08:49:01 +00:00
|
|
|
echo "FATAL: Decompression was not correct"
|
2012-11-08 16:52:37 +00:00
|
|
|
fi
|
|
|
|
rm -f ${tf}.pz ${tf}.1
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2013-05-07 17:00:36 +00:00
|
|
|
#
|
|
|
|
# Test Segmented Global Dedupe
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "#################################################"
|
|
|
|
echo "# Test Segmented Global Deduplication"
|
|
|
|
echo "#################################################"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Select a large file from the list
|
|
|
|
#
|
|
|
|
tstf=
|
|
|
|
tsz=0
|
|
|
|
for tf in `cat files.lst`
|
|
|
|
do
|
|
|
|
sz=`ls -l ${tf} | awk '{ print $5 }'`
|
|
|
|
if [ $sz -gt $tsz ]
|
|
|
|
then
|
|
|
|
tsz=$sz
|
|
|
|
tstf="$tf"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Compute minimum index memory needed for segmented dedupe
|
|
|
|
# sizeof (hash_entry_t) = 20 + sizeof (CRC64) = 28
|
|
|
|
# Each hashtable slot ptr = 8bytes
|
|
|
|
# Total: 28 + 8 = 36
|
|
|
|
# Segment size = 833848
|
|
|
|
# 25 Similarity indicators per segment, each needing one hash_entry_t
|
|
|
|
#
|
|
|
|
nsegs=$((tsz / 833848 + 1))
|
|
|
|
nmem=$((nsegs * 25 * 36))
|
|
|
|
mem_mb=$((nmem / 1048576 + 1))
|
|
|
|
|
|
|
|
#
|
|
|
|
# Now run Global Dedupe with index memory set to force segmented dedupe mechanism
|
|
|
|
#
|
|
|
|
export PCOMPRESS_INDEX_MEM=${mem_mb}
|
|
|
|
cmd="../../pcompress -G -c lz4 -l1 -P -s50m $tstf"
|
|
|
|
echo "Running $cmd"
|
|
|
|
eval $cmd
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "FATAL: Compression errored."
|
|
|
|
rm -f ${tstf}.pz
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
cmd="../../pcompress -d ${tstf}.pz ${tstf}.1"
|
|
|
|
echo "Running $cmd"
|
|
|
|
eval $cmd
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "FATAL: Decompression errored."
|
|
|
|
rm -f ${tstf}.pz ${tstf}.1
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
diff ${tstf} ${tstf}.1 > /dev/null
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo "FATAL: Decompression was not correct"
|
|
|
|
fi
|
|
|
|
rm -f ${tstf}.pz ${tstf}.1
|
|
|
|
|
2012-11-08 16:52:37 +00:00
|
|
|
echo "#################################################"
|
|
|
|
echo ""
|
|
|
|
|