Skip to content

Commit

Permalink
Rename project to Atomix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuujo committed Sep 28, 2015
1 parent e0823de commit c67f778
Show file tree
Hide file tree
Showing 87 changed files with 752 additions and 676 deletions.
26 changes: 13 additions & 13 deletions README.md
@@ -1,33 +1,33 @@
[Copycat][Website]
[Atomix][Website]
=======

**Persistent • Consistent • Fault-tolerant • Database • Coordination • Framework**

#### [Getting started][Getting started][User Manual][User manual][Raft Implementation][Catalog][Google Group][Google group][Javadoc][Javadoc]

[![Build Status](https://travis-ci.org/atomix/copycat.png)](https://travis-ci.org/atomix/copycat)
[![Build Status](https://travis-ci.org/atomix/atomix.png)](https://travis-ci.org/atomix/atomix)

Copycat is a high-level asynchronous framework for building fault-tolerant distributed systems. It combines the consistency of
Atomix is a high-level asynchronous framework for building fault-tolerant distributed systems. It combines the consistency of
[ZooKeeper](https://zookeeper.apache.org/) with the usability of [Hazelcast](http://hazelcast.org/) to provide tools for managing
and coordinating stateful resources in a distributed system. Its strongly consistent, fault-tolerant data store is designed for
such use cases as configuration management, service discovery, group membership, scheduling, messaging, and synchronizing distributed
processes.

Copycat exposes a set of high level APIs with tools to solve a variety of distributed systems problems including:
Atomix exposes a set of high level APIs with tools to solve a variety of distributed systems problems including:
* [Distributed coordination tools](http://atomix.io/user-manual/distributed-resources/#distributed-coordination)
* [Distributed collections](http://atomix.io/user-manual/distributed-resources/#distributed-collections)
* [Distributed atomic variables](http://atomix.io/user-manual/distributed-resources/#distributed-atomic-variables)

Additionally, Copycat is built on a series of low-level libraries that form its consensus algorithm:
* [Catalogue][Catalog] is Copycat's progressive, feature-complete implementation of the [Raft consensus algorithm][Raft]
* [Catalyst][Catalyst] is Copycat's extensible asynchronous I/O, serialization, and networking framework
Additionally, Atomix is built on a series of low-level libraries that form its consensus algorithm:
* [Copycat][Copycat] is Atomix's progressive, feature-complete implementation of the [Raft consensus algorithm][Raft]
* [Catalyst][Catalyst] is Atomix's extensible asynchronous I/O, serialization, and networking framework

**Copycat is still undergoing heavy development and testing and is therefore not recommended for production!**
**Atomix is still undergoing heavy development and testing and is therefore not recommended for production!**

[Jepsen](https://github.com/aphyr/jepsen) tests are [currently being developed](http://github.com/jhalterman/copycat-jepsen)
to verify the stability of Copycat in an unreliable distributed environment. There is still work to be done, and Copycat
[Jepsen](https://github.com/aphyr/jepsen) tests are [currently being developed](http://github.com/jhalterman/atomix-jepsen)
to verify the stability of Atomix in an unreliable distributed environment. There is still work to be done, and Atomix
will not be fully released until significant testing is done both via normal testing frameworks and Jepsen. In the meantime,
Copycat snapshots will be pushed, and a beta release of Copycat is expected within the coming weeks. Follow the project for
Atomix snapshots will be pushed, and a beta release of Atomix is expected within the coming weeks. Follow the project for
updates!

#### [Website][Website][User Manual][User manual][Raft Algorithm][Catalog][Google Group][Google group][Javadoc][Javadoc]
Expand All @@ -36,7 +36,7 @@ updates!
[Getting started]: http://atomix.io/getting-started/
[User manual]: http://atomix.io/user-manual/
[Google group]: https://groups.google.com/forum/#!forum/copycat
[Javadoc]: http://atomix.io/copycat/api/latest/
[Javadoc]: http://atomix.io/atomix/api/latest/
[Raft]: https://raft.github.io/
[Catalog]: http://github.com/atomix/catalogue
[Copycat]: http://github.com/atomix/copycat
[Catalyst]: http://github.com/atomix/catalyst
24 changes: 12 additions & 12 deletions all/pom.xml
Expand Up @@ -18,33 +18,33 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat-parent</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<artifactId>copycat-all</artifactId>
<name>Copycat All</name>
<artifactId>atomix-all</artifactId>
<name>Atomix All</name>

<dependencies>
<dependency>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat-atomic</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix-atomic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat-collections</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix-collections</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat-coordination</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix-coordination</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
12 changes: 6 additions & 6 deletions atomic/pom.xml
Expand Up @@ -18,18 +18,18 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat-parent</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<artifactId>copycat-atomic</artifactId>
<name>Copycat Atomic Variables</name>
<artifactId>atomix-atomic</artifactId>
<name>Atomix Atomic Variables</name>

<dependencies>
<dependency>
<groupId>io.atomix.copycat</groupId>
<artifactId>copycat</artifactId>
<groupId>io.atomix</groupId>
<artifactId>atomix</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
Expand Up @@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.copycat.atomic;
package io.atomix.atomic;

import io.atomix.catalogue.client.Command;
import io.atomix.catalogue.client.Query;
import io.atomix.copycat.client.Command;
import io.atomix.copycat.client.Query;

import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
Expand Down
Expand Up @@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.copycat.atomic;
package io.atomix.atomic;

import io.atomix.catalogue.client.Command;
import io.atomix.catalogue.client.Query;
import io.atomix.catalogue.server.StateMachine;
import io.atomix.Resource;
import io.atomix.atomic.state.AtomicValueCommands;
import io.atomix.atomic.state.AtomicValueState;
import io.atomix.catalyst.util.Assert;
import io.atomix.catalyst.util.Listener;
import io.atomix.copycat.Resource;
import io.atomix.copycat.atomic.state.AtomicValueCommands;
import io.atomix.copycat.atomic.state.AtomicValueState;
import io.atomix.copycat.resource.ResourceContext;
import io.atomix.copycat.client.Command;
import io.atomix.copycat.client.Query;
import io.atomix.copycat.server.StateMachine;
import io.atomix.resource.ResourceContext;

import java.time.Duration;
import java.util.Collections;
Expand All @@ -36,7 +36,7 @@
*
* @author <a href="http://github.com/kuujo">Jordan Halterman</a>
*/
public class DistributedAtomicValue<T> extends Resource {
public class DistributedAtomicValue<T> extends Resource<DistributedAtomicValue<T>> {
private Command.ConsistencyLevel commandConsistency = Command.ConsistencyLevel.LINEARIZABLE;
private Query.ConsistencyLevel queryConsistency = Query.ConsistencyLevel.LINEARIZABLE;
private final java.util.Set<Consumer<T>> changeListeners = Collections.newSetFromMap(new ConcurrentHashMap<>());
Expand Down Expand Up @@ -133,6 +133,7 @@ public CompletableFuture<T> get() {
* @param consistency The read consistency level.
* @return A completable future to be completed with the current value.
*/
@SuppressWarnings("unchecked")
public CompletableFuture<T> get(Query.ConsistencyLevel consistency) {
return submit(AtomicValueCommands.Get.<T>builder()
.withConsistency(consistency)
Expand Down Expand Up @@ -167,6 +168,7 @@ public CompletableFuture<Void> set(T value, Duration ttl) {
* @param consistency The write consistency level.
* @return A completable future to be completed once the value has been set.
*/
@SuppressWarnings("unchecked")
public CompletableFuture<Void> set(T value, Command.ConsistencyLevel consistency) {
return submit(AtomicValueCommands.Set.builder()
.withValue(value)
Expand All @@ -182,6 +184,7 @@ public CompletableFuture<Void> set(T value, Command.ConsistencyLevel consistency
* @param consistency The write consistency level.
* @return A completable future to be completed once the value has been set.
*/
@SuppressWarnings("unchecked")
public CompletableFuture<Void> set(T value, Duration ttl, Command.ConsistencyLevel consistency) {
return submit(AtomicValueCommands.Set.builder()
.withValue(value)
Expand Down Expand Up @@ -218,6 +221,7 @@ public CompletableFuture<T> getAndSet(T value, Duration ttl) {
* @param consistency The write consistency level.
* @return A completable future to be completed with the previous value.
*/
@SuppressWarnings("unchecked")
public CompletableFuture<T> getAndSet(T value, Command.ConsistencyLevel consistency) {
return submit(AtomicValueCommands.GetAndSet.<T>builder()
.withValue(value)
Expand All @@ -233,6 +237,7 @@ public CompletableFuture<T> getAndSet(T value, Command.ConsistencyLevel consiste
* @param consistency The write consistency level.
* @return A completable future to be completed with the previous value.
*/
@SuppressWarnings("unchecked")
public CompletableFuture<T> getAndSet(T value, Duration ttl, Command.ConsistencyLevel consistency) {
return submit(AtomicValueCommands.GetAndSet.<T>builder()
.withValue(value)
Expand Down
Expand Up @@ -15,8 +15,8 @@
*/

/**
* Provides distributed atomic variables such as {@link io.atomix.copycat.atomic.DistributedAtomicValue}.
* Provides distributed atomic variables such as {@link io.atomix.atomic.DistributedAtomicValue}.
*
* @author <a href="http://github.com/kuujo">Jordan Halterman</a>
*/
package io.atomix.copycat.atomic;
package io.atomix.atomic;
Expand Up @@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.copycat.atomic.state;
package io.atomix.atomic.state;

import io.atomix.catalogue.client.Command;
import io.atomix.catalogue.client.Operation;
import io.atomix.catalogue.client.Query;
import io.atomix.catalyst.buffer.BufferInput;
import io.atomix.catalyst.buffer.BufferOutput;
import io.atomix.catalyst.serializer.CatalystSerializable;
import io.atomix.catalyst.serializer.SerializeWith;
import io.atomix.catalyst.serializer.Serializer;
import io.atomix.catalyst.util.BuilderPool;
import io.atomix.copycat.client.Command;
import io.atomix.copycat.client.Operation;
import io.atomix.copycat.client.Query;

/**
* Atomic reference commands.
Expand Down
Expand Up @@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.copycat.atomic.state;
package io.atomix.atomic.state;

import io.atomix.catalogue.client.session.Session;
import io.atomix.catalogue.server.Commit;
import io.atomix.catalogue.server.StateMachine;
import io.atomix.catalogue.server.StateMachineExecutor;
import io.atomix.catalyst.util.concurrent.Scheduled;
import io.atomix.copycat.client.session.Session;
import io.atomix.copycat.server.Commit;
import io.atomix.copycat.server.StateMachine;
import io.atomix.copycat.server.StateMachineExecutor;

import java.time.Duration;
import java.util.HashMap;
Expand Down
Expand Up @@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
io.atomix.copycat.atomic.state.AtomicValueCommands$CompareAndSet
io.atomix.copycat.atomic.state.AtomicValueCommands$Get
io.atomix.copycat.atomic.state.AtomicValueCommands$GetAndSet
io.atomix.copycat.atomic.state.AtomicValueCommands$Set
io.atomix.copycat.atomic.state.AtomicValueCommands$Listen
io.atomix.copycat.atomic.state.AtomicValueCommands$Unlisten
io.atomix.atomic.state.AtomicValueCommands$CompareAndSet
io.atomix.atomic.state.AtomicValueCommands$Get
io.atomix.atomic.state.AtomicValueCommands$GetAndSet
io.atomix.atomic.state.AtomicValueCommands$Set
io.atomix.atomic.state.AtomicValueCommands$Listen
io.atomix.atomic.state.AtomicValueCommands$Unlisten
Expand Up @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.copycat.atomic;
package io.atomix.atomic;

import io.atomix.copycat.CopycatReplica;
import net.jodah.concurrentunit.ConcurrentTestCase;
import io.atomix.catalogue.server.storage.Storage;
import io.atomix.Atomix;
import io.atomix.AtomixReplica;
import io.atomix.catalyst.transport.Address;
import io.atomix.catalyst.transport.LocalServerRegistry;
import io.atomix.catalyst.transport.LocalTransport;
import io.atomix.copycat.Copycat;
import io.atomix.copycat.server.storage.Storage;
import net.jodah.concurrentunit.ConcurrentTestCase;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Expand All @@ -47,11 +47,11 @@ public class DistributedAtomicValueTest extends ConcurrentTestCase {
* Tests setting and getting a value.
*/
public void testSetGet() throws Throwable {
List<Copycat> servers = createCopycats(3);
List<Atomix> servers = createAtomixes(3);

Copycat copycat = servers.get(0);
Atomix atomix = servers.get(0);

DistributedAtomicValue<String> reference = copycat.create("test", DistributedAtomicValue.class).get();
DistributedAtomicValue<String> reference = atomix.create("test", DistributedAtomicValue.class).get();

reference.set("Hello world!").thenRun(this::resume);
await();
Expand All @@ -67,11 +67,11 @@ public void testSetGet() throws Throwable {
* Tests setting and getting a value with a change event.
*/
public void testChangeEvent() throws Throwable {
List<Copycat> servers = createCopycats(3);
List<Atomix> servers = createAtomixes(3);

Copycat copycat = servers.get(0);
Atomix atomix = servers.get(0);

DistributedAtomicValue<String> reference = copycat.create("test", DistributedAtomicValue.class).get();
DistributedAtomicValue<String> reference = atomix.create("test", DistributedAtomicValue.class).get();

reference.onChange(value -> {
threadAssertEquals("Hello world!", value);
Expand All @@ -93,7 +93,7 @@ public void testChangeEvent() throws Throwable {
* Tests compare-and-set.
*/
public void testCompareAndSet() throws Throwable {
List<Copycat> servers = createCopycats(3);
List<Atomix> servers = createAtomixes(3);

DistributedAtomicValue<Integer> reference1 = servers.get(0).create("test", DistributedAtomicValue.class).get();

Expand All @@ -116,34 +116,34 @@ public void testCompareAndSet() throws Throwable {
}

/**
* Creates a Copycat instance.
* Creates a Atomix instance.
*/
private List<Copycat> createCopycats(int nodes) throws Throwable {
private List<Atomix> createAtomixes(int nodes) throws Throwable {
LocalServerRegistry registry = new LocalServerRegistry();

List<Copycat> copycats = new ArrayList<>();
List<Atomix> atomixes = new ArrayList<>();

Collection<Address> members = new ArrayList<>();
for (int i = 1; i <= nodes; i++) {
members.add(new Address("localhost", 5000 + i));
}

for (int i = 1; i <= nodes; i++) {
Copycat copycat = CopycatReplica.builder(new Address("localhost", 5000 + i), members)
Atomix atomix = AtomixReplica.builder(new Address("localhost", 5000 + i), members)
.withTransport(new LocalTransport(registry))
.withStorage(Storage.builder()
.withDirectory(new File(directory, "" + i))
.build())
.build();

copycat.open().thenRun(this::resume);
atomix.open().thenRun(this::resume);

copycats.add(copycat);
atomixes.add(atomix);
}

await(0, nodes);

return copycats;
return atomixes;
}

@BeforeMethod
Expand Down
2 changes: 1 addition & 1 deletion bin/ci-deploy-snapshot.sh
@@ -1,6 +1,6 @@
# From https://coderwall.com/p/9b_lfq

REPO="atomix/copycat"
REPO="atomix/atomix"

if [ "$TRAVIS_REPO_SLUG" == "$REPO" ] && \
[ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && \
Expand Down

0 comments on commit c67f778

Please sign in to comment.