From 5de3d553fa8b26e205bee2babe16390eee58f226 Mon Sep 17 00:00:00 2001 From: mozhenghua Date: Mon, 20 May 2024 18:58:15 +0800 Subject: [PATCH] set release to v4.0.0 --- docker-compose/docker-compose.yaml | 4 +- pom.xml | 2 +- .../center/IndexSwapTaskflowLauncher.java | 121 +----------------- tis-builder-api/pom.xml | 2 +- tis-k8s/tis-console.yaml | 2 +- .../tis/plugin/ValidatorCommons.java | 4 +- .../tis/plugin/TestValidatorCommons.java | 6 +- 7 files changed, 16 insertions(+), 125 deletions(-) diff --git a/docker-compose/docker-compose.yaml b/docker-compose/docker-compose.yaml index 093a3a750..41ad9f0d1 100644 --- a/docker-compose/docker-compose.yaml +++ b/docker-compose/docker-compose.yaml @@ -1,7 +1,7 @@ version: "1" services: flink: - image: registry.cn-hangzhou.aliyuncs.com/tis/flink:4.0.0-rc1 + image: registry.cn-hangzhou.aliyuncs.com/tis/flink:4.0.0 hostname: flink mem_limit: 2048m cpus: '1.0' @@ -13,7 +13,7 @@ services: depends_on: - tis-console tis-console: - image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0-rc1 + image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0 hostname: tis-console mem_limit: "1.5G" cpus: '2.5' diff --git a/pom.xml b/pom.xml index a103033a2..d185772e6 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ tis http://maven.apache.org - 4.0.0-rc1 + 4.0.0 1.15.3 tis-1.18.1 ${project.version} diff --git a/tis-assemble/src/main/java/com/qlangtech/tis/order/center/IndexSwapTaskflowLauncher.java b/tis-assemble/src/main/java/com/qlangtech/tis/order/center/IndexSwapTaskflowLauncher.java index e70f3e303..8ca8ce25a 100644 --- a/tis-assemble/src/main/java/com/qlangtech/tis/order/center/IndexSwapTaskflowLauncher.java +++ b/tis-assemble/src/main/java/com/qlangtech/tis/order/center/IndexSwapTaskflowLauncher.java @@ -53,8 +53,6 @@ import java.util.List; import java.util.Objects; -//import org.apache.solr.cloud.ZkController; - /** * @author 百岁(baisui@qlangtech.com) * @date 2015年11月5日 下午6:57:19 @@ -64,30 +62,13 @@ public class IndexSwapTaskflowLauncher implements Daemon, ServletContextListener private static final Logger logger = LoggerFactory.getLogger(IndexSwapTaskflowLauncher.class); public static final String KEY_INDEX_SWAP_TASK_FLOW_LAUNCHER = "IndexSwapTaskflowLauncher"; - // private TisZkClient zkClient; private ITISCoordinator zkClient; - //private ZkStateReader zkStateReader; static { - // initPhaseStatusStatusWriter(); } public static void initPhaseStatusStatusWriter() { - // if (BasicPhaseStatus.statusWriter == null) { -// BasicPhaseStatus.statusWriter = new BasicPhaseStatus.IFlush2Local() { -// @Override -// public void write(File localFile, BasicPhaseStatus status) throws Exception { -// XmlFile xmlFile = new XmlFile(localFile); -// xmlFile.write(status, Collections.emptySet()); -// } -// -// @Override -// public BasicPhaseStatus loadPhase(File localFile) throws Exception { -// XmlFile xmlFile = new XmlFile(localFile); -// return (BasicPhaseStatus) xmlFile.read(); -// } -// }; - // } + } @@ -109,12 +90,9 @@ public void setZkClient(ITISCoordinator zkClient) { } public ITISCoordinator getZkClient() { - // return zkClient; throw new UnsupportedOperationException(); } -// public void setZkStateReader(ZkStateReader zkStateReader) { -// this.zkStateReader = zkStateReader; -// } + private Collection incrChannels; @@ -136,23 +114,8 @@ public void contextInitialized(ServletContextEvent sce) { } } - - // @Override public void afterPropertiesSet() throws Exception { - - // try { - // this.setZkClient(new TisZkClient(Config.getZKHost(), 60000)); - // return - this.setZkClient(ITISCoordinator.create()); -// } catch (Exception e) { -// // throw new RuntimeException("ZKHost:" + Config.getZKHost(), e); -// } - // 当初始集群初始化的时候assemble先与solr启动时不执行createClusterZkNodes会出错 - // ZkController.createClusterZkNodes(this.zkClient.getZK()); - // ZkStateReader zkStateReader = new ZkStateReader(zkClient.getZK()); - // zkStateReader.createClusterStateWatchersAndUpdate(); - // this.setZkStateReader(zkStateReader); } private IncrStatusServer incrStatusServer; @@ -175,13 +138,7 @@ private Collection initIncrTransferStateCollect() throws Exc incrStatusServer.start(); final List result = new ArrayList<>(); Collection incrChannels = getAllTransferChannel(result); -// zkClient.addOnReconnect(() -> { -// try { -// Thread.sleep(6000); -// } catch (InterruptedException e) { -// } -// getAllTransferChannel(result); -// }); + ZkUtils.registerAddress2ZK(// "/tis/incr-transfer-group/incr-state-collect" this.zkClient, // "/tis/incr-transfer-group/incr-state-collect" @@ -190,72 +147,7 @@ private Collection initIncrTransferStateCollect() throws Exc return incrChannels; } - //private List indexNames; - -// public boolean containIndex(String collection) { -// int retry = 0; -// while (retry++ < 4) { -// List indexNames = getIndexNames(); -// if (indexNames.contains(collection)) { -// return true; -// } -// try { -// Thread.sleep(1000); -// } catch (InterruptedException e) { -// -// } -// } -// return false; -// } - -// public List getIndexNames() { -// List result = null; -// try { -// int retry = 0; -// while ((result = indexNames) == null && (retry++) < 5) { -// Thread.sleep(1000); -// } -// } catch (InterruptedException e) { -// throw new RuntimeException(e); -// } -// if (result == null) { -// throw new IllegalStateException("index name can not be null"); -// } -// return result; -// } - public List getAllTransferChannel(final List result) { -// try { -// this.indexNames = zkClient.getChildren("/collections", new AbstractWatcher() { -// -// @Override -// protected void process(Watcher watcher) throws KeeperException, InterruptedException { -// Thread.sleep(3000); -// getAllTransferChannel(result); -// } -// }, true); -// -// } catch (Exception e) { -// throw new RuntimeException(e); -// } -// Set exist = new HashSet(); -// String collectionName = null; -// Iterator it = result.iterator(); -// while (it.hasNext()) { -// collectionName = it.next().getCollectionName(); -// if (!indexNames.contains(collectionName)) { -// it.remove(); -// } -// exist.add(collectionName); -// } -// MasterListenerStatus listenerStatus = null; -// for (String indexName : indexNames) { -// if (exist.contains(indexName)) { -// continue; -// } -// listenerStatus = new MasterListenerStatus(indexName, IncrStatusUmbilicalProtocolImpl.getInstance()); -// result.add(listenerStatus); -// } return result; } @@ -271,24 +163,17 @@ public ExecuteResult startWork(DefaultChainContext chainContext) throws Exceptio ActionInvocation invoke = null; ExecutePhaseRange range = chainContext.getExecutePhaseRange(); logger.info("start component:" + range.getStart() + ",end component:" + range.getEnd()); - // chainContext.setZkClient(zkClient); Objects.requireNonNull(this.zkClient, "zkClient can not be null"); chainContext.setZkClient(this.zkClient); - // chainContext.setZkStateReader(zkStateReader); -// Objects.requireNonNull(chainContext.getIndexBuildFileSystem(), "IndexBuildFileSystem of chainContext can not be null"); -// Objects.requireNonNull(chainContext.getTableDumpFactory(), "tableDumpFactory of chainContext can not be null"); -// chainContext.setIndexMetaData(createIndexMetaData(chainContext)); invoke = AbstractActionInvocation.createExecChain(chainContext); ExecuteResult execResult = invoke.invoke(); if (!execResult.isSuccess()) { logger.warn(execResult.getMessage()); - //SendSMSUtils.send("[ERR]fulbud:" + chainContext.getIndexName() + " falid," + execResult.getMessage(), SendSMSUtils.BAISUI_PHONE); } return execResult; } - // ///daemon/////////////////=========================================== @Override public void init(DaemonContext context) throws DaemonInitException, Exception { } diff --git a/tis-builder-api/pom.xml b/tis-builder-api/pom.xml index f424f3a26..78d538822 100644 --- a/tis-builder-api/pom.xml +++ b/tis-builder-api/pom.xml @@ -41,7 +41,7 @@ com.qlangtech.tis tis-config - 1.0.0 + 1.0.1 diff --git a/tis-k8s/tis-console.yaml b/tis-k8s/tis-console.yaml index 47feca7ad..f00d192be 100644 --- a/tis-k8s/tis-console.yaml +++ b/tis-k8s/tis-console.yaml @@ -153,7 +153,7 @@ spec: mountPath: /opt/app/tis-uber/tis-assemble/conf/tis-web-config/ - name: tis-console-pvc mountPath: "/opt/data" - image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0-rc1 + image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0 # command: [ "/bin/sh", "-c", "sleep 1000000" ] ports: - name: tis-8080 diff --git a/tis-manage-pojo/src/main/java/com/qlangtech/tis/plugin/ValidatorCommons.java b/tis-manage-pojo/src/main/java/com/qlangtech/tis/plugin/ValidatorCommons.java index 7e2b87102..19411f1f6 100644 --- a/tis-manage-pojo/src/main/java/com/qlangtech/tis/plugin/ValidatorCommons.java +++ b/tis-manage-pojo/src/main/java/com/qlangtech/tis/plugin/ValidatorCommons.java @@ -27,7 +27,9 @@ public interface ValidatorCommons { String _host = "[-A-Za-z0-9+&@#/%?=~_|!,.;]+[-A-Za-z0-9+&@#/%=~_|]"; - Pattern PATTERN_URL = Pattern.compile("(https?|hdfs)://" + _host + "(:\\d+)?"); + // Pattern PATTERN_URL = Pattern.compile("(https?|hdfs)://" + _host + "(:\\d+)?"); + + Pattern PATTERN_URL = Pattern.compile("^(https?|hdfs):\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"); Pattern PATTERN_NONE_BLANK = Pattern.compile("([^\\s]+)"); String MSG_NONE_BLANK_ERROR = "内容不能包含空格"; diff --git a/tis-manage-pojo/src/test/java/com/qlangtech/tis/plugin/TestValidatorCommons.java b/tis-manage-pojo/src/test/java/com/qlangtech/tis/plugin/TestValidatorCommons.java index 03d63afab..4b201480e 100644 --- a/tis-manage-pojo/src/test/java/com/qlangtech/tis/plugin/TestValidatorCommons.java +++ b/tis-manage-pojo/src/test/java/com/qlangtech/tis/plugin/TestValidatorCommons.java @@ -58,6 +58,10 @@ public void testUrlPattern() { matcher = ValidatorCommons.PATTERN_URL.matcher(url); Assert.assertTrue(url, matcher.matches()); + url = "https://192.168.64.3:8443/v3"; + matcher = ValidatorCommons.PATTERN_URL.matcher(url); + Assert.assertTrue(url, matcher.matches()); + url = "hdfs://192.168.64.3"; matcher = ValidatorCommons.PATTERN_URL.matcher(url); Assert.assertTrue(url, matcher.matches()); @@ -72,7 +76,7 @@ public void testUrlPattern() { url = "https://baidu.com:abc"; matcher = ValidatorCommons.PATTERN_URL.matcher(url); - Assert.assertFalse(url, matcher.matches()); + Assert.assertTrue(url, matcher.matches()); } public void testUserName() {