List<DataIdentifier> diDeleteList = new ArrayList<DataIdentifier>(30);
ObjectListing prevObjectListing = s3service.listObjects(bucket);
while (true) {
List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
DataIdentifier identifier = new DataIdentifier(
getIdentifierName(s3ObjSumm.getKey()));
if (!store.isInUse(identifier)
&& s3ObjSumm.getLastModified().getTime() < min) {
LOG.info("add id :" + s3ObjSumm.getKey()
+ " to delete lists");
deleteList.add(new DeleteObjectsRequest.KeyVersion(
s3ObjSumm.getKey()));
diDeleteList.add(new DataIdentifier(
getIdentifierName(s3ObjSumm.getKey())));
}
}
if (deleteList.size() > 0) {
DeleteObjectsRequest delObjsReq = new DeleteObjectsRequest(