// Path: src/main/java/com/noctarius/snowcast/SnowcastException.java
// public class SnowcastException
//         extends RuntimeException {
// 
//     /**
//      * Basic exception constructor
//      */
//     SnowcastException() {
//         super();
//     }
// 
//     /**
//      * Basic exception constructor with a given message
//      *
//      * @param message message to be used
//      */
//     public SnowcastException(@Nonnull String message) {
//         super(message);
//     }
// 
//     /**
//      * Basic exception constructor with a given message and {@link java.lang.Throwable} cause.
//      *
//      * @param message message to be used
//      * @param cause   causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull String message, @Nonnull Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Basic exception constructor with a given {@link java.lang.Throwable} cause.
//      *
//      * @param cause causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/SnowcastIllegalStateException.java
// public class SnowcastIllegalStateException
//         extends SnowcastException {
// 
//     /**
//      * Basic exception constructor
//      *
//      * @param message message to be used
//      */
//     public SnowcastIllegalStateException(@Nonnull String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/SnowcastSequencerAlreadyRegisteredException.java
// public class SnowcastSequencerAlreadyRegisteredException
//         extends SnowcastException {
// 
//     /**
//      * Basic exception constructor
//      *
//      * @param message message to be used
//      */
//     public SnowcastSequencerAlreadyRegisteredException(@Nonnull String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/impl/ExceptionUtils.java
// public static SnowcastException exception(ExceptionMessages exceptionMessage, Object... exceptionParameters) {
//     return exception(SnowcastException::new, exceptionMessage, exceptionParameters);
// }


import static com.noctarius.snowcast.impl.ExceptionMessages.PARTITION_IS_FROZEN;
import static com.noctarius.snowcast.impl.ExceptionMessages.SEQUENCER_ALREADY_REGISTERED;
import static com.noctarius.snowcast.impl.ExceptionMessages.UNREGISTERED_SEQUENCER_LOGICAL_NODE_TABLE;
import static com.noctarius.snowcast.impl.ExceptionUtils.exception;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.UnsafeHelper;
import com.noctarius.snowcast.SnowcastException;
import com.noctarius.snowcast.SnowcastIllegalStateException;
import com.noctarius.snowcast.SnowcastSequencerAlreadyRegisteredException;
import sun.misc.Unsafe;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.reflect.Field;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
        updateFreezeStatus(FROZEN);
    }

    void unfreeze() {
        updateFreezeStatus(UNFROZEN);
    }

    boolean isFrozen() {
        return frozen == FROZEN;
    }

    private void updateFreezeStatus(int newStatus) {
        while (true) {
            int frozen = this.frozen;
            if (frozen == newStatus) {
                return;
            }
            if (UNSAFE.compareAndSwapInt(this, FROZEN_OFFSET, frozen, newStatus)) {
                return;
            }
        }
    }

    private void checkPartitionFreezeStatus() {
        if (isFrozen()) {
            throw exception(SnowcastIllegalStateException::new, PARTITION_IS_FROZEN, partitionId);
        }
    }

    @Nonnull
// Path: src/main/java/com/noctarius/snowcast/SnowcastException.java
// public class SnowcastException
//         extends RuntimeException {
// 
//     /**
//      * Basic exception constructor
//      */
//     SnowcastException() {
//         super();
//     }
// 
//     /**
//      * Basic exception constructor with a given message
//      *
//      * @param message message to be used
//      */
//     public SnowcastException(@Nonnull String message) {
//         super(message);
//     }
// 
//     /**
//      * Basic exception constructor with a given message and {@link java.lang.Throwable} cause.
//      *
//      * @param message message to be used
//      * @param cause   causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull String message, @Nonnull Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Basic exception constructor with a given {@link java.lang.Throwable} cause.
//      *
//      * @param cause causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/SnowcastIllegalStateException.java
// public class SnowcastIllegalStateException
//         extends SnowcastException {
// 
//     /**
//      * Basic exception constructor
//      *
//      * @param message message to be used
//      */
//     public SnowcastIllegalStateException(@Nonnull String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/SnowcastSequencerAlreadyRegisteredException.java
// public class SnowcastSequencerAlreadyRegisteredException
//         extends SnowcastException {
// 
//     /**
//      * Basic exception constructor
//      *
//      * @param message message to be used
//      */
//     public SnowcastSequencerAlreadyRegisteredException(@Nonnull String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/com/noctarius/snowcast/impl/ExceptionUtils.java
// public static SnowcastException exception(ExceptionMessages exceptionMessage, Object... exceptionParameters) {
//     return exception(SnowcastException::new, exceptionMessage, exceptionParameters);
// }


// Path: src/main/java/com/noctarius/snowcast/impl/SequencerPartition.java
import static com.noctarius.snowcast.impl.ExceptionMessages.PARTITION_IS_FROZEN;
import static com.noctarius.snowcast.impl.ExceptionMessages.SEQUENCER_ALREADY_REGISTERED;
import static com.noctarius.snowcast.impl.ExceptionMessages.UNREGISTERED_SEQUENCER_LOGICAL_NODE_TABLE;
import static com.noctarius.snowcast.impl.ExceptionUtils.exception;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.UnsafeHelper;
import com.noctarius.snowcast.SnowcastException;
import com.noctarius.snowcast.SnowcastIllegalStateException;
import com.noctarius.snowcast.SnowcastSequencerAlreadyRegisteredException;
import sun.misc.Unsafe;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.reflect.Field;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

        updateFreezeStatus(FROZEN);
    }

    void unfreeze() {
        updateFreezeStatus(UNFROZEN);
    }

    boolean isFrozen() {
        return frozen == FROZEN;
    }

    private void updateFreezeStatus(int newStatus) {
        while (true) {
            int frozen = this.frozen;
            if (frozen == newStatus) {
                return;
            }
            if (UNSAFE.compareAndSwapInt(this, FROZEN_OFFSET, frozen, newStatus)) {
                return;
            }
        }
    }

    private void checkPartitionFreezeStatus() {
        if (isFrozen()) {
            throw exception(SnowcastIllegalStateException::new, PARTITION_IS_FROZEN, partitionId);
        }
    }

    @Nonnull
    private SequencerDefinition checkSequencerDefinitions(@Nonnull SequencerDefinition definition,