-
Notifications
You must be signed in to change notification settings - Fork 118
Support grpc forward #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Support grpc forward #198
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e1ec2b5
refactor kverrorhandler
Little-Wallace bc8ce39
add parameter store
Little-Wallace 2c0492b
support grpc forward for tikv client
Little-Wallace 0237ac5
check health periodly
Little-Wallace 9431bd3
Merge branch 'master' into grpc
Little-Wallace 5759e25
fix null pointer bug
Little-Wallace 305c203
Merge branch 'grpc' of github.com:Little-Wallace/client-java into grpc
Little-Wallace 403c1ed
fix some bug
Little-Wallace b7fd0de
fix some bug
Little-Wallace 000e6fb
address comment
Little-Wallace 7953a2e
refactor checker
Little-Wallace e70177f
try storeunreachable first
Little-Wallace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |||||
|
|
||||||
| import static org.tikv.common.ConfigUtils.*; | ||||||
|
|
||||||
| import io.grpc.Metadata; | ||||||
| import java.io.Serializable; | ||||||
| import java.net.URI; | ||||||
| import java.util.*; | ||||||
|
|
@@ -32,6 +33,8 @@ public class TiConfiguration implements Serializable { | |||||
|
|
||||||
| private static final Logger logger = LoggerFactory.getLogger(TiConfiguration.class); | ||||||
| private static final ConcurrentHashMap<String, String> settings = new ConcurrentHashMap<>(); | ||||||
| public static final Metadata.Key FORWARD_META_DATA_KEY = | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Metadata.Key.of("tikv-forwarded-host", Metadata.ASCII_STRING_MARSHALLER); | ||||||
|
|
||||||
| static { | ||||||
| loadFromSystemProperties(); | ||||||
|
|
@@ -72,6 +75,8 @@ private static void loadFromDefaultProperties() { | |||||
| setIfMissing(TIKV_METRICS_ENABLE, DEF_METRICS_ENABLE); | ||||||
| setIfMissing(TIKV_METRICS_PORT, DEF_METRICS_PORT); | ||||||
| setIfMissing(TIKV_NETWORK_MAPPING_NAME, DEF_TIKV_NETWORK_MAPPING_NAME); | ||||||
| setIfMissing(TIKV_ENABLE_GRPC_FORWARD, DEF_GRPC_FORWARD_ENABLE); | ||||||
| setIfMissing(TIKV_GRPC_HEALTH_CHECK_TIMEOUT, DEF_CHECK_HEALTH_TIMEOUT); | ||||||
| } | ||||||
|
|
||||||
| public static void listAll() { | ||||||
|
|
@@ -245,6 +250,7 @@ private static ReplicaRead getReplicaRead(String key) { | |||||
| private boolean showRowId = getBoolean(TIKV_SHOW_ROWID); | ||||||
| private String dbPrefix = get(TIKV_DB_PREFIX); | ||||||
| private KVMode kvMode = getKvMode(TIKV_KV_MODE); | ||||||
| private boolean enableGrpcForward = getBoolean(TIKV_ENABLE_GRPC_FORWARD); | ||||||
|
|
||||||
| private int kvClientConcurrency = getInt(TIKV_KV_CLIENT_CONCURRENCY); | ||||||
| private ReplicaRead replicaRead = getReplicaRead(TIKV_REPLICA_READ); | ||||||
|
|
@@ -253,6 +259,7 @@ private static ReplicaRead getReplicaRead(String key) { | |||||
|
|
||||||
| private boolean metricsEnable = getBoolean(TIKV_METRICS_ENABLE); | ||||||
| private int metricsPort = getInt(TIKV_METRICS_PORT); | ||||||
| private int grpcHealthCheckTimeout = getInt(TIKV_GRPC_HEALTH_CHECK_TIMEOUT); | ||||||
|
|
||||||
| private final String networkMappingName = get(TIKV_NETWORK_MAPPING_NAME); | ||||||
|
|
||||||
|
|
@@ -532,4 +539,12 @@ public TiConfiguration setMetricsPort(int metricsPort) { | |||||
| public String getNetworkMappingName() { | ||||||
| return this.networkMappingName; | ||||||
| } | ||||||
|
|
||||||
| public boolean getEnableGrpcForward() { | ||||||
| return this.enableGrpcForward; | ||||||
| } | ||||||
|
|
||||||
| public long getGrpcHealthCheckTimeout() { | ||||||
| return this.grpcHealthCheckTimeout; | ||||||
| } | ||||||
| } | ||||||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why enable by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not?