POST
/
tables
/
{tableName}
/
rebalance
curl --request POST \
  --url https://dev.startree.ai/tables/{tableName}/rebalance \
  --header 'Authorization: <api-key>'
{
  "jobId": "<string>",
  "status": "NO_OP",
  "description": "<string>",
  "instanceAssignment": {},
  "tierInstanceAssignment": {},
  "segmentAssignment": {},
  "preChecksResult": {},
  "rebalanceSummaryResult": {
    "serverInfo": {
      "numServersGettingNewSegments": 123,
      "numServers": {
        "valueBeforeRebalance": 123,
        "expectedValueAfterRebalance": 123
      },
      "serversAdded": [
        "<string>"
      ],
      "serversRemoved": [
        "<string>"
      ],
      "serversUnchanged": [
        "<string>"
      ],
      "serversGettingNewSegments": [
        "<string>"
      ],
      "serverSegmentChangeInfo": {}
    },
    "segmentInfo": {
      "totalSegmentsToBeMoved": 123,
      "maxSegmentsAddedToASingleServer": 123,
      "estimatedAverageSegmentSizeInBytes": 123,
      "totalEstimatedDataToBeMovedInBytes": 123,
      "replicationFactor": {
        "valueBeforeRebalance": 123,
        "expectedValueAfterRebalance": 123
      },
      "numSegmentsInSingleReplica": {
        "valueBeforeRebalance": 123,
        "expectedValueAfterRebalance": 123
      },
      "numSegmentsAcrossAllReplicas": {
        "valueBeforeRebalance": 123,
        "expectedValueAfterRebalance": 123
      }
    }
  }
}

Authorizations

Authorization
string
header
required

The format of the key is "Basic <token>" or "Bearer <token>"

Path Parameters

tableName
string
required

Name of the table to rebalance

Query Parameters

type
string
required

OFFLINE|REALTIME

dryRun
boolean
default:false

Whether to rebalance table in dry-run mode

preChecks
boolean
default:false

Whether to enable pre-checks for table, must be in dry-run mode to enable

reassignInstances
boolean
default:false

Whether to reassign instances before reassigning segments

includeConsuming
boolean
default:false

Whether to reassign CONSUMING segments for real-time table

bootstrap
boolean
default:false

Whether to rebalance table in bootstrap mode (regardless of minimum segment movement, reassign all segments in a round-robin fashion as if adding new segments to an empty table)

downtime
boolean
default:false

Whether to allow downtime for the rebalance

minAvailableReplicas
integer
default:1

For no-downtime rebalance, minimum number of replicas to keep alive during rebalance, or maximum number of replicas allowed to be unavailable if value is negative

lowDiskMode
boolean
default:false

For no-downtime rebalance, whether to enable low disk mode during rebalance. When enabled, segments will first be offloaded from servers, then added to servers after offload is done while maintaining the min available replicas. It may increase the total time of the rebalance, but can be useful when servers are low on disk space, and we want to scale up the cluster and rebalance the table to more servers.

bestEfforts
boolean
default:false

Whether to use best-efforts to rebalance (not fail the rebalance when the no-downtime contract cannot be achieved)

externalViewCheckIntervalInMs
integer
default:1000

How often to check if external view converges with ideal states

externalViewStabilizationTimeoutInMs
integer
default:3600000

How long to wait till external view converges with ideal states

heartbeatIntervalInMs
integer
default:300000

How often to make a status update (i.e. heartbeat)

heartbeatTimeoutInMs
integer
default:3600000

How long to wait for next status update (i.e. heartbeat) before the job is considered failed

maxAttempts
integer
default:3

Max number of attempts to rebalance

retryInitialDelayInMs
integer
default:300000

Initial delay to exponentially backoff retry

updateTargetTier
boolean
default:false

Whether to update segment target tier as part of the rebalance

Response

200 - application/json

successful operation

The response is of type object.