-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[server] Refactor ReadQuotaEnforcementHandler to reduce code duplicat…
…ion across gRPC and Netty handlers (#1154) - Extracted common quota logic into ReadQuotaEnforcementHandler::enforceQuota - Kept handler-specific logic for gRPC and Netty in their respective methods - Renamed GrpcErrorCodes to VeniceReadResponseStatus for shared use across HTTP and gRPC
- Loading branch information
1 parent
ba6ead3
commit 31a442c
Showing
12 changed files
with
420 additions
and
263 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
18 changes: 0 additions & 18 deletions
18
internal/venice-common/src/main/java/com/linkedin/venice/grpc/GrpcErrorCodes.java
This file was deleted.
Oops, something went wrong.
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
19 changes: 19 additions & 0 deletions
19
...al/venice-common/src/main/java/com/linkedin/venice/response/VeniceReadResponseStatus.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,19 @@ | ||
package com.linkedin.venice.response; | ||
|
||
/** | ||
* Enumeration of response status codes for Venice read requests. | ||
* <p> | ||
* **Positive values** correspond to standard HTTP status codes and can be used directly in HTTP responses. | ||
* **Negative values** represent custom Venice-specific error codes. | ||
* <p> | ||
* For example, a status code of `200` indicates a successful read, while a status code of `-100` might indicate a specific Venice-related error. | ||
*/ | ||
public class VeniceReadResponseStatus { | ||
public static final int KEY_NOT_FOUND = -420; | ||
|
||
public static final int OK = 200; | ||
public static final int BAD_REQUEST = 400; | ||
public static final int INTERNAL_ERROR = 500; | ||
public static final int TOO_MANY_REQUESTS = 429; | ||
public static final int SERVICE_UNAVAILABLE = 503; | ||
} |
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
Oops, something went wrong.