@@ -56,28 +56,28 @@ impl CompressorPlugin for crate::layouts::compact::CompactCompressor {
5656
5757/// A layout writer that compresses chunks.
5858#[ derive( Clone ) ]
59- pub struct CompressingStrategy < S > {
60- child : S ,
59+ pub struct CompressingStrategy {
60+ child : Arc < dyn LayoutStrategy > ,
6161 compressor : Arc < dyn CompressorPlugin > ,
6262 executor : Arc < dyn TaskExecutor > ,
6363 parallelism : usize ,
6464}
6565
66- impl < S : LayoutStrategy > CompressingStrategy < S > {
66+ impl CompressingStrategy {
6767 /// Create a new writer that uses the BtrBlocks-style cascading compressor to compress chunks.
6868 ///
6969 /// This provides a good balance between decoding speed and small file size.
7070 ///
7171 /// Set `exclude_int_dict_encoding` to true to prevent dictionary encoding of integer arrays,
7272 /// which is useful when compressing dictionary codes to avoid recursive dictionary encoding.
73- pub fn new_btrblocks (
73+ pub fn new_btrblocks < S : LayoutStrategy > (
7474 child : S ,
7575 executor : Arc < dyn TaskExecutor > ,
7676 parallelism : usize ,
7777 exclude_int_dict_encoding : bool ,
7878 ) -> Self {
7979 Self {
80- child,
80+ child : Arc :: new ( child ) ,
8181 compressor : Arc :: new ( BtrBlocksCompressor {
8282 exclude_int_dict_encoding,
8383 } ) ,
@@ -94,29 +94,29 @@ impl<S: LayoutStrategy> CompressingStrategy<S> {
9494 ///
9595 /// [`CompactCompressor`]: crate::layouts::compact::CompactCompressor
9696 #[ cfg( feature = "zstd" ) ]
97- pub fn new_compact (
97+ pub fn new_compact < S : LayoutStrategy > (
9898 child : S ,
9999 compressor : crate :: layouts:: compact:: CompactCompressor ,
100100 executor : Arc < dyn TaskExecutor > ,
101101 parallelism : usize ,
102102 ) -> Self {
103103 Self {
104- child,
104+ child : Arc :: new ( child ) ,
105105 compressor : Arc :: new ( compressor) ,
106106 executor,
107107 parallelism,
108108 }
109109 }
110110
111111 /// Create a new compressor from a plugin interface.
112- pub fn new_opaque < C : CompressorPlugin > (
112+ pub fn new_opaque < S : LayoutStrategy , C : CompressorPlugin > (
113113 child : S ,
114114 compressor : C ,
115115 executor : Arc < dyn TaskExecutor > ,
116116 parallelism : usize ,
117117 ) -> Self {
118118 Self {
119- child,
119+ child : Arc :: new ( child ) ,
120120 compressor : Arc :: new ( compressor) ,
121121 executor,
122122 parallelism,
@@ -125,10 +125,7 @@ impl<S: LayoutStrategy> CompressingStrategy<S> {
125125}
126126
127127#[ async_trait]
128- impl < S > LayoutStrategy for CompressingStrategy < S >
129- where
130- S : LayoutStrategy ,
131- {
128+ impl LayoutStrategy for CompressingStrategy {
132129 async fn write_stream (
133130 & self ,
134131 ctx : & ArrayContext ,
0 commit comments