-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bc8d94
commit 0862155
Showing
27 changed files
with
852 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ | |
"@aws-sdk/client-polly": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.181.0&dts", | ||
"@aws-sdk/client-s3/": "https://esm.sh/@aws-sdk/[email protected]/", | ||
"@aws-sdk/client-s3": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.181.0&dts", | ||
"@aws-sdk/client-glacier": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.181.0&dts", | ||
"@aws-sdk/util-dynamodb": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.172.0&dts", | ||
"@aws-sdk/signature-v4": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.181.0&dts", | ||
"@aws-sdk/protocol-http": "https://esm.sh/@aws-sdk/[email protected]?deno-std=0.181.0&dts", | ||
|
@@ -69,6 +70,7 @@ | |
"deno_dom": "https://deno.land/x/[email protected]/deno-dom-wasm.ts", | ||
"fluentSchema": "https://esm.sh/[email protected]", | ||
"fromXml": "https://deno.land/x/[email protected]/mod.ts", | ||
"snappy": "https://esm.sh/[email protected]?deno-std=0.181.0&dts", | ||
"gzip_wasm": "https://deno.land/x/[email protected]/mod.ts", | ||
"gfm": "https://deno.land/x/[email protected]/mod.ts", | ||
"imurmurhash": "https://esm.sh/[email protected]?deno-std=0.181.0&dts", | ||
|
@@ -90,6 +92,10 @@ | |
"mu-forms/": "https://esm.sh/[email protected]/", | ||
"multiformats": "https://esm.sh/[email protected]?deno-std=0.181.0&dts", | ||
"mustache": "https://deno.land/x/[email protected]/mod.ts", | ||
|
||
"apache-arrow":"https://esm.sh/[email protected]", | ||
"parquet-wasm/":"https://esm.sh/[email protected]/", | ||
|
||
"superstruct": "https://deno.land/x/[email protected]/mod.ts", | ||
"stripe": "https://esm.sh/[email protected]?deno-std=0.181.0&dts", | ||
"toXml": "https://deno.land/x/[email protected]/mod.ts", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/** | ||
* Due to the nature of how the glacier API works, | ||
* we need to use the a DynamoDB table to store the metadata of the vaults. | ||
* This helps with retaining the required information so that | ||
* vault retrival is avaiable at some later time. | ||
* | ||
* Determine if this is actually helpful... | ||
* The better approach might be to just ensure that | ||
* lifecycle configs exist on buckets to use the Tiered Storage Classes | ||
* so that S3 managages what is moved up and down witin the storage classes. | ||
* | ||
* Since Glacier is organized around "Running JOBs"... (and their status, and completions...) | ||
* this feels like a sufficiently different way to manage the data | ||
* than using within another tiered cache. | ||
*/ | ||
|
||
// @ref: https://www.npmjs.com/package/@aws-sdk/client-glacier | ||
import { | ||
GlacierClient, | ||
ListVaultsCommand, | ||
UploadArchiveCommand, | ||
type UploadArchiveInput, | ||
} from "@aws-sdk/client-glacier"; | ||
|
||
import { | ||
DeleteItemCommand, | ||
DeleteItemCommandOutput, | ||
DescribeTableCommand, | ||
DescribeTableCommandOutput, | ||
DescribeTimeToLiveCommand, | ||
DescribeTimeToLiveCommandOutput, | ||
DynamoDBClient, | ||
GetItemCommand, | ||
PutItemCommand, | ||
QueryCommand, | ||
type QueryCommandInput, | ||
QueryCommandOutput, | ||
ScanCommand, | ||
type ScanCommandInput, | ||
ScanCommandOutput, | ||
} from "@aws-sdk/client-dynamodb"; | ||
|
||
import { | ||
type CacheName, | ||
defaultFromBytes, | ||
defaultRenamer, | ||
defaultToBytesWithTypeNote, | ||
type ICacheableDataForCache, | ||
type ICacheDataFromProvider, | ||
type ICacheProvider, | ||
type NullableProviderData, | ||
type TransformFromBytes, | ||
type TransformToBytes, | ||
} from "../cache.ts"; | ||
|
||
/** | ||
* | ||
AbortMultipartUpload | ||
AbortVaultLock | ||
AddTagsToVault | ||
CompleteMultipartUpload | ||
CompleteVaultLock | ||
CreateVault | ||
- Names can be between 1 and 255 characters long. | ||
- Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period). | ||
- limit of - 1,000 vaults per account | ||
Creates a Vault Location - used in down stream calls | ||
DeleteArchive | ||
DeleteVault | ||
DeleteVaultAccessPolicy | ||
DeleteVaultNotifications | ||
DescribeJob | ||
DescribeVault | ||
GetDataRetrievalPolicy | ||
GetJobOutput | ||
GetVaultAccessPolicy | ||
GetVaultLock | ||
GetVaultNotifications | ||
InitiateJob | ||
tyeps: "select", "archive-retrieval" and "inventory-retrieval" | ||
- why not just instatiate each job type with its own command/function? | ||
InitiateMultipartUpload | ||
InitiateVaultLock | ||
ListJobs | ||
ListMultipartUploads | ||
ListParts | ||
ListProvisionedCapacity | ||
ListTagsForVault | ||
ListVaults | ||
PurchaseProvisionedCapacity | ||
RemoveTagsFromVault | ||
SetDataRetrievalPolicy | ||
SetVaultAccessPolicy | ||
SetVaultNotifications | ||
UploadArchive | ||
UploadMultipartPart | ||
*/ | ||
|
||
export interface GlacierCache extends ICacheProvider<Uint8Array> { | ||
provider: string; | ||
meta: { | ||
size: () => number; | ||
cloud: "AWS:Glacier"; | ||
service: "Glacier"; | ||
region: string; | ||
describeTable: () => Promise<DescribeTableCommandOutput>; | ||
describeTTL: () => Promise<DescribeTimeToLiveCommandOutput>; | ||
deleteItem: (name: string) => Promise<DeleteItemCommandOutput>; | ||
scan: (input: Omit<ScanCommandInput, "TableName">) => Promise<ScanCommandOutput>; | ||
query: (input: Omit<QueryCommandInput, "TableName">) => Promise<QueryCommandOutput>; | ||
}; | ||
transforms: { | ||
renamer(originalName: string): Promise<CacheName>; | ||
toBytes: TransformToBytes; | ||
fromBytes: TransformFromBytes; | ||
}; | ||
set: (name: string, data: Uint8Array | string) => Promise<ICacheDataFromProvider>; | ||
get: (name: string) => Promise<NullableProviderData<Uint8Array>>; | ||
peek: (name: string) => Promise<NullableProviderData<Uint8Array>>; | ||
del: (name: string) => Promise<NullableProviderData<Uint8Array>>; | ||
has: (name: string) => Promise<boolean>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// https://c2.synology.com/en-us/pricing/object-storage | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...clients/cacheProviders/encoders/b64url.ts → ...clients/cacheProviders/recoders/b64url.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Summary | ||
|
||
========= | ||
|
||
## BR | ||
|
||
Brotli usually gets the best compression ratio for JSON, readme, html files, etc. but usually at the cost of speed. It | ||
is usually fast enough, but can choke on very large paylaods. | ||
|
||
## Snappy | ||
|
||
Lives up to the name - is always fastest operation - and starts to choke on large payloads around character count of | ||
`4e7` which is shown in the `recoders.bench.ts` file. | ||
|
||
## GZIP / GZlib | ||
|
||
Sturdiest, longest-lived gold standard | ||
|
||
## ZSTD | ||
|
||
New, middle balanced, very fast, very good compression ratio lib, binary format is not the same as a gz | ||
|
||
# External Considerations | ||
|
||
- For AWS S3 Select - you can [compress a parquet columns][aws-s3-select] within the object using `Snappy` or `GZIP` or you can read data subsets stored in CSV or JSON record files. | ||
- Also for AWS S3 Select - you can [compress a CSV or JSON file][aws-s3-select-doc] usiung `GZIP` or `BZIP2` | ||
|
||
|
||
<!-- Ref Links --> | ||
|
||
- [aws-s3-select-parquet]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/selecting-content-from-objects.html#selecting-content-from-objects-requirements-and-limits | ||
- [aws-s3-select-doc]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#API_SelectObjectContent |
Oops, something went wrong.
0862155
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: