Class KeyRange


  • @API(MAINTAINED)
    public class KeyRange
    extends Object
    A range within a subspace specified by two byte value endpoints.
    • Constructor Detail

      • KeyRange

        public KeyRange​(@Nonnull
                        byte[] lowKey,
                        @Nonnull
                        EndpointType lowEndpoint,
                        @Nonnull
                        byte[] highKey,
                        @Nonnull
                        EndpointType highEndpoint)
        Creates a key range.
        Parameters:
        lowKey - the starting key in the range. Note that a direct reference to this key is retained, so care must be taken not to modify its contents
        lowEndpoint - how the low endpoint is to be treated
        highKey - the ending key in the range. Note that a direct reference to this key is retained, so care must be taken not to modify its contents
        highEndpoint - how the high endpoint is to be treated
      • KeyRange

        public KeyRange​(@Nonnull
                        byte[] lowKey,
                        @Nonnull
                        byte[] highKey)
        Creates a key range.
        Parameters:
        lowKey - the starting key of the range, inclusive
        highKey - the ending key of the range, exclusive
    • Method Detail

      • getLowKey

        @Nonnull
        public byte[] getLowKey()
        Returns the lower boundary of the range to be scanned. How this starting key is to be interpreted in relation to a scan (e.g., inclusive or exclusive) is determined by the low endpoint value (getLowEndpoint(). The value returned by this method should be treated as immutable and must not be modified by the caller.
        Returns:
        the low key of the range to be scanned
      • getLowEndpoint

        @Nonnull
        public EndpointType getLowEndpoint()
        Returns:
        how the lower boundary key of the range is to be interpreted by the scan (e.g. inclusive or exclusive)
      • getHighKey

        @Nonnull
        public byte[] getHighKey()
        Returns the upper boundary of the range to be scanned. How this key is to be interpreted in relation to a scan (e.g., inclusive or exclusive) is determined by the high endpoint value (getHighEndpoint(). The value returned by this method should be treated as immutable and must not be modified by the caller.
        Returns:
        the high key of the range to be scanned
      • getHighEndpoint

        @Nonnull
        public EndpointType getHighEndpoint()
        Returns:
        how the upper boundary key of the range is to be interpreted by the scan (e.g. inclusive or exclusive)