Expand description
Amazon Timestream (timestream) awsJson1_0 service for fakecloud.
One crate serves BOTH the Timestream Write and Timestream Query
SDK clients. AWS ships them as two separate SDK clients
(aws-sdk-timestreamwrite / aws-sdk-timestreamquery), but both share the
same service family and the SAME awsJson1_0 target prefix
Timestream_20181101.<Operation>, so fakecloud routes both to this single
handler over a shared, account-partitioned state store: databases and
tables are created on the write side and read back by the query side.
30 distinct operations (19 write + 15 query, with DescribeEndpoints,
ListTagsForResource, TagResource, and UntagResource shared):
- Databases –
CreateDatabasemintsarn:aws:timestream:<region>:<account>:database/<name>and stores the optionalKmsKeyId,TableCount,CreationTime;DescribeDatabase/ListDatabases/UpdateDatabase/DeleteDatabase(deleting a database that still holds tables is aValidationException). - Tables –
CreateTableunder a database, ARN.../database/<db>/table/<name>,RetentionProperties,MagneticStoreWriteProperties, andSchema(composite partition key) echoed back; statusACTIVE;Describe/List(filtered byDatabaseName) /Update/Delete. - Ingestion –
WriteRecordsvalidates each record (dimensions, measure name/value/type, time/unit, version) against the table, mergesCommonAttributes, stores the points in a bounded in-memory buffer so they are queryable, and returnsRecordsIngested. Malformed records come back asRejectedRecordsinside aRejectedRecordsException. - Query –
Queryruns a real, bounded SQL handler over the ingested points (see “Honest gap” below),PrepareQueryreturnsColumnInfo+Parameters,CancelQuerytears down an in-flight query id. Round-trips aNextToken. - Scheduled queries – full CRUD (
Create/Describe/List/Update/Delete) plusExecuteScheduledQuery, state persisted. - Batch load –
CreateBatchLoadTask/Describe/List/Resume. - Account settings –
DescribeAccountSettings/UpdateAccountSettings(MaxQueryTCU,QueryPricingModel). - Endpoint discovery –
DescribeEndpointsreturns anEndpointslist whoseAddresspoints back at the fakecloud host serving the request (derived from theHostheader) with a largeCachePeriodInMinutes, so a real SDK’s discovery step resolves back to fakecloud. - Tagging – ARN-keyed
TagResource/UntagResource/ListTagsForResource.
Every operation runs model-driven input validation first (required / enum / range), then real, account-partitioned, persisted behavior.
Honest gap – the query SQL subset: a faithful Timestream SQL engine (the
full Trino-derived time-series dialect) is out of scope. query implements
a real, bounded interpreter for the shapes the SDK/e2e/conformance exercise:
SELECT * FROM "db"."table", SELECT COUNT(*) FROM "db"."table", an
optional WHERE time > ago(<n><unit>) / WHERE time <op> <literal> time
filter, ORDER BY time [ASC|DESC], and LIMIT <n>. Ingested points come
back as rows with AWS-shaped ColumnInfo/Datum typing (one column per
dimension, measure_name, measure_value::<type>, time). Query shapes
beyond this subset return a well-formed ValidationException naming the
unsupported construct rather than a wrong or empty success. Endpoint
discovery’s optional auto-mode in the AWS SDK forces https://<address>, so
the e2e drives the default (non-discovery) client pinned to fakecloud and
calls DescribeEndpoints explicitly to prove the host echo.
Re-exports§
pub use service::TimestreamService;pub use service::TIMESTREAM_ACTIONS;pub use state::TimestreamData;pub use state::TimestreamSnapshot;pub use state::TIMESTREAM_SNAPSHOT_SCHEMA_VERSION;
Modules§
- persistence
- Snapshot save/load for Amazon Timestream state.
- query
- A real, bounded SQL handler for Amazon Timestream
Query. - service
- Amazon Timestream awsJson1_0 dispatch + operation handlers.
- shared
- Primitives shared across the Amazon Timestream handlers: ARN synthesis,
id minting, timestamps, endpoint-host derivation, and the internal
database\u{1}tablekey. Kept in one place so the write and query paths cannot diverge on wire format. - state
- Account-partitioned, serializable state for Amazon Timestream.