]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/java/src/main/java/org/rocksdb/TickerType.java
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / TickerType.java
index 551e366dc537a9aaa40397317aadd1452b7285e0..678733513d5c2c8804d56a3baf63f552369b28fc 100644 (file)
@@ -717,6 +717,11 @@ public enum TickerType {
      */
     TXN_SNAPSHOT_MUTEX_OVERHEAD((byte) -0x0C),
 
+    /**
+     * # of times ::Get returned TryAgain due to expired snapshot seq
+     */
+    TXN_GET_TRY_AGAIN((byte) -0x0D),
+
     TICKER_ENUM_MAX((byte) 0x5F);
 
     private final byte value;
@@ -726,13 +731,30 @@ public enum TickerType {
     }
 
     /**
-     * @deprecated Exposes internal value of native enum mappings.
-     *     This method will be marked package private in the next major release.
+     * Returns the byte value of the enumerations value
      *
-     * @return the internal representation
+     * @return byte representation
      */
-    @Deprecated
     public byte getValue() {
         return value;
     }
+
+    /**
+     * Get Ticker type by byte value.
+     *
+     * @param value byte representation of TickerType.
+     *
+     * @return {@link org.rocksdb.TickerType} instance.
+     * @throws java.lang.IllegalArgumentException if an invalid
+     *     value is provided.
+     */
+    public static TickerType getTickerType(final byte value) {
+        for (final TickerType tickerType : TickerType.values()) {
+            if (tickerType.getValue() == value) {
+                return tickerType;
+            }
+        }
+        throw new IllegalArgumentException(
+            "Illegal value provided for TickerType.");
+    }
 }