Class ControllerClient
- java.lang.Object
-
- com.linkedin.venice.controllerapi.ControllerClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
D2ControllerClient
public class ControllerClient extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description ControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls)
ControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StoreMigrationResponse
abortMigration(java.lang.String storeName, java.lang.String destClusterName)
This command should be sent to src controller, not dest controllerSchemaResponse
addDerivedSchema(java.lang.String storeName, int valueSchemaId, java.lang.String derivedSchemaStr)
SchemaResponse
addDerivedSchema(java.lang.String storeName, int valueSchemaId, java.lang.String derivedSchemaStr, int derivedSchemaId)
ControllerResponse
addNodeIntoAllowList(java.lang.String instanceId)
SchemaResponse
addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr)
SchemaResponse
addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr, int valueSchemaId)
SchemaResponse
addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr, int valueSchemaId, DirectionalSchemaCompatibilityType schemaCompatType)
VersionResponse
addVersionAndStartIngestion(java.lang.String storeName, java.lang.String pushJobId, int version, int partitionCount, Version.PushType pushType, java.lang.String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId)
Used for store migration to add version and start ingestion in destination cluster for new pushes in the source cluster during the ingestion.ControllerResponse
checkResourceCleanupForStoreCreation(java.lang.String storeName)
MultiStoreTopicsResponse
cleanupInstanceCustomizedStates()
void
close()
StoreComparisonResponse
compareStore(java.lang.String storeName, java.lang.String fabricA, java.lang.String fabricB)
StoreMigrationResponse
completeMigration(java.lang.String storeName, java.lang.String destClusterName)
ControllerResponse
configureActiveActiveReplicationForCluster(boolean enableActiveActiveReplication, java.lang.String storeType, java.util.Optional<java.lang.String> regionsFilter)
static ControllerClient
constructClusterControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls)
static ControllerClient
constructClusterControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory)
StoreResponse
copyOverStoreMetadata(java.lang.String sourceFabric, java.lang.String destFabric, java.lang.String storeName)
NewStoreResponse
createNewStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema)
NewStoreResponse
createNewStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema, java.lang.String accessPermissions)
ControllerResponse
createNewStoreWithParameters(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema, UpdateStoreQueryParams updateStoreQueryParams)
Simplified API that wraps together the store create and update functionalities with some clean up functionalityNewStoreResponse
createNewSystemStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema)
ControllerResponse
createStoragePersona(java.lang.String name, long quota, java.util.Set<java.lang.String> storesToEnforce, java.util.Set<java.lang.String> owners)
ControllerResponse
dataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, boolean sourceVersionIncluded, boolean copyAllVersionConfigs, java.util.Optional<Version> sourceVersion)
AclResponse
deleteAclForStore(java.lang.String storeName)
MultiVersionResponse
deleteAllVersions(java.lang.String storeName)
ControllerResponse
deleteKafkaTopic(java.lang.String topicName)
VersionResponse
deleteOldVersion(java.lang.String storeName, int versionNum)
ControllerResponse
deleteStoragePersona(java.lang.String name)
TrackableControllerResponse
deleteStore(java.lang.String storeName)
ControllerResponse
deleteValueSchemas(java.lang.String storeName, java.util.List<java.lang.String> schemaIds)
ControllerResponse
disableAndDeleteStore(java.lang.String storeName)
static ControllerClient
discoverAndConstructControllerClient(java.lang.String storeName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory, int retryAttempts)
D2ServiceDiscoveryResponse
discoverCluster(java.lang.String storeName)
static D2ServiceDiscoveryResponse
discoverCluster(java.lang.String discoveryUrls, java.lang.String storeName, java.util.Optional<SSLFactory> sslFactory, int retryAttempts)
protected java.lang.String
discoverLeaderController()
VersionCreationResponse
emptyPush(java.lang.String storeName, java.lang.String pushJobId, long storeSize)
ControllerResponse
enableMaxCapacityProtection(boolean isMaxCapacityProtection)
ControllerResponse
enableQuotaRebalanced(boolean isQuotaRebalanced, int expectRouterCount)
ControllerResponse
enableStoreReads(java.lang.String storeName, boolean enable)
ControllerResponse
enableStoreReadWrites(java.lang.String storeName, boolean enable)
ControllerResponse
enableStoreWrites(java.lang.String storeName, boolean enable)
ControllerResponse
enableThrottling(boolean isThrottlingEnabled)
protected static java.lang.String
encodeQueryParams(QueryParams params)
AclResponse
getAclForStore(java.lang.String storeName)
AdminCommandExecutionResponse
getAdminCommandExecution(long executionId)
AdminTopicMetadataResponse
getAdminTopicMetadata(java.util.Optional<java.lang.String> storeName)
MultiSchemaResponse
getAllReplicationMetadataSchemas(java.lang.String storeName)
MultiSchemaResponse
getAllValueAndDerivedSchema(java.lang.String storeName)
MultiSchemaResponse
getAllValueSchema(java.lang.String storeName)
MultiStoreStatusResponse
getBackupVersions(java.lang.String clusterName, java.lang.String storeName)
java.lang.String
getClusterName()
ClusterStaleDataAuditResponse
getClusterStaleStores(java.lang.String clusterName, java.lang.String parentControllerUrl)
MultiStoragePersonaResponse
getClusterStoragePersonas()
MultiStoreInfoResponse
getClusterStores(java.lang.String clusterName)
java.util.Collection<java.lang.String>
getControllerDiscoveryUrls()
MultiStoreTopicsResponse
getDeletableStoreTopics()
MultiStoreStatusResponse
getFutureVersions(java.lang.String clusterName, java.lang.String storeName)
SystemStoreHeartbeatResponse
getHeartbeatFromSystemStore(java.lang.String storeName)
SchemaUsageResponse
getInUseSchemaIds(java.lang.String storeName)
PubSubTopicConfigResponse
getKafkaTopicConfigs(java.lang.String kafkaTopicName)
SchemaResponse
getKeySchema(java.lang.String storeName)
LastSucceedExecutionIdResponse
getLastSucceedExecutionId()
java.lang.String
getLeaderControllerUrl()
MigrationPushStrategyResponse
getMigrationPushStrategies()
protected static QueryParams
getQueryParamsToDiscoverCluster(java.lang.String storeName)
RegionPushDetailsResponse
getRegionPushDetails(java.lang.String storeName, boolean isPartitionDetailEnabled)
RepushInfoResponse
getRepushInfo(java.lang.String storeName, java.util.Optional<java.lang.String> fabricName)
RoutersClusterConfigResponse
getRoutersClusterConfig()
StorageEngineOverheadRatioResponse
getStorageEngineOverheadRatio(java.lang.String storeName)
StoragePersonaResponse
getStoragePersona(java.lang.String name)
StoragePersonaResponse
getStoragePersonaAssociatedWithStore(java.lang.String name)
StoreResponse
getStore(java.lang.String storeName)
StoreResponse
getStore(java.lang.String storeName, int timeoutMs)
static StoreResponse
getStore(java.lang.String urlsToFindLeaderController, java.lang.String clusterName, java.lang.String storeName)
Deprecated.VersionResponse
getStoreLargestUsedVersion(java.lang.String clusterName, java.lang.String storeName)
SchemaResponse
getValueOrDerivedSchemaId(java.lang.String storeName, java.lang.String derivedSchemaStr)
SchemaResponse
getValueSchema(java.lang.String storeName, int valueSchemaId)
SchemaResponse
getValueSchemaID(java.lang.String storeName, java.lang.String valueSchemaStr)
NodeStatusResponse
isNodeRemovable(java.lang.String instanceId)
NodeStatusResponse
isNodeRemovable(java.lang.String instanceId, java.util.List<java.lang.String> lockedNodeIds)
StoreMigrationResponse
isStoreMigrationAllowed()
ReadyForDataRecoveryResponse
isStoreVersionReadyForDataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, java.util.Optional<java.lang.Integer> sourceAmplificationFactor)
ControllerResponse
killOfflinePushJob(java.lang.String kafkaTopic)
MultiVersionStatusResponse
listBootstrappingVersions()
ChildAwareResponse
listChildControllers(java.lang.String clusterName)
MultiNodesStatusResponse
listInstancesStatuses(boolean enableReplicas)
MultiReplicaResponse
listReplicas(java.lang.String storeName, int version)
MultiReplicaResponse
listStorageNodeReplicas(java.lang.String instanceId)
MultiNodeResponse
listStorageNodes()
StoreHealthAuditResponse
listStorePushInfo(java.lang.String storeName, boolean isPartitionDetailEnabled)
MultiStoreStatusResponse
listStoresStatuses()
StoreMigrationResponse
migrateStore(java.lang.String storeName, java.lang.String destClusterName)
protected QueryParams
newParams()
Add all global parameters in this method.NodeReplicasReadinessResponse
nodeReplicasReadiness(java.lang.String instanceId)
VersionResponse
overrideSetActiveVersion(java.lang.String storeName, int version)
ControllerResponse
prepareDataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, java.util.Optional<java.lang.Integer> sourceAmplificationFactor)
JobStatusQueryResponse
queryDetailedJobStatus(java.lang.String kafkaTopic, java.lang.String region)
This method will retrieve detailed job status, including uncompleted partitions and replicas from a child region.JobStatusQueryResponse
queryJobStatus(java.lang.String kafkaTopic)
JobStatusQueryResponse
queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion)
This method is used to query the job status from a controller.JobStatusQueryResponse
queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, int timeoutMs, java.lang.String targetedRegions)
JobStatusQueryResponse
queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, java.lang.String targetedRegions)
JobStatusQueryResponse
queryOverallJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion)
JobStatusQueryResponse
queryOverallJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, java.lang.String targetedRegions)
This method has a longer timeout intended to be used to query the overall job status on a parent controller.MultiStoreResponse
queryStoreList()
MultiStoreResponse
queryStoreList(boolean includeSystemStores)
MultiStoreResponse
queryStoreList(boolean includeSystemStores, java.util.Optional<java.lang.String> configNameFilter, java.util.Optional<java.lang.String> configValueFilter)
SchemaResponse
removeDerivedSchema(java.lang.String storeName, int valueSchemaId, int derivedSchemaId)
ControllerResponse
removeNodeFromAllowList(java.lang.String instanceId)
ControllerResponse
removeNodeFromCluster(java.lang.String instanceId)
ControllerResponse
removeStoreFromGraveyard(java.lang.String storeName)
VersionCreationResponse
requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride)
VersionCreationResponse
requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride, boolean deferVersionSwap)
VersionCreationResponse
requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride, boolean deferVersionSwap, java.lang.String targetedRegions, int repushSourceVersion)
Request a topic for the VeniceWriter to write into.<R extends ControllerResponse>
RretryableRequest(int totalAttempts, java.util.function.Function<ControllerClient,R> request)
<R extends ControllerResponse>
RretryableRequest(int totalAttempts, java.util.function.Function<ControllerClient,R> request, java.util.function.Function<R,java.lang.Boolean> abortRetryCondition)
static <C extends ControllerClient,R extends ControllerResponse>
RretryableRequest(C client, int totalAttempts, java.util.function.Function<C,R> request)
Useful for pieces of code which want to have a test mocking the result of the function that's passed in...static <C extends ControllerClient,R extends ControllerResponse>
RretryableRequest(C client, int totalAttempts, java.util.function.Function<C,R> request, java.util.function.Function<R,java.lang.Boolean> abortRetryCondition)
ControllerResponse
rollbackToBackupVersion(java.lang.String storeName)
ControllerResponse
rollbackToBackupVersion(java.lang.String storeName, java.lang.String regionFilter)
ControllerResponse
rollForwardToFutureVersion(java.lang.String storeName)
ControllerResponse
rollForwardToFutureVersion(java.lang.String storeName, java.lang.String regionFilter)
ControllerResponse
sendEmptyPushAndWait(java.lang.String storeName, java.lang.String pushJobId, long storeSize, long timeOut)
Sends and empty push to the venice controller, but verifies that the push has succeeded before returning to the caller.ControllerResponse
sendHeartbeatToSystemStore(java.lang.String storeName, long heartbeatTimestamp)
ControllerResponse
sendPushJobDetails(java.lang.String storeName, int version, byte[] pushJobDetails)
ControllerResponse
setMigrationPushStrategy(java.lang.String voldemortStoreName, java.lang.String pushStrategy)
OwnerResponse
setStoreOwner(java.lang.String storeName, java.lang.String owner)
PartitionResponse
setStorePartitionCount(java.lang.String storeName, java.lang.String partitionNum)
ControllerResponse
skipAdminMessage(java.lang.String offset, boolean skipDIV)
AclResponse
updateAclForStore(java.lang.String storeName, java.lang.String accessPermissions)
ControllerResponse
updateAdminTopicMetadata(long executionId, java.util.Optional<java.lang.String> storeName, java.util.Optional<java.lang.Long> offset, java.util.Optional<java.lang.Long> upstreamOffset)
ControllerResponse
updateClusterConfig(UpdateClusterConfigQueryParams queryParams)
ControllerResponse
updateKafkaTopicLogCompaction(java.lang.String kafkaTopicName, boolean logCompactionEnabled)
ControllerResponse
updateKafkaTopicMinInSyncReplica(java.lang.String kafkaTopicName, int minISR)
ControllerResponse
updateKafkaTopicRetention(java.lang.String kafkaTopicName, long retentionInMs)
ControllerResponse
updateStoragePersona(java.lang.String name, UpdateStoragePersonaQueryParams queryParams)
ControllerResponse
updateStore(java.lang.String storeName, UpdateStoreQueryParams queryParams)
ControllerResponse
wipeCluster(java.lang.String fabric, java.util.Optional<java.lang.String> storeName, java.util.Optional<java.lang.Integer> versionNum)
ControllerResponse
writeEndOfPush(java.lang.String storeName, int version)
-
-
-
Constructor Detail
-
ControllerClient
public ControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls)
-
ControllerClient
public ControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory)
- Parameters:
discoveryUrls
- comma-delimited urls to find leader controller.
-
-
Method Detail
-
discoverAndConstructControllerClient
@Deprecated public static ControllerClient discoverAndConstructControllerClient(java.lang.String storeName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory, int retryAttempts)
-
constructClusterControllerClient
@Deprecated public static ControllerClient constructClusterControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls)
-
constructClusterControllerClient
@Deprecated public static ControllerClient constructClusterControllerClient(java.lang.String clusterName, java.lang.String discoveryUrls, java.util.Optional<SSLFactory> sslFactory)
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
discoverLeaderController
protected java.lang.String discoverLeaderController()
-
getStore
public StoreResponse getStore(java.lang.String storeName)
-
getStore
public StoreResponse getStore(java.lang.String storeName, int timeoutMs)
-
getRepushInfo
public RepushInfoResponse getRepushInfo(java.lang.String storeName, java.util.Optional<java.lang.String> fabricName)
-
getFutureVersions
public MultiStoreStatusResponse getFutureVersions(java.lang.String clusterName, java.lang.String storeName)
-
getBackupVersions
public MultiStoreStatusResponse getBackupVersions(java.lang.String clusterName, java.lang.String storeName)
-
getStore
@Deprecated public static StoreResponse getStore(java.lang.String urlsToFindLeaderController, java.lang.String clusterName, java.lang.String storeName)
Deprecated.
-
getStorageEngineOverheadRatio
public StorageEngineOverheadRatioResponse getStorageEngineOverheadRatio(java.lang.String storeName)
-
getInUseSchemaIds
public SchemaUsageResponse getInUseSchemaIds(java.lang.String storeName)
-
deleteValueSchemas
public ControllerResponse deleteValueSchemas(java.lang.String storeName, java.util.List<java.lang.String> schemaIds)
-
requestTopicForWrites
public VersionCreationResponse requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride)
-
requestTopicForWrites
public VersionCreationResponse requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride, boolean deferVersionSwap)
-
requestTopicForWrites
public VersionCreationResponse requestTopicForWrites(java.lang.String storeName, long storeSize, Version.PushType pushType, java.lang.String pushJobId, boolean sendStartOfPush, boolean sorted, boolean wcEnabled, java.util.Optional<java.lang.String> partitioners, java.util.Optional<java.lang.String> compressionDictionary, java.util.Optional<java.lang.String> sourceGridFabric, boolean batchJobHeartbeatEnabled, long rewindTimeInSecondsOverride, boolean deferVersionSwap, java.lang.String targetedRegions, int repushSourceVersion)
Request a topic for the VeniceWriter to write into. A new VPJ push, or a Samza bulk processing job should both use this method. The push job ID needs to be unique for this push. Multiple requests with the same pushJobId are idempotent and will return the same topic.- Parameters:
storeName
- Name of the store being written to.storeSize
- Estimated size of push in bytes, used to determine partitioningpushJobId
- Unique identifier for this jobsendStartOfPush
- Whether controller should send START_OF_PUSH message to the newly created topic, while adding a new version. This is currently used in Samza batch load, a.k.a. grandfathersorted
- Whether the push is going to contain sorted data (in each partition) or notwcEnabled
- Whether write compute is enabled for this push job or notpartitioners
- partitioner class names in a string seperated by commacompressionDictionary
- Base64 encoded dictionary to be used to perform dictionary compressionsourceGridFabric
- An identifier of the data center which is used in native replication to determine the Kafka URLbatchJobHeartbeatEnabled
- whether batch push job enables the heartbeatrewindTimeInSecondsOverride
- if a valid value is specified (>=0) for hybrid store, this param will override the default store-level rewindTimeInSeconds config.deferVersionSwap
- whether to defer version swap after the push is donetargetedRegions
- the list of regions that is separated by comma for targeted region push.repushSourceVersion
-- Returns:
- VersionCreationResponse includes topic and partitioning
-
addVersionAndStartIngestion
public VersionResponse addVersionAndStartIngestion(java.lang.String storeName, java.lang.String pushJobId, int version, int partitionCount, Version.PushType pushType, java.lang.String remoteKafkaBootstrapServers, long rewindTimeInSecondsOverride, int replicationMetadataVersionId)
Used for store migration to add version and start ingestion in destination cluster for new pushes in the source cluster during the ingestion. The idea is like copying or create a version on an existing topic. Different use cases can be explored and expanded in the future. Applicable only to child controllers.- Parameters:
storeName
- of the original push.pushJobId
- of the original push.version
- of the original push.partitionCount
- of the original push.pushType
- of the producer.remoteKafkaBootstrapServers
- of the original push.rewindTimeInSecondsOverride
- of the original push.replicationMetadataVersionId
- of the original push.- Returns:
-
writeEndOfPush
public ControllerResponse writeEndOfPush(java.lang.String storeName, int version)
-
sendEmptyPushAndWait
public ControllerResponse sendEmptyPushAndWait(java.lang.String storeName, java.lang.String pushJobId, long storeSize, long timeOut)
Sends and empty push to the venice controller, but verifies that the push has succeeded before returning to the caller.- Parameters:
storeName
- the store name for which the empty push is forpushJobId
- the push job id for the pushstoreSize
- the size of the store (currently unused)timeOut
- max amount of time this function should take before returning in MILLISECONDS. Retries sent to the controller have 2-second sleeps between them. So a timeout should be chosen that is larger, and a multiple of 2 seconds preferably.- Returns:
- the response from the controller. Either a successful one, or a failed one with more information.
-
createNewStoreWithParameters
public ControllerResponse createNewStoreWithParameters(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema, UpdateStoreQueryParams updateStoreQueryParams)
Simplified API that wraps together the store create and update functionalities with some clean up functionality- Parameters:
storeName
- the store name to create and updateowner
- the owner of this store to be createdkeySchema
- Schema of the key for row retrieval for this storevalueSchema
- Schema of the value for rows in this new storeupdateStoreQueryParams
- What parameters should be applied to this store after it's creation- Returns:
- The response from the first failed operation of store creation or modification
-
emptyPush
public VersionCreationResponse emptyPush(java.lang.String storeName, java.lang.String pushJobId, long storeSize)
-
createNewStore
public NewStoreResponse createNewStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema)
-
createNewStore
public NewStoreResponse createNewStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema, java.lang.String accessPermissions)
-
createNewSystemStore
public NewStoreResponse createNewSystemStore(java.lang.String storeName, java.lang.String owner, java.lang.String keySchema, java.lang.String valueSchema)
-
isStoreMigrationAllowed
public StoreMigrationResponse isStoreMigrationAllowed()
-
migrateStore
public StoreMigrationResponse migrateStore(java.lang.String storeName, java.lang.String destClusterName)
-
completeMigration
public StoreMigrationResponse completeMigration(java.lang.String storeName, java.lang.String destClusterName)
-
abortMigration
public StoreMigrationResponse abortMigration(java.lang.String storeName, java.lang.String destClusterName)
This command should be sent to src controller, not dest controller
-
deleteStore
public TrackableControllerResponse deleteStore(java.lang.String storeName)
-
wipeCluster
public ControllerResponse wipeCluster(java.lang.String fabric, java.util.Optional<java.lang.String> storeName, java.util.Optional<java.lang.Integer> versionNum)
-
compareStore
public StoreComparisonResponse compareStore(java.lang.String storeName, java.lang.String fabricA, java.lang.String fabricB)
-
copyOverStoreMetadata
public StoreResponse copyOverStoreMetadata(java.lang.String sourceFabric, java.lang.String destFabric, java.lang.String storeName)
-
disableAndDeleteStore
public ControllerResponse disableAndDeleteStore(java.lang.String storeName)
-
overrideSetActiveVersion
public VersionResponse overrideSetActiveVersion(java.lang.String storeName, int version)
-
rollbackToBackupVersion
public ControllerResponse rollbackToBackupVersion(java.lang.String storeName, java.lang.String regionFilter)
-
rollbackToBackupVersion
public ControllerResponse rollbackToBackupVersion(java.lang.String storeName)
-
rollForwardToFutureVersion
public ControllerResponse rollForwardToFutureVersion(java.lang.String storeName, java.lang.String regionFilter)
-
rollForwardToFutureVersion
public ControllerResponse rollForwardToFutureVersion(java.lang.String storeName)
-
killOfflinePushJob
public ControllerResponse killOfflinePushJob(java.lang.String kafkaTopic)
-
skipAdminMessage
public ControllerResponse skipAdminMessage(java.lang.String offset, boolean skipDIV)
-
getKafkaTopicConfigs
public PubSubTopicConfigResponse getKafkaTopicConfigs(java.lang.String kafkaTopicName)
-
updateKafkaTopicLogCompaction
public ControllerResponse updateKafkaTopicLogCompaction(java.lang.String kafkaTopicName, boolean logCompactionEnabled)
-
updateKafkaTopicRetention
public ControllerResponse updateKafkaTopicRetention(java.lang.String kafkaTopicName, long retentionInMs)
-
updateKafkaTopicMinInSyncReplica
public ControllerResponse updateKafkaTopicMinInSyncReplica(java.lang.String kafkaTopicName, int minISR)
-
retryableRequest
public <R extends ControllerResponse> R retryableRequest(int totalAttempts, java.util.function.Function<ControllerClient,R> request)
-
retryableRequest
public <R extends ControllerResponse> R retryableRequest(int totalAttempts, java.util.function.Function<ControllerClient,R> request, java.util.function.Function<R,java.lang.Boolean> abortRetryCondition)
-
retryableRequest
public static <C extends ControllerClient,R extends ControllerResponse> R retryableRequest(C client, int totalAttempts, java.util.function.Function<C,R> request)
Useful for pieces of code which want to have a test mocking the result of the function that's passed in...
-
retryableRequest
public static <C extends ControllerClient,R extends ControllerResponse> R retryableRequest(C client, int totalAttempts, java.util.function.Function<C,R> request, java.util.function.Function<R,java.lang.Boolean> abortRetryCondition)
-
queryOverallJobStatus
public JobStatusQueryResponse queryOverallJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, java.lang.String targetedRegions)
This method has a longer timeout intended to be used to query the overall job status on a parent controller. The extended timeout is meant for the parent controller to query each colo's child controller for the job status and aggregate the results. UsequeryJobStatus(String, Optional)
instead if the target is a child controller.- Parameters:
kafkaTopic
- , the version topic name of the push job.incrementalPushVersion
- , the optional incremental push version of the push job.targetedRegions
- , the list of regions that is separated by comma for targeted region push.- Returns:
-
queryOverallJobStatus
public JobStatusQueryResponse queryOverallJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion)
-
queryJobStatus
public JobStatusQueryResponse queryJobStatus(java.lang.String kafkaTopic)
-
queryJobStatus
public JobStatusQueryResponse queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion)
This method is used to query the job status from a controller. It is expected to be a child controller thus a shorter timeout is enforced. UsequeryOverallJobStatus(String, Optional)
instead if the target is a parent controller.
-
queryJobStatus
public JobStatusQueryResponse queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, java.lang.String targetedRegions)
-
queryJobStatus
public JobStatusQueryResponse queryJobStatus(java.lang.String kafkaTopic, java.util.Optional<java.lang.String> incrementalPushVersion, int timeoutMs, java.lang.String targetedRegions)
-
queryDetailedJobStatus
public JobStatusQueryResponse queryDetailedJobStatus(java.lang.String kafkaTopic, java.lang.String region)
This method will retrieve detailed job status, including uncompleted partitions and replicas from a child region. If the request is sent to a parent controller, it will be forwarded to a child controller in the specified region. This method is used for data recovery progress monitoring.
-
sendPushJobDetails
public ControllerResponse sendPushJobDetails(java.lang.String storeName, int version, byte[] pushJobDetails)
-
queryStoreList
public MultiStoreResponse queryStoreList()
-
queryStoreList
public MultiStoreResponse queryStoreList(boolean includeSystemStores)
-
queryStoreList
public MultiStoreResponse queryStoreList(boolean includeSystemStores, java.util.Optional<java.lang.String> configNameFilter, java.util.Optional<java.lang.String> configValueFilter)
-
listStoresStatuses
public MultiStoreStatusResponse listStoresStatuses()
-
enableStoreWrites
public ControllerResponse enableStoreWrites(java.lang.String storeName, boolean enable)
-
enableStoreReads
public ControllerResponse enableStoreReads(java.lang.String storeName, boolean enable)
-
enableStoreReadWrites
public ControllerResponse enableStoreReadWrites(java.lang.String storeName, boolean enable)
-
deleteAllVersions
public MultiVersionResponse deleteAllVersions(java.lang.String storeName)
-
deleteOldVersion
public VersionResponse deleteOldVersion(java.lang.String storeName, int versionNum)
-
isNodeRemovable
public NodeStatusResponse isNodeRemovable(java.lang.String instanceId)
-
isNodeRemovable
public NodeStatusResponse isNodeRemovable(java.lang.String instanceId, java.util.List<java.lang.String> lockedNodeIds)
-
addNodeIntoAllowList
public ControllerResponse addNodeIntoAllowList(java.lang.String instanceId)
-
removeNodeFromAllowList
public ControllerResponse removeNodeFromAllowList(java.lang.String instanceId)
-
removeNodeFromCluster
public ControllerResponse removeNodeFromCluster(java.lang.String instanceId)
-
listStorageNodes
public MultiNodeResponse listStorageNodes()
-
listInstancesStatuses
public MultiNodesStatusResponse listInstancesStatuses(boolean enableReplicas)
-
listReplicas
public MultiReplicaResponse listReplicas(java.lang.String storeName, int version)
-
listStorageNodeReplicas
public MultiReplicaResponse listStorageNodeReplicas(java.lang.String instanceId)
-
nodeReplicasReadiness
public NodeReplicasReadinessResponse nodeReplicasReadiness(java.lang.String instanceId)
-
listChildControllers
public ChildAwareResponse listChildControllers(java.lang.String clusterName)
-
getKeySchema
public SchemaResponse getKeySchema(java.lang.String storeName)
-
addValueSchema
public SchemaResponse addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr)
-
addValueSchema
public SchemaResponse addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr, int valueSchemaId)
-
addValueSchema
public SchemaResponse addValueSchema(java.lang.String storeName, java.lang.String valueSchemaStr, int valueSchemaId, DirectionalSchemaCompatibilityType schemaCompatType)
-
addDerivedSchema
public SchemaResponse addDerivedSchema(java.lang.String storeName, int valueSchemaId, java.lang.String derivedSchemaStr)
-
addDerivedSchema
public SchemaResponse addDerivedSchema(java.lang.String storeName, int valueSchemaId, java.lang.String derivedSchemaStr, int derivedSchemaId)
-
removeDerivedSchema
public SchemaResponse removeDerivedSchema(java.lang.String storeName, int valueSchemaId, int derivedSchemaId)
-
setStorePartitionCount
public PartitionResponse setStorePartitionCount(java.lang.String storeName, java.lang.String partitionNum)
-
setStoreOwner
public OwnerResponse setStoreOwner(java.lang.String storeName, java.lang.String owner)
-
updateStore
public ControllerResponse updateStore(java.lang.String storeName, UpdateStoreQueryParams queryParams)
-
getValueSchema
public SchemaResponse getValueSchema(java.lang.String storeName, int valueSchemaId)
-
getValueSchemaID
public SchemaResponse getValueSchemaID(java.lang.String storeName, java.lang.String valueSchemaStr)
-
getValueOrDerivedSchemaId
public SchemaResponse getValueOrDerivedSchemaId(java.lang.String storeName, java.lang.String derivedSchemaStr)
-
getAllValueSchema
public MultiSchemaResponse getAllValueSchema(java.lang.String storeName)
-
getAllReplicationMetadataSchemas
public MultiSchemaResponse getAllReplicationMetadataSchemas(java.lang.String storeName)
-
getAllValueAndDerivedSchema
public MultiSchemaResponse getAllValueAndDerivedSchema(java.lang.String storeName)
-
getAdminCommandExecution
public AdminCommandExecutionResponse getAdminCommandExecution(long executionId)
-
getLastSucceedExecutionId
public LastSucceedExecutionIdResponse getLastSucceedExecutionId()
-
enableThrottling
public ControllerResponse enableThrottling(boolean isThrottlingEnabled)
-
enableMaxCapacityProtection
public ControllerResponse enableMaxCapacityProtection(boolean isMaxCapacityProtection)
-
enableQuotaRebalanced
public ControllerResponse enableQuotaRebalanced(boolean isQuotaRebalanced, int expectRouterCount)
-
getRoutersClusterConfig
public RoutersClusterConfigResponse getRoutersClusterConfig()
-
getMigrationPushStrategies
public MigrationPushStrategyResponse getMigrationPushStrategies()
-
setMigrationPushStrategy
public ControllerResponse setMigrationPushStrategy(java.lang.String voldemortStoreName, java.lang.String pushStrategy)
-
listBootstrappingVersions
public MultiVersionStatusResponse listBootstrappingVersions()
-
updateAclForStore
public AclResponse updateAclForStore(java.lang.String storeName, java.lang.String accessPermissions)
-
getAclForStore
public AclResponse getAclForStore(java.lang.String storeName)
-
deleteAclForStore
public AclResponse deleteAclForStore(java.lang.String storeName)
-
sendHeartbeatToSystemStore
public ControllerResponse sendHeartbeatToSystemStore(java.lang.String storeName, long heartbeatTimestamp)
-
getHeartbeatFromSystemStore
public SystemStoreHeartbeatResponse getHeartbeatFromSystemStore(java.lang.String storeName)
-
configureActiveActiveReplicationForCluster
public ControllerResponse configureActiveActiveReplicationForCluster(boolean enableActiveActiveReplication, java.lang.String storeType, java.util.Optional<java.lang.String> regionsFilter)
-
checkResourceCleanupForStoreCreation
public ControllerResponse checkResourceCleanupForStoreCreation(java.lang.String storeName)
-
getQueryParamsToDiscoverCluster
protected static QueryParams getQueryParamsToDiscoverCluster(java.lang.String storeName)
-
getDeletableStoreTopics
public MultiStoreTopicsResponse getDeletableStoreTopics()
-
getClusterStaleStores
public ClusterStaleDataAuditResponse getClusterStaleStores(java.lang.String clusterName, java.lang.String parentControllerUrl)
-
getClusterStores
public MultiStoreInfoResponse getClusterStores(java.lang.String clusterName)
-
getStoreLargestUsedVersion
public VersionResponse getStoreLargestUsedVersion(java.lang.String clusterName, java.lang.String storeName)
-
getRegionPushDetails
public RegionPushDetailsResponse getRegionPushDetails(java.lang.String storeName, boolean isPartitionDetailEnabled)
-
listStorePushInfo
public StoreHealthAuditResponse listStorePushInfo(java.lang.String storeName, boolean isPartitionDetailEnabled)
-
discoverCluster
public static D2ServiceDiscoveryResponse discoverCluster(java.lang.String discoveryUrls, java.lang.String storeName, java.util.Optional<SSLFactory> sslFactory, int retryAttempts)
-
discoverCluster
public D2ServiceDiscoveryResponse discoverCluster(java.lang.String storeName)
-
updateClusterConfig
public ControllerResponse updateClusterConfig(UpdateClusterConfigQueryParams queryParams)
-
prepareDataRecovery
public ControllerResponse prepareDataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, java.util.Optional<java.lang.Integer> sourceAmplificationFactor)
-
isStoreVersionReadyForDataRecovery
public ReadyForDataRecoveryResponse isStoreVersionReadyForDataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, java.util.Optional<java.lang.Integer> sourceAmplificationFactor)
-
dataRecovery
public ControllerResponse dataRecovery(java.lang.String sourceFabric, java.lang.String destinationFabric, java.lang.String storeName, int versionNumber, boolean sourceVersionIncluded, boolean copyAllVersionConfigs, java.util.Optional<Version> sourceVersion)
-
getAdminTopicMetadata
public AdminTopicMetadataResponse getAdminTopicMetadata(java.util.Optional<java.lang.String> storeName)
-
updateAdminTopicMetadata
public ControllerResponse updateAdminTopicMetadata(long executionId, java.util.Optional<java.lang.String> storeName, java.util.Optional<java.lang.Long> offset, java.util.Optional<java.lang.Long> upstreamOffset)
-
deleteKafkaTopic
public ControllerResponse deleteKafkaTopic(java.lang.String topicName)
-
createStoragePersona
public ControllerResponse createStoragePersona(java.lang.String name, long quota, java.util.Set<java.lang.String> storesToEnforce, java.util.Set<java.lang.String> owners)
-
getStoragePersona
public StoragePersonaResponse getStoragePersona(java.lang.String name)
-
deleteStoragePersona
public ControllerResponse deleteStoragePersona(java.lang.String name)
-
updateStoragePersona
public ControllerResponse updateStoragePersona(java.lang.String name, UpdateStoragePersonaQueryParams queryParams)
-
getStoragePersonaAssociatedWithStore
public StoragePersonaResponse getStoragePersonaAssociatedWithStore(java.lang.String name)
-
getClusterStoragePersonas
public MultiStoragePersonaResponse getClusterStoragePersonas()
-
cleanupInstanceCustomizedStates
public MultiStoreTopicsResponse cleanupInstanceCustomizedStates()
-
removeStoreFromGraveyard
public ControllerResponse removeStoreFromGraveyard(java.lang.String storeName)
-
newParams
protected QueryParams newParams()
Add all global parameters in this method. Always use a form of this method to generate a new list of NameValuePair objects for making HTTP requests.- Returns:
-
encodeQueryParams
protected static java.lang.String encodeQueryParams(QueryParams params)
-
getClusterName
public java.lang.String getClusterName()
-
getLeaderControllerUrl
public java.lang.String getLeaderControllerUrl()
-
getControllerDiscoveryUrls
public java.util.Collection<java.lang.String> getControllerDiscoveryUrls()
-
-