public class YamlProxyConfiguration extends Object
Constructor and Description |
---|
YamlProxyConfiguration() |
Modifier and Type | Method and Description |
---|---|
MasterSlaveRule |
obtainMasterSlaveRule()
Get master slave rule from yaml.
|
ShardingRule |
obtainShardingRule(Collection<String> dataSourceNames)
Get sharding rule from yaml.
|
static YamlProxyConfiguration |
unmarshal(byte[] yamlBytes)
Unmarshal yaml sharding configuration from yaml bytes.
|
static YamlProxyConfiguration |
unmarshal(File yamlFile)
Unmarshal yaml sharding configuration from yaml file.
|
public static YamlProxyConfiguration unmarshal(File yamlFile) throws IOException
yamlFile
- yaml fileIOException
- IO Exceptionpublic static YamlProxyConfiguration unmarshal(byte[] yamlBytes) throws IOException
yamlBytes
- yaml bytesIOException
- IO Exceptionpublic ShardingRule obtainShardingRule(Collection<String> dataSourceNames)
dataSourceNames
- data source namespublic MasterSlaveRule obtainMasterSlaveRule()
Copyright © 2018. All rights reserved.