Skip to content

Commit

Permalink
Use Search API in TSVB (elastic#76274) (elastic#77767)
Browse files Browse the repository at this point in the history
* Use Search API for TSVB

* Fixed ci

* Fixed ci

* Use constants

* Fixed tests

* Fixed ci

* Fixed ci

* Back old rollup search

* Fixed test

* Fixed tests

* Fixed issue with series data

* Fixed comments

* Fixed comments

* Fixed unit test

* Deleted unused import

* Fixed comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 18, 2020
1 parent 1567be9 commit 5242103
Show file tree
Hide file tree
Showing 30 changed files with 193 additions and 687 deletions.
10 changes: 5 additions & 5 deletions src/plugins/vis_type_timeseries/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/serve
import { VisTypeTimeseriesConfig, config as configSchema } from './config';
import { VisTypeTimeseriesPlugin } from './plugin';

export { VisTypeTimeseriesSetup, Framework } from './plugin';
export { VisTypeTimeseriesSetup } from './plugin';

export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {
deprecations: ({ unused, renameFromRoot }) => [
Expand All @@ -39,10 +39,10 @@ export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {

export { ValidationTelemetryServiceSetup } from './validation_telemetry';

// @ts-ignore
export { AbstractSearchStrategy } from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { AbstractSearchRequest } from './lib/search_strategies/search_requests/abstract_request';
export {
AbstractSearchStrategy,
ReqFacade,
} from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { DefaultSearchCapabilities } from './lib/search_strategies/default_search_capabilities';

Expand Down
17 changes: 1 addition & 16 deletions src/plugins/vis_type_timeseries/server/lib/get_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function getFields(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
payload: {},
Expand All @@ -48,22 +49,6 @@ export async function getFields(
},
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down
19 changes: 2 additions & 17 deletions src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FakeRequest, RequestHandlerContext } from 'kibana/server';
import _ from 'lodash';
import { first, map } from 'rxjs/operators';
import { getPanelData } from './vis_data/get_panel_data';
import { Framework } from '../index';
import { Framework } from '../plugin';
import { ReqFacade } from './search_strategies/strategies/abstract_search_strategy';

interface GetVisDataResponse {
Expand Down Expand Up @@ -65,28 +65,13 @@ export function getVisData(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
pre: {},
payload: request.body,
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5242103

Please sign in to comment.