All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bixuebihui.shardingjdbc.core.constant.ShardingPropertiesConstant Maven / Gradle / Ivy

Go to download

a fast small database connection pool and a active record flavor mini framework

There is a newer version: 1.15.3.3
Show newest version
/*
 * Copyright 1999-2015 dangdang.com.
 * 

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

*/ package com.bixuebihui.shardingjdbc.core.constant; /** * Sharding properties constant. * * @author gaohongtao * @author caohao */ public enum ShardingPropertiesConstant { /** * Enable or Disable to show SQL details. * *

* Print SQL details can help developers debug easier. * The details includes: logic SQL, parse context and rewrote actual SQL list. * Enable this property will log into log topic: {@code Sharding-JDBC-SQL}, log level is {@code INFO}. * Default: false *

*/ SQL_SHOW("sql.show", Boolean.FALSE.toString(), boolean.class), /** * Worker thread max size. * *

* Execute SQL Statement and PrepareStatement will use this thread pool. * One sharding data source will use a independent thread pool, it does not share thread pool even different data source in same JVM. * Default: same with CPU cores. *

*/ EXECUTOR_SIZE("executor.size", String.valueOf(Runtime.getRuntime().availableProcessors()), int.class); ShardingPropertiesConstant(String key, String defaultValue, Class type) { this.key = key; this.defaultValue = defaultValue; this.type = type; } private final String key; private final String defaultValue; private final Class type; /** * Find value via property key. * * @param key property key * @return value enum, return {@code null} if not found */ public static ShardingPropertiesConstant findByKey(final String key) { for (ShardingPropertiesConstant each : ShardingPropertiesConstant.values()) { if (each.getKey().equals(key)) { return each; } } return null; } public String getKey() { return key; } public String getDefaultValue() { return defaultValue; } public Class getType() { return type; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy