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

[YUNIKORN-2249] Add Accept-Encoding header when fetch queue application API #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/app/services/scheduler/scheduler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

import {HttpClient} from '@angular/common/http';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {AllocationInfo} from '@app/models/alloc-info.model';
import {AppInfo} from '@app/models/app-info.model';
Expand Down Expand Up @@ -82,8 +82,10 @@ export class SchedulerService {

fetchAppList(partitionName: string, queueName: string): Observable<AppInfo[]> {
const appsUrl = `${this.envConfig.getSchedulerWebAddress()}/ws/v1/partition/${partitionName}/queue/${queueName}/applications`;
const headers = new HttpHeaders();
headers.set('Accept-Encoding', 'gzip')
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work with scheduler without apache/yunikorn-core#757 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

it should just be ignored if the server does not support it. Fallback will always be identity transform (i.e. no compression)


return this.httpClient.get(appsUrl).pipe(
return this.httpClient.get(appsUrl, {headers}).pipe(
map((data: any) => {
const result: AppInfo[] = [];

Expand Down