Unverified Commit 0705dc0d authored by chenqy's avatar chenqy Committed by GitHub
Browse files

Merge pull request #20 from sharding-sphere/dev

update from origin
parents ff2c1371 51ef4f76
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#### Core

1. [ISSUE #373](https://github.com/sharding-sphere/sharding-sphere/issues/373) Support `order by ?`
1. [ISSUE #610](https://github.com/sharding-sphere/sharding-sphere/issues/610) Route unicast for DQL without table
1. [ISSUE #701](https://github.com/sharding-sphere/sharding-sphere/issues/701) Caching parsed results to improve performance
1. [ISSUE #773](https://github.com/sharding-sphere/sharding-sphere/issues/773) Support sharding and autoincrement key of INSERT without column names
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#### 内核

1. [ISSUE #373](https://github.com/sharding-sphere/sharding-sphere/issues/373) 支持`order by ?`
1. [ISSUE #610](https://github.com/sharding-sphere/sharding-sphere/issues/610) 无表名称的DQL采用单播路由
1. [ISSUE #701](https://github.com/sharding-sphere/sharding-sphere/issues/701) 缓存SQL解析结果以提升性能
1. [ISSUE #773](https://github.com/sharding-sphere/sharding-sphere/issues/773) 支持不包含列名的INSERT语句的分片与自增主键
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
package io.shardingsphere.core.constant.properties;

import io.shardingsphere.core.constant.ConnectionMode;
import io.shardingsphere.core.constant.transaction.TransactionType;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@@ -83,7 +82,7 @@ public enum ShardingPropertiesConstant {
     */
    CONNECTION_MODE("connection.mode", ConnectionMode.MEMORY_STRICTLY.name(), String.class),
    
    PROXY_TRANSACTION_MODE("proxy.transaction.mode", TransactionType.LOCAL.name(), String.class),
    PROXY_TRANSACTION_ENABLED("proxy.transaction.enabled", Boolean.FALSE.toString(), boolean.class),
    
    PROXY_BACKEND_USE_NIO("proxy.backend.use.nio", Boolean.FALSE.toString(), boolean.class),
    
+17 −14
Original line number Diff line number Diff line
@@ -15,37 +15,40 @@
 * </p>
 */

package io.shardingsphere.core.executor.event;
package io.shardingsphere.core.event;

import com.google.common.base.Optional;
import lombok.Getter;
import lombok.Setter;

import java.util.UUID;

/**
 * SQL execution event.
 * Sharding event.
 *
 * @author zhangliang
 */
public abstract class AbstractExecutionEvent {
    
@Getter
public class ShardingEvent {
    
    private final String id = UUID.randomUUID().toString();
    
    @Getter
    @Setter
    private EventExecutionType eventExecutionType = EventExecutionType.BEFORE_EXECUTE;
    private ShardingEventType eventType = ShardingEventType.BEFORE_EXECUTE;
    
    @Setter
    private Exception exception;
    
    /**
     * Get exception.
     * Set execute success.
     */
    public void setExecuteSuccess() {
        eventType = ShardingEventType.EXECUTE_SUCCESS;
    }
    
    /**
     * Set execute failure.
     * 
     * @return exception
     * @param cause fail cause
     */
    public Optional<? extends Exception> getException() {
        return Optional.fromNullable(exception);
    public void setExecuteFailure(final Exception cause) {
        eventType = ShardingEventType.EXECUTE_FAILURE;
        exception = cause;
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -15,26 +15,26 @@
 * </p>
 */

package io.shardingsphere.core.util;
package io.shardingsphere.core.event;

import com.google.common.eventbus.EventBus;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * Event bus for singleton instance.
 * Sharding event bus for singleton instance.
 * 
 * @author zhangliang
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class EventBusInstance {
public final class ShardingEventBusInstance {
    
    private static final EventBus INSTANCE = new EventBus();
    
    /**
     * Get event bus instance.
     * Get sharding event bus instance.
     * 
     * @return event bus instance
     * @return sharding event bus instance
     */
    public static EventBus getInstance() {
        return INSTANCE;
Loading