vogievetsky commented on a change in pull request #7493: No SQL mode in web
console
URL: https://github.com/apache/incubator-druid/pull/7493#discussion_r276869238
##########
File path: web-console/src/views/home-view.tsx
##########
@@ -212,8 +237,21 @@ GROUP BY 1`);
this.dataServerQueryManager = new QueryManager({
processQuery: async (query) => {
- const dataServerCounts = await queryDruidSql({ query });
- return getHeadProp(dataServerCounts, 'count') || 0;
+ const getDataServerNum = async () => {
+ const allServerResp = await
axios.get('/druid/coordinator/v1/servers?simple');
+ const allServers = allServerResp.data;
+ return allServers.reduce((acc: number, s: any) => {
+ return acc + Number(s.type === 'historical');
+ }, 0);
Review comment:
it would be nicer to use the array sum explicitly instead of a reduce that
takes a while to decipher, look at `import { sum } from 'd3-array';` in servers
view
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]