diff --git a/regression-test/plugins/plugin_curl_requester.groovy b/regression-test/plugins/plugin_curl_requester.groovy new file mode 100644 index 0000000000..2e777cb8d7 --- /dev/null +++ b/regression-test/plugins/plugin_curl_requester.groovy @@ -0,0 +1,63 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import org.apache.doris.regression.suite.Suite +import org.codehaus.groovy.runtime.IOGroovyMethods + +Suite.metaClass.curl = { String method, String url /* param */-> + Suite suite = delegate as Suite + if (method != "GET" && method != "POST") + { + throw new Exception(String.format("invalid curl method: %s", method)) + } + if (url.isBlank()) + { + throw new Exception("invalid curl url, blank") + } + + Integer timeout = 10; // 10 seconds; + + String cmd = String.format("curl --max-time %d -X %s %s", timeout, method, url).toString() + logger.info("curl cmd: " + cmd) + def process = cmd.execute() + int code = process.waitFor() + String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))) + String out = process.getText() + + return [code, out, err] +} + +logger.info("Added 'curl' function to Suite") + + +Suite.metaClass.show_be_config = { String ip, String port /*param */ -> + return curl("GET", String.format("http://%s:%s/api/show_config", ip, port)) +} + +logger.info("Added 'show_be_config' function to Suite") + +Suite.metaClass.be_get_compaction_status{ String ip, String port, String tablet_id /* param */-> + return curl("GET", String.format("http://%s:%s/api/compaction/run_status?tablet_id=%s", ip, port, tablet_id)) +} + +logger.info("Added 'be_get_compaction_status' function to Suite") + +Suite.metaClass.be_run_cumulative_compaction = { String ip, String port, String tablet_id /* param */-> + return curl("POST", String.format("http://%s:%s/api/compaction/run?tablet_id=%s&compact_type=cumulative", ip, port, tablet_id)) +} + +logger.info("Added 'be_run_cumulative_compaction' function to Suite") diff --git a/regression-test/suites/compaction/test_compacation_with_delete.groovy b/regression-test/suites/compaction/test_compacation_with_delete.groovy index 306120fe76..e9a05e0efb 100644 --- a/regression-test/suites/compaction/test_compacation_with_delete.groovy +++ b/regression-test/suites/compaction/test_compacation_with_delete.groovy @@ -27,17 +27,7 @@ suite("test_compaction_with_delete") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -112,20 +102,7 @@ suite("test_compaction_with_delete") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -145,20 +122,7 @@ suite("test_compaction_with_delete") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -170,16 +134,8 @@ suite("test_compaction_with_delete") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_compaction_agg_keys.groovy b/regression-test/suites/compaction/test_compaction_agg_keys.groovy index 726ed4018d..4b2397a027 100644 --- a/regression-test/suites/compaction/test_compaction_agg_keys.groovy +++ b/regression-test/suites/compaction/test_compaction_agg_keys.groovy @@ -25,19 +25,9 @@ suite("test_compaction_agg_keys") { def backendId_to_backendIP = [:] def backendId_to_backendHttpPort = [:] getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -117,20 +107,7 @@ suite("test_compaction_agg_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -150,22 +127,10 @@ suite("test_compaction_agg_keys") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def compactionStatus = parseJson(out.trim()) assertEquals("success", compactionStatus.status.toLowerCase()) running = compactionStatus.run_status @@ -175,17 +140,11 @@ suite("test_compaction_agg_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) + assertEquals(code, 0) def tabletJson = parseJson(out.trim()) assert tabletJson.rowsets instanceof List diff --git a/regression-test/suites/compaction/test_compaction_agg_keys_with_delete.groovy b/regression-test/suites/compaction/test_compaction_agg_keys_with_delete.groovy index 594aa7b4e0..f463269034 100644 --- a/regression-test/suites/compaction/test_compaction_agg_keys_with_delete.groovy +++ b/regression-test/suites/compaction/test_compaction_agg_keys_with_delete.groovy @@ -25,19 +25,8 @@ suite("test_compaction_agg_keys_with_delete") { def backendId_to_backendIP = [:] def backendId_to_backendHttpPort = [:] getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -129,20 +118,7 @@ suite("test_compaction_agg_keys_with_delete") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -162,20 +138,7 @@ suite("test_compaction_agg_keys_with_delete") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -187,18 +150,12 @@ suite("test_compaction_agg_keys_with_delete") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def tabletJson = parseJson(out.trim()) assert tabletJson.rowsets instanceof List for (String rowset in (List) tabletJson.rowsets) { diff --git a/regression-test/suites/compaction/test_compaction_dup_keys.groovy b/regression-test/suites/compaction/test_compaction_dup_keys.groovy index e5c5fb42f4..cf3e96ae7d 100644 --- a/regression-test/suites/compaction/test_compaction_dup_keys.groovy +++ b/regression-test/suites/compaction/test_compaction_dup_keys.groovy @@ -27,17 +27,8 @@ suite("test_compaction_dup_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -115,21 +106,9 @@ suite("test_compaction_dup_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) + assertEquals(code, 0) def compactJson = parseJson(out.trim()) if (compactJson.status.toLowerCase() == "fail") { @@ -148,20 +127,7 @@ suite("test_compaction_dup_keys") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -173,18 +139,12 @@ suite("test_compaction_dup_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def tabletJson = parseJson(out.trim()) assert tabletJson.rowsets instanceof List for (String rowset in (List) tabletJson.rowsets) { diff --git a/regression-test/suites/compaction/test_compaction_dup_keys_with_delete.groovy b/regression-test/suites/compaction/test_compaction_dup_keys_with_delete.groovy index 9c9c9481d3..848514017d 100644 --- a/regression-test/suites/compaction/test_compaction_dup_keys_with_delete.groovy +++ b/regression-test/suites/compaction/test_compaction_dup_keys_with_delete.groovy @@ -27,17 +27,8 @@ suite("test_compaction_dup_keys_with_delete") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -127,22 +118,10 @@ suite("test_compaction_dup_keys_with_delete") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def compactJson = parseJson(out.trim()) if (compactJson.status.toLowerCase() == "fail") { assertEquals(disableAutoCompaction, false) @@ -160,22 +139,10 @@ suite("test_compaction_dup_keys_with_delete") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def compactionStatus = parseJson(out.trim()) assertEquals("success", compactionStatus.status.toLowerCase()) running = compactionStatus.run_status @@ -185,18 +152,12 @@ suite("test_compaction_dup_keys_with_delete") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def tabletJson = parseJson(out.trim()) assert tabletJson.rowsets instanceof List for (String rowset in (List) tabletJson.rowsets) { diff --git a/regression-test/suites/compaction/test_compaction_uniq_keys.groovy b/regression-test/suites/compaction/test_compaction_uniq_keys.groovy index 314b9c7096..648c7c4af2 100644 --- a/regression-test/suites/compaction/test_compaction_uniq_keys.groovy +++ b/regression-test/suites/compaction/test_compaction_uniq_keys.groovy @@ -27,17 +27,8 @@ suite("test_compaction_uniq_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -115,20 +106,7 @@ suite("test_compaction_uniq_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -148,20 +126,7 @@ suite("test_compaction_uniq_keys") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -173,16 +138,8 @@ suite("test_compaction_uniq_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_compaction_uniq_keys_row_store.groovy b/regression-test/suites/compaction/test_compaction_uniq_keys_row_store.groovy index ee296df865..2eaf5f212d 100644 --- a/regression-test/suites/compaction/test_compaction_uniq_keys_row_store.groovy +++ b/regression-test/suites/compaction/test_compaction_uniq_keys_row_store.groovy @@ -43,17 +43,8 @@ suite("test_compaction_uniq_keys_row_store") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -171,20 +162,7 @@ suite("test_compaction_uniq_keys_row_store") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -204,22 +182,10 @@ suite("test_compaction_uniq_keys_row_store") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) + def compactionStatus = parseJson(out.trim()) assertEquals("success", compactionStatus.status.toLowerCase()) running = compactionStatus.run_status @@ -229,16 +195,8 @@ suite("test_compaction_uniq_keys_row_store") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_compaction_uniq_keys_with_delete.groovy b/regression-test/suites/compaction/test_compaction_uniq_keys_with_delete.groovy index 82f72f450e..805bc61347 100644 --- a/regression-test/suites/compaction/test_compaction_uniq_keys_with_delete.groovy +++ b/regression-test/suites/compaction/test_compaction_uniq_keys_with_delete.groovy @@ -27,17 +27,8 @@ suite("test_compaction_uniq_keys_with_delete") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -131,20 +122,7 @@ suite("test_compaction_uniq_keys_with_delete") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -164,20 +142,7 @@ suite("test_compaction_uniq_keys_with_delete") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -189,16 +154,8 @@ suite("test_compaction_uniq_keys_with_delete") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_vertical_compaction_agg_keys.groovy b/regression-test/suites/compaction/test_vertical_compaction_agg_keys.groovy index f0d5279fa1..036cb44b6b 100644 --- a/regression-test/suites/compaction/test_vertical_compaction_agg_keys.groovy +++ b/regression-test/suites/compaction/test_vertical_compaction_agg_keys.groovy @@ -27,17 +27,7 @@ suite("test_vertical_compaction_agg_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -129,20 +119,7 @@ suite("test_vertical_compaction_agg_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -161,21 +138,7 @@ suite("test_vertical_compaction_agg_keys") { do { Thread.sleep(1000) String tablet_id = tablet[0] - backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -187,16 +150,8 @@ suite("test_vertical_compaction_agg_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_vertical_compaction_dup_keys.groovy b/regression-test/suites/compaction/test_vertical_compaction_dup_keys.groovy index 980c2c7cc4..1380e5e817 100644 --- a/regression-test/suites/compaction/test_vertical_compaction_dup_keys.groovy +++ b/regression-test/suites/compaction/test_vertical_compaction_dup_keys.groovy @@ -27,17 +27,8 @@ suite("test_vertical_compaction_dup_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -128,20 +119,7 @@ suite("test_vertical_compaction_dup_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -161,20 +139,7 @@ suite("test_vertical_compaction_dup_keys") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -186,16 +151,8 @@ suite("test_vertical_compaction_dup_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/compaction/test_vertical_compaction_uniq_keys.groovy b/regression-test/suites/compaction/test_vertical_compaction_uniq_keys.groovy index 29e8bc524e..3da11dbc60 100644 --- a/regression-test/suites/compaction/test_vertical_compaction_uniq_keys.groovy +++ b/regression-test/suites/compaction/test_vertical_compaction_uniq_keys.groovy @@ -27,17 +27,7 @@ suite("test_vertical_compaction_uniq_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -126,20 +116,7 @@ suite("test_vertical_compaction_uniq_keys") { for (String[] tablet in tablets) { String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -159,20 +136,7 @@ suite("test_vertical_compaction_uniq_keys") { Thread.sleep(1000) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - logger.info(command) - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) @@ -184,16 +148,8 @@ suite("test_vertical_compaction_uniq_keys") { int rowCount = 0 for (String[] tablet in tablets) { String tablet_id = tablet[0] - StringBuilder sb = new StringBuilder(); def compactionStatusUrlIndex = 18 - sb.append("curl -X GET ") - sb.append(tablet[compactionStatusUrlIndex]) - String command = sb.toString() - // wait for cleaning stale_rowsets - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", tablet[compactionStatusUrlIndex]) logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def tabletJson = parseJson(out.trim()) diff --git a/regression-test/suites/json_p0/test_json_load_and_function.groovy b/regression-test/suites/json_p0/test_json_load_and_function.groovy index a7280b0dd0..756810933b 100644 --- a/regression-test/suites/json_p0/test_json_load_and_function.groovy +++ b/regression-test/suites/json_p0/test_json_load_and_function.groovy @@ -51,13 +51,7 @@ suite("test_json_load_and_function", "p0") { log.info("Stream load result: ${result}".toString()) def json = parseJson(result) - StringBuilder sb = new StringBuilder() - sb.append("curl -X GET " + json.ErrorURL) - String command = sb.toString() - def process = command.execute() - def code = process.waitFor() - def err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))) - def out = process.getText() + (code, out, err) = curl("GET", json.ErrorURL) log.info("error result: " + out) assertEquals("fail", json.Status.toLowerCase()) @@ -90,13 +84,7 @@ suite("test_json_load_and_function", "p0") { log.info("Stream load result: ${result}".toString()) def json = parseJson(result) - StringBuilder sb = new StringBuilder() - sb.append("curl -X GET " + json.ErrorURL) - String command = sb.toString() - def process = command.execute() - def code = process.waitFor() - def err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))) - def out = process.getText() + (code, out, err) = curl("GET", json.ErrorURL) log.info("error result: " + out) assertEquals("success", json.Status.toLowerCase()) diff --git a/regression-test/suites/jsonb_p0/test_jsonb_load_and_function.groovy b/regression-test/suites/jsonb_p0/test_jsonb_load_and_function.groovy index 9c7d1623fe..fd2b246c7c 100644 --- a/regression-test/suites/jsonb_p0/test_jsonb_load_and_function.groovy +++ b/regression-test/suites/jsonb_p0/test_jsonb_load_and_function.groovy @@ -50,14 +50,7 @@ suite("test_jsonb_load_and_function", "p0") { } log.info("Stream load result: ${result}".toString()) def json = parseJson(result) - - StringBuilder sb = new StringBuilder() - sb.append("curl -X GET " + json.ErrorURL) - String command = sb.toString() - def process = command.execute() - def code = process.waitFor() - def err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))) - def out = process.getText() + (code, out, err) = curl("GET", json.ErrorURL) log.info("error result: " + out) assertEquals("fail", json.Status.toLowerCase()) @@ -89,14 +82,7 @@ suite("test_jsonb_load_and_function", "p0") { } log.info("Stream load result: ${result}".toString()) def json = parseJson(result) - - StringBuilder sb = new StringBuilder() - sb.append("curl -X GET " + json.ErrorURL) - String command = sb.toString() - def process = command.execute() - def code = process.waitFor() - def err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))) - def out = process.getText() + (code, out, err) = curl("GET", json.ErrorURL) log.info("error result: " + out) assertEquals("success", json.Status.toLowerCase()) diff --git a/regression-test/suites/load_p0/stream_load/test_map_load_and_compaction.groovy b/regression-test/suites/load_p0/stream_load/test_map_load_and_compaction.groovy index 5ff0e14d7e..52063dca57 100644 --- a/regression-test/suites/load_p0/stream_load/test_map_load_and_compaction.groovy +++ b/regression-test/suites/load_p0/stream_load/test_map_load_and_compaction.groovy @@ -69,11 +69,7 @@ suite("test_map_load_and_compaction", "p0") { } def checkCompactionStatus = {compactionStatus, assertRowSetNum-> - String checkStatus = new String("curl -X GET "+compactionStatus) - process = checkStatus.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = curl("GET", compactionStatus) logger.info("Check compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactStatusJson = parseJson(out.trim()) @@ -114,20 +110,7 @@ suite("test_map_load_and_compaction", "p0") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactJson = parseJson(out.trim()) @@ -136,20 +119,7 @@ suite("test_map_load_and_compaction", "p0") { // wait compactions done do { Thread.sleep(1000) - sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String cm = sb.toString() - logger.info(cm) - process = cm.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def cs = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change/test_number_overflow.groovy b/regression-test/suites/schema_change/test_number_overflow.groovy index b4ab65ebf6..7eb0b2b5f0 100644 --- a/regression-test/suites/schema_change/test_number_overflow.groovy +++ b/regression-test/suites/schema_change/test_number_overflow.groovy @@ -31,17 +31,8 @@ suite ("test_number_overflow") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/datev2/test_agg_keys_schema_change_datev2.groovy b/regression-test/suites/schema_change_p0/datev2/test_agg_keys_schema_change_datev2.groovy index 0689deba04..11e0440612 100644 --- a/regression-test/suites/schema_change_p0/datev2/test_agg_keys_schema_change_datev2.groovy +++ b/regression-test/suites/schema_change_p0/datev2/test_agg_keys_schema_change_datev2.groovy @@ -30,17 +30,8 @@ suite("test_agg_keys_schema_change_datev2") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -52,20 +43,7 @@ suite("test_agg_keys_schema_change_datev2") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -76,19 +54,7 @@ suite("test_agg_keys_schema_change_datev2") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/datev2/test_dup_keys_schema_change_datev2.groovy b/regression-test/suites/schema_change_p0/datev2/test_dup_keys_schema_change_datev2.groovy index ba506521b7..25f4eb8956 100644 --- a/regression-test/suites/schema_change_p0/datev2/test_dup_keys_schema_change_datev2.groovy +++ b/regression-test/suites/schema_change_p0/datev2/test_dup_keys_schema_change_datev2.groovy @@ -30,17 +30,8 @@ suite("test_dup_keys_schema_change_datev2") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -52,20 +43,7 @@ suite("test_dup_keys_schema_change_datev2") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -76,19 +54,7 @@ suite("test_dup_keys_schema_change_datev2") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/datev2/test_schema_change_varchar_to_datev2.groovy b/regression-test/suites/schema_change_p0/datev2/test_schema_change_varchar_to_datev2.groovy index f9b1ddcd22..35125cd63d 100644 --- a/regression-test/suites/schema_change_p0/datev2/test_schema_change_varchar_to_datev2.groovy +++ b/regression-test/suites/schema_change_p0/datev2/test_schema_change_varchar_to_datev2.groovy @@ -30,17 +30,7 @@ suite("test_schema_change_varchar_to_datev2") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -52,20 +42,7 @@ suite("test_schema_change_varchar_to_datev2") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -76,19 +53,7 @@ suite("test_schema_change_varchar_to_datev2") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.groovy b/regression-test/suites/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.groovy index 07111ac10d..033de35e83 100644 --- a/regression-test/suites/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.groovy +++ b/regression-test/suites/schema_change_p0/decimalv3/test_agg_keys_schema_change_decimalv3.groovy @@ -31,17 +31,7 @@ suite("test_agg_keys_schema_change_decimalv3") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -53,20 +43,7 @@ suite("test_agg_keys_schema_change_decimalv3") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id ) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -77,19 +54,7 @@ suite("test_agg_keys_schema_change_decimalv3") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_agg_keys_schema_change.groovy b/regression-test/suites/schema_change_p0/test_agg_keys_schema_change.groovy index 4f7bb72c0b..db55c4e806 100644 --- a/regression-test/suites/schema_change_p0/test_agg_keys_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_agg_keys_schema_change.groovy @@ -33,17 +33,8 @@ suite ("test_agg_keys_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -202,20 +193,7 @@ suite ("test_agg_keys_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -226,19 +204,7 @@ suite ("test_agg_keys_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_agg_mv_schema_change.groovy b/regression-test/suites/schema_change_p0/test_agg_mv_schema_change.groovy index 99768b9594..8808dfb2d1 100644 --- a/regression-test/suites/schema_change_p0/test_agg_mv_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_agg_mv_schema_change.groovy @@ -50,17 +50,8 @@ suite ("test_agg_mv_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -167,20 +158,7 @@ suite ("test_agg_mv_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -192,19 +170,7 @@ suite ("test_agg_mv_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_agg_rollup_schema_change.groovy b/regression-test/suites/schema_change_p0/test_agg_rollup_schema_change.groovy index d58715f3f0..19e3716664 100644 --- a/regression-test/suites/schema_change_p0/test_agg_rollup_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_agg_rollup_schema_change.groovy @@ -50,17 +50,8 @@ suite ("test_agg_rollup_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -178,20 +169,7 @@ suite ("test_agg_rollup_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -203,19 +181,7 @@ suite ("test_agg_rollup_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_agg_vals_schema_change.groovy b/regression-test/suites/schema_change_p0/test_agg_vals_schema_change.groovy index bddebafa27..43766aa499 100644 --- a/regression-test/suites/schema_change_p0/test_agg_vals_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_agg_vals_schema_change.groovy @@ -28,17 +28,8 @@ suite ("test_agg_vals_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -165,20 +156,7 @@ suite ("test_agg_vals_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -190,19 +168,7 @@ suite ("test_agg_vals_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_dup_keys_schema_change.groovy b/regression-test/suites/schema_change_p0/test_dup_keys_schema_change.groovy index 85e2a543db..8eb6329db9 100644 --- a/regression-test/suites/schema_change_p0/test_dup_keys_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_keys_schema_change.groovy @@ -31,17 +31,8 @@ suite ("test_dup_keys_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -171,20 +162,7 @@ suite ("test_dup_keys_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -196,19 +174,7 @@ suite ("test_dup_keys_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_dup_mv_schema_change.groovy b/regression-test/suites/schema_change_p0/test_dup_mv_schema_change.groovy index 465b406e7c..aeafa8d15b 100644 --- a/regression-test/suites/schema_change_p0/test_dup_mv_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_mv_schema_change.groovy @@ -48,17 +48,8 @@ suite ("test_dup_mv_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -186,20 +177,7 @@ suite ("test_dup_mv_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -211,19 +189,7 @@ suite ("test_dup_mv_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_dup_rollup_schema_change.groovy b/regression-test/suites/schema_change_p0/test_dup_rollup_schema_change.groovy index ae3f520637..e31a2f8c57 100644 --- a/regression-test/suites/schema_change_p0/test_dup_rollup_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_rollup_schema_change.groovy @@ -50,17 +50,8 @@ suite ("test_dup_rollup_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -197,20 +188,7 @@ suite ("test_dup_rollup_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -222,19 +200,7 @@ suite ("test_dup_rollup_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_dup_vals_schema_change.groovy b/regression-test/suites/schema_change_p0/test_dup_vals_schema_change.groovy index cb217d95d9..635c4fbfeb 100644 --- a/regression-test/suites/schema_change_p0/test_dup_vals_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_vals_schema_change.groovy @@ -27,17 +27,8 @@ suite ("test_dup_vals_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -152,20 +143,7 @@ suite ("test_dup_vals_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -177,19 +155,7 @@ suite ("test_dup_vals_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_uniq_keys_schema_change.groovy b/regression-test/suites/schema_change_p0/test_uniq_keys_schema_change.groovy index 229b2aa0fc..3375af18a8 100644 --- a/regression-test/suites/schema_change_p0/test_uniq_keys_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_uniq_keys_schema_change.groovy @@ -27,17 +27,8 @@ suite ("test_uniq_keys_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -148,20 +139,7 @@ suite ("test_uniq_keys_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -173,19 +151,7 @@ suite ("test_uniq_keys_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy b/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy index 146f423deb..535437bf4b 100644 --- a/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy @@ -45,17 +45,8 @@ suite ("test_uniq_mv_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -189,20 +180,7 @@ suite ("test_uniq_mv_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -214,19 +192,7 @@ suite ("test_uniq_mv_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_uniq_rollup_schema_change.groovy b/regression-test/suites/schema_change_p0/test_uniq_rollup_schema_change.groovy index 2b05a38164..b2b40b0bf6 100644 --- a/regression-test/suites/schema_change_p0/test_uniq_rollup_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_uniq_rollup_schema_change.groovy @@ -49,17 +49,8 @@ suite ("test_uniq_rollup_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -195,20 +186,7 @@ suite ("test_uniq_rollup_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -220,19 +198,7 @@ suite ("test_uniq_rollup_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_uniq_vals_schema_change.groovy b/regression-test/suites/schema_change_p0/test_uniq_vals_schema_change.groovy index 14645262ff..87283f24d9 100644 --- a/regression-test/suites/schema_change_p0/test_uniq_vals_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_uniq_vals_schema_change.groovy @@ -29,17 +29,8 @@ suite ("test_uniq_vals_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -156,20 +147,7 @@ suite ("test_uniq_vals_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) //assertEquals(code, 0) } @@ -181,19 +159,7 @@ suite ("test_uniq_vals_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/schema_change_p0/test_varchar_schema_change.groovy b/regression-test/suites/schema_change_p0/test_varchar_schema_change.groovy index b497def031..e98ff259f5 100644 --- a/regression-test/suites/schema_change_p0/test_varchar_schema_change.groovy +++ b/regression-test/suites/schema_change_p0/test_varchar_schema_change.groovy @@ -33,17 +33,8 @@ suite ("test_varchar_schema_change") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) @@ -146,20 +137,7 @@ suite ("test_varchar_schema_change") { String tablet_id = tablet[0] backend_id = tablet[2] logger.info("run compaction:" + tablet_id) - StringBuilder sb = new StringBuilder(); - sb.append("curl -X POST http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run?tablet_id=") - sb.append(tablet_id) - sb.append("&compact_type=cumulative") - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err) } @@ -170,19 +148,7 @@ suite ("test_varchar_schema_change") { Thread.sleep(100) String tablet_id = tablet[0] backend_id = tablet[2] - StringBuilder sb = new StringBuilder(); - sb.append("curl -X GET http://") - sb.append(backendId_to_backendIP.get(backend_id)) - sb.append(":") - sb.append(backendId_to_backendHttpPort.get(backend_id)) - sb.append("/api/compaction/run_status?tablet_id=") - sb.append(tablet_id) - - String command = sb.toString() - process = command.execute() - code = process.waitFor() - err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - out = process.getText() + (code, out, err) = be_get_compaction_status(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id) logger.info("Get compaction status: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def compactionStatus = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys.groovy index b445fa050e..6e05c4edfc 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys.groovy @@ -31,19 +31,9 @@ suite("test_segcompaction_agg_keys") { def backendId_to_backendIP = [:] def backendId_to_backendHttpPort = [:] getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys_index.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys_index.groovy index 9b82cd75e3..3dd6316541 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys_index.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_agg_keys_index.groovy @@ -31,19 +31,8 @@ suite("test_segcompaction_agg_keys_index") { def backendId_to_backendIP = [:] def backendId_to_backendHttpPort = [:] getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys.groovy index 712820dbdc..bd1bb06c58 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys.groovy @@ -33,17 +33,8 @@ suite("test_segcompaction_dup_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys_index.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys_index.groovy index 4c11cef5f1..b5b4d8eb8e 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys_index.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_dup_keys_index.groovy @@ -33,17 +33,7 @@ suite("test_segcompaction_dup_keys_index") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys.groovy index e85baddde6..9e5308314f 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys.groovy @@ -33,17 +33,8 @@ suite("test_segcompaction_unique_keys") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy index 304de39cb2..8bd6e3d7b4 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy @@ -33,17 +33,7 @@ suite("test_segcompaction_unique_keys_index") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow.groovy index ae7446d1db..2f35a1fec0 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow.groovy @@ -33,17 +33,8 @@ suite("test_segcompaction_unique_keys_mow") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim()) diff --git a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow_index.groovy b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow_index.groovy index a687e01a76..0eaca8dc80 100644 --- a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow_index.groovy +++ b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_mow_index.groovy @@ -33,17 +33,8 @@ suite("test_segcompaction_unique_keys_mow_index") { getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); backend_id = backendId_to_backendIP.keySet()[0] - StringBuilder showConfigCommand = new StringBuilder(); - showConfigCommand.append("curl -X GET http://") - showConfigCommand.append(backendId_to_backendIP.get(backend_id)) - showConfigCommand.append(":") - showConfigCommand.append(backendId_to_backendHttpPort.get(backend_id)) - showConfigCommand.append("/api/show_config") - logger.info(showConfigCommand.toString()) - def process = showConfigCommand.toString().execute() - int code = process.waitFor() - String err = IOGroovyMethods.getText(new BufferedReader(new InputStreamReader(process.getErrorStream()))); - String out = process.getText() + (code, out, err) = show_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id)) + logger.info("Show config: code=" + code + ", out=" + out + ", err=" + err) assertEquals(code, 0) def configList = parseJson(out.trim())