-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[controller][gRPC] Migrate Venice Controller APIs to gRPC
- Add controller handler service and gRPC server with secure mode - Implement create store, get store, getAllStores, list stores APIs - Add proto definitions for Stores and empty push - Enable configuration to toggle gRPC server on/off - Fix error handling and transport in ControllerClient for test compatibility - Add additional routes: AdminCommandExecution, AdminTopicMetadata, Cluster, Version - Update Docker setup for gRPC compatibility Add experimental changes Add integration test
- Loading branch information
1 parent
ed335b8
commit 052e0d8
Showing
56 changed files
with
3,143 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...mmon/src/main/java/com/linkedin/venice/controllerapi/request/ClusterDiscoveryRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.linkedin.venice.controllerapi.request; | ||
|
||
public class ClusterDiscoveryRequest extends ControllerRequest { | ||
private static final String CLUSTER_NAME_PLACEHOLDER = "UNKNOWN"; | ||
|
||
public ClusterDiscoveryRequest(String storeName) { | ||
super(CLUSTER_NAME_PLACEHOLDER, storeName); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...ice-common/src/main/java/com/linkedin/venice/controllerapi/request/ControllerRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.linkedin.venice.controllerapi.request; | ||
|
||
import static com.linkedin.venice.controllerapi.ControllerApiConstants.CLUSTER; | ||
import static com.linkedin.venice.controllerapi.ControllerApiConstants.STORE_NAME; | ||
|
||
|
||
/** | ||
* Base class for request objects used in controller endpoints. | ||
* | ||
* Extend this class to ensure required parameters are validated in the constructor of the extending class. | ||
* This class is intended for use on both the client and server sides. | ||
* All required parameters should be passed to and validated within the constructor of the extending class. | ||
*/ | ||
public class ControllerRequest { | ||
protected String clusterName; | ||
protected String storeName; | ||
|
||
public ControllerRequest(String clusterName) { | ||
this.clusterName = validateParam(clusterName, CLUSTER); | ||
this.storeName = null; | ||
} | ||
|
||
public ControllerRequest(String clusterName, String storeName) { | ||
this.clusterName = validateParam(clusterName, CLUSTER); | ||
this.storeName = validateParam(storeName, STORE_NAME); | ||
} | ||
|
||
public String getClusterName() { | ||
return clusterName; | ||
} | ||
|
||
public String getStoreName() { | ||
return storeName; | ||
} | ||
|
||
public static String validateParam(String param, String paramName) { | ||
if (param == null || param.isEmpty()) { | ||
throw new IllegalArgumentException("The request is missing the " + paramName + ", which is a mandatory field."); | ||
} | ||
return param; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...common/src/main/java/com/linkedin/venice/controllerapi/request/CreateNewStoreRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.linkedin.venice.controllerapi.request; | ||
|
||
/** | ||
* Represents a request to create a new store in the specified Venice cluster with the provided parameters. | ||
* This class encapsulates all necessary details for the creation of a store, including its name, owner, | ||
* schema definitions, and access permissions. | ||
*/ | ||
public class CreateNewStoreRequest extends ControllerRequest { | ||
public static final String DEFAULT_STORE_OWNER = ""; | ||
|
||
private final String owner; | ||
private final String keySchema; | ||
private final String valueSchema; | ||
private final boolean isSystemStore; | ||
|
||
// a JSON string representing the access permissions for the store | ||
private final String accessPermissions; | ||
|
||
public CreateNewStoreRequest( | ||
String clusterName, | ||
String storeName, | ||
String owner, | ||
String keySchema, | ||
String valueSchema, | ||
String accessPermissions, | ||
boolean isSystemStore) { | ||
super(clusterName, storeName); | ||
this.keySchema = validateParam(keySchema, "Key schema"); | ||
this.valueSchema = validateParam(valueSchema, "Value schema"); | ||
this.owner = owner == null ? DEFAULT_STORE_OWNER : owner; | ||
this.accessPermissions = accessPermissions; | ||
this.isSystemStore = isSystemStore; | ||
} | ||
|
||
public String getOwner() { | ||
return owner; | ||
} | ||
|
||
public String getKeySchema() { | ||
return keySchema; | ||
} | ||
|
||
public String getValueSchema() { | ||
return valueSchema; | ||
} | ||
|
||
public String getAccessPermissions() { | ||
return accessPermissions; | ||
} | ||
|
||
public boolean isSystemStore() { | ||
return isSystemStore; | ||
} | ||
} |
Oops, something went wrong.