update comments

This commit is contained in:
Alek Westover
2023-06-15 12:33:53 -04:00
parent 86d7cb674d
commit 34ac170904
4 changed files with 17 additions and 7 deletions
+6
View File
@@ -0,0 +1,6 @@
# fuzzystrmatch extension
comment = 'determine similarities and distance between strings'
default_version = '1.2'
module_pathname = '$libdir/fuzzystrmatch'
relocatable = true
trusted = true
+5
View File
@@ -0,0 +1,5 @@
comment = 'Job scheduler for PostgreSQL'
default_version = '1.5'
module_pathname = '$libdir/pg_cron'
relocatable = false
schema = pg_catalog
+6 -5
View File
@@ -1,5 +1,5 @@
/*
* This is a MWE of using our RemoteStorage API to call the aws stuff and download multiple files
* This is a MWE of using the RemoteStorage API to list and download files from aws
*/
macro_rules! alek { ($expression:expr) => { println!("{:?}", $expression); }; }
@@ -17,8 +17,7 @@ use tracing_subscriber;
async fn main() -> anyhow::Result<()> {
let subscriber = tracing_subscriber::FmtSubscriber::new();
tracing::subscriber::set_global_default(subscriber)?;
// TODO: right now we are using the same config parameters as pageserver; but should we have our own configs?
// TODO: read configs from a different place!
let cfg_file_path = Path::new("./../.neon/pageserver.toml");
let cfg_file_contents = std::fs::read_to_string(cfg_file_path)
.with_context(|| format!( "Failed to read pageserver config at '{}'", cfg_file_path.display()))?;
@@ -32,15 +31,17 @@ async fn main() -> anyhow::Result<()> {
let remote_storage = GenericRemoteStorage::from_config(&remote_storage_config)?;
let folder = RemotePath::new(Path::new("public_extensions"))?;
// lists all the files in the public_extensions folder
let from_paths = remote_storage.list_files(Some(&folder)).await?;
alek!(from_paths);
for remote_from_path in from_paths {
// TODO: where should we actually save the files to?
if remote_from_path.extension() == Some("control") {
let file_name = remote_from_path.object_name().expect("it must exist");
info!("{:?}",file_name);
info!("{:?}", file_name);
alek!(&remote_from_path);
// download the file
let mut download = remote_storage.download(&remote_from_path).await?;
// write the file to a local location
let mut write_data_buffer = Vec::new();
download.download_stream.read_to_end(&mut write_data_buffer).await?;
let mut output_file = BufWriter::new(File::create(file_name)?);
-2
View File
@@ -336,7 +336,6 @@ impl RemoteStorage for S3Bucket {
&self,
folder: Option<&RemotePath>
) -> anyhow::Result<Vec<RemotePath>>{
// TODO: should we use DownloadError error type instead of anyhow::Error?
let folder_name = folder.map(|x|
String::from(x.object_name().expect("invalid folder name"))
);
@@ -367,7 +366,6 @@ impl RemoteStorage for S3Bucket {
for object in response.contents().unwrap_or_default() {
let object_path = object.key().unwrap();
println!("{:?}", object_path);
let remote_path = self.s3_object_to_relative_path(object_path);
all_files.push(remote_path);
}