com.github.antelopeframework.mybatis.shard.routing.PartitionGroup Maven / Gradle / Ivy
package com.github.antelopeframework.mybatis.shard.routing;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* 分区组: 每个 {@link DataSource} 代表一个分区; 多个 {@link DataSource} 形成一个分区组.
*
* @author yangzhi.yzh
*
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class PartitionGroup {
private String name;
private List partitions = new ArrayList<>();
public int size() {
return partitions.size();
}
public void addPartition(DataSource partition) {
partitions.add(partition);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy