Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/voldemort/voldemort
Browse files Browse the repository at this point in the history
  • Loading branch information
ctasada committed Oct 18, 2012
2 parents 8b961a7 + 922ec3a commit a235956
Show file tree
Hide file tree
Showing 110 changed files with 13,592 additions and 1,582 deletions.
7 changes: 5 additions & 2 deletions .classpath
Expand Up @@ -51,8 +51,11 @@
<classpathentry kind="lib" path="lib/libthrift-0.5.0.jar"/>
<classpathentry kind="lib" path="lib/compress-lzf-0.9.1.jar"/>
<classpathentry kind="lib" path="lib/snappy-0.2.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.1.2.jar" />
<classpathentry kind="lib" path="lib/httpcore-4.1.2.jar" />
<classpathentry kind="lib" path="lib/httpclient-4.1.2.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.1.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/joda-time-1.6.jar"/>
<classpathentry kind="lib" path="lib/mail-1.4.1.jar"/>
<classpathentry kind="lib" path="lib/azkaban-common-0.05.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
8 changes: 4 additions & 4 deletions .settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
#Fri Dec 30 14:37:10 PST 2011
#Thu Aug 30 10:43:57 PDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
Expand All @@ -11,9 +11,9 @@ org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand Down Expand Up @@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=82
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=82
Expand Down
4 changes: 2 additions & 2 deletions META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.8-b03-424 (Apple Inc.)
Created-By: 20.2-b06 (Sun Microsystems Inc.)
Implementation-Title: Voldemort
Implementation-Version: 0.90.1
Implementation-Version: 0.96
Implementation-Vendor: LinkedIn

93 changes: 93 additions & 0 deletions bin/repeat-junit-test.sh
@@ -0,0 +1,93 @@
#!/bin/bash -e

# Copyright 2012 LinkedIn, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

usage() {
echo
echo "Usage:"
echo "bin/repeat-junit-test.sh test_file num_times"
echo
cat <<EOF
Invoke bin/repeat-junit-test.sh from the root of a Voldemort
checkout. bin/repeat-junit-test.sh invokes 'ant junit-test' num_times
for test test_name.
The argument num_times must be an integer. The argument test_name must
be a class name suitable for 'ant junit-test'. I.e., a fully qualified
java class name. Remember, the class name does not include the .java
extension. An example test_name is voldemort.utils.ServerTestUtilsTest.
The pretty html junit output that ends up in dist/junit-single-report
on a single invocation of 'ant junit-test' is collected in a temp
directory. This circumvents the normal behavior of ant in which
dist/junit-single-report is overwritten with each invocation of 'ant
junit-test'.
bin/repeat-junit-test.sh is useful to run after adding a new test
case, or when trying to reproduce intermittent failures of a specific
test.
EOF
}

if [ $# != 2 ]; then
echo "ERROR: Incorrect number of arguments: $# provided, 2 needed." >&2
usage
exit 1
fi

TESTNAME=$1
# Hackish test that makes sure some java file exists for given
# testname. No guarantee that junit-test can run the specified test,
# but at least protects against typos.
FILENAME=`echo $TESTNAME | sed 's/.*\.//g'`.java
FINDFILE=`find . -name "$FILENAME" | wc -l`
if [[ $FINDFILE == 0 ]]
then
echo "ERROR: Did not find an appropriate file (with name $FILENAME), given test name $TESTNAME." >&2
usage
exit 1
fi


NUMTIMES=$2
if [[ ! $NUMTIMES == +([0-9]) ]]
then
echo "ERROR: argument num_times is not an integer: $NUMTIMES." >&2
usage
exit 1
fi

TMPDIR=`mktemp -d -p '/tmp/'`

for ((i=1;i<=$NUMTIMES;i++)); do
echo
echo "STARTING ITERATION $i"
echo

# Run junit-test and capture stdout to .out and stderr to .err
junitiout="$TMPDIR/TEST-$TESTNAME-$i.out"
junitierr="$TMPDIR/TEST-$TESTNAME-$i.err"
ant junit-test -Dtest.name=$TESTNAME > >(tee $junitiout) 2> >(tee $junitierr >&2)

# Collect results
junitidir="$TMPDIR/junit-single-report-$TESTNAME-$i"
echo
echo "COLLECTING RESULTS OF ITERATION $i IN $junitidir"
cp -r dist/junit-single-reports $junitidir
mv $junitiout $junitidir
mv $junitierr $junitidir
done


75 changes: 75 additions & 0 deletions bin/repeat-junit.sh
@@ -0,0 +1,75 @@
#!/bin/bash -e

# Copyright 2012 LinkedIn, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

usage() {
echo
echo "Usage:"
echo "bin/repeat-junit.sh num_times"
echo
cat <<EOF
Invoke bin/repeat-junit.sh from the root of a Voldemort
checkout. bin/repeat-junit.sh invokes 'ant junit' num_times.
The argument num_times must be an integer.
The pretty html junit output that ends up in dist/junit-reports on a
single invocation of 'ant junit' is collected in a temp
directory. This circumvents the normal behavior of ant in which
dist/junit-reports is overwritten with each invocation of 'ant
junit'.
bin/repeat-junit.sh is useful to run after making some substantial
changes, or when trying to track down intermittent failures (that
occur more on your local box then on a Hudson test machine...).
EOF
}

if [ $# != 1 ]; then
echo "ERROR: Incorrect number of arguments: $# provided, 1 needed." >&2
usage
exit 1
fi

NUMTIMES=$1
if [[ ! $NUMTIMES == +([0-9]) ]]
then
echo "ERROR: argument num_times is not an integer: $NUMTIMES." >&2
usage
exit 1
fi

TMPDIR=`mktemp -d -p '/tmp/'`

for ((i=1;i<=$NUMTIMES;i++)); do
echo
echo "STARTING ITERATION $i"
echo

# Run junit and capture stdout to .out and stderr to .err
junitiout="$TMPDIR/junit-$i.out"
junitierr="$TMPDIR/junit-$i.err"
ant junit > >(tee $junitiout) 2> >(tee $junitierr >&2)

# Collect results
junitidir="$TMPDIR/junit-reports-$i"
echo
echo "COLLECTING RESULTS OF ITERATION $i IN $junitidir"
cp -r dist/junit-reports $junitidir
mv $junitiout $junitidir
mv $junitierr $junitidir
done


4 changes: 3 additions & 1 deletion build.properties
Expand Up @@ -14,6 +14,8 @@ inttestsrc.dir=test/integration
testclasses.dir=dist/testclasses
testreport.dir=dist/junit-reports
testhtml.dir=dist/junit-reports/html
singletestreport.dir=dist/junit-single-reports
singletesthtml.dir=dist/junit-single-reports/html
longtestreport.dir=dist/junit-long-reports
longtesthtml.dir=dist/junit-long-reports/html

Expand All @@ -40,4 +42,4 @@ tomcat.context=/voldemort
javac.version=1.5

## Release
curr.release=0.96
curr.release=1.0.0
27 changes: 19 additions & 8 deletions build.xml
Expand Up @@ -222,7 +222,7 @@
<target name="contrib-junit" depends="contrib-jar" description="Run contrib junit tests except EC2 and Krati tests.">
<replace-dir dir="${contribtestreport.dir}" />
<replace-dir dir="${contribtesthtml.dir}" />
<junit printsummary="yes" maxmemory="1024m" showoutput="true" failureProperty="test.failure">
<junit printsummary="yes" maxmemory="2048m" showoutput="true" failureProperty="test.failure">
<classpath refid="contrib-test-classpath" />
<formatter type="xml" />
<batchtest fork="yes" todir="${contribtestreport.dir}">
Expand All @@ -249,7 +249,7 @@
</copy>
<replace-dir dir="${contribtestreport.dir}" />
<replace-dir dir="${contribtesthtml.dir}" />
<junit printsummary="yes" maxmemory="1024m" showoutput="true" failureProperty="test.failure">
<junit printsummary="yes" maxmemory="2048m" showoutput="true" failureProperty="test.failure">
<syspropertyset>
<propertyref prefix="ec2" />
</syspropertyset>
Expand Down Expand Up @@ -381,7 +381,7 @@
<target name="junit" depends="build, buildtest" description="Run junit tests.">
<replace-dir dir="${testreport.dir}" />
<replace-dir dir="${testhtml.dir}" />
<junit printsummary="yes" showoutput="true" maxmemory="1024m">
<junit printsummary="yes" showoutput="true" maxmemory="2048m" timeout="1200000">
<classpath refid="test-classpath" />
<formatter type="xml" />
<batchtest fork="yes" todir="${testreport.dir}">
Expand All @@ -402,10 +402,10 @@
<target name="junit-long" depends="build, buildtest, junit" description="Run long junit tests that uses larger data sets than normal junit tests.">
<replace-dir dir="${longtestreport.dir}" />
<replace-dir dir="${longtesthtml.dir}" />
<junit printsummary="yes" showoutput="true" maxmemory="1024m">
<junit printsummary="yes" showoutput="true" maxmemory="2048m" fork="yes" timeout="5400000">
<classpath refid="test-classpath" />
<formatter type="xml" />
<batchtest fork="yes" todir="${longtestreport.dir}">
<batchtest todir="${longtestreport.dir}">
<fileset dir="${longtestsrc.dir}">
<include name="**/*Test.java" />
</fileset>
Expand All @@ -419,11 +419,22 @@
</junitreport>
</target>

<target name="junit-test" depends="build, buildtest, contrib-jar" description="Run single junit test with -Dtest.name=">
<junit printsummary="yes" showoutput="true" maxmemory="1024m">
<target name="junit-test" depends="build, buildtest, contrib-jar" description="Run single junit test for class ClassName with -Dtest.name=[ClassName] (Note: Use the class name, not the file name with the .java extension)">
<replace-dir dir="${singletestreport.dir}" />
<replace-dir dir="${singletesthtml.dir}" />
<junit printsummary="on" showoutput="true" maxmemory="2048m">
<classpath refid="contrib-test-classpath" />
<test name="${test.name}" />
<classpath path="${log4j.properties.dir}" />
<formatter type="plain" />
<formatter type="xml" />
<test name="${test.name}" todir="${singletestreport.dir}"/>
</junit>
<junitreport todir="${singletesthtml.dir}">
<fileset dir="${singletestreport.dir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${singletesthtml.dir}" format="frames" />
</junitreport>
</target>

<target name="junit-all" depends="junit-long, contrib-junit" description="Run All junit tests including contrib.">
Expand Down
57 changes: 39 additions & 18 deletions config/single_node_cluster/config/stores.xml
@@ -1,18 +1,39 @@
<stores>
<store>
<name>test</name>
<persistence>bdb</persistence>
<description>Test store</description>
<owners> harry@hogwarts.edu, hermoine@hogwarts.edu </owners>
<routing>client</routing>
<replication-factor>1</replication-factor>
<required-reads>1</required-reads>
<required-writes>1</required-writes>
<key-serializer>
<type>string</type>
</key-serializer>
<value-serializer>
<type>string</type>
</value-serializer>
</store>
</stores>
<stores>
<store>
<name>test</name>
<persistence>bdb</persistence>
<description>Test store</description>
<owners>harry@hogwarts.edu, hermoine@hogwarts.edu</owners>
<routing-strategy>consistent-routing</routing-strategy>
<routing>client</routing>
<replication-factor>1</replication-factor>
<required-reads>1</required-reads>
<required-writes>1</required-writes>
<key-serializer>
<type>string</type>
</key-serializer>
<value-serializer>
<type>string</type>
</value-serializer>
</store>
<store>
<name>test-evolution</name>
<persistence>bdb</persistence>
<description>Test store</description>
<owners>harry@hogwarts.edu, hermoine@hogwarts.edu</owners>
<routing-strategy>consistent-routing</routing-strategy>
<routing>client</routing>
<replication-factor>1</replication-factor>
<required-reads>1</required-reads>
<required-writes>1</required-writes>
<key-serializer>
<type>string</type>
</key-serializer>
<value-serializer>
<type>avro-generic-versioned</type>
<schema-info version="0">{"type": "record", "name": "myrec","fields": [{ "name": "original", "type": "string" }]}</schema-info>
<schema-info version="1">{"type": "record", "name": "myrec","fields": [{ "name": "original", "type": "string" }, { "name": "new-field", "type": "string", "default":"" }]}</schema-info>
</value-serializer>
</store>

</stores>

0 comments on commit a235956

Please sign in to comment.