public final class HintManagerHolder extends Object
Use thread-local to manage hint.
Modifier and Type | Field and Description |
---|---|
static String |
DB_COLUMN_NAME |
static String |
DB_TABLE_NAME |
Constructor and Description |
---|
HintManagerHolder() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clear hint manager for current thread-local.
|
static HintManager |
get()
Get hint manager in current thread.
|
static com.google.common.base.Optional<ShardingValue> |
getDatabaseShardingValue(ShardingKey shardingKey)
Get database sharding value.
|
static com.google.common.base.Optional<ShardingValue> |
getTableShardingValue(ShardingKey shardingKey)
Get table sharding value.
|
static boolean |
isDatabaseShardingOnly()
Adjust database sharding only.
|
static boolean |
isMasterRouteOnly()
Adjust is force route to master database only or not.
|
static boolean |
isUseShardingHint()
Adjust use sharding hint in current thread.
|
static void |
setHintManager(HintManager hintManager)
Set hint manager.
|
public static final String DB_TABLE_NAME
public static final String DB_COLUMN_NAME
public static void setHintManager(HintManager hintManager)
hintManager
- hint manager instancepublic static boolean isUseShardingHint()
public static com.google.common.base.Optional<ShardingValue> getDatabaseShardingValue(ShardingKey shardingKey)
shardingKey
- sharding keypublic static com.google.common.base.Optional<ShardingValue> getTableShardingValue(ShardingKey shardingKey)
shardingKey
- sharding keypublic static boolean isMasterRouteOnly()
public static boolean isDatabaseShardingOnly()
public static void clear()
public static HintManager get()
Copyright © 2018. All rights reserved.