Skip to content

Commit 67396be

Browse files
nikhilsinhaparseableparmesant
authored andcommitted
remove: local caching (parseablehq#1069)
remove all traces of caching from the code removed cache from endpoints, metrics, stream info
1 parent 3d9bc80 commit 67396be

File tree

10 files changed

+4
-64
lines changed

10 files changed

+4
-64
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This section elaborates available options to run Parseable in production or deve
9393
## Features :rocket:
9494

9595
- [High availability & Cluster mode ↗︎](https://www.parseable.com/docs/concepts/distributed-architecture)
96-
- [Local cache ↗︎](https://www.parseable.com/docs/features/tiering)
96+
- [Hot Tier ↗︎](https://www.parseable.com/docs/features/tiering)
9797
- [Alerts ↗︎](https://www.parseable.com/docs/alerts)
9898
- [Role based access control ↗︎](https://www.parseable.com/docs/rbac)
9999
- [OAuth2 support ↗︎](https://www.parseable.com/docs/oidc)

src/handlers/http/about.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use std::path::PathBuf;
3939
/// "license": "AGPL-3.0-only",
4040
/// "mode": mode,
4141
/// "staging": staging,
42-
/// "cache": cache_details,
4342
/// "grpcPort": grpc_port,
4443
/// "store": {
4544
/// "type": CONFIG.get_storage_mode_string(),

src/handlers/http/logstream.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ pub async fn get_stream_info(req: HttpRequest) -> Result<impl Responder, StreamE
455455
.time_partition_limit
456456
.map(|limit| limit.to_string()),
457457
custom_partition: stream_meta.custom_partition.clone(),
458-
cache_enabled: stream_meta.cache_enabled,
459458
static_schema_flag: stream_meta.static_schema_flag.clone(),
460459
};
461460

src/handlers/http/modal/ingest_server.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use super::OpenIdClient;
2525
use super::ParseableServer;
2626
use crate::analytics;
2727
use crate::handlers::airplane;
28-
use crate::handlers::http::caching_removed;
2928
use crate::handlers::http::ingest;
3029
use crate::handlers::http::logstream;
3130
use crate::handlers::http::middleware::DisAllowRootUser;
@@ -268,13 +267,6 @@ impl IngestServer {
268267
.authorize_for_stream(Action::GetStats),
269268
),
270269
)
271-
.service(
272-
web::resource("/cache")
273-
// PUT "/logstream/{logstream}/cache" ==> caching has been deprecated
274-
.route(web::put().to(caching_removed))
275-
// GET "/logstream/{logstream}/cache" ==> caching has been deprecated
276-
.route(web::get().to(caching_removed)),
277-
)
278270
.service(
279271
web::scope("/retention").service(
280272
web::resource("/cleanup").route(

src/handlers/http/modal/query_server.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ impl ParseableServer for QueryServer {
5656
.service(Server::get_correlation_webscope())
5757
.service(Server::get_query_factory())
5858
.service(Server::get_trino_factory())
59-
.service(Server::get_cache_webscope())
6059
.service(Server::get_liveness_factory())
6160
.service(Server::get_readiness_factory())
6261
.service(Server::get_about_factory())
@@ -329,13 +328,6 @@ impl QueryServer {
329328
.authorize_for_stream(Action::GetRetention),
330329
),
331330
)
332-
.service(
333-
web::resource("/cache")
334-
// PUT "/logstream/{logstream}/cache" ==> caching has been deprecated
335-
.route(web::put().to(caching_removed))
336-
// GET "/logstream/{logstream}/cache" ==> caching has been deprecated
337-
.route(web::get().to(caching_removed)),
338-
)
339331
.service(
340332
web::resource("/hottier")
341333
// PUT "/logstream/{logstream}/hottier" ==> Set hottier for given logstream

src/handlers/http/modal/server.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use crate::handlers;
2323
use crate::handlers::http::about;
2424
use crate::handlers::http::alerts;
2525
use crate::handlers::http::base_path;
26-
use crate::handlers::http::caching_removed;
2726
use crate::handlers::http::health_check;
2827
use crate::handlers::http::query;
2928
use crate::handlers::http::trino;
@@ -73,7 +72,6 @@ impl ParseableServer for Server {
7372
.service(Self::get_correlation_webscope())
7473
.service(Self::get_query_factory())
7574
.service(Self::get_trino_factory())
76-
.service(Self::get_cache_webscope())
7775
.service(Self::get_ingest_factory())
7876
.service(Self::get_liveness_factory())
7977
.service(Self::get_readiness_factory())
@@ -320,18 +318,6 @@ impl Server {
320318
web::resource("/query").route(web::post().to(query::query).authorize(Action::Query))
321319
}
322320

323-
pub fn get_cache_webscope() -> Scope {
324-
web::scope("/cache").service(
325-
web::scope("/{user_id}").service(
326-
web::scope("/{stream}").service(
327-
web::resource("")
328-
.route(web::get().to(caching_removed))
329-
.route(web::post().to(caching_removed)),
330-
),
331-
),
332-
)
333-
}
334-
335321
// get the logstream web scope
336322
pub fn get_logstream_webscope() -> Scope {
337323
web::scope("/logstream")
@@ -414,13 +400,6 @@ impl Server {
414400
.authorize_for_stream(Action::GetRetention),
415401
),
416402
)
417-
.service(
418-
web::resource("/cache")
419-
// PUT "/logstream/{logstream}/cache" ==> Set retention for given logstream
420-
.route(web::put().to(caching_removed))
421-
// GET "/logstream/{logstream}/cache" ==> Get retention for given logstream
422-
.route(web::get().to(caching_removed)),
423-
)
424403
.service(
425404
web::resource("/hottier")
426405
// PUT "/logstream/{logstream}/hottier" ==> Set hottier for given logstream

src/metadata.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pub struct LogStreamMetadata {
6464
pub schema_version: SchemaVersion,
6565
pub schema: HashMap<String, Arc<Field>>,
6666
pub retention: Option<Retention>,
67-
pub cache_enabled: bool,
6867
pub created_at: String,
6968
pub first_event_at: Option<String>,
7069
pub time_partition: Option<String>,
@@ -397,7 +396,6 @@ pub async fn load_stream_metadata_on_server_start(
397396
created_at,
398397
first_event_at,
399398
retention,
400-
cache_enabled,
401399
snapshot,
402400
stats,
403401
time_partition,
@@ -432,7 +430,6 @@ pub async fn load_stream_metadata_on_server_start(
432430
schema_version,
433431
schema,
434432
retention,
435-
cache_enabled,
436433
created_at,
437434
first_event_at,
438435
time_partition,

src/metrics/prom_utils.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub struct Metrics {
5050
event_time: NaiveDateTime,
5151
commit: String,
5252
staging: String,
53-
cache: String,
5453
}
5554

5655
#[derive(Debug, Serialize, Default, Clone)]
@@ -85,7 +84,6 @@ impl Default for Metrics {
8584
event_time: Utc::now().naive_utc(),
8685
commit: "".to_string(),
8786
staging: "".to_string(),
88-
cache: "".to_string(),
8987
}
9088
}
9189
}
@@ -109,7 +107,6 @@ impl Metrics {
109107
event_time: Utc::now().naive_utc(),
110108
commit: "".to_string(),
111109
staging: "".to_string(),
112-
cache: "".to_string(),
113110
}
114111
}
115112
}
@@ -206,7 +203,7 @@ impl Metrics {
206203
}
207204
}
208205
}
209-
let (commit_id, staging, cache) = Self::from_about_api_response(ingestor_metadata.clone())
206+
let (commit_id, staging) = Self::from_about_api_response(ingestor_metadata.clone())
210207
.await
211208
.map_err(|err| {
212209
error!("Fatal: failed to get ingestor info: {:?}", err);
@@ -215,14 +212,13 @@ impl Metrics {
215212

216213
prom_dress.commit = commit_id;
217214
prom_dress.staging = staging;
218-
prom_dress.cache = cache;
219215

220216
Ok(prom_dress)
221217
}
222218

223219
pub async fn from_about_api_response(
224220
ingestor_metadata: IngestorMetadata,
225-
) -> Result<(String, String, String), PostError> {
221+
) -> Result<(String, String), PostError> {
226222
let uri = Url::parse(&format!(
227223
"{}{}/about",
228224
&ingestor_metadata.domain_name,
@@ -249,15 +245,7 @@ impl Metrics {
249245
.get("staging")
250246
.and_then(|x| x.as_str())
251247
.unwrap_or_default();
252-
let cache = about_api_json
253-
.get("cache")
254-
.and_then(|x| x.as_str())
255-
.unwrap_or_default();
256-
Ok((
257-
commit_id.to_string(),
258-
staging.to_string(),
259-
cache.to_string(),
260-
))
248+
Ok((commit_id.to_string(), staging.to_string()))
261249
} else {
262250
warn!(
263251
"Failed to fetch about API response from ingestor: {}\n",

src/option.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use serde::{Deserialize, Serialize};
3030
use std::env;
3131
use std::path::PathBuf;
3232
use std::sync::Arc;
33-
pub const MIN_CACHE_SIZE_BYTES: u64 = 1073741824; // 1 GiB
3433

3534
pub const JOIN_COMMUNITY: &str =
3635
"Join us on Parseable Slack community for questions : https://logg.ing/community";

src/storage/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ pub struct ObjectStoreFormat {
9797
pub stats: FullStats,
9898
#[serde(default)]
9999
pub snapshot: Snapshot,
100-
#[serde(default)]
101-
pub cache_enabled: bool,
102100
#[serde(skip_serializing_if = "Option::is_none")]
103101
pub retention: Option<Retention>,
104102
#[serde(skip_serializing_if = "Option::is_none")]
@@ -121,8 +119,6 @@ pub struct StreamInfo {
121119
#[serde(rename = "first-event-at")]
122120
#[serde(skip_serializing_if = "Option::is_none")]
123121
pub first_event_at: Option<String>,
124-
#[serde(default)]
125-
pub cache_enabled: bool,
126122
#[serde(skip_serializing_if = "Option::is_none")]
127123
pub time_partition: Option<String>,
128124
#[serde(skip_serializing_if = "Option::is_none")]
@@ -192,7 +188,6 @@ impl Default for ObjectStoreFormat {
192188
permissions: vec![Permisssion::new("parseable".to_string())],
193189
stats: FullStats::default(),
194190
snapshot: Snapshot::default(),
195-
cache_enabled: false,
196191
retention: None,
197192
time_partition: None,
198193
time_partition_limit: None,

0 commit comments

Comments
 (0)