2727import java .io .InputStream ;
2828import java .util .List ;
2929import java .util .Map ;
30- import java .util .Objects ;
3130
3231public interface StorageRpc {
3332
@@ -133,89 +132,6 @@ public BatchResponse(Map<StorageObject, Tuple<Boolean, StorageException>> delete
133132 }
134133 }
135134
136- class RewriteRequest {
137-
138- public final StorageObject source ;
139- public final Map <StorageRpc .Option , ?> sourceOptions ;
140- public final StorageObject target ;
141- public final Map <StorageRpc .Option , ?> targetOptions ;
142- public final Long megabytesRewrittenPerCall ;
143-
144- public RewriteRequest (StorageObject source , Map <StorageRpc .Option , ?> sourceOptions ,
145- StorageObject target , Map <StorageRpc .Option , ?> targetOptions ,
146- Long megabytesRewrittenPerCall ) {
147- this .source = source ;
148- this .sourceOptions = sourceOptions ;
149- this .target = target ;
150- this .targetOptions = targetOptions ;
151- this .megabytesRewrittenPerCall = megabytesRewrittenPerCall ;
152- }
153-
154- @ Override
155- public boolean equals (Object obj ) {
156- if (obj == null ) {
157- return false ;
158- }
159- if (!(obj instanceof RewriteRequest )) {
160- return false ;
161- }
162- final RewriteRequest other = (RewriteRequest ) obj ;
163- return Objects .equals (this .source , other .source )
164- && Objects .equals (this .sourceOptions , other .sourceOptions )
165- && Objects .equals (this .target , other .target )
166- && Objects .equals (this .targetOptions , other .targetOptions )
167- && Objects .equals (this .megabytesRewrittenPerCall , other .megabytesRewrittenPerCall );
168- }
169-
170- @ Override
171- public int hashCode () {
172- return Objects .hash (source , sourceOptions , target , targetOptions , megabytesRewrittenPerCall );
173- }
174- }
175-
176- class RewriteResponse {
177-
178- public final RewriteRequest rewriteRequest ;
179- public final StorageObject result ;
180- public final long blobSize ;
181- public final boolean isDone ;
182- public final String rewriteToken ;
183- public final long totalBytesRewritten ;
184-
185- public RewriteResponse (RewriteRequest rewriteRequest , StorageObject result , long blobSize ,
186- boolean isDone , String rewriteToken , long totalBytesRewritten ) {
187- this .rewriteRequest = rewriteRequest ;
188- this .result = result ;
189- this .blobSize = blobSize ;
190- this .isDone = isDone ;
191- this .rewriteToken = rewriteToken ;
192- this .totalBytesRewritten = totalBytesRewritten ;
193- }
194-
195- @ Override
196- public boolean equals (Object obj ) {
197- if (obj == null ) {
198- return false ;
199- }
200- if (!(obj instanceof RewriteResponse )) {
201- return false ;
202- }
203- final RewriteResponse other = (RewriteResponse ) obj ;
204- return Objects .equals (this .rewriteRequest , other .rewriteRequest )
205- && Objects .equals (this .result , other .result )
206- && Objects .equals (this .rewriteToken , other .rewriteToken )
207- && this .blobSize == other .blobSize
208- && Objects .equals (this .isDone , other .isDone )
209- && this .totalBytesRewritten == other .totalBytesRewritten ;
210- }
211-
212- @ Override
213- public int hashCode () {
214- return Objects .hash (rewriteRequest , result , blobSize , isDone , rewriteToken ,
215- totalBytesRewritten );
216- }
217- }
218-
219135 Bucket create (Bucket bucket , Map <Option , ?> options ) throws StorageException ;
220136
221137 StorageObject create (StorageObject object , InputStream content , Map <Option , ?> options )
@@ -245,6 +161,9 @@ StorageObject patch(StorageObject storageObject, Map<Option, ?> options)
245161 StorageObject compose (Iterable <StorageObject > sources , StorageObject target ,
246162 Map <Option , ?> targetOptions ) throws StorageException ;
247163
164+ StorageObject copy (StorageObject source , Map <Option , ?> sourceOptions ,
165+ StorageObject target , Map <Option , ?> targetOptions ) throws StorageException ;
166+
248167 byte [] load (StorageObject storageObject , Map <Option , ?> options )
249168 throws StorageException ;
250169
@@ -255,8 +174,4 @@ byte[] read(StorageObject from, Map<Option, ?> options, long position, int bytes
255174
256175 void write (String uploadId , byte [] toWrite , int toWriteOffset , StorageObject dest ,
257176 long destOffset , int length , boolean last ) throws StorageException ;
258-
259- RewriteResponse openRewrite (RewriteRequest rewriteRequest ) throws StorageException ;
260-
261- RewriteResponse continueRewrite (RewriteResponse previousResponse ) throws StorageException ;
262177}
0 commit comments