Class GraphBinaryReadLimits

java.lang.Object
org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryReadLimits

public final class GraphBinaryReadLimits extends Object
The bounds a GraphBinaryReader applies to the length and count prefixes it reads from the wire before using them to size an allocation. The values are exposed as the maxGraphBinaryValueLength, maxGraphBinaryInitialCapacity and maxGraphBinaryBulkedListLength settings of Gremlin Server and the Java driver. A limit may be raised up to Integer.MAX_VALUE.
  • Field Details

  • Method Details

    • of

      public static GraphBinaryReadLimits of(int maxValueLength, int maxInitialCapacity, int maxBulkedListLength)
      Creates limits from the supplied values, each of which must be greater than zero.
      Throws:
      IllegalArgumentException - if a value is not greater than zero
    • getMaxValueLength

      public int getMaxValueLength()
      The maximum length in bytes of a single String, BigInteger or binary value. A value declaring a longer length is rejected.
    • getMaxInitialCapacity

      public int getMaxInitialCapacity()
      The maximum capacity reserved up front for a collection or map read from the wire. This does not limit the size of the collection, which grows as elements are read. It only bounds the memory reserved before they are.
    • getMaxBulkedListLength

      public int getMaxBulkedListLength()
      The maximum number of entries that a single bulked list may expand to. A bulked list sends each distinct item once with a repeat count and is expanded into a full list when read, so a small message can otherwise describe a very large list. A bulked list that would expand beyond this size is rejected.
    • 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