Skip to content

Commit

Permalink
rename original StreamingJob to StreamingRelation
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Oct 29, 2024
1 parent 577e162 commit 55ec1c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dashboard/components/Relations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Title from "../components/Title"
import useFetch from "../lib/api/fetch"
import {
Relation,
StreamingJob,
StreamingRelation,
getDatabases,
getSchemas,
getUsers,
Expand Down Expand Up @@ -73,7 +73,7 @@ export const dependentsColumn: Column<Relation> = {
),
}

export const fragmentsColumn: Column<StreamingJob> = {
export const fragmentsColumn: Column<StreamingRelation> = {
name: "Fragments",
width: 1,
content: (r) => (
Expand Down
8 changes: 4 additions & 4 deletions dashboard/lib/api/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface Relation {
databaseName?: string
}

export class StreamingJobInfo {
export class StreamingJob {
jobId!: number
objType!: string
name!: string
Expand Down Expand Up @@ -101,7 +101,7 @@ export class StreamingJobInfo {
}
}

export interface StreamingJob extends Relation {
export interface StreamingRelation extends Relation {
dependentRelations: number[]
}

Expand All @@ -124,14 +124,14 @@ export function relationTypeTitleCase(x: Relation) {
return _.startCase(_.toLower(relationType(x)))
}

export function relationIsStreamingJob(x: Relation): x is StreamingJob {
export function relationIsStreamingJob(x: Relation): x is StreamingRelation {
const type = relationType(x)
return type !== "UNKNOWN" && type !== "SOURCE" && type !== "INTERNAL"
}

export async function getStreamingJobs() {
let jobs = plainToInstance(
StreamingJobInfo,
StreamingJob,
(await api.get("/streaming_jobs")) as any[]
)
jobs = sortBy(jobs, (x) => x.jobId)
Expand Down

0 comments on commit 55ec1c5

Please sign in to comment.