xtreemfs/bin/xtfs_benchmark
2020-09-22 02:25:22 +02:00

55 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
# exec $JAVA_HOME/bin/java -Dcom.sun.sdp.conf=$XTREEMFS/sdp.conf -Dcom.sun.sdp.debug=sdp.log -Djava.net.preferIPv4Stack=true -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
# org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*
# exec $JAVA_HOME/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=3128 -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
# org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*