/*
 * Copyright 1999-2015 dangdang.com.
 * <p>
 * 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.
 * </p>
 */

package com.dangdang.ddframe.rdb.sharding.config;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 配置项常量.
 * 
 * @author gaohongtao
 * @author caohao
 */
@RequiredArgsConstructor
@Getter
public enum ShardingPropertiesConstant {
    
    /**
     * 是否开启显示SQL.
     * 
     * <p>
     * 默认值: 关闭
     * </p>
     */
    SQL_SHOW("sql.show", Boolean.TRUE.toString(), boolean.class),
    
    /**
     * 是否开启SQL.
     *
     * <p>
     * 默认值: 关闭
     * </p>
     */
    METRICS_ENABLE("metrics.enable", Boolean.FALSE.toString(), boolean.class),
    
    /**
     * 度量输出周期.
     * 
     * <p>
     * 单位: 毫秒.
     * 默认值: 30000毫秒.
     * </p>
     */
    METRICS_MILLISECONDS_PERIOD("metrics.millisecond.period", "30000", long.class),
    
    /**
     * 工作线程数量.
     * 
     * <p>
     * 默认值: 100
     * </p>
     */
    EXECUTOR_SIZE("executor.size", String.valueOf(Runtime.getRuntime().availableProcessors()), int.class);
    
    private final String key;
    
    private final String defaultValue;
    
    private final Class<?> type;
    
    /**
     * 根据属性键查找枚举.
     * 
     * @param key 属性键
     * @return 枚举值
     */
    public static ShardingPropertiesConstant findByKey(final String key) {
        for (ShardingPropertiesConstant each : ShardingPropertiesConstant.values()) {
            if (each.getKey().equals(key)) {
                return each;
            }
        }
        return null;
    }
}

@@ -1420,11 +1420,13 @@
 %E8%AE%A4%E5%80%BC: 
-100
+CPU%E6%A0%B8%E6%95%B0
 %0A   

update javadoc