Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Aug 27, 2024
1 parent 185f6c9 commit e5a2927
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 9 additions & 5 deletions dashboard/lib/api/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import {
View,
} from "../../proto/gen/catalog"
import {
ListObjectDependenciesResponse_ObjectDependencies as ObjectDependencies, RelationIdInfos,
ListObjectDependenciesResponse_ObjectDependencies as ObjectDependencies,
RelationIdInfos,
TableFragments,
} from "../../proto/gen/meta"
import { ColumnCatalog, Field } from "../../proto/gen/plan_common"
Expand All @@ -36,15 +37,18 @@ import api from "./api"

// NOTE(kwannoel): This can be optimized further, instead of fetching the entire TableFragments struct,
// We can fetch the fields we need from TableFragments, in a truncated struct.
export async function getFragmentsByJobId(jobId: number): Promise<TableFragments> {
export async function getFragmentsByJobId(
jobId: number
): Promise<TableFragments> {
let route = "/fragments/job_id/" + jobId.toString()
console.log("route: ", route)
let tableFragments: TableFragments = TableFragments.fromJSON(await api.get(route))
let tableFragments: TableFragments = TableFragments.fromJSON(
await api.get(route)
)
return tableFragments
}

export async function getRelationIdInfos(): Promise<RelationIdInfos> {
let fragmentIds: RelationIdInfos = (await api.get("/relation_id_infos"))
let fragmentIds: RelationIdInfos = await api.get("/relation_id_infos")
return fragmentIds
}

Expand Down
6 changes: 2 additions & 4 deletions dashboard/pages/fragment_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ import {
fetchPrometheusBackPressure,
} from "../lib/api/metric"
import {
getFragments,
getFragmentIds,
getFragmentsByJobId,
getRelationIdInfos,
getStreamingJobs,
getRelationIdInfos
} from "../lib/api/streaming"
import { FragmentBox } from "../lib/layout"
import { TableFragments, TableFragments_Fragment } from "../proto/gen/meta"
Expand Down Expand Up @@ -210,7 +208,7 @@ export default function Streaming() {

useEffect(() => {
if (relationId) {
getFragmentsByJobId(relationId).then(tf => {
getFragmentsByJobId(relationId).then((tf) => {
setTableFragments(tf)
})
}
Expand Down

0 comments on commit e5a2927

Please sign in to comment.