All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.scalecube.cluster.membership.SyncData Maven / Gradle / Ivy

There is a newer version: 2.7.1
Show newest version
package io.scalecube.cluster.membership;

import io.protostuff.Tag;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.annotation.concurrent.Immutable;

/**
 * A class containing full membership table from specific member and used full synchronization between cluster members.
 *
 * @author Anton Kharenko
 */
@Immutable
final class SyncData {

  /**
   * Full cluster membership table.
   */
  @Tag(1)
  private final List membership;

  /**
   * Sort of cluster identifier. Only members in the same sync group allowed to join into cluster.
   */
  @Tag(2)
  private final String syncGroup;

  SyncData(Collection membership, String syncGroup) {
    this.membership = new ArrayList<>(membership);
    this.syncGroup = syncGroup;
  }

  Collection getMembership() {
    return new ArrayList<>(membership);
  }

  String getSyncGroup() {
    return syncGroup;
  }

  @Override
  public String toString() {
    return "SyncData{membership=" + membership + ", syncGroup=" + syncGroup + '}';
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy