File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
core/src/main/java/com/scalar/db/storage/objectstorage/cloudstorage Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 66import com .google .cloud .storage .BlobInfo ;
77import com .google .cloud .storage .Storage ;
88import com .google .cloud .storage .StorageBatch ;
9+ import com .google .cloud .storage .StorageBatchResult ;
910import com .google .cloud .storage .StorageException ;
1011import com .google .cloud .storage .StorageOptions ;
1112import com .google .common .annotations .VisibleForTesting ;
1718import java .io .IOException ;
1819import java .nio .ByteBuffer ;
1920import java .nio .charset .StandardCharsets ;
21+ import java .util .ArrayList ;
2022import java .util .List ;
2123import java .util .Optional ;
2224import java .util .Set ;
@@ -183,10 +185,14 @@ public void deleteByPrefix(String prefix) throws ObjectStorageWrapperException {
183185 int endIndex = Math .min (i + BATCH_DELETE_SIZE_LIMIT , blobIds .size ());
184186 List <BlobId > batch = blobIds .subList (i , endIndex );
185187 StorageBatch storageBatch = storage .batch ();
188+ List <StorageBatchResult <Boolean >> results = new ArrayList <>();
186189 for (BlobId blobId : batch ) {
187- storageBatch .delete (blobId );
190+ results . add ( storageBatch .delete (blobId ) );
188191 }
189192 storageBatch .submit ();
193+ for (StorageBatchResult <Boolean > result : results ) {
194+ result .get ();
195+ }
190196 }
191197 } catch (Exception e ) {
192198 throw new ObjectStorageWrapperException (
You can’t perform that action at this time.
0 commit comments