Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing missing error message from pinot-admin command #5305

Merged
merged 4 commits into from
Apr 27, 2020

Conversation

xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Apr 26, 2020

Fix the issue that pinot-admin.sh only return message for success request, not failed messages from http requests.

Current:

bin/pinot-admin.sh AddTable -tableConfigFile examples/baseballStats_offline_table_config.json -schemaFile examples/baseballStats_schema.json -controllerHost 127.0.0.1 -controllerPort 9000 -exec

Executing command: AddTable -tableConfigFile examples/baseballStats_offline_table_config.json -schemaFile examples/baseballStats_schema.json -controllerHost 127.0.0.1 -controllerPort 9000 -exec
Sending request: http://127.0.0.1:9000/schemas to controller: localhost, version: Unknown
Exception caught:
java.io.IOException: Server returned HTTP response code: 409 for URL: http://127.0.0.1:9000/tables
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) ~[?:1.8.0_232]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[?:1.8.0_232]
	at org.apache.pinot.tools.admin.command.AbstractBaseAdminCommand.sendRequest(AbstractBaseAdminCommand.java:85) ~[pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]
	at org.apache.pinot.tools.admin.command.AbstractBaseAdminCommand.sendPostRequest(AbstractBaseAdminCommand.java:63) ~[pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]
	at org.apache.pinot.tools.admin.command.AddTableCommand.sendTableCreationRequest(AddTableCommand.java:138) ~[pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]
	at org.apache.pinot.tools.admin.command.AddTableCommand.execute(AddTableCommand.java:163) ~[pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]
	at org.apache.pinot.tools.admin.PinotAdministrator.execute(PinotAdministrator.java:158) [pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]
	at org.apache.pinot.tools.admin.PinotAdministrator.main(PinotAdministrator.java:170) [pinot-all-0.4.0-SNAPSHOT-jar-with-dependencies.jar:0.4.0-SNAPSHOT-80a943501464d983396ae935b1ca7061d94ade37]

After fix:

➜ bin/pinot-admin.sh AddTable -tableConfigFile examples/baseballStats_offline_table_config.json -schemaFile examples/baseballStats_schema.json -controllerHost 127.0.0.1 -controllerPort 9000 -exec

Executing command: AddTable -tableConfigFile examples/baseballStats_offline_table_config.json -schemaFile examples/baseballStats_schema.json -controllerHost 127.0.0.1 -controllerPort 9000 -exec
Sending request: http://127.0.0.1:9000/schemas to controller: localhost, version: Unknown
{"code":409,"error":"Table baseballStats1_OFFLINE already exists"}

@xiangfu0 xiangfu0 force-pushed the fixing_pinot_admin_add_table_exist_issue branch from 4dc198f to 2005fca Compare April 26, 2020 06:38
@xiangfu0 xiangfu0 changed the title Fixing the missed error message from Pinot Server when using pinot-admin command Fixing missing error message from pinot-admin command Apr 26, 2020
Copy link
Member

@jackjlli jackjlli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but LGTM

@xiangfu0 xiangfu0 merged commit 3d9d206 into master Apr 27, 2020
@xiangfu0 xiangfu0 deleted the fixing_pinot_admin_add_table_exist_issue branch April 27, 2020 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants