From b60a157b3bb2a0d85f5375ab6b77e14fb116aa88 Mon Sep 17 00:00:00 2001 From: yanhuqing666 Date: Mon, 3 Jul 2017 17:37:30 +0800 Subject: [PATCH] #117 1.change unnecessary mycat to server2.other can repalce to ushard --- pom.xml | 10 +- src/main/java/io/mycat/MycatServer.java | 9 +- src/main/java/io/mycat/MycatStartup.java | 3 +- .../backend/mysql/xa/XARecoverCallback.java | 4 +- src/main/java/io/mycat/config/Alarms.java | 2 +- src/main/java/io/mycat/config/Versions.java | 5 +- .../java/io/mycat/config/Versions.template | 1 + .../config/classloader/DynaClassLoader.java | 3 +- .../config/loader/console/ZookeeperPath.java | 4 +- .../loader/zkprocess/comm/ZkParamCfg.java | 6 - .../config/loader/zkprocess/entity/Rules.java | 3 +- .../loader/zkprocess/entity/Schemas.java | 3 +- .../loader/zkprocess/entity/Server.java | 3 +- .../loader/zkprocess/entity/package-info.java | 4 +- .../zkprocess/parse/XmlProcessBase.java | 5 +- .../io/mycat/config/model/FirewallConfig.java | 9 - .../io/mycat/config/model/SystemConfig.java | 14 +- .../mycat/manager/handler/ShowServerLog.java | 2 +- .../response/SelectVersionComment.java | 4 +- .../io/mycat/manager/response/ShowHelp.java | 14 +- .../io/mycat/manager/response/ShowSysLog.java | 3 +- .../mycat/manager/response/ShowSysParam.java | 24 +- .../java/io/mycat/memory/MyCatMemory.java | 34 +- .../unsafe/memory/mm/MemoryManager.java | 10 +- .../unsafe/storage/DataNodeDiskManager.java | 2 +- .../unsafe/storage/DataNodeFileManager.java | 4 +- .../utils/sort/UnsafeExternalRowSorter.java | 2 +- .../utils/sort/UnsafeExternalSorter.java | 2 +- .../java/io/mycat/meta/ProxyMetaManager.java | 6 +- src/main/java/io/mycat/meta/SchemaMeta.java | 2 +- .../{MyCatMeta.java => StructureMeta.java} | 481 +++++++++--------- ...atMeta.protocol => StructureMeta.protocol} | 2 +- .../meta/table/AbstractTableMetaHandler.java | 2 +- .../java/io/mycat/meta/table/MetaHelper.java | 6 +- .../meta/table/TableMetaCheckHandler.java | 2 +- .../meta/table/TableMetaInitHandler.java | 2 +- src/main/java/io/mycat/net/AIOAcceptor.java | 2 +- .../io/mycat/net/mysql/HeartbeatPacket.java | 2 +- .../java/io/mycat/plan/node/TableNode.java | 4 +- .../io/mycat/plan/node/view/ViewNode.java | 2 +- .../java/io/mycat/route/RouteService.java | 18 +- .../route/impl/DruidMycatRouteStrategy.java | 2 +- .../parser/druid/impl/DruidInsertParser.java | 4 +- .../parser/druid/impl/DruidSelectParser.java | 4 +- .../parser/druid/impl/DruidUpdateParser.java | 2 +- .../druid/impl/ddl/DruidAlterTableParser.java | 4 +- .../handler/FetchMySQLSequnceHandler.java | 148 ++++++ .../handler/IncrSequenceMySQLHandler.java | 229 +-------- .../route/sequence/handler/SequenceVal.java | 78 +++ .../io/mycat/server/ServerConnection.java | 6 +- .../io/mycat/server/parser/ServerParse.java | 3 +- .../io/mycat/server/util/GlobalTableUtil.java | 2 +- .../sqlengine/mpp/DataNodeMergeManager.java | 6 +- .../mycat/sqlengine/mpp/UnsafeRowGrouper.java | 2 +- .../util/exception/TmpFileException.java | 44 +- .../resources/index_to_charset.properties | 219 -------- src/main/resources/myid.properties | 7 +- ushard.xml | 76 ++- 58 files changed, 700 insertions(+), 856 deletions(-) rename src/main/java/io/mycat/meta/protocol/{MyCatMeta.java => StructureMeta.java} (86%) rename src/main/java/io/mycat/meta/protocol/{MyCatMeta.protocol => StructureMeta.protocol} (97%) create mode 100644 src/main/java/io/mycat/route/sequence/handler/FetchMySQLSequnceHandler.java create mode 100644 src/main/java/io/mycat/route/sequence/handler/SequenceVal.java delete mode 100644 src/main/resources/index_to_charset.properties diff --git a/pom.xml b/pom.xml index 7f6f165a7..b7272684f 100644 --- a/pom.xml +++ b/pom.xml @@ -268,9 +268,9 @@ src/main/resources - - **/.svn/** - + + *.dtd + ${basedir} @@ -426,6 +426,10 @@ @annotation-name@ mycat: + + @root_prefix@ + ushard + diff --git a/src/main/java/io/mycat/MycatServer.java b/src/main/java/io/mycat/MycatServer.java index a13f54059..6512e42f8 100644 --- a/src/main/java/io/mycat/MycatServer.java +++ b/src/main/java/io/mycat/MycatServer.java @@ -40,7 +40,6 @@ import io.mycat.config.MycatConfig; import io.mycat.config.classloader.DynaClassLoader; import io.mycat.config.loader.zkprocess.comm.ZkConfig; import io.mycat.config.loader.zkprocess.comm.ZkParamCfg; -import io.mycat.config.loader.zkprocess.entity.server.System; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.SystemConfig; import io.mycat.config.model.TableConfig; @@ -82,14 +81,14 @@ import java.util.concurrent.atomic.AtomicLong; */ public class MycatServer { - public static final String NAME = "MyCat"; + public static final String NAME = "MyCat_"; private static final long LOG_WATCH_DELAY = 60000L; private static final long TIME_UPDATE_PERIOD = 20L; private static final long DEFAULT_SQL_STAT_RECYCLE_PERIOD = 5 * 1000L; private static final long DEFAULT_OLD_CONNECTION_CLEAR_PERIOD = 5 * 1000L; private static final MycatServer INSTANCE = new MycatServer(); - private static final Logger LOGGER = LoggerFactory.getLogger("MycatServer"); + private static final Logger LOGGER = LoggerFactory.getLogger("Server"); private static final Repository fileRepository = new FileSystemRepository(); private AtomicBoolean backupLocked; @@ -218,7 +217,7 @@ public class MycatServer { seq = xaIDInc.incrementAndGet(); } } - return "'Mycat." + this.getConfig().getSystem().getMycatNodeId() + "." + seq + "'"; + return "'"+NAME+"Server." + this.getConfig().getSystem().getServerNodeId() + "." + seq + "'"; } private void genXidSeq(String xaID) { @@ -288,7 +287,7 @@ public class MycatServer { // server startup LOGGER.info("==============================================="); - LOGGER.info(NAME + " is ready to startup ..."); + LOGGER.info(NAME + "Server is ready to startup ..."); String inf = "Startup processors ...,total processors:" + system.getProcessors() + ",aio thread pool size:" + system.getProcessorExecutor() diff --git a/src/main/java/io/mycat/MycatStartup.java b/src/main/java/io/mycat/MycatStartup.java index fbc1ffd90..d8e075ef4 100644 --- a/src/main/java/io/mycat/MycatStartup.java +++ b/src/main/java/io/mycat/MycatStartup.java @@ -28,6 +28,7 @@ package io.mycat; import java.text.SimpleDateFormat; import java.util.Date; +import io.mycat.manager.handler.ShowServerLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,7 +56,7 @@ public final class MycatStartup { // startup server.startup(); - System.out.println("MyCAT Server startup successfully. see logs in logs/mycat.log"); + System.out.println("Server startup successfully. see logs in logs/"+ ShowServerLog.DEFAULT_LOGFILE); } catch (Exception e) { SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); diff --git a/src/main/java/io/mycat/backend/mysql/xa/XARecoverCallback.java b/src/main/java/io/mycat/backend/mysql/xa/XARecoverCallback.java index 5ac144af5..2ab86222a 100644 --- a/src/main/java/io/mycat/backend/mysql/xa/XARecoverCallback.java +++ b/src/main/java/io/mycat/backend/mysql/xa/XARecoverCallback.java @@ -29,11 +29,11 @@ public class XARecoverCallback implements SQLQueryResultListener> result) { if (result.isSuccess()) { - LOGGER.debug("[CALLBACK][XA " + operator + "] when Mycat start"); + LOGGER.debug("[CALLBACK][XA " + operator + "] when server start"); XAStateLog.updateXARecoverylog(logEntry.getCoordinatorId(), logEntry.getHost(), logEntry.getPort(), logEntry.getSchema(), txState); XAStateLog.writeCheckpoint(logEntry.getCoordinatorId()); } else { - LOGGER.warn("[CALLBACK][XA " + operator + "] when Mycat start,but failed"); + LOGGER.warn("[CALLBACK][XA " + operator + "] when server start,but failed"); } } } diff --git a/src/main/java/io/mycat/config/Alarms.java b/src/main/java/io/mycat/config/Alarms.java index f954db8b6..8b1ac3e7f 100644 --- a/src/main/java/io/mycat/config/Alarms.java +++ b/src/main/java/io/mycat/config/Alarms.java @@ -30,7 +30,7 @@ package io.mycat.config; */ public interface Alarms { /** 默认报警关键词 **/ - public static final String DEFAULT = "#!MyCat#"; + public static final String DEFAULT = "#!Server#"; /** 集群无有效的节点可提供服务 **/ public static final String CLUSTER_EMPTY = "#!CLUSTER_EMPTY#"; diff --git a/src/main/java/io/mycat/config/Versions.java b/src/main/java/io/mycat/config/Versions.java index 572069cc0..4063f2937 100644 --- a/src/main/java/io/mycat/config/Versions.java +++ b/src/main/java/io/mycat/config/Versions.java @@ -32,9 +32,10 @@ public abstract class Versions { public static final byte PROTOCOL_VERSION = 10; /**服务器版本**/ - public static byte[] SERVER_VERSION = "5.6.29-mycat-2.17.04.0-20170508103825".getBytes(); - public static byte[] VERSION_COMMENT = "MyCat Server (OpenCloundDB)".getBytes(); + public static byte[] SERVER_VERSION = "5.6.29-mycat-2.17.06.0-20170703165824".getBytes(); + public static byte[] VERSION_COMMENT = "Mycat Server".getBytes(); public static String ANNOTATION_NAME = "mycat:"; + public static final String ROOT_PREFIX = "mycat"; public static void setServerVersion(String version) { byte[] mysqlVersionPart = version.getBytes(); diff --git a/src/main/java/io/mycat/config/Versions.template b/src/main/java/io/mycat/config/Versions.template index 25eb0caa1..830b9b2b7 100644 --- a/src/main/java/io/mycat/config/Versions.template +++ b/src/main/java/io/mycat/config/Versions.template @@ -35,6 +35,7 @@ public abstract class Versions { public static byte[] SERVER_VERSION = "@server-version@".getBytes(); public static byte[] VERSION_COMMENT = "@version-comment@".getBytes(); public static String ANNOTATION_NAME = "@annotation-name@"; + public static final String ROOT_PREFIX = "@root_prefix@"; public static void setServerVersion(String version) { byte[] mysqlVersionPart = version.getBytes(); diff --git a/src/main/java/io/mycat/config/classloader/DynaClassLoader.java b/src/main/java/io/mycat/config/classloader/DynaClassLoader.java index 2f39b9ef5..ae130a8ee 100644 --- a/src/main/java/io/mycat/config/classloader/DynaClassLoader.java +++ b/src/main/java/io/mycat/config/classloader/DynaClassLoader.java @@ -9,6 +9,7 @@ import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import io.mycat.config.Versions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -121,7 +122,7 @@ public class DynaClassLoader { */ public Class loadClass(String name) throws ClassNotFoundException { if (name.startsWith("java") || name.startsWith("sun") - || name.startsWith("io.mycat")) { + || name.startsWith("io."+ Versions.ROOT_PREFIX)) { return super.loadClass(name); } DynaClass dynaClass = loadedDynaClassMap.get(name); diff --git a/src/main/java/io/mycat/config/loader/console/ZookeeperPath.java b/src/main/java/io/mycat/config/loader/console/ZookeeperPath.java index dfe8d7b11..ffe0a7b54 100644 --- a/src/main/java/io/mycat/config/loader/console/ZookeeperPath.java +++ b/src/main/java/io/mycat/config/loader/console/ZookeeperPath.java @@ -1,5 +1,7 @@ package io.mycat.config.loader.console; +import io.mycat.config.Versions; + /** * 专门用来操作zookeeper路径的文件信息 * 源文件名:ZkPath.java @@ -23,7 +25,7 @@ public enum ZookeeperPath { * 最基础的mycat节点 * @字段说明 FLOW_ZK_PATH_ONLINE */ - FLOW_ZK_PATH_BASE("mycat"), + FLOW_ZK_PATH_BASE(Versions.ROOT_PREFIX), /** * 在当前在线的节点 diff --git a/src/main/java/io/mycat/config/loader/zkprocess/comm/ZkParamCfg.java b/src/main/java/io/mycat/config/loader/zkprocess/comm/ZkParamCfg.java index ea0b1955f..544db9664 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/comm/ZkParamCfg.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/comm/ZkParamCfg.java @@ -36,12 +36,6 @@ public enum ZkParamCfg { * @字段说明 zk_CFG_MYID */ ZK_CFG_MYID("myid"), - - - MYCAT_SERVER_TYPE("type"), - - MYCAT_BOOSTER_DATAHOSTS("boosterDataHosts"), - /** * 集群中所有节点的名称信息 * @字段说明 ZK_CFG_CLUSTER_NODES diff --git a/src/main/java/io/mycat/config/loader/zkprocess/entity/Rules.java b/src/main/java/io/mycat/config/loader/zkprocess/entity/Rules.java index c49fc8f9a..d61c5a8f5 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/entity/Rules.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/entity/Rules.java @@ -7,11 +7,12 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +import io.mycat.config.Versions; import io.mycat.config.loader.zkprocess.entity.rule.function.Function; import io.mycat.config.loader.zkprocess.entity.rule.tablerule.TableRule; @XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(namespace = "http://io.mycat/", name = "rule") +@XmlRootElement(namespace = "http://io."+ Versions.ROOT_PREFIX+"/", name = "rule") public class Rules { /** diff --git a/src/main/java/io/mycat/config/loader/zkprocess/entity/Schemas.java b/src/main/java/io/mycat/config/loader/zkprocess/entity/Schemas.java index 9f0792ca2..1439d9752 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/entity/Schemas.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/entity/Schemas.java @@ -7,12 +7,13 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +import io.mycat.config.Versions; import io.mycat.config.loader.zkprocess.entity.schema.datahost.DataHost; import io.mycat.config.loader.zkprocess.entity.schema.datanode.DataNode; import io.mycat.config.loader.zkprocess.entity.schema.schema.Schema; @XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(namespace = "http://io.mycat/", name = "schema") +@XmlRootElement(namespace = "http://io."+ Versions.ROOT_PREFIX+"/", name = "schema") public class Schemas { /** * 配制的逻辑表信息 diff --git a/src/main/java/io/mycat/config/loader/zkprocess/entity/Server.java b/src/main/java/io/mycat/config/loader/zkprocess/entity/Server.java index 318e4472f..1434a830f 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/entity/Server.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/entity/Server.java @@ -7,11 +7,12 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import io.mycat.config.Versions; import io.mycat.config.loader.zkprocess.entity.server.System; import io.mycat.config.loader.zkprocess.entity.server.user.User; @XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(namespace = "http://io.mycat/", name = "server") +@XmlRootElement(namespace = "http://io."+ Versions.ROOT_PREFIX+"/", name = "server") public class Server { @XmlElement(required = true) diff --git a/src/main/java/io/mycat/config/loader/zkprocess/entity/package-info.java b/src/main/java/io/mycat/config/loader/zkprocess/entity/package-info.java index b4612832f..5d69886bc 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/entity/package-info.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/entity/package-info.java @@ -1,6 +1,8 @@ -@XmlSchema(xmlns = @XmlNs(prefix = "mycat", namespaceURI = "http://io.mycat/") , elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@XmlSchema(xmlns = @XmlNs(prefix = Versions.ROOT_PREFIX, namespaceURI = "http://io."+ Versions.ROOT_PREFIX+"/") , elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package io.mycat.config.loader.zkprocess.entity; +import io.mycat.config.Versions; + import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlSchema; diff --git a/src/main/java/io/mycat/config/loader/zkprocess/parse/XmlProcessBase.java b/src/main/java/io/mycat/config/loader/zkprocess/parse/XmlProcessBase.java index 8920a4430..32958af2b 100644 --- a/src/main/java/io/mycat/config/loader/zkprocess/parse/XmlProcessBase.java +++ b/src/main/java/io/mycat/config/loader/zkprocess/parse/XmlProcessBase.java @@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.transform.stream.StreamSource; +import io.mycat.config.Versions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -114,7 +115,7 @@ public class XmlProcessBase { if (null != name) { marshaller.setProperty("com.sun.xml.internal.bind.xmlHeaders", - String.format("", name)); + String.format("", name)); } Path path = Paths.get(inputPath); @@ -149,7 +150,7 @@ public class XmlProcessBase { if (null != name) { marshaller.setProperty("com.sun.xml.internal.bind.xmlHeaders", - String.format("", name)); + String.format("", name)); } if (null != map && !map.isEmpty()) { diff --git a/src/main/java/io/mycat/config/model/FirewallConfig.java b/src/main/java/io/mycat/config/model/FirewallConfig.java index 8a898536d..42ab99f4e 100644 --- a/src/main/java/io/mycat/config/model/FirewallConfig.java +++ b/src/main/java/io/mycat/config/model/FirewallConfig.java @@ -208,13 +208,4 @@ public final class FirewallConfig { } } } -// public static void main(String[] args) throws Exception { -// List userConfigs = new ArrayList(); -// UserConfig user = new UserConfig(); -// user.setName("mycat"); -// userConfigs.add(user); -// updateToFile("127.0.0.1",userConfigs); -// } - - } \ No newline at end of file diff --git a/src/main/java/io/mycat/config/model/SystemConfig.java b/src/main/java/io/mycat/config/model/SystemConfig.java index e0368ce2f..1917f527a 100644 --- a/src/main/java/io/mycat/config/model/SystemConfig.java +++ b/src/main/java/io/mycat/config/model/SystemConfig.java @@ -68,7 +68,7 @@ public final class SystemConfig { private static final boolean DEFAULT_USE_ZK_SWITCH = true; private static final boolean DEFAULT_LOWER_CASE = true; private static final String DEFAULT_TRANSACTION_BASE_DIR = "txlogs"; - private static final String DEFAULT_TRANSACTION_BASE_NAME = "mycat-tx"; + private static final String DEFAULT_TRANSACTION_BASE_NAME = "server-tx"; private static final int DEFAULT_TRANSACTION_ROTATE_SIZE = 16; private static final long CHECKTABLECONSISTENCYPERIOD = 30 * 60 * 1000; // 全局表一致性检测任务,默认24小时调度一次 @@ -128,7 +128,7 @@ public final class SystemConfig { private int usingAIO = 0; private int packetHeaderSize = 4; private int maxPacketSize = 16 * 1024 * 1024; - private int mycatNodeId=1; + private int serverNodeId =1; private int useCompression =0; private int useSqlStat = 1; @@ -742,12 +742,12 @@ public final class SystemConfig { this.usingAIO = usingAIO; } - public int getMycatNodeId() { - return mycatNodeId; + public int getServerNodeId() { + return serverNodeId; } - public void setMycatNodeId(int mycatNodeId) { - this.mycatNodeId = mycatNodeId; + public void setServerNodeId(int serverNodeId) { + this.serverNodeId = serverNodeId; } @Override @@ -791,7 +791,7 @@ public final class SystemConfig { + ", usingAIO=" + usingAIO + ", packetHeaderSize=" + packetHeaderSize + ", maxPacketSize=" + maxPacketSize - + ", mycatNodeId=" + mycatNodeId + + ", serverNodeId=" + serverNodeId + "]"; } diff --git a/src/main/java/io/mycat/manager/handler/ShowServerLog.java b/src/main/java/io/mycat/manager/handler/ShowServerLog.java index 9d998f1e6..971641312 100644 --- a/src/main/java/io/mycat/manager/handler/ShowServerLog.java +++ b/src/main/java/io/mycat/manager/handler/ShowServerLog.java @@ -55,7 +55,7 @@ public final class ShowServerLog { .getHeader(FIELD_COUNT); private static final FieldPacket[] fields = new FieldPacket[FIELD_COUNT]; private static final EOFPacket eof = new EOFPacket(); - private static final String DEFAULT_LOGFILE = "mycat.log"; + public static final String DEFAULT_LOGFILE = "mycat.log"; private static final Logger LOGGER = LoggerFactory .getLogger(ShowServerLog.class); static { diff --git a/src/main/java/io/mycat/manager/response/SelectVersionComment.java b/src/main/java/io/mycat/manager/response/SelectVersionComment.java index 5aa7572d9..051618dfc 100644 --- a/src/main/java/io/mycat/manager/response/SelectVersionComment.java +++ b/src/main/java/io/mycat/manager/response/SelectVersionComment.java @@ -27,6 +27,7 @@ import java.nio.ByteBuffer; import io.mycat.backend.mysql.PacketUtil; import io.mycat.config.Fields; +import io.mycat.config.Versions; import io.mycat.manager.ManagerConnection; import io.mycat.net.mysql.EOFPacket; import io.mycat.net.mysql.FieldPacket; @@ -38,7 +39,6 @@ import io.mycat.net.mysql.RowDataPacket; */ public final class SelectVersionComment { - private static final byte[] VERSION_COMMENT = "MyCat Server (monitor)".getBytes(); private static final int FIELD_COUNT = 1; private static final ResultSetHeaderPacket header = PacketUtil.getHeader(FIELD_COUNT); private static final FieldPacket[] fields = new FieldPacket[FIELD_COUNT]; @@ -71,7 +71,7 @@ public final class SelectVersionComment { // write rows byte packetId = eof.packetId; RowDataPacket row = new RowDataPacket(FIELD_COUNT); - row.add(VERSION_COMMENT); + row.add(Versions.VERSION_COMMENT); row.packetId = ++packetId; buffer = row.write(buffer, c,true); diff --git a/src/main/java/io/mycat/manager/response/ShowHelp.java b/src/main/java/io/mycat/manager/response/ShowHelp.java index ad961486a..304f0638d 100644 --- a/src/main/java/io/mycat/manager/response/ShowHelp.java +++ b/src/main/java/io/mycat/manager/response/ShowHelp.java @@ -110,7 +110,7 @@ public final class ShowHelp { // show helps.put("show @@time.current", "Report current timestamp"); helps.put("show @@time.startup", "Report startup timestamp"); - helps.put("show @@version", "Report Mycat Server version"); + helps.put("show @@version", "Report Server version"); helps.put("show @@server", "Report server status"); helps.put("show @@threadpool", "Report threadPool status"); helps.put("show @@database", "Report databases"); @@ -145,10 +145,10 @@ public final class ShowHelp { helps.put("show @@slow where schema = ?", "Report schema slow sql"); helps.put("show @@slow where datanode = ?", "Report datanode slow sql"); helps.put("show @@sysparam", "Report system param"); - helps.put("show @@syslog limit=?", "Report system mycat.log"); - helps.put("show @@white", "show mycat white host "); - helps.put("show @@white.set=?,?", "set mycat white host,[ip,user]"); - helps.put("show @@directmemory=1 or 2", "show mycat direct memory usage"); + helps.put("show @@syslog limit=?", "Report system log"); + helps.put("show @@white", "show server white host "); + helps.put("show @@white.set=?,?", "set server white host,[ip,user]"); + helps.put("show @@directmemory=1 or 2", "show server direct memory usage"); // switch helps.put("switch @@datasource name:index", "Switch dataSource"); @@ -176,8 +176,8 @@ public final class ShowHelp { helps.put("reload @@sqlstat=close", "Close real-time sql stat analyzer"); // offline/online - helps.put("offline", "Change MyCat status to OFF"); - helps.put("online", "Change MyCat status to ON"); + helps.put("offline", "Change Server status to OFF"); + helps.put("online", "Change Server status to ON"); // clear helps.put("clear @@slow where schema = ?", "Clear slow sql by schema"); diff --git a/src/main/java/io/mycat/manager/response/ShowSysLog.java b/src/main/java/io/mycat/manager/response/ShowSysLog.java index b9b7bb23d..3607e757a 100644 --- a/src/main/java/io/mycat/manager/response/ShowSysLog.java +++ b/src/main/java/io/mycat/manager/response/ShowSysLog.java @@ -13,6 +13,7 @@ import io.mycat.backend.mysql.PacketUtil; import io.mycat.config.Fields; import io.mycat.config.model.SystemConfig; import io.mycat.manager.ManagerConnection; +import io.mycat.manager.handler.ShowServerLog; import io.mycat.net.mysql.EOFPacket; import io.mycat.net.mysql.FieldPacket; import io.mycat.net.mysql.ResultSetHeaderPacket; @@ -64,7 +65,7 @@ public class ShowSysLog { // write rows byte packetId = eof.packetId; - String filename = SystemConfig.getHomePath() + File.separator + "logs" + File.separator + "mycat.log"; + String filename = SystemConfig.getHomePath() + File.separator + "logs" + File.separator + ShowServerLog.DEFAULT_LOGFILE; String[] lines = getLinesByLogFile(filename, numLines); diff --git a/src/main/java/io/mycat/manager/response/ShowSysParam.java b/src/main/java/io/mycat/manager/response/ShowSysParam.java index b21b43c78..533cdd6a9 100644 --- a/src/main/java/io/mycat/manager/response/ShowSysParam.java +++ b/src/main/java/io/mycat/manager/response/ShowSysParam.java @@ -112,31 +112,31 @@ public class ShowSysParam { "Mysql_charset", "Mysql_txIsolation", "Mysql_sqlExecuteTimeout", - "Mycat_processorCheckPeriod", - "Mycat_dataNodeIdleCheckPeriod", - "Mycat_dataNodeHeartbeatPeriod", - "Mycat_bindIp", - "Mycat_serverPort", - "Mycat_managerPort"}; + "Server_processorCheckPeriod", + "Server_dataNodeIdleCheckPeriod", + "Server_dataNodeHeartbeatPeriod", + "Server_bindIp", + "Server_serverPort", + "Server_managerPort"}; private static final String[] PARAM_DESCRIPTION = { "主要用于指定系统可用的线程数,默认值为Runtime.getRuntime().availableProcessors()方法返回的值。主要影响processorBufferPool、processorBufferLocalPercent、processorExecutor属性。NIOProcessor的个数也是由这个属性定义的,所以调优的时候可以适当的调高这个属性。", "指定每次分配Socket Direct Buffer的大小,默认是4096个字节。这个属性也影响buffer pool的长度。", "指定bufferPool计算 比例值。由于每次执行NIO读、写操作都需要使用到buffer,系统初始化的时候会建立一定长度的buffer池来加快读、写的效率,减少建立buffer的时间", - "主要用于指定NIOProcessor上共享的businessExecutor固定线程池大小。mycat在需要处理一些异步逻辑的时候会把任务提交到这个线程池中。新版本中这个连接池的使用频率不是很大了,可以设置一个较小的值。", - "指定使用Mycat全局序列的类型。", + "主要用于指定NIOProcessor上共享的businessExecutor固定线程池大小。Server在需要处理一些异步逻辑的时候会把任务提交到这个线程池中。新版本中这个连接池的使用频率不是很大了,可以设置一个较小的值。", + "指定使用全局序列的类型。", "指定Mysql协议中的报文头长度。默认4", "指定Mysql协议可以携带的数据最大长度。默认16M", "指定连接的空闲超时时间。某连接在发起空闲检查下,发现距离上次使用超过了空闲时间,那么这个连接会被回收,就是被直接的关闭掉。默认30分钟", "连接的初始化字符集。默认为utf8", "前端连接的初始化事务隔离级别,只在初始化的时候使用,后续会根据客户端传递过来的属性对后端数据库连接进行同步。默认为REPEATED_READ", - "SQL执行超时的时间,Mycat会检查连接上最后一次执行SQL的时间,若超过这个时间则会直接关闭这连接。默认时间为300秒", + "SQL执行超时的时间,Server会检查连接上最后一次执行SQL的时间,若超过这个时间则会直接关闭这连接。默认时间为300秒", "清理NIOProcessor上前后端空闲、超时和关闭连接的间隔时间。默认是1秒", "对后端连接进行空闲、超时检查的时间间隔,默认是300秒", "对后端所有读、写库发起心跳的间隔时间,默认是10秒", - "mycat服务监听的IP地址,默认值为0.0.0.0", - "mycat的使用端口,默认值为8066", - "mycat的管理端口,默认值为9066"}; + "服务监听的IP地址,默认值为0.0.0.0", + "使用端口,默认值为8066", + "管理端口,默认值为9066"}; public static final String[] ISOLATIONS = {"", "READ_UNCOMMITTED", "READ_COMMITTED", "REPEATED_READ", "SERIALIZABLE"}; } diff --git a/src/main/java/io/mycat/memory/MyCatMemory.java b/src/main/java/io/mycat/memory/MyCatMemory.java index d24f655e5..54fb5e867 100644 --- a/src/main/java/io/mycat/memory/MyCatMemory.java +++ b/src/main/java/io/mycat/memory/MyCatMemory.java @@ -90,35 +90,35 @@ public class MyCatMemory { */ if(system.getUseOffHeapForMerge()== 1){ - conf.set("mycat.memory.offHeap.enabled","true"); + conf.set("server.memory.offHeap.enabled","true"); }else{ - conf.set("mycat.memory.offHeap.enabled","false"); + conf.set("server.memory.offHeap.enabled","false"); } if(system.getUseStreamOutput() == 1){ - conf.set("mycat.stream.output.result","true"); + conf.set("server.stream.output.result","true"); }else{ - conf.set("mycat.stream.output.result","false"); + conf.set("server.stream.output.result","false"); } if(system.getMemoryPageSize() != null){ - conf.set("mycat.buffer.pageSize",system.getMemoryPageSize()); + conf.set("server.buffer.pageSize",system.getMemoryPageSize()); }else{ - conf.set("mycat.buffer.pageSize","1m"); + conf.set("server.buffer.pageSize","1m"); } if(system.getSpillsFileBufferSize() != null){ - conf.set("mycat.merge.file.buffer",system.getSpillsFileBufferSize()); + conf.set("server.merge.file.buffer",system.getSpillsFileBufferSize()); }else{ - conf.set("mycat.merge.file.buffer","32k"); + conf.set("server.merge.file.buffer","32k"); } - conf.set("mycat.pointer.array.len","8k") - .set("mycat.memory.offHeap.size", JavaUtils.bytesToString2(resultSetBufferSize)); + conf.set("server.pointer.array.len","8k") + .set("server.memory.offHeap.size", JavaUtils.bytesToString2(resultSetBufferSize)); - LOGGER.info("mycat.memory.offHeap.size: " + + LOGGER.info("resultSetBufferSize: " + JavaUtils.bytesToString2(resultSetBufferSize)); resultMergeMemoryManager = @@ -156,13 +156,13 @@ public class MyCatMemory { * mycat.direct.output.result * mycat.local.dir */ - conf.set("mycat.memory.offHeap.enabled","true") - .set("mycat.pointer.array.len","8K") - .set("mycat.buffer.pageSize","1m") - .set("mycat.memory.offHeap.size", JavaUtils.bytesToString2(resultSetBufferSize)) - .set("mycat.stream.output.result","false"); + conf.set("server.memory.offHeap.enabled","true") + .set("server.pointer.array.len","8K") + .set("server.buffer.pageSize","1m") + .set("server.memory.offHeap.size", JavaUtils.bytesToString2(resultSetBufferSize)) + .set("server.stream.output.result","false"); - LOGGER.info("mycat.memory.offHeap.size: " + JavaUtils.bytesToString2(resultSetBufferSize)); + LOGGER.info("resultSetBufferSize: " + JavaUtils.bytesToString2(resultSetBufferSize)); resultMergeMemoryManager = new ResultMergeMemoryManager(conf,numCores,maxOnHeapMemory); diff --git a/src/main/java/io/mycat/memory/unsafe/memory/mm/MemoryManager.java b/src/main/java/io/mycat/memory/unsafe/memory/mm/MemoryManager.java index 33463984c..6fbcd54e9 100644 --- a/src/main/java/io/mycat/memory/unsafe/memory/mm/MemoryManager.java +++ b/src/main/java/io/mycat/memory/unsafe/memory/mm/MemoryManager.java @@ -29,7 +29,7 @@ public abstract class MemoryManager { public MemoryManager(MycatPropertyConf conf, int numCores, long onHeapExecutionMemory){ this.conf = conf; this.numCores =numCores; - maxOffHeapMemory = conf.getSizeAsBytes("mycat.memory.offHeap.size","128m"); + maxOffHeapMemory = conf.getSizeAsBytes("server.memory.offHeap.size","128m"); offHeapExecutionMemory = maxOffHeapMemory; onHeapExecutionMemoryPool.incrementPoolSize(onHeapExecutionMemory); @@ -91,8 +91,8 @@ public void releaseExecutionMemory(long numBytes, long taskAttemptId, MemoryMode * sun.misc.Unsafe. */ public final MemoryMode tungstenMemoryMode(){ - if (conf.getBoolean("mycat.memory.offHeap.enabled", false)) { - assert (conf.getSizeAsBytes("mycat.memory.offHeap.size",0) > 0); + if (conf.getBoolean("server.memory.offHeap.enabled", false)) { + assert (conf.getSizeAsBytes("server.memory.offHeap.size",0) > 0); assert (Platform.unaligned()); return MemoryMode.OFF_HEAP; } else { @@ -103,7 +103,7 @@ public void releaseExecutionMemory(long numBytes, long taskAttemptId, MemoryMode /** * The default page size, in bytes. * - * If user didn't explicitly set "mycat.buffer.pageSize", we figure out the default value + * If user didn't explicitly set "server.buffer.pageSize", we figure out the default value * by looking at the number of cores available to the process, and the total amount of memory, * and then divide it by a factor of safety. */ @@ -139,7 +139,7 @@ public void releaseExecutionMemory(long numBytes, long taskAttemptId, MemoryMode long size = ByteArrayMethods.nextPowerOf2(maxTungstenMemory / cores / safetyFactor); long defaultSize = Math.min(maxPageSize, Math.max(minPageSize, size)); - defaultSize = conf.getSizeAsBytes("mycat.buffer.pageSize", defaultSize); + defaultSize = conf.getSizeAsBytes("server.buffer.pageSize", defaultSize); return defaultSize; } diff --git a/src/main/java/io/mycat/memory/unsafe/storage/DataNodeDiskManager.java b/src/main/java/io/mycat/memory/unsafe/storage/DataNodeDiskManager.java index dc3d86925..d1b7eb209 100644 --- a/src/main/java/io/mycat/memory/unsafe/storage/DataNodeDiskManager.java +++ b/src/main/java/io/mycat/memory/unsafe/storage/DataNodeDiskManager.java @@ -38,7 +38,7 @@ public class DataNodeDiskManager { File file, SerializerInstance serializerInstance, int bufferSize) throws IOException { - boolean syncWrites = conf.getBoolean("mycat.merge.sync", false); + boolean syncWrites = conf.getBoolean("server.merge.sync", false); return new DiskRowWriter(file, serializerInstance, bufferSize,new FileOutputStream(file), syncWrites,blockId); } diff --git a/src/main/java/io/mycat/memory/unsafe/storage/DataNodeFileManager.java b/src/main/java/io/mycat/memory/unsafe/storage/DataNodeFileManager.java index b009c7718..23530a9ce 100644 --- a/src/main/java/io/mycat/memory/unsafe/storage/DataNodeFileManager.java +++ b/src/main/java/io/mycat/memory/unsafe/storage/DataNodeFileManager.java @@ -65,7 +65,7 @@ public class DataNodeFileManager { this.deleteFilesOnStop = deleteFilesOnStop; - subDirsPerLocalDir = conf.getInt("mycat.diskStore.subDirectories", 64); + subDirsPerLocalDir = conf.getInt("server.diskStore.subDirectories", 64); localDirs = createLocalDirs(conf); if (localDirs.isEmpty()) { System.exit(-1); @@ -138,7 +138,7 @@ public class DataNodeFileManager { */ private List createLocalDirs(MycatPropertyConf conf) { - String rootDirs = conf.getString("mycat.local.dirs","datanode"); + String rootDirs = conf.getString("server.local.dirs","datanode"); String rdir[] = rootDirs.split(","); List dirs = new ArrayList(); diff --git a/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalRowSorter.java b/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalRowSorter.java index 051c7da1d..4ec82d3cb 100644 --- a/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalRowSorter.java +++ b/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalRowSorter.java @@ -67,7 +67,7 @@ public final class UnsafeExternalRowSorter { myCatMemory.getSerializerManager(), recordComparator, prefixComparator, - myCatMemory.getConf().getSizeAsBytes("mycat.pointer.array.len","16K"), + myCatMemory.getConf().getSizeAsBytes("server.pointer.array.len","16K"), pageSizeBytes, canUseRadixSort, enableSort); diff --git a/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalSorter.java b/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalSorter.java index 84ac3b65a..8707a94f7 100644 --- a/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalSorter.java +++ b/src/main/java/io/mycat/memory/unsafe/utils/sort/UnsafeExternalSorter.java @@ -122,7 +122,7 @@ public final class UnsafeExternalSorter extends MemoryConsumer { if(MycatServer.getInstance().getMyCatMemory() != null){ this.fileBufferSizeBytes = (int) MycatServer.getInstance(). - getMyCatMemory().getConf().getSizeAsBytes("mycat.merge.file.buffer", "32k"); + getMyCatMemory().getConf().getSizeAsBytes("server.merge.file.buffer", "32k"); }else{ this.fileBufferSizeBytes = 32*1024; } diff --git a/src/main/java/io/mycat/meta/ProxyMetaManager.java b/src/main/java/io/mycat/meta/ProxyMetaManager.java index 74fffbe01..ee3d9e270 100644 --- a/src/main/java/io/mycat/meta/ProxyMetaManager.java +++ b/src/main/java/io/mycat/meta/ProxyMetaManager.java @@ -24,9 +24,9 @@ import io.mycat.config.model.DBHostConfig; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.SystemConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; -import io.mycat.meta.protocol.MyCatMeta.IndexMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.IndexMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.meta.table.AbstractTableMetaHandler; import io.mycat.meta.table.MetaHelper; import io.mycat.meta.table.MetaHelper.INDEX_TYPE; diff --git a/src/main/java/io/mycat/meta/SchemaMeta.java b/src/main/java/io/mycat/meta/SchemaMeta.java index 95a59068b..069a62b63 100644 --- a/src/main/java/io/mycat/meta/SchemaMeta.java +++ b/src/main/java/io/mycat/meta/SchemaMeta.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; public class SchemaMeta { diff --git a/src/main/java/io/mycat/meta/protocol/MyCatMeta.java b/src/main/java/io/mycat/meta/protocol/StructureMeta.java similarity index 86% rename from src/main/java/io/mycat/meta/protocol/MyCatMeta.java rename to src/main/java/io/mycat/meta/protocol/StructureMeta.java index 953fe206b..2c6a55ab4 100644 --- a/src/main/java/io/mycat/meta/protocol/MyCatMeta.java +++ b/src/main/java/io/mycat/meta/protocol/StructureMeta.java @@ -1,10 +1,10 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: MyCatMeta.protocol +// source: StructureMeta.protocol package io.mycat.meta.protocol; -public final class MyCatMeta { - private MyCatMeta() {} +public final class StructureMeta { + private StructureMeta() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } @@ -161,14 +161,14 @@ public final class MyCatMeta { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_IndexMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_IndexMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.class, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.IndexMeta.class, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder.class); } public static com.google.protobuf.Parser PARSER = @@ -362,7 +362,7 @@ public final class MyCatMeta { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getTypeBytes()); + .computeBytesSize(2, getTypeBytes()); } { int dataSize = 0; @@ -385,53 +385,53 @@ public final class MyCatMeta { return super.writeReplace(); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom(byte[] data) + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseDelimitedFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseDelimitedFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.IndexMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.IndexMeta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -440,7 +440,7 @@ public final class MyCatMeta { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(io.mycat.meta.protocol.MyCatMeta.IndexMeta prototype) { + public static Builder newBuilder(io.mycat.meta.protocol.StructureMeta.IndexMeta prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -457,20 +457,20 @@ public final class MyCatMeta { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:io.mycat.meta.protocol.IndexMeta) - io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder { + io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_IndexMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_IndexMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.class, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.IndexMeta.class, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder.class); } - // Construct using io.mycat.meta.protocol.MyCatMeta.IndexMeta.newBuilder() + // Construct using io.mycat.meta.protocol.StructureMeta.IndexMeta.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -505,23 +505,23 @@ public final class MyCatMeta { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_IndexMeta_descriptor; } - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getDefaultInstanceForType() { - return io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance(); + public io.mycat.meta.protocol.StructureMeta.IndexMeta getDefaultInstanceForType() { + return io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance(); } - public io.mycat.meta.protocol.MyCatMeta.IndexMeta build() { - io.mycat.meta.protocol.MyCatMeta.IndexMeta result = buildPartial(); + public io.mycat.meta.protocol.StructureMeta.IndexMeta build() { + io.mycat.meta.protocol.StructureMeta.IndexMeta result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public io.mycat.meta.protocol.MyCatMeta.IndexMeta buildPartial() { - io.mycat.meta.protocol.MyCatMeta.IndexMeta result = new io.mycat.meta.protocol.MyCatMeta.IndexMeta(this); + public io.mycat.meta.protocol.StructureMeta.IndexMeta buildPartial() { + io.mycat.meta.protocol.StructureMeta.IndexMeta result = new io.mycat.meta.protocol.StructureMeta.IndexMeta(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -543,16 +543,16 @@ public final class MyCatMeta { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.mycat.meta.protocol.MyCatMeta.IndexMeta) { - return mergeFrom((io.mycat.meta.protocol.MyCatMeta.IndexMeta)other); + if (other instanceof io.mycat.meta.protocol.StructureMeta.IndexMeta) { + return mergeFrom((io.mycat.meta.protocol.StructureMeta.IndexMeta)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(io.mycat.meta.protocol.MyCatMeta.IndexMeta other) { - if (other == io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()) return this; + public Builder mergeFrom(io.mycat.meta.protocol.StructureMeta.IndexMeta other) { + if (other == io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; @@ -593,11 +593,11 @@ public final class MyCatMeta { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.mycat.meta.protocol.MyCatMeta.IndexMeta parsedMessage = null; + io.mycat.meta.protocol.StructureMeta.IndexMeta parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (io.mycat.meta.protocol.MyCatMeta.IndexMeta) e.getUnfinishedMessage(); + parsedMessage = (io.mycat.meta.protocol.StructureMeta.IndexMeta) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -1060,8 +1060,7 @@ public final class MyCatMeta { com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); - @SuppressWarnings("unused") - int mutable_bitField0_ = 0; + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1147,14 +1146,14 @@ public final class MyCatMeta { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.ColumnMeta.class, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.ColumnMeta.class, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder.class); } public static com.google.protobuf.Parser PARSER = @@ -1579,53 +1578,53 @@ public final class MyCatMeta { return super.writeReplace(); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom(byte[] data) + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseDelimitedFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseDelimitedFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.ColumnMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.ColumnMeta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1634,7 +1633,7 @@ public final class MyCatMeta { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(io.mycat.meta.protocol.MyCatMeta.ColumnMeta prototype) { + public static Builder newBuilder(io.mycat.meta.protocol.StructureMeta.ColumnMeta prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -1651,20 +1650,20 @@ public final class MyCatMeta { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:io.mycat.meta.protocol.ColumnMeta) - io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder { + io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.ColumnMeta.class, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.ColumnMeta.class, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder.class); } - // Construct using io.mycat.meta.protocol.MyCatMeta.ColumnMeta.newBuilder() + // Construct using io.mycat.meta.protocol.StructureMeta.ColumnMeta.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1713,23 +1712,23 @@ public final class MyCatMeta { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_ColumnMeta_descriptor; } - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta getDefaultInstanceForType() { - return io.mycat.meta.protocol.MyCatMeta.ColumnMeta.getDefaultInstance(); + public io.mycat.meta.protocol.StructureMeta.ColumnMeta getDefaultInstanceForType() { + return io.mycat.meta.protocol.StructureMeta.ColumnMeta.getDefaultInstance(); } - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta build() { - io.mycat.meta.protocol.MyCatMeta.ColumnMeta result = buildPartial(); + public io.mycat.meta.protocol.StructureMeta.ColumnMeta build() { + io.mycat.meta.protocol.StructureMeta.ColumnMeta result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta buildPartial() { - io.mycat.meta.protocol.MyCatMeta.ColumnMeta result = new io.mycat.meta.protocol.MyCatMeta.ColumnMeta(this); + public io.mycat.meta.protocol.StructureMeta.ColumnMeta buildPartial() { + io.mycat.meta.protocol.StructureMeta.ColumnMeta result = new io.mycat.meta.protocol.StructureMeta.ColumnMeta(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -1778,16 +1777,16 @@ public final class MyCatMeta { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.mycat.meta.protocol.MyCatMeta.ColumnMeta) { - return mergeFrom((io.mycat.meta.protocol.MyCatMeta.ColumnMeta)other); + if (other instanceof io.mycat.meta.protocol.StructureMeta.ColumnMeta) { + return mergeFrom((io.mycat.meta.protocol.StructureMeta.ColumnMeta)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(io.mycat.meta.protocol.MyCatMeta.ColumnMeta other) { - if (other == io.mycat.meta.protocol.MyCatMeta.ColumnMeta.getDefaultInstance()) return this; + public Builder mergeFrom(io.mycat.meta.protocol.StructureMeta.ColumnMeta other) { + if (other == io.mycat.meta.protocol.StructureMeta.ColumnMeta.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; @@ -1846,11 +1845,11 @@ public final class MyCatMeta { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.mycat.meta.protocol.MyCatMeta.ColumnMeta parsedMessage = null; + io.mycat.meta.protocol.StructureMeta.ColumnMeta parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (io.mycat.meta.protocol.MyCatMeta.ColumnMeta) e.getUnfinishedMessage(); + parsedMessage = (io.mycat.meta.protocol.StructureMeta.ColumnMeta) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -2453,7 +2452,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - java.util.List + java.util.List getColumnsList(); /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; @@ -2462,7 +2461,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - io.mycat.meta.protocol.MyCatMeta.ColumnMeta getColumns(int index); + io.mycat.meta.protocol.StructureMeta.ColumnMeta getColumns(int index); /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; * @@ -2478,7 +2477,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - java.util.List + java.util.List getColumnsOrBuilderList(); /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; @@ -2487,7 +2486,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder getColumnsOrBuilder( + io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder getColumnsOrBuilder( int index); /** @@ -2556,21 +2555,21 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - io.mycat.meta.protocol.MyCatMeta.IndexMeta getPrimary(); + io.mycat.meta.protocol.StructureMeta.IndexMeta getPrimary(); /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getPrimaryOrBuilder(); + io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getPrimaryOrBuilder(); /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - java.util.List + java.util.List getUniIndexList(); /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - io.mycat.meta.protocol.MyCatMeta.IndexMeta getUniIndex(int index); + io.mycat.meta.protocol.StructureMeta.IndexMeta getUniIndex(int index); /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ @@ -2578,23 +2577,23 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - java.util.List + java.util.List getUniIndexOrBuilderList(); /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getUniIndexOrBuilder( + io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getUniIndexOrBuilder( int index); /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - java.util.List + java.util.List getIndexList(); /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - io.mycat.meta.protocol.MyCatMeta.IndexMeta getIndex(int index); + io.mycat.meta.protocol.StructureMeta.IndexMeta getIndex(int index); /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ @@ -2602,12 +2601,12 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - java.util.List + java.util.List getIndexOrBuilderList(); /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getIndexOrBuilder( + io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getIndexOrBuilder( int index); } /** @@ -2670,10 +2669,10 @@ public final class MyCatMeta { } case 18: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - columns_ = new java.util.ArrayList(); + columns_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000002; } - columns_.add(input.readMessage(io.mycat.meta.protocol.MyCatMeta.ColumnMeta.PARSER, extensionRegistry)); + columns_.add(input.readMessage(io.mycat.meta.protocol.StructureMeta.ColumnMeta.PARSER, extensionRegistry)); break; } case 24: { @@ -2708,11 +2707,11 @@ public final class MyCatMeta { break; } case 74: { - io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder subBuilder = null; + io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder subBuilder = null; if (((bitField0_ & 0x00000080) == 0x00000080)) { subBuilder = primary_.toBuilder(); } - primary_ = input.readMessage(io.mycat.meta.protocol.MyCatMeta.IndexMeta.PARSER, extensionRegistry); + primary_ = input.readMessage(io.mycat.meta.protocol.StructureMeta.IndexMeta.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(primary_); primary_ = subBuilder.buildPartial(); @@ -2722,18 +2721,18 @@ public final class MyCatMeta { } case 82: { if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { - uniIndex_ = new java.util.ArrayList(); + uniIndex_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000200; } - uniIndex_.add(input.readMessage(io.mycat.meta.protocol.MyCatMeta.IndexMeta.PARSER, extensionRegistry)); + uniIndex_.add(input.readMessage(io.mycat.meta.protocol.StructureMeta.IndexMeta.PARSER, extensionRegistry)); break; } case 90: { if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { - index_ = new java.util.ArrayList(); + index_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000400; } - index_.add(input.readMessage(io.mycat.meta.protocol.MyCatMeta.IndexMeta.PARSER, extensionRegistry)); + index_.add(input.readMessage(io.mycat.meta.protocol.StructureMeta.IndexMeta.PARSER, extensionRegistry)); break; } } @@ -2759,14 +2758,14 @@ public final class MyCatMeta { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_TableMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_TableMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.TableMeta.class, io.mycat.meta.protocol.MyCatMeta.TableMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.TableMeta.class, io.mycat.meta.protocol.StructureMeta.TableMeta.Builder.class); } public static com.google.protobuf.Parser PARSER = @@ -2840,7 +2839,7 @@ public final class MyCatMeta { } public static final int COLUMNS_FIELD_NUMBER = 2; - private java.util.List columns_; + private java.util.List columns_; /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; * @@ -2848,7 +2847,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public java.util.List getColumnsList() { + public java.util.List getColumnsList() { return columns_; } /** @@ -2858,7 +2857,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public java.util.List + public java.util.List getColumnsOrBuilderList() { return columns_; } @@ -2879,7 +2878,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta getColumns(int index) { + public io.mycat.meta.protocol.StructureMeta.ColumnMeta getColumns(int index) { return columns_.get(index); } /** @@ -2889,7 +2888,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder getColumnsOrBuilder( + public io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder getColumnsOrBuilder( int index) { return columns_.get(index); } @@ -3012,7 +3011,7 @@ public final class MyCatMeta { } public static final int PRIMARY_FIELD_NUMBER = 9; - private io.mycat.meta.protocol.MyCatMeta.IndexMeta primary_; + private io.mycat.meta.protocol.StructureMeta.IndexMeta primary_; /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ @@ -3022,28 +3021,28 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getPrimary() { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getPrimary() { return primary_; } /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getPrimaryOrBuilder() { + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getPrimaryOrBuilder() { return primary_; } public static final int UNIINDEX_FIELD_NUMBER = 10; - private java.util.List uniIndex_; + private java.util.List uniIndex_; /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public java.util.List getUniIndexList() { + public java.util.List getUniIndexList() { return uniIndex_; } /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public java.util.List + public java.util.List getUniIndexOrBuilderList() { return uniIndex_; } @@ -3056,29 +3055,29 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getUniIndex(int index) { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getUniIndex(int index) { return uniIndex_.get(index); } /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getUniIndexOrBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getUniIndexOrBuilder( int index) { return uniIndex_.get(index); } public static final int INDEX_FIELD_NUMBER = 11; - private java.util.List index_; + private java.util.List index_; /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public java.util.List getIndexList() { + public java.util.List getIndexList() { return index_; } /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public java.util.List + public java.util.List getIndexOrBuilderList() { return index_; } @@ -3091,13 +3090,13 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getIndex(int index) { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getIndex(int index) { return index_.get(index); } /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getIndexOrBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getIndexOrBuilder( int index) { return index_.get(index); } @@ -3111,7 +3110,7 @@ public final class MyCatMeta { aiOffset_ = -1L; type_ = 0; aiColPos_ = -1; - primary_ = io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance(); + primary_ = io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance(); uniIndex_ = java.util.Collections.emptyList(); index_ = java.util.Collections.emptyList(); } @@ -3250,53 +3249,53 @@ public final class MyCatMeta { return super.writeReplace(); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom(byte[] data) + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseDelimitedFrom(java.io.InputStream input) + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseDelimitedFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static io.mycat.meta.protocol.MyCatMeta.TableMeta parseFrom( + public static io.mycat.meta.protocol.StructureMeta.TableMeta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3305,7 +3304,7 @@ public final class MyCatMeta { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(io.mycat.meta.protocol.MyCatMeta.TableMeta prototype) { + public static Builder newBuilder(io.mycat.meta.protocol.StructureMeta.TableMeta prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -3322,20 +3321,20 @@ public final class MyCatMeta { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:io.mycat.meta.protocol.TableMeta) - io.mycat.meta.protocol.MyCatMeta.TableMetaOrBuilder { + io.mycat.meta.protocol.StructureMeta.TableMetaOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_TableMeta_fieldAccessorTable + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_TableMeta_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.mycat.meta.protocol.MyCatMeta.TableMeta.class, io.mycat.meta.protocol.MyCatMeta.TableMeta.Builder.class); + io.mycat.meta.protocol.StructureMeta.TableMeta.class, io.mycat.meta.protocol.StructureMeta.TableMeta.Builder.class); } - // Construct using io.mycat.meta.protocol.MyCatMeta.TableMeta.newBuilder() + // Construct using io.mycat.meta.protocol.StructureMeta.TableMeta.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3380,7 +3379,7 @@ public final class MyCatMeta { aiColPos_ = -1; bitField0_ = (bitField0_ & ~0x00000080); if (primaryBuilder_ == null) { - primary_ = io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance(); + primary_ = io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance(); } else { primaryBuilder_.clear(); } @@ -3406,23 +3405,23 @@ public final class MyCatMeta { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.mycat.meta.protocol.MyCatMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; + return io.mycat.meta.protocol.StructureMeta.internal_static_io_mycat_meta_protocol_TableMeta_descriptor; } - public io.mycat.meta.protocol.MyCatMeta.TableMeta getDefaultInstanceForType() { - return io.mycat.meta.protocol.MyCatMeta.TableMeta.getDefaultInstance(); + public io.mycat.meta.protocol.StructureMeta.TableMeta getDefaultInstanceForType() { + return io.mycat.meta.protocol.StructureMeta.TableMeta.getDefaultInstance(); } - public io.mycat.meta.protocol.MyCatMeta.TableMeta build() { - io.mycat.meta.protocol.MyCatMeta.TableMeta result = buildPartial(); + public io.mycat.meta.protocol.StructureMeta.TableMeta build() { + io.mycat.meta.protocol.StructureMeta.TableMeta result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public io.mycat.meta.protocol.MyCatMeta.TableMeta buildPartial() { - io.mycat.meta.protocol.MyCatMeta.TableMeta result = new io.mycat.meta.protocol.MyCatMeta.TableMeta(this); + public io.mycat.meta.protocol.StructureMeta.TableMeta buildPartial() { + io.mycat.meta.protocol.StructureMeta.TableMeta result = new io.mycat.meta.protocol.StructureMeta.TableMeta(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -3494,16 +3493,16 @@ public final class MyCatMeta { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.mycat.meta.protocol.MyCatMeta.TableMeta) { - return mergeFrom((io.mycat.meta.protocol.MyCatMeta.TableMeta)other); + if (other instanceof io.mycat.meta.protocol.StructureMeta.TableMeta) { + return mergeFrom((io.mycat.meta.protocol.StructureMeta.TableMeta)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(io.mycat.meta.protocol.MyCatMeta.TableMeta other) { - if (other == io.mycat.meta.protocol.MyCatMeta.TableMeta.getDefaultInstance()) return this; + public Builder mergeFrom(io.mycat.meta.protocol.StructureMeta.TableMeta other) { + if (other == io.mycat.meta.protocol.StructureMeta.TableMeta.getDefaultInstance()) return this; if (other.hasTableName()) { bitField0_ |= 0x00000001; tableName_ = other.tableName_; @@ -3646,11 +3645,11 @@ public final class MyCatMeta { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.mycat.meta.protocol.MyCatMeta.TableMeta parsedMessage = null; + io.mycat.meta.protocol.StructureMeta.TableMeta parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (io.mycat.meta.protocol.MyCatMeta.TableMeta) e.getUnfinishedMessage(); + parsedMessage = (io.mycat.meta.protocol.StructureMeta.TableMeta) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -3761,17 +3760,17 @@ public final class MyCatMeta { return this; } - private java.util.List columns_ = + private java.util.List columns_ = java.util.Collections.emptyList(); private void ensureColumnsIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { - columns_ = new java.util.ArrayList(columns_); + columns_ = new java.util.ArrayList(columns_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.ColumnMeta, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder, io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder> columnsBuilder_; + io.mycat.meta.protocol.StructureMeta.ColumnMeta, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder, io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder> columnsBuilder_; /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; @@ -3780,7 +3779,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public java.util.List getColumnsList() { + public java.util.List getColumnsList() { if (columnsBuilder_ == null) { return java.util.Collections.unmodifiableList(columns_); } else { @@ -3808,7 +3807,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta getColumns(int index) { + public io.mycat.meta.protocol.StructureMeta.ColumnMeta getColumns(int index) { if (columnsBuilder_ == null) { return columns_.get(index); } else { @@ -3823,7 +3822,7 @@ public final class MyCatMeta { * */ public Builder setColumns( - int index, io.mycat.meta.protocol.MyCatMeta.ColumnMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.ColumnMeta value) { if (columnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3844,7 +3843,7 @@ public final class MyCatMeta { * */ public Builder setColumns( - int index, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder builderForValue) { if (columnsBuilder_ == null) { ensureColumnsIsMutable(); columns_.set(index, builderForValue.build()); @@ -3861,7 +3860,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public Builder addColumns(io.mycat.meta.protocol.MyCatMeta.ColumnMeta value) { + public Builder addColumns(io.mycat.meta.protocol.StructureMeta.ColumnMeta value) { if (columnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3882,7 +3881,7 @@ public final class MyCatMeta { * */ public Builder addColumns( - int index, io.mycat.meta.protocol.MyCatMeta.ColumnMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.ColumnMeta value) { if (columnsBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3903,7 +3902,7 @@ public final class MyCatMeta { * */ public Builder addColumns( - io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder builderForValue) { + io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder builderForValue) { if (columnsBuilder_ == null) { ensureColumnsIsMutable(); columns_.add(builderForValue.build()); @@ -3921,7 +3920,7 @@ public final class MyCatMeta { * */ public Builder addColumns( - int index, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder builderForValue) { if (columnsBuilder_ == null) { ensureColumnsIsMutable(); columns_.add(index, builderForValue.build()); @@ -3939,7 +3938,7 @@ public final class MyCatMeta { * */ public Builder addAllColumns( - java.lang.Iterable values) { + java.lang.Iterable values) { if (columnsBuilder_ == null) { ensureColumnsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3991,7 +3990,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder getColumnsBuilder( + public io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder getColumnsBuilder( int index) { return getColumnsFieldBuilder().getBuilder(index); } @@ -4002,7 +4001,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder getColumnsOrBuilder( + public io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder getColumnsOrBuilder( int index) { if (columnsBuilder_ == null) { return columns_.get(index); } else { @@ -4016,7 +4015,7 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public java.util.List + public java.util.List getColumnsOrBuilderList() { if (columnsBuilder_ != null) { return columnsBuilder_.getMessageOrBuilderList(); @@ -4031,9 +4030,9 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder addColumnsBuilder() { + public io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder addColumnsBuilder() { return getColumnsFieldBuilder().addBuilder( - io.mycat.meta.protocol.MyCatMeta.ColumnMeta.getDefaultInstance()); + io.mycat.meta.protocol.StructureMeta.ColumnMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; @@ -4042,10 +4041,10 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder addColumnsBuilder( + public io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder addColumnsBuilder( int index) { return getColumnsFieldBuilder().addBuilder( - index, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.getDefaultInstance()); + index, io.mycat.meta.protocol.StructureMeta.ColumnMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.ColumnMeta columns = 2; @@ -4054,16 +4053,16 @@ public final class MyCatMeta { *所有的列属性,有序 * */ - public java.util.List + public java.util.List getColumnsBuilderList() { return getColumnsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.ColumnMeta, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder, io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder> + io.mycat.meta.protocol.StructureMeta.ColumnMeta, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder, io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder> getColumnsFieldBuilder() { if (columnsBuilder_ == null) { columnsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.ColumnMeta, io.mycat.meta.protocol.MyCatMeta.ColumnMeta.Builder, io.mycat.meta.protocol.MyCatMeta.ColumnMetaOrBuilder>( + io.mycat.meta.protocol.StructureMeta.ColumnMeta, io.mycat.meta.protocol.StructureMeta.ColumnMeta.Builder, io.mycat.meta.protocol.StructureMeta.ColumnMetaOrBuilder>( columns_, ((bitField0_ & 0x00000002) == 0x00000002), getParentForChildren(), @@ -4309,9 +4308,9 @@ public final class MyCatMeta { return this; } - private io.mycat.meta.protocol.MyCatMeta.IndexMeta primary_ = io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance(); + private io.mycat.meta.protocol.StructureMeta.IndexMeta primary_ = io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> primaryBuilder_; + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> primaryBuilder_; /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ @@ -4321,7 +4320,7 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getPrimary() { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getPrimary() { if (primaryBuilder_ == null) { return primary_; } else { @@ -4331,7 +4330,7 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public Builder setPrimary(io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + public Builder setPrimary(io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (primaryBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4348,7 +4347,7 @@ public final class MyCatMeta { * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ public Builder setPrimary( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (primaryBuilder_ == null) { primary_ = builderForValue.build(); onChanged(); @@ -4361,12 +4360,12 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public Builder mergePrimary(io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + public Builder mergePrimary(io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (primaryBuilder_ == null) { if (((bitField0_ & 0x00000100) == 0x00000100) && - primary_ != io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()) { + primary_ != io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()) { primary_ = - io.mycat.meta.protocol.MyCatMeta.IndexMeta.newBuilder(primary_).mergeFrom(value).buildPartial(); + io.mycat.meta.protocol.StructureMeta.IndexMeta.newBuilder(primary_).mergeFrom(value).buildPartial(); } else { primary_ = value; } @@ -4382,7 +4381,7 @@ public final class MyCatMeta { */ public Builder clearPrimary() { if (primaryBuilder_ == null) { - primary_ = io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance(); + primary_ = io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance(); onChanged(); } else { primaryBuilder_.clear(); @@ -4393,7 +4392,7 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder getPrimaryBuilder() { + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder getPrimaryBuilder() { bitField0_ |= 0x00000100; onChanged(); return getPrimaryFieldBuilder().getBuilder(); @@ -4401,7 +4400,7 @@ public final class MyCatMeta { /** * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getPrimaryOrBuilder() { + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getPrimaryOrBuilder() { if (primaryBuilder_ != null) { return primaryBuilder_.getMessageOrBuilder(); } else { @@ -4412,11 +4411,11 @@ public final class MyCatMeta { * optional .io.mycat.meta.protocol.IndexMeta primary = 9; */ private com.google.protobuf.SingleFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> getPrimaryFieldBuilder() { if (primaryBuilder_ == null) { primaryBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder>( + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder>( getPrimary(), getParentForChildren(), isClean()); @@ -4425,22 +4424,22 @@ public final class MyCatMeta { return primaryBuilder_; } - private java.util.List uniIndex_ = + private java.util.List uniIndex_ = java.util.Collections.emptyList(); private void ensureUniIndexIsMutable() { if (!((bitField0_ & 0x00000200) == 0x00000200)) { - uniIndex_ = new java.util.ArrayList(uniIndex_); + uniIndex_ = new java.util.ArrayList(uniIndex_); bitField0_ |= 0x00000200; } } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> uniIndexBuilder_; + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> uniIndexBuilder_; /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public java.util.List getUniIndexList() { + public java.util.List getUniIndexList() { if (uniIndexBuilder_ == null) { return java.util.Collections.unmodifiableList(uniIndex_); } else { @@ -4460,7 +4459,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getUniIndex(int index) { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getUniIndex(int index) { if (uniIndexBuilder_ == null) { return uniIndex_.get(index); } else { @@ -4471,7 +4470,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder setUniIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (uniIndexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4488,7 +4487,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder setUniIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (uniIndexBuilder_ == null) { ensureUniIndexIsMutable(); uniIndex_.set(index, builderForValue.build()); @@ -4501,7 +4500,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public Builder addUniIndex(io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + public Builder addUniIndex(io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (uniIndexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4518,7 +4517,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder addUniIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (uniIndexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4535,7 +4534,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder addUniIndex( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (uniIndexBuilder_ == null) { ensureUniIndexIsMutable(); uniIndex_.add(builderForValue.build()); @@ -4549,7 +4548,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder addUniIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (uniIndexBuilder_ == null) { ensureUniIndexIsMutable(); uniIndex_.add(index, builderForValue.build()); @@ -4563,7 +4562,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ public Builder addAllUniIndex( - java.lang.Iterable values) { + java.lang.Iterable values) { if (uniIndexBuilder_ == null) { ensureUniIndexIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -4603,14 +4602,14 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder getUniIndexBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder getUniIndexBuilder( int index) { return getUniIndexFieldBuilder().getBuilder(index); } /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getUniIndexOrBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getUniIndexOrBuilder( int index) { if (uniIndexBuilder_ == null) { return uniIndex_.get(index); } else { @@ -4620,7 +4619,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public java.util.List + public java.util.List getUniIndexOrBuilderList() { if (uniIndexBuilder_ != null) { return uniIndexBuilder_.getMessageOrBuilderList(); @@ -4631,31 +4630,31 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder addUniIndexBuilder() { + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder addUniIndexBuilder() { return getUniIndexFieldBuilder().addBuilder( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()); + io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder addUniIndexBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder addUniIndexBuilder( int index) { return getUniIndexFieldBuilder().addBuilder( - index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()); + index, io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.IndexMeta uniIndex = 10; */ - public java.util.List + public java.util.List getUniIndexBuilderList() { return getUniIndexFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> getUniIndexFieldBuilder() { if (uniIndexBuilder_ == null) { uniIndexBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder>( + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder>( uniIndex_, ((bitField0_ & 0x00000200) == 0x00000200), getParentForChildren(), @@ -4665,22 +4664,22 @@ public final class MyCatMeta { return uniIndexBuilder_; } - private java.util.List index_ = + private java.util.List index_ = java.util.Collections.emptyList(); private void ensureIndexIsMutable() { if (!((bitField0_ & 0x00000400) == 0x00000400)) { - index_ = new java.util.ArrayList(index_); + index_ = new java.util.ArrayList(index_); bitField0_ |= 0x00000400; } } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> indexBuilder_; + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> indexBuilder_; /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public java.util.List getIndexList() { + public java.util.List getIndexList() { if (indexBuilder_ == null) { return java.util.Collections.unmodifiableList(index_); } else { @@ -4700,7 +4699,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta getIndex(int index) { + public io.mycat.meta.protocol.StructureMeta.IndexMeta getIndex(int index) { if (indexBuilder_ == null) { return index_.get(index); } else { @@ -4711,7 +4710,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder setIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (indexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4728,7 +4727,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder setIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (indexBuilder_ == null) { ensureIndexIsMutable(); index_.set(index, builderForValue.build()); @@ -4741,7 +4740,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public Builder addIndex(io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + public Builder addIndex(io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (indexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4758,7 +4757,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder addIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta value) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta value) { if (indexBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4775,7 +4774,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder addIndex( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (indexBuilder_ == null) { ensureIndexIsMutable(); index_.add(builderForValue.build()); @@ -4789,7 +4788,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder addIndex( - int index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder builderForValue) { + int index, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder builderForValue) { if (indexBuilder_ == null) { ensureIndexIsMutable(); index_.add(index, builderForValue.build()); @@ -4803,7 +4802,7 @@ public final class MyCatMeta { * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ public Builder addAllIndex( - java.lang.Iterable values) { + java.lang.Iterable values) { if (indexBuilder_ == null) { ensureIndexIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -4843,14 +4842,14 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder getIndexBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder getIndexBuilder( int index) { return getIndexFieldBuilder().getBuilder(index); } /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder getIndexOrBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder getIndexOrBuilder( int index) { if (indexBuilder_ == null) { return index_.get(index); } else { @@ -4860,7 +4859,7 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public java.util.List + public java.util.List getIndexOrBuilderList() { if (indexBuilder_ != null) { return indexBuilder_.getMessageOrBuilderList(); @@ -4871,31 +4870,31 @@ public final class MyCatMeta { /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder addIndexBuilder() { + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder addIndexBuilder() { return getIndexFieldBuilder().addBuilder( - io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()); + io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder addIndexBuilder( + public io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder addIndexBuilder( int index) { return getIndexFieldBuilder().addBuilder( - index, io.mycat.meta.protocol.MyCatMeta.IndexMeta.getDefaultInstance()); + index, io.mycat.meta.protocol.StructureMeta.IndexMeta.getDefaultInstance()); } /** * repeated .io.mycat.meta.protocol.IndexMeta index = 11; */ - public java.util.List + public java.util.List getIndexBuilderList() { return getIndexFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder> + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder> getIndexFieldBuilder() { if (indexBuilder_ == null) { indexBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.mycat.meta.protocol.MyCatMeta.IndexMeta, io.mycat.meta.protocol.MyCatMeta.IndexMeta.Builder, io.mycat.meta.protocol.MyCatMeta.IndexMetaOrBuilder>( + io.mycat.meta.protocol.StructureMeta.IndexMeta, io.mycat.meta.protocol.StructureMeta.IndexMeta.Builder, io.mycat.meta.protocol.StructureMeta.IndexMetaOrBuilder>( index_, ((bitField0_ & 0x00000400) == 0x00000400), getParentForChildren(), @@ -4940,24 +4939,24 @@ public final class MyCatMeta { descriptor; static { java.lang.String[] descriptorData = { - "\n\022MyCatMeta.protocol\022\026io.mycat.meta.prot" + - "ocol\"8\n\tIndexMeta\022\014\n\004name\030\001 \002(\t\022\014\n\004type\030" + - "\002 \002(\t\022\017\n\007columns\030\003 \003(\t\"\304\001\n\nColumnMeta\022\014\n" + - "\004name\030\001 \002(\t\022\020\n\010dataType\030\002 \002(\t\022\022\n\nisUnsig" + - "ned\030\003 \001(\010\022\016\n\006length\030\004 \001(\005\022\021\n\tprecision\030\005" + - " \001(\005\022\r\n\005scale\030\006 \001(\005\022\017\n\007canNull\030\007 \001(\010\022\020\n\010" + - "sdefault\030\010 \001(\t\022\022\n\nauto_incre\030\t \001(\010\022\031\n\013ch" + - "arsetname\030\n \001(\t:\004utf8\"\343\002\n\tTableMeta\022\021\n\tt" + - "ableName\030\001 \001(\t\0223\n\007columns\030\002 \003(\0132\".io.myc" + - "at.meta.protocol.ColumnMeta\022\025\n\006isView\030\003 ", - "\001(\010:\005false\022\021\n\tcreateSql\030\004 \001(\t\022\017\n\007version" + - "\030\005 \001(\003\022\024\n\010aiOffset\030\006 \001(\003:\002-1\022\014\n\004type\030\007 \001" + - "(\005\022\024\n\010aiColPos\030\010 \001(\005:\002-1\0222\n\007primary\030\t \001(" + - "\0132!.io.mycat.meta.protocol.IndexMeta\0223\n\010" + - "uniIndex\030\n \003(\0132!.io.mycat.meta.protocol." + - "IndexMeta\0220\n\005index\030\013 \003(\0132!.io.mycat.meta" + - ".protocol.IndexMetaB%\n\026io.mycat.meta.pro" + - "tocolB\tMyCatMetaH\001" + "\n\026StructureMeta.protocol\022\026io.mycat.meta." + + "protocol\"8\n\tIndexMeta\022\014\n\004name\030\001 \002(\t\022\014\n\004t" + + "ype\030\002 \002(\t\022\017\n\007columns\030\003 \003(\t\"\304\001\n\nColumnMet" + + "a\022\014\n\004name\030\001 \002(\t\022\020\n\010dataType\030\002 \002(\t\022\022\n\nisU" + + "nsigned\030\003 \001(\010\022\016\n\006length\030\004 \001(\005\022\021\n\tprecisi" + + "on\030\005 \001(\005\022\r\n\005scale\030\006 \001(\005\022\017\n\007canNull\030\007 \001(\010" + + "\022\020\n\010sdefault\030\010 \001(\t\022\022\n\nauto_incre\030\t \001(\010\022\031" + + "\n\013charsetname\030\n \001(\t:\004utf8\"\343\002\n\tTableMeta\022" + + "\021\n\ttableName\030\001 \001(\t\0223\n\007columns\030\002 \003(\0132\".io" + + ".mycat.meta.protocol.ColumnMeta\022\025\n\006isVie", + "w\030\003 \001(\010:\005false\022\021\n\tcreateSql\030\004 \001(\t\022\017\n\007ver" + + "sion\030\005 \001(\003\022\024\n\010aiOffset\030\006 \001(\003:\002-1\022\014\n\004type" + + "\030\007 \001(\005\022\024\n\010aiColPos\030\010 \001(\005:\002-1\0222\n\007primary\030" + + "\t \001(\0132!.io.mycat.meta.protocol.IndexMeta" + + "\0223\n\010uniIndex\030\n \003(\0132!.io.mycat.meta.proto" + + "col.IndexMeta\0220\n\005index\030\013 \003(\0132!.io.mycat." + + "meta.protocol.IndexMetaB)\n\026io.mycat.meta" + + ".protocolB\rStructureMetaH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { diff --git a/src/main/java/io/mycat/meta/protocol/MyCatMeta.protocol b/src/main/java/io/mycat/meta/protocol/StructureMeta.protocol similarity index 97% rename from src/main/java/io/mycat/meta/protocol/MyCatMeta.protocol rename to src/main/java/io/mycat/meta/protocol/StructureMeta.protocol index 8b3476cad..06fa1c801 100644 --- a/src/main/java/io/mycat/meta/protocol/MyCatMeta.protocol +++ b/src/main/java/io/mycat/meta/protocol/StructureMeta.protocol @@ -1,7 +1,7 @@ package io.mycat.meta.protocol; option java_package = "io.mycat.meta.protocol"; -option java_outer_classname = "MyCatMeta"; +option java_outer_classname = "StructureMeta"; option optimize_for = SPEED; diff --git a/src/main/java/io/mycat/meta/table/AbstractTableMetaHandler.java b/src/main/java/io/mycat/meta/table/AbstractTableMetaHandler.java index 9afcba1be..7e7f57207 100644 --- a/src/main/java/io/mycat/meta/table/AbstractTableMetaHandler.java +++ b/src/main/java/io/mycat/meta/table/AbstractTableMetaHandler.java @@ -19,7 +19,7 @@ import com.alibaba.druid.sql.parser.SQLStatementParser; import io.mycat.MycatServer; import io.mycat.backend.datasource.PhysicalDBNode; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.sqlengine.OneRawSQLQueryResultHandler; import io.mycat.sqlengine.SQLJob; import io.mycat.sqlengine.SQLQueryResult; diff --git a/src/main/java/io/mycat/meta/table/MetaHelper.java b/src/main/java/io/mycat/meta/table/MetaHelper.java index 151493483..e62c97dd8 100644 --- a/src/main/java/io/mycat/meta/table/MetaHelper.java +++ b/src/main/java/io/mycat/meta/table/MetaHelper.java @@ -21,9 +21,9 @@ import com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlOrderingExpr; import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex; import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; -import io.mycat.meta.protocol.MyCatMeta.IndexMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.IndexMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.util.StringUtil; public class MetaHelper { diff --git a/src/main/java/io/mycat/meta/table/TableMetaCheckHandler.java b/src/main/java/io/mycat/meta/table/TableMetaCheckHandler.java index f7103d86e..e9e29ec99 100644 --- a/src/main/java/io/mycat/meta/table/TableMetaCheckHandler.java +++ b/src/main/java/io/mycat/meta/table/TableMetaCheckHandler.java @@ -3,7 +3,7 @@ package io.mycat.meta.table; import io.mycat.MycatServer; import io.mycat.config.model.TableConfig; import io.mycat.meta.ProxyMetaManager; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import java.util.Set; diff --git a/src/main/java/io/mycat/meta/table/TableMetaInitHandler.java b/src/main/java/io/mycat/meta/table/TableMetaInitHandler.java index 0a8a088db..593d01d08 100644 --- a/src/main/java/io/mycat/meta/table/TableMetaInitHandler.java +++ b/src/main/java/io/mycat/meta/table/TableMetaInitHandler.java @@ -2,7 +2,7 @@ package io.mycat.meta.table; import io.mycat.MycatServer; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import java.util.Set; diff --git a/src/main/java/io/mycat/net/AIOAcceptor.java b/src/main/java/io/mycat/net/AIOAcceptor.java index 64c772d5e..f72ce7051 100644 --- a/src/main/java/io/mycat/net/AIOAcceptor.java +++ b/src/main/java/io/mycat/net/AIOAcceptor.java @@ -102,7 +102,7 @@ public final class AIOAcceptor implements SocketAcceptor, serverChannel.accept(ID_GENERATOR.getId(), this); } else { throw new IllegalStateException( - "MyCAT Server Channel has been closed"); + "Server Channel has been closed"); } } diff --git a/src/main/java/io/mycat/net/mysql/HeartbeatPacket.java b/src/main/java/io/mycat/net/mysql/HeartbeatPacket.java index 5a04c3d8c..d942a7174 100644 --- a/src/main/java/io/mycat/net/mysql/HeartbeatPacket.java +++ b/src/main/java/io/mycat/net/mysql/HeartbeatPacket.java @@ -70,7 +70,7 @@ public class HeartbeatPacket extends MySQLPacket { @Override protected String getPacketInfo() { - return "Mycat Heartbeat Packet"; + return "Heartbeat Packet"; } } \ No newline at end of file diff --git a/src/main/java/io/mycat/plan/node/TableNode.java b/src/main/java/io/mycat/plan/node/TableNode.java index 9a423384d..18eb57211 100644 --- a/src/main/java/io/mycat/plan/node/TableNode.java +++ b/src/main/java/io/mycat/plan/node/TableNode.java @@ -11,8 +11,8 @@ import io.mycat.config.MycatConfig; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.TableConfig; import io.mycat.config.model.TableConfig.TableTypeEnum; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.plan.NamedField; import io.mycat.plan.PlanNode; import io.mycat.plan.common.item.Item; diff --git a/src/main/java/io/mycat/plan/node/view/ViewNode.java b/src/main/java/io/mycat/plan/node/view/ViewNode.java index 210824acf..2fb34a2d2 100644 --- a/src/main/java/io/mycat/plan/node/view/ViewNode.java +++ b/src/main/java/io/mycat/plan/node/view/ViewNode.java @@ -3,7 +3,7 @@ package io.mycat.plan.node.view; import java.util.ArrayList; import java.util.List; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; import io.mycat.plan.PlanNode; import io.mycat.plan.common.item.Item; import io.mycat.plan.node.QueryNode; diff --git a/src/main/java/io/mycat/route/RouteService.java b/src/main/java/io/mycat/route/RouteService.java index 2f4351743..aa30435a1 100644 --- a/src/main/java/io/mycat/route/RouteService.java +++ b/src/main/java/io/mycat/route/RouteService.java @@ -46,12 +46,10 @@ import java.util.Map; public class RouteService { private static final Logger LOGGER = LoggerFactory .getLogger(RouteService.class); - public static final String MYCAT_HINT_TYPE = "_mycatHintType"; + public static final String HINT_TYPE = "_serverHintType"; private final CachePool sqlRouteCache; private final LayerCachePool tableId2DataNodeCache; - private final String OLD_MYCAT_HINT = "/*!mycat:"; // 处理自定义分片注解, 注解格式:/*!mycat: type = value */ sql - private final String NEW_MYCAT_HINT = "/*#mycat:"; // 新的注解格式:/* !mycat: type = value */ sql,oldMycatHint的格式不兼容直连mysql private final String HINT_SPLIT = "="; @@ -98,11 +96,12 @@ public class RouteService { int firstSplitPos = hint.indexOf(HINT_SPLIT); if(firstSplitPos > 0 ){ Map hintMap= parseHint(hint); - String hintType = (String) hintMap.get(MYCAT_HINT_TYPE); + String hintType = (String) hintMap.get(HINT_TYPE); String hintSql = (String) hintMap.get(hintType); if( hintSql.length() == 0 ) { - LOGGER.warn("comment int sql must meet :/*!mycat:type=value*/ or /*#mycat:type=value*/ or /*mycat:type=value*/: "+stmt); - throw new SQLSyntaxErrorException("comment int sql must meet :/*!mycat:type=value*/ or /*#mycat:type=value*/ or /*mycat:type=value*/: "+stmt); + String msg = "comment in sql must meet :/*!"+ Versions.ANNOTATION_NAME+"type=value*/ or /*#"+ Versions.ANNOTATION_NAME+"type=value*/ or /*"+ Versions.ANNOTATION_NAME+"type=value*/: "+stmt; + LOGGER.warn(msg); + throw new SQLSyntaxErrorException(msg); } String realSQL = stmt.substring(endPos + "*/".length()).trim(); @@ -126,8 +125,9 @@ public class RouteService { } }else{//fixed by runfriends@126.com - LOGGER.warn("comment in sql must meet :/*!mycat:type=value*/ or /*#mycat:type=value*/ or /*mycat:type=value*/: "+stmt); - throw new SQLSyntaxErrorException("comment in sql must meet :/*!mcat:type=value*/ or /*#mycat:type=value*/ or /*mycat:type=value*/: "+stmt); + String msg = "comment in sql must meet :/*!"+ Versions.ANNOTATION_NAME+"type=value*/ or /*#"+ Versions.ANNOTATION_NAME+"type=value*/ or /*"+ Versions.ANNOTATION_NAME+"type=value*/: "+stmt; + LOGGER.warn(msg); + throw new SQLSyntaxErrorException(msg); } } } else { @@ -218,7 +218,7 @@ public class RouteService { } if(map.isEmpty()) { - map.put(MYCAT_HINT_TYPE,key) ; + map.put(HINT_TYPE,key) ; } map.put(key,value.trim()); diff --git a/src/main/java/io/mycat/route/impl/DruidMycatRouteStrategy.java b/src/main/java/io/mycat/route/impl/DruidMycatRouteStrategy.java index 9255b9e7c..4105150c9 100644 --- a/src/main/java/io/mycat/route/impl/DruidMycatRouteStrategy.java +++ b/src/main/java/io/mycat/route/impl/DruidMycatRouteStrategy.java @@ -44,7 +44,7 @@ public class DruidMycatRouteStrategy extends AbstractRouteStrategy { statement = list.get(0); visitor = new MycatSchemaStatVisitor(); } catch (Exception t) { - LOGGER.error("DruidMycatRouteStrategyError", t); + LOGGER.error("routeNormalSqlWithAST", t); throw new SQLSyntaxErrorException(t); } diff --git a/src/main/java/io/mycat/route/parser/druid/impl/DruidInsertParser.java b/src/main/java/io/mycat/route/parser/druid/impl/DruidInsertParser.java index e3fda4c18..996865dab 100644 --- a/src/main/java/io/mycat/route/parser/druid/impl/DruidInsertParser.java +++ b/src/main/java/io/mycat/route/parser/druid/impl/DruidInsertParser.java @@ -28,8 +28,8 @@ import io.mycat.config.MycatPrivileges; import io.mycat.config.MycatPrivileges.Checktype; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.IndexMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.IndexMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.route.RouteResultset; import io.mycat.route.RouteResultsetNode; import io.mycat.route.function.AbstractPartitionAlgorithm; diff --git a/src/main/java/io/mycat/route/parser/druid/impl/DruidSelectParser.java b/src/main/java/io/mycat/route/parser/druid/impl/DruidSelectParser.java index efb6e8673..c76dc7983 100644 --- a/src/main/java/io/mycat/route/parser/druid/impl/DruidSelectParser.java +++ b/src/main/java/io/mycat/route/parser/druid/impl/DruidSelectParser.java @@ -19,8 +19,8 @@ import io.mycat.config.MycatPrivileges; import io.mycat.config.MycatPrivileges.Checktype; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.plan.common.item.Item; import io.mycat.plan.visitor.MySQLItemVisitor; import io.mycat.route.RouteResultset; diff --git a/src/main/java/io/mycat/route/parser/druid/impl/DruidUpdateParser.java b/src/main/java/io/mycat/route/parser/druid/impl/DruidUpdateParser.java index b4721da94..52a8390ed 100644 --- a/src/main/java/io/mycat/route/parser/druid/impl/DruidUpdateParser.java +++ b/src/main/java/io/mycat/route/parser/druid/impl/DruidUpdateParser.java @@ -33,7 +33,7 @@ import io.mycat.config.MycatPrivileges.Checktype; import io.mycat.config.model.ERTable; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.route.RouteResultset; import io.mycat.route.parser.druid.MycatSchemaStatVisitor; import io.mycat.route.util.RouterUtil; diff --git a/src/main/java/io/mycat/route/parser/druid/impl/ddl/DruidAlterTableParser.java b/src/main/java/io/mycat/route/parser/druid/impl/ddl/DruidAlterTableParser.java index 631153e88..37e9b01f0 100644 --- a/src/main/java/io/mycat/route/parser/druid/impl/ddl/DruidAlterTableParser.java +++ b/src/main/java/io/mycat/route/parser/druid/impl/ddl/DruidAlterTableParser.java @@ -29,8 +29,8 @@ import io.mycat.MycatServer; import io.mycat.config.ErrorCode; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.ColumnMeta; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.ColumnMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.route.RouteResultset; import io.mycat.route.parser.druid.MycatSchemaStatVisitor; import io.mycat.route.parser.druid.impl.DefaultDruidParser; diff --git a/src/main/java/io/mycat/route/sequence/handler/FetchMySQLSequnceHandler.java b/src/main/java/io/mycat/route/sequence/handler/FetchMySQLSequnceHandler.java new file mode 100644 index 000000000..994d01b98 --- /dev/null +++ b/src/main/java/io/mycat/route/sequence/handler/FetchMySQLSequnceHandler.java @@ -0,0 +1,148 @@ +package io.mycat.route.sequence.handler; + +import io.mycat.MycatServer; +import io.mycat.backend.BackendConnection; +import io.mycat.backend.datasource.PhysicalDBNode; +import io.mycat.backend.mysql.nio.handler.ResponseHandler; +import io.mycat.config.MycatConfig; +import io.mycat.net.mysql.ErrorPacket; +import io.mycat.net.mysql.FieldPacket; +import io.mycat.net.mysql.RowDataPacket; +import io.mycat.route.RouteResultsetNode; +import io.mycat.server.parser.ServerParse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +/** + * Created by huqing.yan on 2017/7/3. + */ +public class FetchMySQLSequnceHandler implements ResponseHandler { + protected static final Logger LOGGER = LoggerFactory + .getLogger(FetchMySQLSequnceHandler.class); + public void execute(SequenceVal seqVal) { + MycatConfig conf = MycatServer.getInstance().getConfig(); + PhysicalDBNode mysqlDN = conf.getDataNodes().get(seqVal.dataNode); + try { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("execute in datanode " + seqVal.dataNode + + " for fetch sequnce sql " + seqVal.sql); + } + // 修正获取seq的逻辑,在读写分离的情况下只能走写节点。修改Select模式为Update模式。 + mysqlDN.getConnection(mysqlDN.getDatabase(), true, + new RouteResultsetNode(seqVal.dataNode, ServerParse.UPDATE, + seqVal.sql), this, seqVal); + } catch (Exception e) { + LOGGER.warn("get connection err " + e); + } + + } + + public String getLastestError(String seqName) { + return IncrSequenceMySQLHandler.latestErrors.get(seqName); + } + + @Override + public void connectionAcquired(BackendConnection conn) { + + conn.setResponseHandler(this); + try { + conn.query(((SequenceVal) conn.getAttachment()).sql); + } catch (Exception e) { + executeException(conn, e); + } + } + + @Override + public void connectionError(Throwable e, BackendConnection conn) { + ((SequenceVal) conn.getAttachment()).dbfinished = true; + LOGGER.warn("connectionError " + e); + + } + + @Override + public void errorResponse(byte[] data, BackendConnection conn) { + SequenceVal seqVal = ((SequenceVal) conn.getAttachment()); + seqVal.dbfinished = true; + + ErrorPacket err = new ErrorPacket(); + err.read(data); + String errMsg = new String(err.message); + LOGGER.warn("errorResponse " + err.errno + " " + errMsg); + IncrSequenceMySQLHandler.latestErrors.put(seqVal.seqName, errMsg); + conn.release(); + + } + + @Override + public void okResponse(byte[] ok, BackendConnection conn) { + boolean executeResponse = conn.syncAndExcute(); + if (executeResponse) { + ((SequenceVal) conn.getAttachment()).dbfinished = true; + conn.release(); + } + + } + + @Override + public boolean rowResponse(byte[] row, RowDataPacket rowPacket, boolean isLeft, BackendConnection conn) { + RowDataPacket rowDataPkg = new RowDataPacket(1); + rowDataPkg.read(row); + byte[] columnData = rowDataPkg.fieldValues.get(0); + String columnVal = new String(columnData); + SequenceVal seqVal = (SequenceVal) conn.getAttachment(); + if (IncrSequenceMySQLHandler.errSeqResult.equals(columnVal)) { + seqVal.dbretVal = IncrSequenceMySQLHandler.errSeqResult; + LOGGER.warn(" sequnce sql returned err value ,sequence:" + + seqVal.seqName + " " + columnVal + " sql:" + seqVal.sql); + } else { + seqVal.dbretVal = columnVal; + } + return false; + } + + @Override + public void rowEofResponse(byte[] eof, boolean isLeft, BackendConnection conn) { + ((SequenceVal) conn.getAttachment()).dbfinished = true; + conn.release(); + } + + @Override + public void relayPacketResponse(byte[] relayPacket, BackendConnection conn) { + + } + + @Override + public void endPacketResponse(byte[] endPacket, BackendConnection conn) { + + } + + private void executeException(BackendConnection c, Throwable e) { + SequenceVal seqVal = ((SequenceVal) c.getAttachment()); + seqVal.dbfinished = true; + String errMgs=e.toString(); + IncrSequenceMySQLHandler.latestErrors.put(seqVal.seqName, errMgs); + LOGGER.warn("executeException " + errMgs); + c.close("exception:" +errMgs); + + } + + @Override + public void writeQueueAvailable() { + + } + + @Override + public void connectionClose(BackendConnection conn, String reason) { + + LOGGER.warn("connection closed " + conn + " reason:" + reason); + } + + @Override + public void fieldEofResponse(byte[] header, List fields, List fieldPackets, byte[] eof, + boolean isLeft, BackendConnection conn) { + + } + +} \ No newline at end of file diff --git a/src/main/java/io/mycat/route/sequence/handler/IncrSequenceMySQLHandler.java b/src/main/java/io/mycat/route/sequence/handler/IncrSequenceMySQLHandler.java index 6d165d01b..385256287 100644 --- a/src/main/java/io/mycat/route/sequence/handler/IncrSequenceMySQLHandler.java +++ b/src/main/java/io/mycat/route/sequence/handler/IncrSequenceMySQLHandler.java @@ -1,19 +1,5 @@ package io.mycat.route.sequence.handler; -import java.io.IOException; -import java.io.InputStream; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - -import io.mycat.net.mysql.FieldPacket; -import io.mycat.route.util.PropertiesUtil; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import io.mycat.MycatServer; import io.mycat.backend.BackendConnection; import io.mycat.backend.datasource.PhysicalDBNode; @@ -21,9 +7,21 @@ import io.mycat.backend.mysql.nio.handler.ResponseHandler; import io.mycat.config.MycatConfig; import io.mycat.config.util.ConfigException; import io.mycat.net.mysql.ErrorPacket; +import io.mycat.net.mysql.FieldPacket; import io.mycat.net.mysql.RowDataPacket; import io.mycat.route.RouteResultsetNode; +import io.mycat.route.util.PropertiesUtil; import io.mycat.server.parser.ServerParse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; public class IncrSequenceMySQLHandler implements SequenceHandler { @@ -34,13 +32,10 @@ public class IncrSequenceMySQLHandler implements SequenceHandler { protected static final String errSeqResult = "-999999999,null"; protected static Map latestErrors = new ConcurrentHashMap(); private final FetchMySQLSequnceHandler mysqlSeqFetcher = new FetchMySQLSequnceHandler(); - - private static class IncrSequenceMySQLHandlerHolder { - private static final IncrSequenceMySQLHandler instance = new IncrSequenceMySQLHandler(); - } + private static final IncrSequenceMySQLHandler instance = new IncrSequenceMySQLHandler(); public static IncrSequenceMySQLHandler getInstance() { - return IncrSequenceMySQLHandlerHolder.instance; + return IncrSequenceMySQLHandler.instance; } public void load(boolean isLowerCaseTableNames) { @@ -134,202 +129,6 @@ public class IncrSequenceMySQLHandler implements SequenceHandler { } } -class FetchMySQLSequnceHandler implements ResponseHandler { - private static final Logger LOGGER = LoggerFactory - .getLogger(FetchMySQLSequnceHandler.class); - public void execute(SequenceVal seqVal) { - MycatConfig conf = MycatServer.getInstance().getConfig(); - PhysicalDBNode mysqlDN = conf.getDataNodes().get(seqVal.dataNode); - try { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("execute in datanode " + seqVal.dataNode - + " for fetch sequnce sql " + seqVal.sql); - } - // 修正获取seq的逻辑,在读写分离的情况下只能走写节点。修改Select模式为Update模式。 - mysqlDN.getConnection(mysqlDN.getDatabase(), true, - new RouteResultsetNode(seqVal.dataNode, ServerParse.UPDATE, - seqVal.sql), this, seqVal); - } catch (Exception e) { - LOGGER.warn("get connection err " + e); - } - } - public String getLastestError(String seqName) { - return IncrSequenceMySQLHandler.latestErrors.get(seqName); - } - - @Override - public void connectionAcquired(BackendConnection conn) { - - conn.setResponseHandler(this); - try { - conn.query(((SequenceVal) conn.getAttachment()).sql); - } catch (Exception e) { - executeException(conn, e); - } - } - - @Override - public void connectionError(Throwable e, BackendConnection conn) { - ((SequenceVal) conn.getAttachment()).dbfinished = true; - LOGGER.warn("connectionError " + e); - - } - - @Override - public void errorResponse(byte[] data, BackendConnection conn) { - SequenceVal seqVal = ((SequenceVal) conn.getAttachment()); - seqVal.dbfinished = true; - - ErrorPacket err = new ErrorPacket(); - err.read(data); - String errMsg = new String(err.message); - LOGGER.warn("errorResponse " + err.errno + " " + errMsg); - IncrSequenceMySQLHandler.latestErrors.put(seqVal.seqName, errMsg); - conn.release(); - - } - - @Override - public void okResponse(byte[] ok, BackendConnection conn) { - boolean executeResponse = conn.syncAndExcute(); - if (executeResponse) { - ((SequenceVal) conn.getAttachment()).dbfinished = true; - conn.release(); - } - - } - - @Override - public boolean rowResponse(byte[] row, RowDataPacket rowPacket, boolean isLeft, BackendConnection conn) { - RowDataPacket rowDataPkg = new RowDataPacket(1); - rowDataPkg.read(row); - byte[] columnData = rowDataPkg.fieldValues.get(0); - String columnVal = new String(columnData); - SequenceVal seqVal = (SequenceVal) conn.getAttachment(); - if (IncrSequenceMySQLHandler.errSeqResult.equals(columnVal)) { - seqVal.dbretVal = IncrSequenceMySQLHandler.errSeqResult; - LOGGER.warn(" sequnce sql returned err value ,sequence:" - + seqVal.seqName + " " + columnVal + " sql:" + seqVal.sql); - } else { - seqVal.dbretVal = columnVal; - } - return false; - } - - @Override - public void rowEofResponse(byte[] eof, boolean isLeft, BackendConnection conn) { - ((SequenceVal) conn.getAttachment()).dbfinished = true; - conn.release(); - } - - @Override - public void relayPacketResponse(byte[] relayPacket, BackendConnection conn) { - - } - - @Override - public void endPacketResponse(byte[] endPacket, BackendConnection conn) { - - } - - private void executeException(BackendConnection c, Throwable e) { - SequenceVal seqVal = ((SequenceVal) c.getAttachment()); - seqVal.dbfinished = true; - String errMgs=e.toString(); - IncrSequenceMySQLHandler.latestErrors.put(seqVal.seqName, errMgs); - LOGGER.warn("executeException " + errMgs); - c.close("exception:" +errMgs); - - } - - @Override - public void writeQueueAvailable() { - - } - - @Override - public void connectionClose(BackendConnection conn, String reason) { - - LOGGER.warn("connection closed " + conn + " reason:" + reason); - } - - @Override - public void fieldEofResponse(byte[] header, List fields, List fieldPackets, byte[] eof, - boolean isLeft, BackendConnection conn) { - - } - -} - -class SequenceVal { - public AtomicBoolean newValueSetted = new AtomicBoolean(false); - public AtomicLong curVal = new AtomicLong(0); - public volatile String dbretVal = null; - public volatile boolean dbfinished; - public AtomicBoolean fetching = new AtomicBoolean(false); - public volatile long maxSegValue; - public volatile boolean successFetched; - public volatile String dataNode; - public final String seqName; - public final String sql; - - public SequenceVal(String seqName, String dataNode) { - this.seqName = seqName; - this.dataNode = dataNode; - sql = "SELECT mycat_seq_nextval('" + seqName + "')"; - } - - public boolean isNexValValid(Long nexVal) { - if (nexVal < this.maxSegValue) { - return true; - } else { - return false; - } - } - -// FetchMySQLSequnceHandler seqHandler; - - public void setCurValue(long newValue) { - curVal.set(newValue); - successFetched = true; - } - - public Long[] waitFinish() { - long start = System.currentTimeMillis(); - long end = start + 10 * 1000; - while (System.currentTimeMillis() < end) { - if (dbretVal == IncrSequenceMySQLHandler.errSeqResult) { - throw new java.lang.RuntimeException( - "sequnce not found in db table "); - } else if (dbretVal != null) { - String[] items = dbretVal.split(","); - Long curVal = Long.parseLong(items[0]); - int span = Integer.parseInt(items[1]); - return new Long[] { curVal, curVal + span }; - } else { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - IncrSequenceMySQLHandler.LOGGER - .warn("wait db fetch sequnce err " + e); - } - } - } - return null; - } - - public boolean isSuccessFetched() { - return successFetched; - } - - public long nextValue() { - if (successFetched == false) { - throw new java.lang.RuntimeException( - "sequnce fetched failed from db "); - } - return curVal.incrementAndGet(); - } -} diff --git a/src/main/java/io/mycat/route/sequence/handler/SequenceVal.java b/src/main/java/io/mycat/route/sequence/handler/SequenceVal.java new file mode 100644 index 000000000..9996250b5 --- /dev/null +++ b/src/main/java/io/mycat/route/sequence/handler/SequenceVal.java @@ -0,0 +1,78 @@ +package io.mycat.route.sequence.handler; + +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Created by huqing.yan on 2017/7/3. + */ +public class SequenceVal { + + public AtomicBoolean newValueSetted = new AtomicBoolean(false); + public AtomicLong curVal = new AtomicLong(0); + public volatile String dbretVal = null; + public volatile boolean dbfinished; + public AtomicBoolean fetching = new AtomicBoolean(false); + public volatile long maxSegValue; + public volatile boolean successFetched; + public volatile String dataNode; + public final String seqName; + public final String sql; + + public SequenceVal(String seqName, String dataNode) { + this.seqName = seqName; + this.dataNode = dataNode; + sql = "SELECT mycat_seq_nextval('" + seqName + "')"; + } + + public boolean isNexValValid(Long nexVal) { + if (nexVal < this.maxSegValue) { + return true; + } else { + return false; + } + } + +// FetchMySQLSequnceHandler seqHandler; + + public void setCurValue(long newValue) { + curVal.set(newValue); + successFetched = true; + } + + public Long[] waitFinish() { + long start = System.currentTimeMillis(); + long end = start + 10 * 1000; + while (System.currentTimeMillis() < end) { + if (dbretVal == IncrSequenceMySQLHandler.errSeqResult) { + throw new java.lang.RuntimeException( + "sequnce not found in db table "); + } else if (dbretVal != null) { + String[] items = dbretVal.split(","); + Long curVal = Long.parseLong(items[0]); + int span = Integer.parseInt(items[1]); + return new Long[] { curVal, curVal + span }; + } else { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + IncrSequenceMySQLHandler.LOGGER + .warn("wait db fetch sequnce err " + e); + } + } + } + return null; + } + + public boolean isSuccessFetched() { + return successFetched; + } + + public long nextValue() { + if (successFetched == false) { + throw new java.lang.RuntimeException( + "sequnce fetched failed from db "); + } + return curVal.incrementAndGet(); + } +} diff --git a/src/main/java/io/mycat/server/ServerConnection.java b/src/main/java/io/mycat/server/ServerConnection.java index 6138b2f00..84707e111 100644 --- a/src/main/java/io/mycat/server/ServerConnection.java +++ b/src/main/java/io/mycat/server/ServerConnection.java @@ -193,7 +193,7 @@ public class ServerConnection extends FrontendConnection { if (db != null){ schemaConfig = MycatServer.getInstance().getConfig().getSchemas().get(db); if (schemaConfig == null) { - writeErrMessage(ErrorCode.ERR_BAD_LOGICDB, "Unknown MyCAT Database '" + db + "'"); + writeErrMessage(ErrorCode.ERR_BAD_LOGICDB, "Unknown Database '" + db + "'"); return; } } @@ -205,12 +205,12 @@ public class ServerConnection extends FrontendConnection { // 检查当前使用的DB String db = this.schema; if (db == null) { - writeErrMessage(ErrorCode.ERR_BAD_LOGICDB,"No MyCAT Database selected"); + writeErrMessage(ErrorCode.ERR_BAD_LOGICDB,"No Database selected"); return null; } SchemaConfig schema = MycatServer.getInstance().getConfig().getSchemas().get(db); if (schema == null) { - writeErrMessage(ErrorCode.ERR_BAD_LOGICDB,"Unknown MyCAT Database '" + db + "'"); + writeErrMessage(ErrorCode.ERR_BAD_LOGICDB,"Unknown Database '" + db + "'"); return null; } diff --git a/src/main/java/io/mycat/server/parser/ServerParse.java b/src/main/java/io/mycat/server/parser/ServerParse.java index 394e1a237..6475037df 100644 --- a/src/main/java/io/mycat/server/parser/ServerParse.java +++ b/src/main/java/io/mycat/server/parser/ServerParse.java @@ -26,6 +26,7 @@ package io.mycat.server.parser; import java.util.regex.Matcher; import java.util.regex.Pattern; +import io.mycat.config.Versions; import io.mycat.route.parser.util.ParseUtil; /** @@ -696,7 +697,7 @@ public final class ServerParse { // /*!mycat: sql=SELECT * FROM test where id=99 */set @pin=1; // call p_test(@pin,@pout); // select @pout; - if(stmt.startsWith("/*!mycat:")||stmt.startsWith("/*#mycat:")||stmt.startsWith("/*mycat:")) + if(stmt.startsWith("/*!"+ Versions.ANNOTATION_NAME)||stmt.startsWith("/*#"+ Versions.ANNOTATION_NAME)||stmt.startsWith("/*"+ Versions.ANNOTATION_NAME)) { Matcher matcher = callPattern.matcher(stmt); if (matcher.find()) { diff --git a/src/main/java/io/mycat/server/util/GlobalTableUtil.java b/src/main/java/io/mycat/server/util/GlobalTableUtil.java index 8c47ef160..11d0fa54b 100644 --- a/src/main/java/io/mycat/server/util/GlobalTableUtil.java +++ b/src/main/java/io/mycat/server/util/GlobalTableUtil.java @@ -29,7 +29,7 @@ import io.mycat.config.MycatConfig; import io.mycat.config.model.SchemaConfig; import io.mycat.config.model.SystemConfig; import io.mycat.config.model.TableConfig; -import io.mycat.meta.protocol.MyCatMeta.TableMeta; +import io.mycat.meta.protocol.StructureMeta.TableMeta; import io.mycat.server.util.SchemaUtil.SchemaInfo; import io.mycat.sqlengine.SQLQueryResult; import io.mycat.util.StringUtil; diff --git a/src/main/java/io/mycat/sqlengine/mpp/DataNodeMergeManager.java b/src/main/java/io/mycat/sqlengine/mpp/DataNodeMergeManager.java index 195a4e560..d8b6ad8fb 100644 --- a/src/main/java/io/mycat/sqlengine/mpp/DataNodeMergeManager.java +++ b/src/main/java/io/mycat/sqlengine/mpp/DataNodeMergeManager.java @@ -194,13 +194,13 @@ public class DataNodeMergeManager extends AbstractDataNodeMerge { myCatMemory, schema, prefixComparator, prefixComputer, - conf.getSizeAsBytes("mycat.buffer.pageSize","1m"), + conf.getSizeAsBytes("server.buffer.pageSize","1m"), false/**是否使用基数排序*/, true/**排序*/); } - if(conf.getBoolean("mycat.stream.output.result",false) + if(conf.getBoolean("server.stream.output.result",false) && globalSorter == null && unsafeRowGrouper == null){ setStreamOutputResult(true); @@ -234,7 +234,7 @@ public class DataNodeMergeManager extends AbstractDataNodeMerge { schema, prefixComparator, prefixComputer, - conf.getSizeAsBytes("mycat.buffer.pageSize", "1m"), + conf.getSizeAsBytes("server.buffer.pageSize", "1m"), false,/**是否使用基数排序*/ false/**不排序*/); } diff --git a/src/main/java/io/mycat/sqlengine/mpp/UnsafeRowGrouper.java b/src/main/java/io/mycat/sqlengine/mpp/UnsafeRowGrouper.java index 86eb49125..a086ca7c6 100644 --- a/src/main/java/io/mycat/sqlengine/mpp/UnsafeRowGrouper.java +++ b/src/main/java/io/mycat/sqlengine/mpp/UnsafeRowGrouper.java @@ -117,7 +117,7 @@ public class UnsafeRowGrouper { groupKeySchema, dataNodeMemoryManager, 2*1024, - conf.getSizeAsBytes("mycat.buffer.pageSize", "1m"), + conf.getSizeAsBytes("server.buffer.pageSize", "1m"), false); } diff --git a/src/main/java/io/mycat/util/exception/TmpFileException.java b/src/main/java/io/mycat/util/exception/TmpFileException.java index 319aea413..0393a3fe6 100644 --- a/src/main/java/io/mycat/util/exception/TmpFileException.java +++ b/src/main/java/io/mycat/util/exception/TmpFileException.java @@ -1,9 +1,7 @@ package io.mycat.util.exception; import java.io.IOException; -import java.io.InputStream; import java.text.MessageFormat; -import java.util.Locale; import java.util.Properties; @@ -11,17 +9,19 @@ public class TmpFileException extends RuntimeException { private static final long serialVersionUID = 1L; private static final Properties MESSAGES = new Properties(); static { - try { - InputStream in = TmpFileException.class.getResourceAsStream("/io/mycat/util/exception/res/_messages_en.prop"); - if (in != null) { - MESSAGES.load(in); - } - String language = Locale.getDefault().getLanguage(); - if (!"en".equals(language)) { - - } - } catch (IOException e) { - } + MESSAGES.put("5301","Could not open file {0}"); + MESSAGES.put("5302","Could not force file {0}"); + MESSAGES.put("5303","Could not sync file {0}"); + MESSAGES.put("5304","Reading from {0} failed"); + MESSAGES.put("5305","Writing to {0} failed"); + MESSAGES.put("5306","Error while renaming file {0} to {1}"); + MESSAGES.put("5307","Cannot delete file {0}"); + MESSAGES.put("5308","IO Exception: {0}"); + MESSAGES.put("5309","Reading from {0} failed,index out of bounds"); + MESSAGES.put("5310","Hex a decimal string with odd number of characters: {0}"); + MESSAGES.put("5311","Hex a decimal string contains non-hex character: {0}"); + MESSAGES.put("5312","Invalid value {0} for parameter {1}"); + MESSAGES.put("5313","Error while creating file {0}"); } private TmpFileException(String message) { @@ -43,11 +43,7 @@ public class TmpFileException extends RuntimeException { } private static String translate(String key, String... params) { - String message = null; - if (MESSAGES != null) { - // Tomcat sets final static fields to null sometimes - message = MESSAGES.getProperty(key); - } + String message = MESSAGES.getProperty(key); if (message == null) { message = "(Message " + key + " not found)"; } @@ -109,16 +105,4 @@ public class TmpFileException extends RuntimeException { return get(errorCode * 10, e.toString(), message); } - /** - * Gets a exception meaning this value is invalid. - * - * @param param - * the name of the parameter - * @param value - * the value passed - * @return the IllegalArgumentException object - */ - public static TmpFileException getInvalidValueException(int errorCode, String param, Object value) { - return get(errorCode, value == null ? "null" : value.toString(), param); - } } diff --git a/src/main/resources/index_to_charset.properties b/src/main/resources/index_to_charset.properties deleted file mode 100644 index b990ce466..000000000 --- a/src/main/resources/index_to_charset.properties +++ /dev/null @@ -1,219 +0,0 @@ -1=big5 -2=latin2 -3=dec8 -4=cp850 -5=latin1 -6=hp8 -7=koi8r -8=latin1 -9=latin2 -10=swe7 -11=ascii -12=ujis -13=sjis -14=cp1251 -15=latin1 -16=hebrew -18=tis620 -19=euckr -20=latin7 -21=latin2 -22=koi8u -23=cp1251 -24=gb2312 -25=greek -26=cp1250 -27=latin2 -28=gbk -29=cp1257 -30=latin5 -31=latin1 -32=armscii8 -33=utf8 -34=cp1250 -35=ucs2 -36=cp866 -37=keybcs2 -38=macce -39=macroman -40=cp852 -41=latin7 -42=latin7 -43=macce -44=cp1250 -45=utf8mb4 -46=utf8mb4 -47=latin1 -48=latin1 -49=latin1 -50=cp1251 -51=cp1251 -52=cp1251 -53=macroman -54=utf16 -55=utf16 -56=utf16le -57=cp1256 -58=cp1257 -59=cp1257 -60=utf32 -61=utf32 -62=utf16le -63=binary -64=armscii8 -65=ascii -66=cp1250 -67=cp1256 -68=cp866 -69=dec8 -70=greek -71=hebrew -72=hp8 -73=keybcs2 -74=koi8r -75=koi8u -77=latin2 -78=latin5 -79=latin7 -80=cp850 -81=cp852 -82=swe7 -83=utf8 -84=big5 -85=euckr -86=gb2312 -87=gbk -88=sjis -89=tis620 -90=ucs2 -91=ujis -92=geostd8 -93=geostd8 -94=latin1 -95=cp932 -96=cp932 -97=eucjpms -98=eucjpms -99=cp1250 -101=utf16 -102=utf16 -103=utf16 -104=utf16 -105=utf16 -106=utf16 -107=utf16 -108=utf16 -109=utf16 -110=utf16 -111=utf16 -112=utf16 -113=utf16 -114=utf16 -115=utf16 -116=utf16 -117=utf16 -118=utf16 -119=utf16 -120=utf16 -121=utf16 -122=utf16 -123=utf16 -124=utf16 -128=ucs2 -129=ucs2 -130=ucs2 -131=ucs2 -132=ucs2 -133=ucs2 -134=ucs2 -135=ucs2 -136=ucs2 -137=ucs2 -138=ucs2 -139=ucs2 -140=ucs2 -141=ucs2 -142=ucs2 -143=ucs2 -144=ucs2 -145=ucs2 -146=ucs2 -147=ucs2 -148=ucs2 -149=ucs2 -150=ucs2 -151=ucs2 -159=ucs2 -160=utf32 -161=utf32 -162=utf32 -163=utf32 -164=utf32 -165=utf32 -166=utf32 -167=utf32 -168=utf32 -169=utf32 -170=utf32 -171=utf32 -172=utf32 -173=utf32 -174=utf32 -175=utf32 -176=utf32 -177=utf32 -178=utf32 -179=utf32 -180=utf32 -181=utf32 -182=utf32 -183=utf32 -192=utf8 -193=utf8 -194=utf8 -195=utf8 -196=utf8 -197=utf8 -198=utf8 -199=utf8 -200=utf8 -201=utf8 -202=utf8 -203=utf8 -204=utf8 -205=utf8 -206=utf8 -207=utf8 -208=utf8 -209=utf8 -210=utf8 -211=utf8 -212=utf8 -213=utf8 -214=utf8 -215=utf8 -223=utf8 -224=utf8mb4 -225=utf8mb4 -226=utf8mb4 -227=utf8mb4 -228=utf8mb4 -229=utf8mb4 -230=utf8mb4 -231=utf8mb4 -232=utf8mb4 -233=utf8mb4 -234=utf8mb4 -235=utf8mb4 -236=utf8mb4 -237=utf8mb4 -238=utf8mb4 -239=utf8mb4 -240=utf8mb4 -241=utf8mb4 -242=utf8mb4 -243=utf8mb4 -244=utf8mb4 -245=utf8mb4 -246=utf8mb4 -247=utf8mb4 \ No newline at end of file diff --git a/src/main/resources/myid.properties b/src/main/resources/myid.properties index 5f654fb80..951b16844 100644 --- a/src/main/resources/myid.properties +++ b/src/main/resources/myid.properties @@ -1,8 +1,5 @@ loadZk=false zkURL=127.0.0.1:2181 clusterId=mycat-cluster-1 -myid=mycat_fz_01 -clusterNodes=mycat_fz_01,mycat_fz_02,mycat_fz_04 -#server booster ; booster install on db same server,will reset all minCon to 1 -type=server -boosterDataHosts=dn2,dn3 +myid=server_fz_01 +clusterNodes=server_fz_01,server_fz_02,server_fz_04 diff --git a/ushard.xml b/ushard.xml index 95a83d9b4..51b09ed3e 100644 --- a/ushard.xml +++ b/ushard.xml @@ -232,12 +232,9 @@ src/main/resources - - **/.svn/** - rule_template.xml - schema_template.xml - server_template.xml - + + *.dtd + @@ -409,6 +406,23 @@ + + IncrSequenceMySQLHandler + process-sources + + replace + + + ${project.basedir}/src/main/java/io/mycat/route/sequence/handler/SequenceVal.java + ${project.basedir}/src/main/java/io/mycat/route/sequence/handler/SequenceVal.java + + + mycat_seq_nextval + ushard_seq_nextval + + + + init_zk_data process-sources @@ -461,24 +475,28 @@ - log4j2.xml + dbseq.sql process-sources replace - ${project.basedir}/src/main/resources/log4j2.xml - ${project.basedir}/src/main/resources/log4j2.xml + ${project.basedir}/src/main/resources/dbseq.sql + ${project.basedir}/src/main/resources/dbseq.sql mycat ushard + + MYCAT + USHARD + - 1log4j2.xml + log4j2.xml process-sources replace @@ -516,6 +534,40 @@ + + MycatServer.java + process-sources + + replace + + + ${project.basedir}/src/main/java/io/mycat/MycatServer.java + ${project.basedir}/src/main/java/io/mycat/MycatServer.java + + + MyCat_ + Ushard_ + + + + + + GlobalTableUtil.java + process-sources + + replace + + + ${project.basedir}/src/main/java/io/mycat/server/util/GlobalTableUtil.java + ${project.basedir}/src/main/java/io/mycat/server/util/GlobalTableUtil.java + + + _mycat_op_time + _ushard_op_time + + + + ShowServerLog.java process-sources @@ -555,6 +607,10 @@ @annotation-name@ ushard: + + @root_prefix@ + ushard +