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

org.infinispan.counter.api.Storage Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.counter.api;

import org.infinispan.commons.marshall.ProtoStreamTypeIds;
import org.infinispan.protostream.annotations.ProtoEnumValue;
import org.infinispan.protostream.annotations.ProtoTypeId;

/**
 * The storage mode of a counter.
 *
 * @author Pedro Ruivo
 * @since 9.0
 */
@ProtoTypeId(ProtoStreamTypeIds.COUNTER_STORAGE)
public enum Storage {
   /**
    * The counter value is lost when the cluster is restarted/stopped.
    */
   @ProtoEnumValue(number = 0)
   VOLATILE,
   /**
    * The counter value is stored persistently and survives a cluster restart/stop.
    */
   @ProtoEnumValue(number = 1)
   PERSISTENT;

   private static final Storage[] CACHED_VALUES = values();

   public static Storage valueOf(int index) {
      return CACHED_VALUES[index];
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy