swamirishi commented on code in PR #4187:
URL: https://github.com/apache/ozone/pull/4187#discussion_r1248046201
##########
hadoop-ozone/s3gateway/pom.xml:
##########
@@ -177,6 +177,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
Review Comment:
removed it
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -547,6 +572,588 @@ public void testCreateSnapshotMissingMandatoryParams()
throws Exception {
() -> createSnapshot(nullstr, bucket));
}
+ private Set<OmKeyInfo> getDeletedKeysFromRocksDb(
+ OMMetadataManager metadataManager) throws IOException {
+ Set<OmKeyInfo> deletedKeys = Sets.newHashSet();
+ try (TableIterator<String,
+ ? extends Table.KeyValue<String, RepeatedOmKeyInfo>>
+ deletedTableIterator = metadataManager.getDeletedTable()
+ .iterator()) {
+ while (deletedTableIterator.hasNext()) {
+ Table.KeyValue<String, RepeatedOmKeyInfo> val =
+ deletedTableIterator.next();
+ deletedKeys.addAll(val.getValue().getOmKeyInfoList());
+ }
+ }
+
+ try (TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>>
+ deletedDirTableIterator = metadataManager.getDeletedDirTable()
+ .iterator()) {
+ while (deletedDirTableIterator.hasNext()) {
+ deletedKeys.add(deletedDirTableIterator.next().getValue());
+ }
+ }
+ return deletedKeys;
+ }
+
+ private OmKeyInfo getOmKeyInfo(String volume, String bucket,
+ String key) throws IOException {
+ return cluster.getOzoneManager().getKeyManager()
+ .getKeyInfo(new OmKeyArgs.Builder().setVolumeName(volume)
+ .setBucketName(bucket).setKeyName(key).build(), null);
+ }
+
+ /**
+ * Testing scenario:
+ * 1) Key k1 is created.
+ * 2) Snapshot snap1 created.
+ * 3) Snapshot snap2 is created
+ * 4) Key k1 is deleted.
+ * 5) Snapdiff b/w snap3 & snap2 taken to assert difference of 1 key
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]