public final class HintManager extends Object implements AutoCloseable
ThreadLocal.| 构造器和说明 |
|---|
HintManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDatabaseShardingValue(String logicTable,
Comparable<?> value)
Add sharding value for database.
|
void |
addTableShardingValue(String logicTable,
Comparable<?> value)
Add sharding value for table.
|
static void |
clear()
Clear thread local for hint manager.
|
void |
clearShardingValues()
Clear sharding values.
|
void |
close() |
static Collection<Comparable<?>> |
getDatabaseShardingValues()
Get database sharding values.
|
static Collection<Comparable<?>> |
getDatabaseShardingValues(String logicTable)
Get database sharding values.
|
static HintManager |
getInstance()
Get a new instance for
HintManager. |
static Collection<Comparable<?>> |
getTableShardingValues(String logicTable)
Get table sharding values.
|
static boolean |
isDatabaseShardingOnly()
Judge whether database sharding only.
|
static boolean |
isInstantiated()
Judge whether hint manager instantiated or not.
|
static boolean |
isWriteRouteOnly()
Judge whether route to write database only or not.
|
void |
setDatabaseShardingValue(Comparable<?> value)
Set sharding value for database sharding only.
|
void |
setReadwriteSplittingAuto()
Set database routing to be automatic.
|
void |
setWriteRouteOnly()
Set database operation force route to write database only.
|
public static HintManager getInstance()
HintManager.HintManager instancepublic void setDatabaseShardingValue(Comparable<?> value)
The sharding operator is =
value - sharding valuepublic void addDatabaseShardingValue(String logicTable, Comparable<?> value)
The sharding operator is =
logicTable - logic table namevalue - sharding valuepublic void addTableShardingValue(String logicTable, Comparable<?> value)
The sharding operator is =
logicTable - logic table namevalue - sharding valuepublic static Collection<Comparable<?>> getDatabaseShardingValues()
public static Collection<Comparable<?>> getDatabaseShardingValues(String logicTable)
logicTable - logic tablepublic static Collection<Comparable<?>> getTableShardingValues(String logicTable)
logicTable - logic table namepublic static boolean isDatabaseShardingOnly()
public void setWriteRouteOnly()
public void setReadwriteSplittingAuto()
public static boolean isWriteRouteOnly()
public static void clear()
public void clearShardingValues()
public static boolean isInstantiated()
public void close()
close 在接口中 AutoCloseableCopyright © 2022 The Apache Software Foundation. All rights reserved.