Skip to content

Commit 04a23d6

Browse files
authored
fix: remove caching from console (#403)
1 parent 4f0b863 commit 04a23d6

File tree

9 files changed

+46
-68
lines changed

9 files changed

+46
-68
lines changed

src/@types/parseable/api/about.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export type AboutData = {
1515
uiVersion: string;
1616
grpcPort: number;
1717
oidcActive: boolean;
18-
cache: string;
1918
analytics: {
2019
clarityTag: string;
2120
};

src/@types/parseable/api/clusterInfo.ts

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export type IngestorQueryRecord = {
3434
event_time: string;
3535
commit: string;
3636
staging: string;
37-
cache: string;
3837
parseable_storage_size_data: number;
3938
parseable_storage_size_staging: number;
4039
parseable_lifetime_storage_size_data: number;

src/@types/parseable/api/stream.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export type action = {
3636
export type StreamInfo = {
3737
'created-at': string;
3838
'first-event-at': string;
39-
cache_enabled: boolean;
4039
time_partition: string;
4140
static_schema_flag: boolean;
4241
time_partition_limit: string;

src/api/caching.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Axios } from './axios';
2-
import { CACHING_STATUS_URL } from './constants';
1+
// import { Axios } from './axios';
2+
// import { CACHING_STATUS_URL } from './constants';
33

4-
export const getCachingStatus = (streamName: string) => {
5-
return Axios().get(CACHING_STATUS_URL(streamName));
6-
};
4+
// export const getCachingStatus = (streamName: string) => {
5+
// return Axios().get(CACHING_STATUS_URL(streamName));
6+
// };
77

8-
export const updateCaching = (streamName: string, type: boolean) => {
9-
return Axios().put(CACHING_STATUS_URL(streamName), type, { headers: { 'Content-Type': 'application/json' } });
10-
};
8+
// export const updateCaching = (streamName: string, type: boolean) => {
9+
// return Axios().put(CACHING_STATUS_URL(streamName), type, { headers: { 'Content-Type': 'application/json' } });
10+
// };

src/api/constants.ts

-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ export const LOGOUT_URL = `${API_V1}/o/logout?redirect=${window.location.origin}
6161
export const LLM_QUERY_URL = `${API_V1}/llm`;
6262
export const IS_LLM_ACTIVE_URL = `${LLM_QUERY_URL}/isactive`;
6363

64-
// caching
65-
export const CACHING_STATUS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/cache`;
66-
6764
export const CLUSTER_INFO_URL = `${API_V1}/cluster/info`;
6865
export const CLUSTER_METRICS_URL = `${API_V1}/cluster/metrics`;
6966
export const INGESTOR_DELETE_URL = (ingestorUrl: string) => `${API_V1}/cluster/${ingestorUrl}`;

src/components/Navbar/infoModal.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ const InfoModal: FC<InfoModalProps> = (props) => {
120120
</Tooltip>
121121
</Stack>
122122
</Box>
123-
<Box className={aboutTextInnerBox}>
124-
<Text className={aboutTextKey}>Cache</Text>
125-
<Text className={aboutTextValue}>{getAboutData?.data.cache}</Text>
126-
</Box>
127123
<Box className={aboutTextInnerBox}>
128124
<Text className={aboutTextKey}>LLM Status</Text>
129125
<Text className={aboutTextValue}>{llmStatus}</Text>

src/hooks/useCacheToggle.tsx

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
import { useMutation, useQuery } from 'react-query';
2-
import { getCachingStatus, updateCaching } from '@/api/caching';
3-
import { notifySuccess } from '@/utils/notification';
4-
import { useStreamStore, streamStoreReducers } from '@/pages/Stream/providers/StreamProvider';
1+
// import { useMutation, useQuery } from 'react-query';
2+
// import { getCachingStatus, updateCaching } from '@/api/caching';
3+
// import { notifySuccess } from '@/utils/notification';
4+
// import { useStreamStore, streamStoreReducers } from '@/pages/Stream/providers/StreamProvider';
55

6-
const { setCacheEnabled } = streamStoreReducers;
6+
// const { setCacheEnabled } = streamStoreReducers;
77

8-
export const useCacheToggle = (streamName: string) => {
9-
const [, setStreamStore] = useStreamStore(() => null);
10-
const {
11-
data: checkCacheData,
12-
refetch: getCacheStatusRefetch,
13-
isError: getCacheError,
14-
isLoading: getCacheLoading,
15-
} = useQuery(['fetch-cache-status', streamName], () => getCachingStatus(streamName), {
16-
retry: false,
17-
enabled: streamName !== '',
18-
refetchOnWindowFocus: false,
19-
onSuccess: (data) => {
20-
setStreamStore((store) => setCacheEnabled(store, data.data));
21-
},
22-
});
8+
// export const useCacheToggle = (streamName: string) => {
9+
// const [, setStreamStore] = useStreamStore(() => null);
10+
// const {
11+
// data: checkCacheData,
12+
// refetch: getCacheStatusRefetch,
13+
// isError: getCacheError,
14+
// isLoading: getCacheLoading,
15+
// } = useQuery(['fetch-cache-status', streamName], () => getCachingStatus(streamName), {
16+
// retry: false,
17+
// enabled: streamName !== '',
18+
// refetchOnWindowFocus: false,
19+
// onSuccess: (data) => {
20+
// setStreamStore((store) => setCacheEnabled(store, data.data));
21+
// },
22+
// });
2323

24-
const { mutate: updateCacheStatus } = useMutation(
25-
({ type }: { type: boolean; onSuccess?: () => void }) => updateCaching(streamName, type),
26-
{
27-
onSuccess: (_data, variables) => {
28-
notifySuccess({ message: `Cache status modified successfully` });
29-
getCacheStatusRefetch();
30-
variables.onSuccess && variables.onSuccess();
31-
},
32-
},
33-
);
24+
// const { mutate: updateCacheStatus } = useMutation(
25+
// ({ type }: { type: boolean; onSuccess?: () => void }) => updateCaching(streamName, type),
26+
// {
27+
// onSuccess: (_data, variables) => {
28+
// notifySuccess({ message: `Cache status modified successfully` });
29+
// getCacheStatusRefetch();
30+
// variables.onSuccess && variables.onSuccess();
31+
// },
32+
// },
33+
// );
3434

35-
return {
36-
isCacheEnabled: checkCacheData?.data,
37-
getCacheError,
38-
updateCacheStatus,
39-
getCacheLoading,
40-
};
41-
};
35+
// return {
36+
// isCacheEnabled: checkCacheData?.data,
37+
// getCacheError,
38+
// updateCacheStatus,
39+
// getCacheLoading,
40+
// };
41+
// };

src/pages/Stream/providers/StreamProvider.tsx

-10
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ type StreamStore = {
8787
hotTier: HotTierConfig;
8888
info: StreamInfo | object;
8989
sideBarOpen: boolean;
90-
cacheEnabled: boolean | null;
9190
};
9291

9392
type LogsStoreReducers = {
@@ -100,7 +99,6 @@ type LogsStoreReducers = {
10099
transformAlerts: (alerts: TransformedAlert[]) => Alert[];
101100
setCleanStoreForStreamChange: (store: StreamStore) => ReducerOutput;
102101
toggleSideBar: (store: StreamStore) => ReducerOutput;
103-
setCacheEnabled: (store: StreamStore, enabled: boolean) => ReducerOutput;
104102
setStreamInfo: (_store: StreamStore, infoResponse: AxiosResponse<StreamInfo>) => ReducerOutput;
105103
setHotTier: (_store: StreamStore, hotTier: HotTierConfig) => ReducerOutput;
106104
};
@@ -121,7 +119,6 @@ const initialState: StreamStore = {
121119
},
122120
info: {},
123121
sideBarOpen: false,
124-
cacheEnabled: null,
125122
hotTier: {},
126123
};
127124

@@ -137,12 +134,6 @@ const toggleSideBar = (store: StreamStore) => {
137134
};
138135
};
139136

140-
const setCacheEnabled = (_store: StreamStore, enabled: boolean) => {
141-
return {
142-
cacheEnabled: enabled,
143-
};
144-
};
145-
146137
const parseType = (type: any): 'text' | 'number' | 'timestamp' => {
147138
if (typeof type === 'object') {
148139
if (_.get(type, 'Timestamp', null)) {
@@ -316,7 +307,6 @@ const streamStoreReducers: LogsStoreReducers = {
316307
setCleanStoreForStreamChange,
317308
setStats,
318309
toggleSideBar,
319-
setCacheEnabled,
320310
setStreamInfo,
321311
setHotTier,
322312
};

src/pages/Systems/MachineInfo.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ const IngestorInfo = () => {
141141
<Stack flex={1} style={{ justifyContent: 'space-around' }}>
142142
<Stack style={{ width: '100%', flexDirection: 'row' }}>
143143
<InfoItem title="Address" value={ingestorInfo?.domain_name || '–'} showCopyBtn />
144-
<InfoItem title="Cache" value={recentRecord?.cache || '–'} />
145144
<InfoItem title="Staging Files" value={HumanizeNumber(recentRecord?.parseable_staging_files || 0)} />
146145
<InfoItem title="Staging Size" value={formatBytes(recentRecord?.parseable_storage_size_staging || 0) || ''} />
146+
<InfoItem title="Commit" value={recentRecord?.commit || '–'} />
147147
</Stack>
148148
<Stack style={{ width: '100%', flexDirection: 'row' }}>
149-
<InfoItem title="Commit" value={recentRecord?.commit || '–'} />
150149
<InfoItem title="Staging Directory" width="75%" value={ingestorInfo?.staging_path || '–'} />
151150
</Stack>
152151
</Stack>
@@ -170,7 +169,6 @@ const QuerierInfo = () => {
170169
<Stack flex={1} style={{ justifyContent: 'space-around' }}>
171170
<Stack style={{ width: '100%', flexDirection: 'row' }}>
172171
<InfoItem title="Address" value={currentMachine || ''} showCopyBtn />
173-
<InfoItem title="Cache" value={instanceConfig?.cache || ''} />
174172
<InfoItem title="Commit" value={instanceConfig?.commit || ''} />
175173
<InfoItem title="Version" value={instanceConfig?.version || ''} />
176174
</Stack>

0 commit comments

Comments
 (0)