Expose InstrumentedObjectStore and make generic over T: ObjectStore#15
Expose InstrumentedObjectStore and make generic over T: ObjectStore#15kylebarron wants to merge 1 commit intodatafusion-contrib:mainfrom
Conversation
|
Hi @kylebarron , I'd really like to avoid exposing the What do you think instead about creating a new interface specifically for the multiple trait /// Instruments the provided `ObjectStore + Signer` with tracing.
pub fn instrument_signed_object_store(
store: Arc<dyn ObjectStore + Signer>,
name: &str,
) -> Arc<dyn ObjectStore + Signer> |
I don't think that's possible for me, as I need to store an Perhaps if I didn't try to support signing, then I could just store a bare, type-erased The code seems pretty stable, so perhaps it wouldn't be too bad if I vendored this file, but I'd be happy to use |
Which issue does this PR close?
Rationale for this change
I'd like to consider using
InstrumentedObjectStoreinobstore, a Python binding toobject_store. I prototyped this in developmentseed/obstore#544 but I need a few changes to be able to avoid type erasure to use signing APIs.None of these changes are backwards-incompatible because
InstrumentedObjectStoreisn't currently exposed.What changes are included in this PR?
InstrumentedObjectStorepublicly. I can't use a genericArc<dyn ObjectStore>because I also expose signing APIs, and those aren't implemented on the type-erasedObjectStore. Because they're only implemented on the concrete S3/GCS/Azure stores, I need to store the non-type-erasedAmazonS3directly.InstrumentedObjectStoregeneric overT: ObjectStore. As mentioned above, I need to be able to avoid type erasure, so that I can get a reference back to the original&AmazonS3to use with signing APIs.fn inner(&self) -> &Tso that I can access the original store passed in.Are these changes tested?
Tested by existing tests.
Are there any user-facing changes?
Only new APIs.