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 threadlocal for hint manager.
|
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 |
isPrimaryRouteOnly()
Judge whether route to primary database only or not.
|
void |
setDatabaseShardingValue(Comparable<?> value)
Set sharding value for database sharding only.
|
void |
setPrimaryRouteOnly()
Set database operation force route to primary 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 setPrimaryRouteOnly()
public static boolean isPrimaryRouteOnly()
public static void clear()
public void close()
close 在接口中 AutoCloseableCopyright © 2020 The Apache Software Foundation. All rights reserved.