You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2020/04/26 06:21:09 UTC
[incubator-pinot] branch fixing_pinot_admin_add_table_exist_issue
created (now 4dc198f)
This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a change to branch fixing_pinot_admin_add_table_exist_issue
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.
at 4dc198f Fixing the missed error message from Pinot Server when using pinot-admin command
This branch includes the following new commits:
new 4dc198f Fixing the missed error message from Pinot Server when using pinot-admin command
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[incubator-pinot] 01/01: Fixing the missed error message from Pinot
Server when using pinot-admin command
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiangfu pushed a commit to branch fixing_pinot_admin_add_table_exist_issue
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
commit 4dc198f99b59fbcba4fbe8e35dd1ffec907d4577
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Sat Apr 25 23:20:46 2020 -0700
Fixing the missed error message from Pinot Server when using pinot-admin command
---
.../tools/admin/command/AbstractBaseAdminCommand.java | 15 +++++++++++----
.../apache/pinot/tools/admin/command/AddTableCommand.java | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
index 6c37405..14922d7 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
@@ -23,6 +23,7 @@ import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
@@ -86,14 +87,20 @@ public class AbstractBaseAdminCommand extends AbstractBaseCommand {
writer.flush();
}
- final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
- final StringBuilder sb = new StringBuilder();
- String line = null;
+ try {
+ return readInputStream(conn.getInputStream());
+ } catch (Exception e) {
+ return readInputStream(conn.getErrorStream());
+ }
+ }
+ private static String readInputStream(InputStream inputStream) throws IOException {
+ final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
+ final StringBuilder sb = new StringBuilder();
+ String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
-
return sb.toString();
}
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AddTableCommand.java b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AddTableCommand.java
index 7cb380a..91571c7 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AddTableCommand.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AddTableCommand.java
@@ -137,7 +137,7 @@ public class AddTableCommand extends AbstractBaseAdminCommand implements Command
String res = AbstractBaseAdminCommand
.sendPostRequest(ControllerRequestURLBuilder.baseUrl(_controllerAddress).forTableCreate(), node.toString());
LOGGER.info(res);
- return res.contains("succesfully added");
+ return res.contains("Successfully added");
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org