Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 815 batch restore of objects for GCP #816

Open
wants to merge 11 commits into
base: issue_792_batch_restore_s3
Choose a base branch
from

Conversation

evgeniimv
Copy link

This PR related to issue #815

The same logic as in PR #806 (issue #792)

Description:
Introducing of a new feature in the GCP-CP client for the ability to restore folders in the GCP storage.
Implementing a new RestoreFolderVO object to configure folder restoration.

General options:

  • with/without recursion, to be able to restore subfolders
  • with/without include/exclude lists to be able to manage files for restore

Details:
Specifying RestoreFolderVO is mandatory; specifying the include/exclude lists is optional.
Specifying the path to the recovery folder is optional; an empty path means the root directory.

@evgeniimv evgeniimv changed the base branch from develop to issue_792_batch_restore_s3 December 3, 2019 14:20
}
};
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add empty line please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}
}

private boolean isFileWithDeleteMarkerAndShouldBeRestore(final AbstractDataStorageItem item,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move this method into ProviderUtils to reuse it into S3Helper ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, replaced

if (StringUtils.isNotBlank(folderPath)) {
folderPath = normalizeFolderPath(requestPath);
}
final Page<Blob> blobs = client.list(bucketName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to move this logic into separate method and reuse it into listItems methd?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it, now it looks little bit better

}
};
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate)

}
}

private boolean isFileWithDeleteMarkerAndShouldBeRestore(final AbstractDataStorageItem item,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move this method into ProviderUtils class and reuse it into S3Helper?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate)

if (isFileWithDeleteMarkerAndShouldBeRestore(item, restoreFolderVO)) {
final Blob blob = checkBlobExistsAndGet(bucketName, item.getPath(), client,
removeDeletedMarkerFromVersion(((DataStorageFile) item).getVersion()));
final Storage.CopyRequest request = Storage.CopyRequest.newBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to create a new method (wth copy bob logic) and reuse it into restoreFileVersion?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@evgeniimv evgeniimv force-pushed the issue_792_batch_restore_s3_GCP branch from e5b8a8e to 2ac0ccf Compare December 4, 2019 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants