Package oracle.nosql.driver.ops

## Class TableUsageRequest

- java.lang.Object
- - oracle.nosql.driver.ops.Request
  - - oracle.nosql.driver.ops.TableUsageRequest

-     public class TableUsageRequest
      extends Request

  Cloud service only.

  Represents the argument of a `NoSQLHandle.getTableUsage(oracle.nosql.driver.ops.TableUsageRequest)` operation which returns dynamic information associated with a table, as returned in `TableUsageResult`. This information includes a time series of usage snapshots, each indicating data such as read and write throughput, throttling events, etc, as found in `TableUsageResult.TableUsage`.

  It is possible to return a range of usage records or, by default, only the most recent usage record. Usage records are created on a regular basis and maintained for a period of time. Only records for time periods that have completed are returned so that a user never sees changing data for a specific range.

  See Also:
    `NoSQLHandle.getTableUsage(oracle.nosql.driver.ops.TableUsageRequest)`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TableUsageRequest()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `getEndTime()` | Returns the end time to use for the request in milliseconds since the Epoch.
    `String` | `getEndTimeString()` | Returns the end time as an ISO 8601 formatted string.
    `int` | `getLimit()` | Returns the limit to the number of usage records desired.
    `long` | `getStartTime()` | Returns the start time to use for the request in milliseconds since the Epoch.
    `String` | `getStartTimeString()` | Returns the start time as an ISO 8601 formatted string.
    `String` | `getTypeName()` | Returns the type name of the request.
    `TableUsageRequest` | `setCompartment​(String compartment)` | Cloud service only.
    `TableUsageRequest` | `setEndTime​(long endTime)` | Sets the end time to use for the request in milliseconds since the Epoch in UTC time.
    `TableUsageRequest` | `setEndTime​(String endTime)` | Sets the end time from an ISO 8601 formatted string.
    `TableUsageRequest` | `setLimit​(int limit)` | Sets the limit to the number of usage records desired.
    `TableUsageRequest` | `setStartTime​(long startTime)` | Sets the start time to use for the request in milliseconds since the Epoch in UTC time.
    `TableUsageRequest` | `setStartTime​(String startTime)` | Sets the start time from an ISO 8601 formatted string.
    `TableUsageRequest` | `setTableName​(String tableName)` | Sets the table name to use for the request.
    `TableUsageRequest` | `setTimeout​(int timeoutMs)` | Sets the request timeout value, in milliseconds.

    - ### Methods inherited from class oracle.nosql.driver.ops.Request

      `getCompartment, getRateLimitDelayedMs, getReadRateLimiter, getRetryStats, getTableName, getWriteRateLimiter, setRateLimitDelayedMs, setReadRateLimiter, setWriteRateLimiter`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TableUsageRequest

          public TableUsageRequest()

  - ### Method Detail

    - #### setCompartment

          public TableUsageRequest setCompartment​(String compartment)

      Cloud service only.

      Sets the name or id of a compartment to be used for this operation.

      The compartment may be specified as either a name (or path for nested compartments) or as an id (OCID). A name (vs id) can only be used when authenticated using a specific user identity. It is not available if authenticated as an Instance Principal which can be done when calling the service from a compute instance in the Oracle Cloud Infrastructure. See `SignatureProvider.createWithInstancePrincipal()`

      Parameters:
        `compartment` - the name or id. If using a nested compartment, specify the full compartment path `compartmentA.compartmentB`, but exclude the name of the root compartment (tenant).
      Returns:
        this

    - #### setTableName

          public TableUsageRequest setTableName​(String tableName)

      Sets the table name to use for the request. This is a required parameter.
      Parameters:
        `tableName` - the table name
      Returns:
        this

    - #### setStartTime

          public TableUsageRequest setStartTime​(long startTime)

      Sets the start time to use for the request in milliseconds since the Epoch in UTC time. If no time range is set for this request the most recent complete usage record is returned.
      Parameters:
        `startTime` - the start time
      Returns:
        this

    - #### setStartTime

          public TableUsageRequest setStartTime​(String startTime)

      Sets the start time from an ISO 8601 formatted string. If timezone is not specified it is interpreted as UTC.
      Parameters:
        `startTime` - the string of a Timestamp in ISO 8601 format "uuuu-MM-dd['T'HH:mm:ss[.f..f]]".
      Returns:
        this

    - #### getStartTime

          public long getStartTime()

      Returns the start time to use for the request in milliseconds since the Epoch.
      Returns:
        the start time

    - #### getStartTimeString

          public String getStartTimeString()

      Returns the start time as an ISO 8601 formatted string. If the start timestamp is not set, null is returned.
      Returns:
        the start time, or null if not set.

    - #### setEndTime

          public TableUsageRequest setEndTime​(long endTime)

      Sets the end time to use for the request in milliseconds since the Epoch in UTC time. If no time range is set for this request the most recent complete usage record is returned.
      Parameters:
        `endTime` - the end time
      Returns:
        this

    - #### setEndTime

          public TableUsageRequest setEndTime​(String endTime)

      Sets the end time from an ISO 8601 formatted string. If timezone is not specified it is interpreted as UTC.
      Parameters:
        `endTime` - the string of a Timestamp in ISO 8601 format "uuuu-MM-dd['T'HH:mm:ss[.f..f]]".
      Returns:
        this

    - #### getEndTime

          public long getEndTime()

      Returns the end time to use for the request in milliseconds since the Epoch.
      Returns:
        the end time

    - #### getEndTimeString

          public String getEndTimeString()

      Returns the end time as an ISO 8601 formatted string. If the end timestamp is not set, null is returned.
      Returns:
        the end time, or null if not set.

    - #### setLimit

          public TableUsageRequest setLimit​(int limit)

      Sets the limit to the number of usage records desired. If this value is 0 there is no limit, but not all usage records may be returned in a single request due to size limitations.
      Parameters:
        `limit` - the numeric limit
      Returns:
        this

    - #### getLimit

          public int getLimit()

      Returns the limit to the number of usage records desired.
      Returns:
        the end time

    - #### setTimeout

          public TableUsageRequest setTimeout​(int timeoutMs)

      Sets the request timeout value, in milliseconds. This overrides any default value set in `NoSQLHandleConfig`. The value must be positive.
      Parameters:
        `timeoutMs` - the timeout value, in milliseconds
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the timeout value is less than or equal to 0

    - #### getTypeName

          public String getTypeName()

      Description copied from class: `Request`
      Returns the type name of the request. This is used for stats.
      Specified by:
        `getTypeName` in class `Request`
      Returns:
        the type name of the request