Skip to content

Commit

Permalink
fix/jmh conflict unittest (#71)
Browse files Browse the repository at this point in the history
* (fix) isolate jmh and unit_test #69

* (fix) update maven-compiler-plugin version to 3.8.0 #69

* (fix) update maven-compiler-plugin version to 3.8.0 #69

* (fix) recover jmh code
  • Loading branch information
fengjiachun authored and killme2008 committed Mar 28, 2019
1 parent 802310d commit f2e9d8b
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 55 deletions.
19 changes: 9 additions & 10 deletions jraft-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<name>jraft-core ${project.version}</name>

<dependencies>

<!-- junit -->
<dependency>
<groupId>junit</groupId>
Expand All @@ -24,18 +23,15 @@
<artifactId>junit-dep</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>

<!-- rocksdb-->
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
</dependency>

<!-- mock -->
<dependency>
<groupId>org.mockito</groupId>
Expand All @@ -47,13 +43,11 @@
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>

<!-- log -->
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -75,7 +69,6 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
</dependency>

<dependency>
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
Expand All @@ -84,7 +77,6 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>

<!-- commons -->
<dependency>
<groupId>commons-io</groupId>
Expand All @@ -94,7 +86,6 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>

<!-- bolt -->
<dependency>
<groupId>com.alipay.sofa</groupId>
Expand All @@ -104,11 +95,19 @@
<groupId>com.alipay.sofa</groupId>
<artifactId>hessian</artifactId>
</dependency>

<!-- metrics -->
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
<!-- benchmark -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.common;
package com.alipay.sofa.jraft.util;

import java.util.concurrent.TimeUnit;

Expand All @@ -30,8 +30,6 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;

import com.alipay.sofa.jraft.util.AsciiStringUtil;

/**
* @author jiachun.fjc
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.common;
package com.alipay.sofa.jraft.util;

import java.nio.charset.StandardCharsets;
import java.util.UUID;
Expand All @@ -33,9 +33,6 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;

import com.alipay.sofa.jraft.util.BytesUtil;
import com.alipay.sofa.jraft.util.Utils;

/**
* @author jiachun.fjc
*/
Expand Down
9 changes: 0 additions & 9 deletions jraft-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@
<artifactId>log4j-jcl</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- benchmark -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions jraft-rheakv/rheakv-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,14 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
<!-- benchmark -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv;
package com.alipay.sofa.jraft.rhea.benchmark;

import java.util.concurrent.ThreadLocalRandom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.raw;
package com.alipay.sofa.jraft.rhea.benchmark.raw;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.raw;
package com.alipay.sofa.jraft.rhea.benchmark.raw;

import java.util.concurrent.TimeUnit;

Expand All @@ -34,8 +34,8 @@

import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.raw;
package com.alipay.sofa.jraft.rhea.benchmark.raw;

import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
Expand All @@ -38,9 +38,9 @@
import com.alipay.sofa.jraft.rhea.util.Lists;
import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.raw;
package com.alipay.sofa.jraft.rhea.benchmark.raw;

import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
Expand All @@ -35,9 +35,9 @@

import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.raw;
package com.alipay.sofa.jraft.rhea.benchmark.raw;

import java.io.File;
import java.io.FileOutputStream;
Expand All @@ -33,8 +33,8 @@
import com.alipay.sofa.jraft.rhea.util.ZipUtil;
import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.rhea;
package com.alipay.sofa.jraft.rhea.benchmark.rhea;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.rhea;
package com.alipay.sofa.jraft.rhea.benchmark.rhea;

import java.io.IOException;
import java.util.List;
Expand All @@ -35,14 +35,14 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;

import com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil;
import com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil;
import com.alipay.sofa.jraft.rhea.client.RheaKVStore;
import com.alipay.sofa.jraft.rhea.storage.KVEntry;
import com.alipay.sofa.jraft.rhea.util.Lists;
import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.kv.rhea;
package com.alipay.sofa.jraft.rhea.benchmark.rhea;

import java.io.IOException;
import java.util.concurrent.ThreadLocalRandom;
Expand All @@ -37,9 +37,9 @@
import com.alipay.sofa.jraft.rhea.client.RheaKVStore;
import com.alipay.sofa.jraft.util.BytesUtil;

import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.benchmark.kv.BenchmarkUtil.VALUE_BYTES;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.CONCURRENCY;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.KEY_COUNT;
import static com.alipay.sofa.jraft.rhea.benchmark.BenchmarkUtil.VALUE_BYTES;

/**
* @author jiachun.fjc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.benchmark.common;
package com.alipay.sofa.jraft.rhea.util;

import java.util.concurrent.TimeUnit;

Expand All @@ -30,8 +30,6 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;

import com.alipay.sofa.jraft.rhea.util.VarInts;

/**
* @author jiachun.fjc
*/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.0</version>
<configuration>
<source>${java_source_version}</source>
<target>${java_target_version}</target>
Expand Down

0 comments on commit f2e9d8b

Please sign in to comment.