Class StateArchivalSettings

java.lang.Object
org.stellar.sdk.xdr.StateArchivalSettings
All Implemented Interfaces:
XdrElement

public class StateArchivalSettings extends Object implements XdrElement
StateArchivalSettings's original definition in the XDR file is:
 struct StateArchivalSettings {
     uint32 maxEntryTTL;
     uint32 minTemporaryTTL;
     uint32 minPersistentTTL;

     // rent_fee = wfee_rate_average / rent_rate_denominator_for_type
     int64 persistentRentRateDenominator;
     int64 tempRentRateDenominator;

     // max number of entries that emit archival meta in a single ledger
     uint32 maxEntriesToArchive;

     // Number of snapshots to use when calculating average live Soroban State size
     uint32 liveSorobanStateSizeWindowSampleSize;

     // How often to sample the live Soroban State size for the average, in ledgers
     uint32 liveSorobanStateSizeWindowSamplePeriod;

     // Maximum number of bytes that we scan for eviction per ledger
     uint32 evictionScanSize;

     // Lowest BucketList level to be scanned to evict entries
     uint32 startingEvictionScanLevel;
 };
 
  • Constructor Details

    • StateArchivalSettings

      public StateArchivalSettings()
    • StateArchivalSettings

      public StateArchivalSettings(Uint32 maxEntryTTL, Uint32 minTemporaryTTL, Uint32 minPersistentTTL, Int64 persistentRentRateDenominator, Int64 tempRentRateDenominator, Uint32 maxEntriesToArchive, Uint32 liveSorobanStateSizeWindowSampleSize, Uint32 liveSorobanStateSizeWindowSamplePeriod, Uint32 evictionScanSize, Uint32 startingEvictionScanLevel)
      Creates a new StateArchivalSettings instance.
      Parameters:
      maxEntryTTL - the maxEntryTTL field value
      minTemporaryTTL - the minTemporaryTTL field value
      minPersistentTTL - the minPersistentTTL field value
      persistentRentRateDenominator - the persistentRentRateDenominator field value
      tempRentRateDenominator - the tempRentRateDenominator field value
      maxEntriesToArchive - the maxEntriesToArchive field value
      liveSorobanStateSizeWindowSampleSize - the liveSorobanStateSizeWindowSampleSize field value
      liveSorobanStateSizeWindowSamplePeriod - the liveSorobanStateSizeWindowSamplePeriod field value
      evictionScanSize - the evictionScanSize field value
      startingEvictionScanLevel - the startingEvictionScanLevel field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static StateArchivalSettings decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static StateArchivalSettings decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static StateArchivalSettings fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static StateArchivalSettings fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static StateArchivalSettings fromJson(String json)
    • builder

    • toBuilder

    • getMaxEntryTTL

      public Uint32 getMaxEntryTTL()
      Value of the maxEntryTTL field.
      Returns:
      the maxEntryTTL field value
    • getMinTemporaryTTL

      public Uint32 getMinTemporaryTTL()
      Value of the minTemporaryTTL field.
      Returns:
      the minTemporaryTTL field value
    • getMinPersistentTTL

      public Uint32 getMinPersistentTTL()
      Value of the minPersistentTTL field.
      Returns:
      the minPersistentTTL field value
    • getPersistentRentRateDenominator

      public Int64 getPersistentRentRateDenominator()
      Value of the persistentRentRateDenominator field.
      Returns:
      the persistentRentRateDenominator field value
    • getTempRentRateDenominator

      public Int64 getTempRentRateDenominator()
      Value of the tempRentRateDenominator field.
      Returns:
      the tempRentRateDenominator field value
    • getMaxEntriesToArchive

      public Uint32 getMaxEntriesToArchive()
      Value of the maxEntriesToArchive field.
      Returns:
      the maxEntriesToArchive field value
    • getLiveSorobanStateSizeWindowSampleSize

      public Uint32 getLiveSorobanStateSizeWindowSampleSize()
      Value of the liveSorobanStateSizeWindowSampleSize field.
      Returns:
      the liveSorobanStateSizeWindowSampleSize field value
    • getLiveSorobanStateSizeWindowSamplePeriod

      public Uint32 getLiveSorobanStateSizeWindowSamplePeriod()
      Value of the liveSorobanStateSizeWindowSamplePeriod field.
      Returns:
      the liveSorobanStateSizeWindowSamplePeriod field value
    • getEvictionScanSize

      public Uint32 getEvictionScanSize()
      Value of the evictionScanSize field.
      Returns:
      the evictionScanSize field value
    • getStartingEvictionScanLevel

      public Uint32 getStartingEvictionScanLevel()
      Value of the startingEvictionScanLevel field.
      Returns:
      the startingEvictionScanLevel field value
    • setMaxEntryTTL

      public void setMaxEntryTTL(Uint32 maxEntryTTL)
      Value of the maxEntryTTL field.
      Parameters:
      maxEntryTTL - the maxEntryTTL field value
    • setMinTemporaryTTL

      public void setMinTemporaryTTL(Uint32 minTemporaryTTL)
      Value of the minTemporaryTTL field.
      Parameters:
      minTemporaryTTL - the minTemporaryTTL field value
    • setMinPersistentTTL

      public void setMinPersistentTTL(Uint32 minPersistentTTL)
      Value of the minPersistentTTL field.
      Parameters:
      minPersistentTTL - the minPersistentTTL field value
    • setPersistentRentRateDenominator

      public void setPersistentRentRateDenominator(Int64 persistentRentRateDenominator)
      Value of the persistentRentRateDenominator field.
      Parameters:
      persistentRentRateDenominator - the persistentRentRateDenominator field value
    • setTempRentRateDenominator

      public void setTempRentRateDenominator(Int64 tempRentRateDenominator)
      Value of the tempRentRateDenominator field.
      Parameters:
      tempRentRateDenominator - the tempRentRateDenominator field value
    • setMaxEntriesToArchive

      public void setMaxEntriesToArchive(Uint32 maxEntriesToArchive)
      Value of the maxEntriesToArchive field.
      Parameters:
      maxEntriesToArchive - the maxEntriesToArchive field value
    • setLiveSorobanStateSizeWindowSampleSize

      public void setLiveSorobanStateSizeWindowSampleSize(Uint32 liveSorobanStateSizeWindowSampleSize)
      Value of the liveSorobanStateSizeWindowSampleSize field.
      Parameters:
      liveSorobanStateSizeWindowSampleSize - the liveSorobanStateSizeWindowSampleSize field value
    • setLiveSorobanStateSizeWindowSamplePeriod

      public void setLiveSorobanStateSizeWindowSamplePeriod(Uint32 liveSorobanStateSizeWindowSamplePeriod)
      Value of the liveSorobanStateSizeWindowSamplePeriod field.
      Parameters:
      liveSorobanStateSizeWindowSamplePeriod - the liveSorobanStateSizeWindowSamplePeriod field value
    • setEvictionScanSize

      public void setEvictionScanSize(Uint32 evictionScanSize)
      Value of the evictionScanSize field.
      Parameters:
      evictionScanSize - the evictionScanSize field value
    • setStartingEvictionScanLevel

      public void setStartingEvictionScanLevel(Uint32 startingEvictionScanLevel)
      Value of the startingEvictionScanLevel field.
      Parameters:
      startingEvictionScanLevel - the startingEvictionScanLevel field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object