From 892c311757d61cffef0ccd3f95b869d5ad4eeed5 Mon Sep 17 00:00:00 2001 From: Arjun Singh Bora Date: Thu, 12 Dec 2024 18:54:05 -0800 Subject: [PATCH] . --- .../controller/server/AdminSparkServer.java | 105 +++++++++++++++++- .../controller/server/StoresRoutes.java | 33 +++++- 2 files changed, 136 insertions(+), 2 deletions(-) diff --git a/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/AdminSparkServer.java b/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/AdminSparkServer.java index 2a99d560d8..6500255369 100644 --- a/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/AdminSparkServer.java +++ b/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/AdminSparkServer.java @@ -1,7 +1,110 @@ package com.linkedin.venice.controller.server; import static com.linkedin.venice.controllerapi.ControllerApiConstants.CLUSTER; -import static com.linkedin.venice.controllerapi.ControllerRoute.*; +import static com.linkedin.venice.controllerapi.ControllerRoute.ABORT_MIGRATION; +import static com.linkedin.venice.controllerapi.ControllerRoute.ADD_DERIVED_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.ADD_VALUE_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.ADD_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.AGGREGATED_HEALTH_STATUS; +import static com.linkedin.venice.controllerapi.ControllerRoute.ALLOW_LIST_ADD_NODE; +import static com.linkedin.venice.controllerapi.ControllerRoute.ALLOW_LIST_REMOVE_NODE; +import static com.linkedin.venice.controllerapi.ControllerRoute.BACKUP_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.CHECK_RESOURCE_CLEANUP_FOR_STORE_CREATION; +import static com.linkedin.venice.controllerapi.ControllerRoute.CLEANUP_INSTANCE_CUSTOMIZED_STATES; +import static com.linkedin.venice.controllerapi.ControllerRoute.CLUSTER_DISCOVERY; +import static com.linkedin.venice.controllerapi.ControllerRoute.CLUSTER_HEALTH_STORES; +import static com.linkedin.venice.controllerapi.ControllerRoute.COMPARE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.COMPLETE_MIGRATION; +import static com.linkedin.venice.controllerapi.ControllerRoute.CONFIGURE_ACTIVE_ACTIVE_REPLICATION_FOR_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.CREATE_REAL_TIME_TOPIC; +import static com.linkedin.venice.controllerapi.ControllerRoute.CREATE_STORAGE_PERSONA; +import static com.linkedin.venice.controllerapi.ControllerRoute.ClUSTER_HEALTH_INSTANCES; +import static com.linkedin.venice.controllerapi.ControllerRoute.DATA_RECOVERY; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_ACL; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_ALL_VERSIONS; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_KAFKA_TOPIC; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_OLD_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_STORAGE_PERSONA; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.EMPTY_PUSH; +import static com.linkedin.venice.controllerapi.ControllerRoute.ENABLE_MAX_CAPACITY_PROTECTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.ENABLE_QUOTA_REBALANCED; +import static com.linkedin.venice.controllerapi.ControllerRoute.ENABLE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.ENABLE_THROTTLING; +import static com.linkedin.venice.controllerapi.ControllerRoute.END_OF_PUSH; +import static com.linkedin.venice.controllerapi.ControllerRoute.EXECUTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.FUTURE_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ACL; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ADMIN_TOPIC_METADATA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ALL_MIGRATION_PUSH_STRATEGIES; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ALL_REPLICATION_METADATA_SCHEMAS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ALL_VALUE_AND_DERIVED_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ALL_VALUE_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_CLUSTER_STORAGE_PERSONAS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_DELETABLE_STORE_TOPICS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_HEARTBEAT_TIMESTAMP_FROM_SYSTEM_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_INUSE_SCHEMA_IDS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_KAFKA_TOPIC_CONFIGS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_KEY_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ONGOING_INCREMENTAL_PUSH_VERSIONS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_REGION_PUSH_DETAILS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_REPUSH_INFO; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_ROUTERS_CLUSTER_CONFIG; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STALE_STORES_IN_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STORAGE_PERSONA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STORAGE_PERSONA_ASSOCIATED_WITH_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STORES_IN_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STORE_LARGEST_USED_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_VALUE_OR_DERIVED_SCHEMA_ID; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_VALUE_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_VALUE_SCHEMA_ID; +import static com.linkedin.venice.controllerapi.ControllerRoute.IS_STORE_VERSION_READY_FOR_DATA_RECOVERY; +import static com.linkedin.venice.controllerapi.ControllerRoute.JOB; +import static com.linkedin.venice.controllerapi.ControllerRoute.KILL_OFFLINE_PUSH_JOB; +import static com.linkedin.venice.controllerapi.ControllerRoute.LAST_SUCCEED_EXECUTION_ID; +import static com.linkedin.venice.controllerapi.ControllerRoute.LEADER_CONTROLLER; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_BOOTSTRAPPING_VERSIONS; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_CHILD_CLUSTERS; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_NODES; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_REPLICAS; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_STORES; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_STORE_PUSH_INFO; +import static com.linkedin.venice.controllerapi.ControllerRoute.MASTER_CONTROLLER; +import static com.linkedin.venice.controllerapi.ControllerRoute.MIGRATE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.NEW_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.NODE_REMOVABLE; +import static com.linkedin.venice.controllerapi.ControllerRoute.NODE_REPLICAS; +import static com.linkedin.venice.controllerapi.ControllerRoute.NODE_REPLICAS_READINESS; +import static com.linkedin.venice.controllerapi.ControllerRoute.OFFLINE_PUSH_INFO; +import static com.linkedin.venice.controllerapi.ControllerRoute.PREPARE_DATA_RECOVERY; +import static com.linkedin.venice.controllerapi.ControllerRoute.REMOVE_DERIVED_SCHEMA; +import static com.linkedin.venice.controllerapi.ControllerRoute.REMOVE_NODE; +import static com.linkedin.venice.controllerapi.ControllerRoute.REMOVE_STORE_FROM_GRAVEYARD; +import static com.linkedin.venice.controllerapi.ControllerRoute.REPLICATE_META_DATA; +import static com.linkedin.venice.controllerapi.ControllerRoute.REQUEST_TOPIC; +import static com.linkedin.venice.controllerapi.ControllerRoute.ROLLBACK_TO_BACKUP_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.ROLL_FORWARD_TO_FUTURE_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.SEND_HEARTBEAT_TIMESTAMP_TO_SYSTEM_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.SEND_PUSH_JOB_DETAILS; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_MIGRATION_PUSH_STRATEGY; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_OWNER; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_PARTITION_COUNT; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_TOPIC_COMPACTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.SKIP_ADMIN; +import static com.linkedin.venice.controllerapi.ControllerRoute.STORAGE_ENGINE_OVERHEAD_RATIO; +import static com.linkedin.venice.controllerapi.ControllerRoute.STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.STORE_MIGRATION_ALLOWED; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_ACL; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_ADMIN_TOPIC_METADATA; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_CLUSTER_CONFIG; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_KAFKA_TOPIC_LOG_COMPACTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_KAFKA_TOPIC_MIN_IN_SYNC_REPLICA; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_KAFKA_TOPIC_RETENTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_STORAGE_PERSONA; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPLOAD_PUSH_JOB_STATUS; +import static com.linkedin.venice.controllerapi.ControllerRoute.WIPE_CLUSTER; import com.fasterxml.jackson.databind.ObjectMapper; import com.linkedin.venice.HttpConstants; diff --git a/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/StoresRoutes.java b/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/StoresRoutes.java index 90142af8aa..7680b8635e 100644 --- a/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/StoresRoutes.java +++ b/services/venice-controller/src/main/java/com/linkedin/venice/controller/server/StoresRoutes.java @@ -23,7 +23,38 @@ import static com.linkedin.venice.controllerapi.ControllerApiConstants.TOPIC_COMPACTION_POLICY; import static com.linkedin.venice.controllerapi.ControllerApiConstants.VERSION; import static com.linkedin.venice.controllerapi.ControllerApiConstants.WRITE_OPERATION; -import static com.linkedin.venice.controllerapi.ControllerRoute.*; +import static com.linkedin.venice.controllerapi.ControllerRoute.ABORT_MIGRATION; +import static com.linkedin.venice.controllerapi.ControllerRoute.BACKUP_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.CLUSTER_HEALTH_STORES; +import static com.linkedin.venice.controllerapi.ControllerRoute.COMPARE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.COMPLETE_MIGRATION; +import static com.linkedin.venice.controllerapi.ControllerRoute.CONFIGURE_ACTIVE_ACTIVE_REPLICATION_FOR_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.CREATE_REAL_TIME_TOPIC; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_ALL_VERSIONS; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_KAFKA_TOPIC; +import static com.linkedin.venice.controllerapi.ControllerRoute.DELETE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.ENABLE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.FUTURE_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_DELETABLE_STORE_TOPICS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_HEARTBEAT_TIMESTAMP_FROM_SYSTEM_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_INUSE_SCHEMA_IDS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_REGION_PUSH_DETAILS; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_REPUSH_INFO; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STALE_STORES_IN_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.GET_STORES_IN_CLUSTER; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_STORES; +import static com.linkedin.venice.controllerapi.ControllerRoute.LIST_STORE_PUSH_INFO; +import static com.linkedin.venice.controllerapi.ControllerRoute.MIGRATE_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.REMOVE_STORE_FROM_GRAVEYARD; +import static com.linkedin.venice.controllerapi.ControllerRoute.ROLLBACK_TO_BACKUP_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.ROLL_FORWARD_TO_FUTURE_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.SEND_HEARTBEAT_TIMESTAMP_TO_SYSTEM_STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_OWNER; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_TOPIC_COMPACTION; +import static com.linkedin.venice.controllerapi.ControllerRoute.SET_VERSION; +import static com.linkedin.venice.controllerapi.ControllerRoute.STORAGE_ENGINE_OVERHEAD_RATIO; +import static com.linkedin.venice.controllerapi.ControllerRoute.STORE; +import static com.linkedin.venice.controllerapi.ControllerRoute.UPDATE_STORE; import com.linkedin.venice.HttpConstants; import com.linkedin.venice.acl.DynamicAccessController;