{
30 | }
31 |
--------------------------------------------------------------------------------
/ratis-common/src/test/java/org/apache/ratis/test/tag/FlakyTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.test.tag;
19 |
20 | /**
21 | * Interface to mark JUnit4 test classes or methods that exhibit intermittent
22 | * issues. These are run separately from the normal tests in CI. In case of
23 | * failure they may be repeated a few times.
24 | * Usage: @Category(FlakyTest.class) @Flaky("RATIS-123")
25 | */
26 | public interface FlakyTest {
27 | // category marker
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-common/src/test/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | org.apache.ratis.JUnit5TestExecutionListener
--------------------------------------------------------------------------------
/ratis-common/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 | # log4j configuration used during build and unit tests
13 |
14 | log4j.rootLogger=info,stdout
15 | log4j.threshold=ALL
16 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
17 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
18 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n
19 |
--------------------------------------------------------------------------------
/ratis-docs/README.md:
--------------------------------------------------------------------------------
1 |
17 | # Apache Ratis docs
18 |
19 | This subproject contains the inline documentation for Apache Ratis.
20 |
21 | ## View rendered documents
22 | To view the documents locally, you can run:
23 |
24 | ```
25 | cd ratis-docs
26 | mvn site:run
27 | ```
28 |
29 | Then visit http://localhost:8080/ to view rendered documents.
30 |
31 | ## Write document
32 | To create new document, please add markdown files into `src/site/markdown` folder, and then create a link in `site.xml`. For example, `site/markdown/cli.md` could be accessed by `cli.html`.
33 |
34 | For more about the usage, please refer to the [documentation of maven-site-plugin](https://maven.apache.org/guides/mini/guide-site.html).
35 |
36 |
--------------------------------------------------------------------------------
/ratis-docs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
19 | 4.0.0
20 |
21 | ratis
22 | org.apache.ratis
23 | 3.1.3
24 |
25 |
26 | ratis-docs
27 | Apache Ratis Documentation
28 | jar
29 |
30 |
31 |
32 | true
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/ratis-docs/src/site/resources/images/ratis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/ratis/848cd394c4cc6ed4e1568bfa6c92a922dfe3f10e/ratis-docs/src/site/resources/images/ratis.png
--------------------------------------------------------------------------------
/ratis-examples/src/main/bin/client.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
18 |
19 | USAGE="client.sh "
20 |
21 | if [ "$#" -lt 2 ]; then
22 | echo "$USAGE"
23 | exit 1
24 | fi
25 |
26 | source $DIR/common.sh
27 |
28 | # One of the examples, e.g. "filestore" or "arithmetic"
29 | example="$1"
30 | shift
31 |
32 | subcommand="$1"
33 | shift
34 |
35 | java ${LOGGER_OPTS} -jar $ARTIFACT "$example" "$subcommand" "$@"
36 |
--------------------------------------------------------------------------------
/ratis-examples/src/main/bin/server.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
18 | source $DIR/common.sh
19 |
20 | java ${LOGGER_OPTS} -jar $ARTIFACT "$@"
21 |
--------------------------------------------------------------------------------
/ratis-examples/src/main/bin/stop-all.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | kill $(jps | grep 'ratis-examples' | grep -v 'grep' | awk '{print $1}')
18 | echo "All Ratis examples have been stopped."
19 |
--------------------------------------------------------------------------------
/ratis-examples/src/main/java/org/apache/ratis/examples/arithmetic/Evaluable.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.examples.arithmetic;
19 |
20 | import java.util.Map;
21 |
22 | public interface Evaluable {
23 | Double evaluate(Map variableMap);
24 | }
25 |
--------------------------------------------------------------------------------
/ratis-examples/src/main/java/org/apache/ratis/examples/arithmetic/cli/Arithmetic.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.ratis.examples.arithmetic.cli;
20 |
21 | import org.apache.ratis.examples.common.SubCommandBase;
22 |
23 | import java.util.ArrayList;
24 | import java.util.List;
25 |
26 | /**
27 | * This class enumerates all the commands enqueued by Arithmetic state machine.
28 | */
29 | public final class Arithmetic {
30 | private Arithmetic() {
31 | }
32 |
33 | public static List getSubCommands() {
34 | List commands = new ArrayList<>();
35 | commands.add(new Server());
36 | commands.add(new Assign());
37 | commands.add(new Get());
38 | return commands;
39 | }
40 | }
--------------------------------------------------------------------------------
/ratis-examples/src/main/resources/conf.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | raft.server.address.list=127.0.0.1:10024,127.0.0.1:10124,127.0.0.1:11124
18 | # raft.server.root.storage.path
19 | # raft.server.priority.list=1,0,0
20 | # raft.server.simulated-slowness.list=0,1s,0
--------------------------------------------------------------------------------
/ratis-examples/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 |
18 | log4j.rootLogger=INFO, stdout
19 |
20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
21 | log4j.appender.stdout.Target=System.out
22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
23 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
24 |
--------------------------------------------------------------------------------
/ratis-examples/src/test/java/org/apache/ratis/examples/filestore/TestFileStoreAsyncWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.examples.filestore;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 |
22 | public class TestFileStoreAsyncWithGrpc
23 | extends FileStoreAsyncBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-examples/src/test/java/org/apache/ratis/examples/filestore/TestFileStoreStreamingWithGrpcCluster.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.examples.filestore;
19 |
20 | import org.apache.ratis.datastream.MiniRaftClusterWithRpcTypeGrpcAndDataStreamTypeNetty;
21 |
22 | public class TestFileStoreStreamingWithGrpcCluster
23 | extends FileStoreStreamingBaseTest
24 | implements MiniRaftClusterWithRpcTypeGrpcAndDataStreamTypeNetty.FactoryGet {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-examples/src/test/java/org/apache/ratis/examples/filestore/TestFileStoreWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.examples.filestore;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 |
22 | public class TestFileStoreWithGrpc
23 | extends FileStoreBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-examples/src/test/java/org/apache/ratis/examples/filestore/TestFileStoreWithNetty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.examples.filestore;
19 |
20 | import org.apache.ratis.netty.MiniRaftClusterWithNetty;
21 |
22 | public class TestFileStoreWithNetty
23 | extends FileStoreBaseTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 |
26 | @Override
27 | public void testWatch() {
28 | //NettyClientRpc does not support sendRequestAsyncUnordered
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ratis-examples/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 | # log4j configuration used during build and unit tests
13 |
14 | log4j.rootLogger=info,stdout
15 | log4j.threshold=ALL
16 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
17 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
18 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
19 |
--------------------------------------------------------------------------------
/ratis-experiments/scripts/flatbuf-compile.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -eu
18 |
19 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
20 | DOCDIR="$DIR/.."
21 |
22 | if [ "$(which flatc)" ]; then
23 | DESTDIR="$DOCDIR/target/generated-sources/"
24 | mkdir -p "$DESTDIR"
25 | cd "$DOCDIR"
26 | flatc --grpc --java --gen-mutable -o ./target/generated-sources/ ./src/main/flatbufs/*.fbs
27 | cd -
28 | fi
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ratis-experiments/src/main/flatbufs/FileTransfer.fbs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | namespace org.apache.ratis.flatbufs;
19 |
20 | table TransferMsg {
21 | partId: uint32;
22 | data: [byte];
23 | }
24 |
25 | table TransferReply {
26 | partId: uint32;
27 | message: string;
28 | }
29 |
30 | rpc_service FileTransfer{
31 | SendData(TransferMsg):TransferReply (streaming: "bidi");
32 | }
33 |
34 | root_type TransferMsg;
35 |
--------------------------------------------------------------------------------
/ratis-experiments/src/main/java/org/apache/ratis/experiments/nettyzerocopy/objects/RequestDataComposite.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.ratis.experiments.nettyzerocopy.objects;
20 |
21 | import org.apache.ratis.thirdparty.io.netty.buffer.ByteBuf;
22 |
23 | public class RequestDataComposite {
24 | private int dataId;
25 | private ByteBuf buff;
26 |
27 | public ByteBuf getBuff() {
28 | return buff;
29 | }
30 |
31 | public int getDataId() {
32 | return dataId;
33 | }
34 |
35 | public void setDataId(int dataId) {
36 | this.dataId = dataId;
37 | }
38 |
39 | public void setBuff(ByteBuf buff) {
40 | this.buff = buff;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ratis-experiments/src/main/java/org/apache/ratis/experiments/nettyzerocopy/objects/ResponseData.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.ratis.experiments.nettyzerocopy.objects;
20 |
21 | public class ResponseData {
22 | private int id;
23 |
24 | public int getId() {
25 | return id;
26 | }
27 |
28 | public void setId(int id) {
29 | this.id = id;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ratis-metrics-api/src/main/java/org/apache/ratis/metrics/LongCounter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.metrics;
19 |
20 | public interface LongCounter {
21 | default void inc() {
22 | inc(1L);
23 | }
24 |
25 | void inc(long n);
26 |
27 | default void dec() {
28 | dec(1L);
29 | }
30 |
31 | void dec(long n);
32 |
33 | long getCount();
34 | }
35 |
--------------------------------------------------------------------------------
/ratis-metrics-api/src/main/java/org/apache/ratis/metrics/MetricRegistryFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.metrics;
19 |
20 | /**
21 | * A Factory for creating MetricRegistries. This is the main plugin point for metrics implementation
22 | */
23 | public interface MetricRegistryFactory {
24 | /**
25 | * Create a MetricRegistry from the given MetricRegistryInfo
26 | * @param info the descriptor for MetricRegistry
27 | * @return a MetricRegistry implementation
28 | */
29 | RatisMetricRegistry create(MetricRegistryInfo info);
30 | }
31 |
--------------------------------------------------------------------------------
/ratis-metrics-api/src/main/java/org/apache/ratis/metrics/RatisMetricRegistry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.metrics;
19 |
20 | import java.util.function.Supplier;
21 |
22 | public interface RatisMetricRegistry {
23 | Timekeeper timer(String name);
24 |
25 | LongCounter counter(String name);
26 |
27 | boolean remove(String name);
28 |
29 | void gauge(String name, Supplier> gaugeSupplier);
30 |
31 | MetricRegistryInfo getMetricRegistryInfo();
32 | }
33 |
--------------------------------------------------------------------------------
/ratis-metrics-default/src/main/java/org/apache/ratis/metrics/impl/MetricRegistryFactoryImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.metrics.impl;
19 |
20 | import org.apache.ratis.metrics.MetricRegistryFactory;
21 | import org.apache.ratis.metrics.MetricRegistryInfo;
22 |
23 | public class MetricRegistryFactoryImpl implements MetricRegistryFactory {
24 | @Override
25 | public RatisMetricRegistryImpl create(MetricRegistryInfo info) {
26 | return new RatisMetricRegistryImpl(info);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-metrics-default/src/main/resources/META-INF/services/org.apache.ratis.metrics.MetricRegistries:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | org.apache.ratis.metrics.impl.MetricRegistriesImpl
19 |
--------------------------------------------------------------------------------
/ratis-metrics-dropwizard3/src/main/java/org/apache/ratis/metrics/dropwizard3/Dm3MetricRegistryFactoryImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.metrics.dropwizard3;
19 |
20 | import org.apache.ratis.metrics.MetricRegistryFactory;
21 | import org.apache.ratis.metrics.MetricRegistryInfo;
22 |
23 | public class Dm3MetricRegistryFactoryImpl implements MetricRegistryFactory {
24 | @Override
25 | public Dm3RatisMetricRegistryImpl create(MetricRegistryInfo info) {
26 | return new Dm3RatisMetricRegistryImpl(info);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-metrics-dropwizard3/src/main/resources/META-INF/services/org.apache.ratis.metrics.MetricRegistries:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | org.apache.ratis.metrics.dropwizard3.Dm3MetricRegistriesImpl
19 |
--------------------------------------------------------------------------------
/ratis-proto/src/main/proto/Experiments.proto:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | syntax = "proto3";
19 | option java_package = "org.apache.ratis.proto";
20 | option java_outer_classname = "ExperimentsProtos";
21 | option java_generate_equals_and_hash = true;
22 | package ratis.experiments;
23 |
24 | message TransferMsgProto {
25 | uint32 partId = 1;
26 | bytes data = 2;
27 | }
28 |
29 | message TransferReplyProto {
30 | uint32 partId = 1;
31 | string message = 2;
32 | }
33 |
34 | service FileTransferExampleService {
35 | rpc sendData(stream TransferMsgProto) returns (stream TransferReplyProto);
36 | }
--------------------------------------------------------------------------------
/ratis-proto/src/main/proto/Test.proto:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | syntax = "proto3";
19 |
20 | option java_multiple_files = true;
21 | option java_package = "org.apache.ratis.test.proto";
22 | option java_outer_classname = "TestProto";
23 |
24 | package org.apache.ratis.test;
25 |
26 | service Greeter {
27 | rpc Hello (stream HelloRequest)
28 | returns (stream HelloReply) {}
29 |
30 | rpc Binary (stream BinaryRequest)
31 | returns (stream BinaryReply) {}
32 | }
33 |
34 | message HelloRequest {
35 | string name = 1;
36 | }
37 |
38 | message HelloReply {
39 | string message = 1;
40 | }
41 |
42 | message BinaryRequest {
43 | bytes data = 1;
44 | }
45 |
46 | message BinaryReply {
47 | bytes data = 1;
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/ratis-replicated-map/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 | # log4j configuration used during build and unit tests
13 |
14 | log4j.rootLogger=info,stdout
15 | log4j.threshold=ALL
16 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
17 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
18 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
19 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/DataStreamServer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server;
19 |
20 | import java.io.Closeable;
21 |
22 | /**
23 | * Interface for streaming server.
24 | */
25 | public interface DataStreamServer extends Closeable {
26 | /**
27 | * Get network interface for server.
28 | */
29 | DataStreamServerRpc getServerRpc();
30 | }
31 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/DataStreamServerRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server;
19 |
20 | import org.apache.ratis.protocol.RaftPeer;
21 |
22 | import java.io.Closeable;
23 |
24 | /**
25 | * A server interface handling incoming streams
26 | * Relays those streams to other servers after persisting
27 | */
28 | public interface DataStreamServerRpc extends ServerRpc, RaftPeer.Add, Closeable {
29 | }
30 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/ServerRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server;
19 |
20 | import java.io.Closeable;
21 | import java.io.IOException;
22 | import java.net.InetSocketAddress;
23 |
24 | /**
25 | * A general server interface.
26 | */
27 | public interface ServerRpc extends Closeable {
28 | /** Start the RPC service. */
29 | void start() throws IOException;
30 |
31 | /** @return the address where this RPC server is listening to. */
32 | InetSocketAddress getInetSocketAddress();
33 | }
34 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/metrics/RaftLogMetrics.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.metrics;
19 |
20 | import org.apache.ratis.server.raftlog.LogEntryHeader;
21 |
22 | /** Metrics for a raft log. */
23 | public interface RaftLogMetrics {
24 | /** A log entry just has been committed. */
25 | void onLogEntryCommitted(LogEntryHeader header);
26 |
27 | /** Read statemachine data timeout */
28 | default void onStateMachineDataReadTimeout() {
29 | }
30 |
31 | /** Write statemachine data timeout */
32 | default void onStateMachineDataWriteTimeout() {
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/metrics/RaftServerMetrics.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.ratis.server.metrics;
20 |
21 | /** Metrics for a raft Server. */
22 | public interface RaftServerMetrics {
23 | /** A snapshot just has been installed. */
24 | void onSnapshotInstalled();
25 | }
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/raftlog/RaftLogIOException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.raftlog;
19 |
20 | import org.apache.ratis.protocol.exceptions.RaftException;
21 |
22 | /**
23 | * Exception while reading/writing RaftLog
24 | */
25 | public class RaftLogIOException extends RaftException {
26 | public RaftLogIOException(Throwable cause) {
27 | super(cause);
28 | }
29 |
30 | public RaftLogIOException(String msg) {
31 | super(msg);
32 | }
33 |
34 | public RaftLogIOException(String message, Throwable cause) {
35 | super(message, cause);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/server/storage/RaftStorageMetadataFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.storage;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * Represent a file on disk which persistently stores the metadata of a raft storage.
24 | * The file is updated atomically.
25 | */
26 | public interface RaftStorageMetadataFile {
27 | /** @return the metadata persisted in this file. */
28 | RaftStorageMetadata getMetadata() throws IOException;
29 |
30 | /** Persist the given metadata. */
31 | void persist(RaftStorageMetadata newMetadata) throws IOException;
32 | }
33 |
--------------------------------------------------------------------------------
/ratis-server-api/src/main/java/org/apache/ratis/statemachine/SnapshotRetentionPolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.statemachine;
19 |
20 | /**
21 | * Retention policy of state machine snapshots.
22 | */
23 | public interface SnapshotRetentionPolicy {
24 | int DEFAULT_ALL_SNAPSHOTS_RETAINED = -1;
25 |
26 | /**
27 | * @return -1 for retaining all the snapshots; otherwise, return the number of snapshots to be retained.
28 | */
29 | default int getNumSnapshotsRetained() {
30 | return DEFAULT_ALL_SNAPSHOTS_RETAINED;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/datastream/TestNettyDataStreamWithNettyCluster.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.datastream;
19 |
20 |
21 | import org.junit.jupiter.api.Disabled;
22 |
23 | @Disabled("Ignored by runzhiwang, because NettyClientRpc does not support sendRequestAsync")
24 | public class TestNettyDataStreamWithNettyCluster
25 | extends DataStreamClusterTests
26 | implements MiniRaftClusterWithRpcTypeNettyAndDataStreamTypeNetty.FactoryGet {
27 | }
28 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestGroupInfoWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.GroupInfoBaseTest;
21 |
22 | public class TestGroupInfoWithGrpc
23 | extends GroupInfoBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestGroupManagementWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.MiniRaftCluster;
21 | import org.apache.ratis.server.impl.GroupManagementBaseTest;
22 |
23 | public class TestGroupManagementWithGrpc extends GroupManagementBaseTest {
24 | @Override
25 | public MiniRaftCluster.Factory extends MiniRaftCluster> getClusterFactory() {
26 | return MiniRaftClusterWithGrpc.FACTORY;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestGrpcFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.BaseTest;
21 | import org.junit.jupiter.api.Assertions;
22 | import org.junit.jupiter.api.Test;
23 |
24 | public class TestGrpcFactory extends BaseTest {
25 | @Test
26 | public void testUseCacheForAllThreads() {
27 | // trigger GrpcFactory static initializer
28 | final boolean value = GrpcFactory.checkPooledByteBufAllocatorUseCacheForAllThreads(LOG::info);
29 | Assertions.assertFalse(value);
30 | }
31 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestInstallSnapshotNotificationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.InstallSnapshotNotificationTests;
21 |
22 | public class TestInstallSnapshotNotificationWithGrpc
23 | extends InstallSnapshotNotificationTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestLogMetadataTestsWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.ratis.grpc;
21 |
22 | import org.apache.ratis.server.impl.LogMetadataTests;
23 |
24 | public class TestLogMetadataTestsWithGrpc extends LogMetadataTests
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestMessageStreamApiWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.MessageStreamApiTests;
21 |
22 | public class TestMessageStreamApiWithGrpc extends MessageStreamApiTests
23 | implements MiniRaftClusterWithGrpc.FactoryGet {
24 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestPreAppendLeaderStepDownWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.PreAppendLeaderStepDownTest;
21 |
22 | public class TestPreAppendLeaderStepDownWithGrpc
23 | extends PreAppendLeaderStepDownTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftAsyncExceptionWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.RaftAsyncExceptionTests;
21 |
22 | public class TestRaftAsyncExceptionWithGrpc
23 | extends RaftAsyncExceptionTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftAsyncWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.RaftAsyncTests;
21 | import org.junit.jupiter.api.Timeout;
22 |
23 | @Timeout(100)
24 | public class TestRaftAsyncWithGrpc extends RaftAsyncTests
25 | implements MiniRaftClusterWithGrpc.FactoryGet {
26 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftExceptionWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.RaftExceptionBaseTest;
21 |
22 | public class TestRaftExceptionWithGrpc
23 | extends RaftExceptionBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftLogTruncateWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.RaftLogTruncateTests;
21 |
22 | public class TestRaftLogTruncateWithGrpc extends RaftLogTruncateTests
23 | implements MiniRaftClusterWithGrpc.FactoryGet {
24 | }
25 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftOutputStreamWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.OutputStreamBaseTest;
21 | import org.junit.jupiter.api.Timeout;
22 |
23 | @Timeout(value = 100)
24 | public class TestRaftOutputStreamWithGrpc
25 | extends OutputStreamBaseTest
26 | implements MiniRaftClusterWithGrpc.FactoryGet {
27 | }
28 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftReconfigurationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.RaftReconfigurationBaseTest;
21 |
22 | public class TestRaftReconfigurationWithGrpc
23 | extends RaftReconfigurationBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRaftStateMachineExceptionWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.RaftStateMachineExceptionTests;
21 |
22 | public class TestRaftStateMachineExceptionWithGrpc
23 | extends RaftStateMachineExceptionTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestReConfigPropertyWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.ratis.grpc;
20 |
21 |
22 | import org.apache.ratis.TestReConfigProperty;
23 |
24 | public class TestReConfigPropertyWithGrpc extends TestReConfigProperty
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestReadOnlyRequestWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.ReadOnlyRequestTests;
21 |
22 | public class TestReadOnlyRequestWithGrpc
23 | extends ReadOnlyRequestTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestReadOnlyRequestWithLongTimeoutWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.ReadOnlyRequestWithLongTimeoutTests;
21 |
22 | public class TestReadOnlyRequestWithLongTimeoutWithGrpc
23 | extends ReadOnlyRequestWithLongTimeoutTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestRequestLimitAsyncWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.RequestLimitAsyncBaseTest;
21 |
22 | public class TestRequestLimitAsyncWithGrpc
23 | extends RequestLimitAsyncBaseTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestServerPauseResumeWithGrpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.ServerPauseResumeTest;
21 |
22 | public class TestServerPauseResumeWithGrpc
23 | extends ServerPauseResumeTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 |
26 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestServerRestartWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.ServerRestartTests;
21 |
22 | public class TestServerRestartWithGrpc
23 | extends ServerRestartTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestSnapshotManagementWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.statemachine.SnapshotManagementTest;
21 |
22 | public class TestSnapshotManagementWithGrpc
23 | extends SnapshotManagementTest
24 | implements MiniRaftClusterWithGrpc.FactoryGet {
25 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/TestStateMachineShutdownWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc;
19 |
20 | import org.apache.ratis.server.impl.StateMachineShutdownTests;
21 |
22 | public class TestStateMachineShutdownWithGrpc
23 | extends StateMachineShutdownTests
24 | implements MiniRaftClusterWithGrpc.FactoryGet{
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/cli/TestElectionCommandIntegrationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc.cli;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 | import org.apache.ratis.shell.cli.sh.ElectionCommandIntegrationTest;
22 |
23 | public class TestElectionCommandIntegrationWithGrpc
24 | extends ElectionCommandIntegrationTest
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/cli/TestGroupCommandIntegrationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc.cli;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 | import org.apache.ratis.shell.cli.sh.GroupCommandIntegrationTest;
22 |
23 | public class TestGroupCommandIntegrationWithGrpc
24 | extends GroupCommandIntegrationTest
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/cli/TestPeerCommandIntegrationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc.cli;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 | import org.apache.ratis.shell.cli.sh.PeerCommandIntegrationTest;
22 |
23 | public class TestPeerCommandIntegrationWithGrpc
24 | extends PeerCommandIntegrationTest
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/grpc/cli/TestSnapshotCommandIntegrationWithGrpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.grpc.cli;
19 |
20 | import org.apache.ratis.grpc.MiniRaftClusterWithGrpc;
21 | import org.apache.ratis.shell.cli.sh.SnapshotCommandIntegrationTest;
22 |
23 | public class TestSnapshotCommandIntegrationWithGrpc
24 | extends SnapshotCommandIntegrationTest
25 | implements MiniRaftClusterWithGrpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestGroupInfoWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.GroupInfoBaseTest;
21 |
22 | public class TestGroupInfoWithNetty
23 | extends GroupInfoBaseTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestGroupManagementWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.MiniRaftCluster;
21 | import org.apache.ratis.server.impl.GroupManagementBaseTest;
22 |
23 | public class TestGroupManagementWithNetty extends GroupManagementBaseTest {
24 | @Override
25 | public MiniRaftCluster.Factory extends MiniRaftCluster> getClusterFactory() {
26 | return MiniRaftClusterWithNetty.FACTORY;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestLogAppenderWithNetty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.LogAppenderTests;
21 |
22 | public class TestLogAppenderWithNetty
23 | extends LogAppenderTests
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestPreAppendLeaderStepDownWithNetty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.PreAppendLeaderStepDownTest;
21 |
22 | public class TestPreAppendLeaderStepDownWithNetty
23 | extends PreAppendLeaderStepDownTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftAsyncWithNetty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.RaftAsyncTests;
21 | import org.junit.jupiter.api.Timeout;
22 |
23 | @Timeout(100)
24 | public class TestRaftAsyncWithNetty
25 | extends RaftAsyncTests
26 | implements MiniRaftClusterWithNetty.FactoryGet {
27 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftExceptionWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.RaftExceptionBaseTest;
21 |
22 | public class TestRaftExceptionWithNetty
23 | extends RaftExceptionBaseTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftReconfigurationWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.RaftReconfigurationBaseTest;
21 |
22 | public class TestRaftReconfigurationWithNetty
23 | extends RaftReconfigurationBaseTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftSnapshotWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.MiniRaftCluster;
21 | import org.apache.ratis.statemachine.RaftSnapshotBaseTest;
22 |
23 | public class TestRaftSnapshotWithNetty extends RaftSnapshotBaseTest {
24 | @Override
25 | public MiniRaftCluster.Factory> getFactory() {
26 | return MiniRaftClusterWithNetty.FACTORY;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftStateMachineExceptionWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.RaftStateMachineExceptionTests;
21 |
22 | public class TestRaftStateMachineExceptionWithNetty
23 | extends RaftStateMachineExceptionTests
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.RaftBasicTests;
21 | import org.apache.ratis.server.impl.BlockRequestHandlingInjection;
22 | import org.junit.jupiter.api.Test;
23 |
24 | public class TestRaftWithNetty
25 | extends RaftBasicTests
26 | implements MiniRaftClusterWithNetty.FactoryGet {
27 |
28 | @Override
29 | @Test
30 | public void testWithLoad() throws Exception {
31 | super.testWithLoad();
32 | BlockRequestHandlingInjection.getInstance().unblockAll();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestRetryCacheWithNettyRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.RetryCacheTests;
21 |
22 | public class TestRetryCacheWithNettyRpc
23 | extends RetryCacheTests
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestServerPauseResumeWithNetty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.impl.ServerPauseResumeTest;
21 |
22 | public class TestServerPauseResumeWithNetty
23 | extends ServerPauseResumeTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestServerRestartWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.server.ServerRestartTests;
21 |
22 | public class TestServerRestartWithNetty
23 | extends ServerRestartTests
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/netty/TestSnapshotManagementWithNetty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.netty;
19 |
20 | import org.apache.ratis.statemachine.SnapshotManagementTest;
21 |
22 | public class TestSnapshotManagementWithNetty
23 | extends SnapshotManagementTest
24 | implements MiniRaftClusterWithNetty.FactoryGet {
25 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/protocol/ProtocolTestUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.protocol;
19 |
20 | import org.apache.ratis.util.BiWeakValueCache;
21 |
22 | public interface ProtocolTestUtils {
23 | static BiWeakValueCache getTermIndexCache() {
24 | return TermIndex.Impl.getCache();
25 | }
26 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestGroupInfoWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.GroupInfoBaseTest;
21 |
22 | public class TestGroupInfoWithSimulatedRpc
23 | extends GroupInfoBaseTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestGroupManagementWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.MiniRaftCluster;
21 | import org.apache.ratis.server.impl.GroupManagementBaseTest;
22 |
23 | public class TestGroupManagementWithSimulatedRpc extends GroupManagementBaseTest {
24 | @Override
25 | public MiniRaftCluster.Factory extends MiniRaftCluster> getClusterFactory() {
26 | return MiniRaftClusterWithSimulatedRpc.FACTORY;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestLeaderElectionWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.LeaderElectionTests;
21 |
22 | public class TestLeaderElectionWithSimulatedRpc
23 | extends LeaderElectionTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestLogAppenderWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.LogAppenderTests;
21 |
22 | public class TestLogAppenderWithSimulatedRpc
23 | extends LogAppenderTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestPreAppendLeaderStepDownWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.PreAppendLeaderStepDownTest;
21 |
22 | public class TestPreAppendLeaderStepDownWithSimulatedRpc
23 | extends PreAppendLeaderStepDownTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRaftExceptionWithSimulation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.RaftExceptionBaseTest;
21 |
22 | public class TestRaftExceptionWithSimulation
23 | extends RaftExceptionBaseTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRaftReconfigurationWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.RaftReconfigurationBaseTest;
21 |
22 | public class TestRaftReconfigurationWithSimulatedRpc
23 | extends RaftReconfigurationBaseTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRaftSnapshotWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.MiniRaftCluster;
21 | import org.apache.ratis.statemachine.RaftSnapshotBaseTest;
22 |
23 | public class TestRaftSnapshotWithSimulatedRpc extends RaftSnapshotBaseTest {
24 | @Override
25 | public MiniRaftCluster.Factory> getFactory() {
26 | return MiniRaftClusterWithSimulatedRpc.FACTORY;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRaftStateMachineExceptionWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.RaftStateMachineExceptionTests;
21 |
22 | public class TestRaftStateMachineExceptionWithSimulatedRpc extends
23 | RaftStateMachineExceptionTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRaftWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.RaftBasicTests;
21 |
22 | public class TestRaftWithSimulatedRpc
23 | extends RaftBasicTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRatisServerMetricsWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.impl.TestRatisServerMetricsBase;
21 |
22 | /** Tests on Ratis server metrics with simulated rpc. */
23 | public class TestRatisServerMetricsWithSimulatedRpc
24 | extends TestRatisServerMetricsBase
25 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet{
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestRetryCacheWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.RetryCacheTests;
21 |
22 | public class TestRetryCacheWithSimulatedRpc
23 | extends RetryCacheTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestServerPauseResumeWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | package org.apache.ratis.server.simulation;
2 |
3 | import org.apache.ratis.server.impl.ServerPauseResumeTest;
4 |
5 | /*
6 | * Licensed to the Apache Software Foundation (ASF) under one
7 | * or more contributor license agreements. See the NOTICE file
8 | * distributed with this work for additional information
9 | * regarding copyright ownership. The ASF licenses this file
10 | * to you under the Apache License, Version 2.0 (the
11 | * "License"); you may not use this file except in compliance
12 | * with the License. You may obtain a copy of the License at
13 | *
14 | * http://www.apache.org/licenses/LICENSE-2.0
15 | *
16 | * Unless required by applicable law or agreed to in writing, software
17 | * distributed under the License is distributed on an "AS IS" BASIS,
18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | * See the License for the specific language governing permissions and
20 | * limitations under the License.
21 | */
22 | public class TestServerPauseResumeWithSimulatedRpc
23 | extends ServerPauseResumeTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestServerRestartWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.server.ServerRestartTests;
21 |
22 | public class TestServerRestartWithSimulatedRpc
23 | extends ServerRestartTests
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
--------------------------------------------------------------------------------
/ratis-test/src/test/java/org/apache/ratis/server/simulation/TestSnapshotManagementWithSimulatedRpc.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.ratis.server.simulation;
19 |
20 | import org.apache.ratis.statemachine.SnapshotManagementTest;
21 |
22 | public class TestSnapshotManagementWithSimulatedRpc
23 | extends SnapshotManagementTest
24 | implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
25 | }
26 |
--------------------------------------------------------------------------------
/ratis-test/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 | # log4j configuration used during build and unit tests
13 |
14 | log4j.rootLogger=info,stdout
15 | log4j.threshold=ALL
16 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
17 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
18 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n
19 |
--------------------------------------------------------------------------------
/ratis-test/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | mock-maker-inline
14 |
--------------------------------------------------------------------------------
/src/main/resources/ratis-version.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | name=${project.name}
19 | version=${project.version}
20 | revision=${version-info.scm.commit}
21 |
--------------------------------------------------------------------------------