Unverified Commit e7ba3167 authored by 张亮's avatar 张亮 Committed by GitHub
Browse files

Merge branch 'dev' into dev

parents ff07b49e 0573a99c
Loading
Loading
Loading
Loading

Organization.md

0 → 100644
+23 −0
Original line number Diff line number Diff line
# Sharding-JDBC Organization

## Organization members

# Project Management Committee (PMC)
As a member of PMC, you **must** contribute and maintain the features or modules, and also take part in project management and building the eco-system. Because of that, you have following rights:
1. In charged with responsibility and governance for all projects/repositories in Sharding-JDBC organization.
1. Edit rights for all repositories.
1. Merge right for pull request.
1. Vote right for promoting contributor to Committer Team and PMC.
1. Start a vote for promoting contributor to Committer Team and PMC, pull request or feature discussion.
1. For now, only 张亮 [@terrymanu](https://github.com/terrymanu) has right to remove people from PMC or Committer Team.

The current Project Management Committee is as follows (in chronological order):
* 张亮, Zhang Liang, [@terrymanu](https://github.com/terrymanu) Architect director, Jingdong
* 曹昊, Cao Hao, [@ascrutae](https://github.com/haocao) Senior Architect, Dangdang
* 吴晟, Sheng Wu, [@wu-sheng](https://github.com/wu-sheng) APM and tracing expert, Apache SkyWalking(incubator) creator & PMC member

# Voting

In various situations the Sharding-JDBC shall hold a vote. These votes can happen on the phone, email, or via a voting service, when appropriate. Voters can either respond "agree, yes, +1", "disagree, no, -1", or "abstain". A vote passes with two-thirds vote of votes cast. An abstain vote equals not voting at all.

张亮 [@terrymanu](https://github.com/terrymanu) has a special veto power: override the voting result, default: not use.
+36 −0
Original line number Diff line number Diff line
/*
 * 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 io.shardingjdbc.core.constant;

/**
 * Sharding constant.
 * 
 * @author zhangliang
 */
public interface ShardingConstant {
    
    /**
     * Logic database schema name.
     * 
     * <p>
     * Sharding-JDBC just have one logic database schema. 
     * Default: sharding_db
     * </p>
     */
    String LOGIC_SCHEMA_NAME = "sharding_db";
}
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import io.shardingjdbc.core.jdbc.adapter.AbstractDataSourceAdapter;
import io.shardingjdbc.core.jdbc.core.ShardingContext;
import io.shardingjdbc.core.jdbc.core.connection.ShardingConnection;
import io.shardingjdbc.core.rule.ShardingRule;
import lombok.Getter;

import java.sql.SQLException;
import java.util.Map;
@@ -38,6 +39,7 @@ import java.util.concurrent.ConcurrentHashMap;
 */
public class ShardingDataSource extends AbstractDataSourceAdapter implements AutoCloseable {
    
    @Getter
    private ShardingProperties shardingProperties;
    
    private ExecutorEngine executorEngine;
+3 −4
Original line number Diff line number Diff line
package io.shardingjdbc.core.merger.show;

import io.shardingjdbc.core.constant.ShardingConstant;
import io.shardingjdbc.core.merger.ResultSetMerger;

import java.io.InputStream;
@@ -14,8 +15,6 @@ import java.util.Calendar;
 */
public final class ShowDatabasesResultSetMerger implements ResultSetMerger {
    
    private static final String LOGIC_DATABASE_NAME = "sharding_db";
    
    private boolean firstNext = true;
    
    @Override
@@ -29,12 +28,12 @@ public final class ShowDatabasesResultSetMerger implements ResultSetMerger {
    
    @Override
    public Object getValue(final int columnIndex, final Class<?> type) throws SQLException {
        return LOGIC_DATABASE_NAME;
        return ShardingConstant.LOGIC_SCHEMA_NAME;
    }
    
    @Override
    public Object getValue(final String columnLabel, final Class<?> type) throws SQLException {
        return LOGIC_DATABASE_NAME;
        return ShardingConstant.LOGIC_SCHEMA_NAME;
    }
    
    @Override
+2 −1
Original line number Diff line number Diff line
package io.shardingjdbc.core.merger.show;

import com.google.common.base.Optional;
import io.shardingjdbc.core.constant.ShardingConstant;
import io.shardingjdbc.core.merger.common.AbstractMemoryResultSetMerger;
import io.shardingjdbc.core.merger.common.MemoryResultSetRow;
import io.shardingjdbc.core.rule.ShardingRule;
@@ -32,7 +33,7 @@ public final class ShowTablesResultSetMerger extends AbstractMemoryResultSetMerg
    private final Set<String> tableNames = new HashSet<>();
    
    static {
        LABEL_AND_INDEX_MAP.put("Tables_in_sharding_db", 1); 
        LABEL_AND_INDEX_MAP.put("Tables_in_" + ShardingConstant.LOGIC_SCHEMA_NAME, 1); 
    }
    
    public ShowTablesResultSetMerger(final ShardingRule shardingRule, final List<ResultSet> resultSets) throws SQLException {
Loading