forked from opensearch-project/opensearch-migrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into RfsInstrumentation + fixup some unit tests t…
…hat were not context aware. Signed-off-by: Greg Schohn <greg.schohn@gmail.com> # Conflicts: # RFS/build.gradle # RFS/src/main/java/com/rfs/ReindexFromSnapshot.java # RFS/src/main/java/com/rfs/RunRfsWorker.java # RFS/src/main/java/com/rfs/cms/OpenSearchCmsClient.java # RFS/src/main/java/com/rfs/common/DocumentReindexer.java # RFS/src/main/java/com/rfs/common/OpenSearchClient.java # RFS/src/main/java/com/rfs/common/SnapshotCreator.java
- Loading branch information
Showing
29 changed files
with
1,219 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,45 @@ | ||
package com.rfs.cms; | ||
|
||
import java.util.Optional; | ||
|
||
/* | ||
* Client to connect to and work with the Coordinating Metadata Store. The CMS could be implemented by any reasonable | ||
* data store option (Postgres, AWS DynamoDB, Elasticsearch/Opensearch, etc). | ||
*/ | ||
public interface CmsClient { | ||
/* | ||
* Creates a new entry in the CMS for the Snapshot's progress. Returns true if we created the entry, and false if | ||
* the entry already exists. | ||
*/ | ||
public boolean createSnapshotEntry(String snapshotName); | ||
|
||
/* | ||
* Attempt to retrieve the Snapshot entry from the CMS, if it exists; null if it doesn't currently exist | ||
* Creates a new entry in the CMS for the Snapshot's progress. Returns an Optional; if the document was created, it | ||
* will be the created object and empty otherwise. | ||
*/ | ||
public CmsEntry.Snapshot getSnapshotEntry(String snapshotName); | ||
public Optional<CmsEntry.Snapshot> createSnapshotEntry(String snapshotName); | ||
|
||
/* | ||
* Updates the status of the Snapshot entry in the CMS. Returns true if the update was successful, and false if | ||
* something else updated it before we could | ||
* Attempt to retrieve the Snapshot entry from the CMS. Returns an Optional; if the document exists, it will be the | ||
* retrieved entry and empty otherwise. | ||
*/ | ||
public boolean updateSnapshotEntry(String snapshotName, CmsEntry.SnapshotStatus status); | ||
public Optional<CmsEntry.Snapshot> getSnapshotEntry(String snapshotName); | ||
|
||
/* | ||
* Creates a new entry in the CMS for the Metadata Migration's progress. Returns true if we created the entry, and | ||
* false if the entry already exists. | ||
* Updates the Snapshot entry in the CMS. Returns an Optional; if the document was updated, it will be | ||
* the updated entry and empty otherwise. | ||
*/ | ||
public boolean createMetadataEntry(); | ||
public Optional<CmsEntry.Snapshot> updateSnapshotEntry(String snapshotName, CmsEntry.SnapshotStatus status); | ||
|
||
/* | ||
* Attempt to retrieve the Metadata Migration entry from the CMS, if it exists; null if it doesn't currently exist | ||
* Creates a new entry in the CMS for the Metadata Migration's progress. Returns an Optional; if the document was | ||
* created, it will be the created entry and empty otherwise. | ||
*/ | ||
public CmsEntry.Metadata getMetadataEntry(); | ||
public Optional<CmsEntry.Metadata> createMetadataEntry(); | ||
|
||
/* | ||
* Updates just the status field of the Metadata Migration entry in the CMS. Returns true if the update was successful, | ||
* Attempt to retrieve the Metadata Migration entry from the CMS, if it exists. Returns an Optional; if the document | ||
* exists, it will be the retrieved entry and empty otherwise. | ||
*/ | ||
public boolean setMetadataMigrationStatus(CmsEntry.MetadataStatus status); | ||
public Optional<CmsEntry.Metadata> getMetadataEntry(); | ||
|
||
/* | ||
* Updates all fields of the Metadata Migration entry in the CMS. Returns true if the update was successful, and | ||
* false if something else updated it before we could | ||
* Updates the Metadata Migration entry in the CMS. Returns an Optional; if the document was updated, | ||
* it will be the updated entry and empty otherwise. | ||
*/ | ||
public boolean updateMetadataEntry(CmsEntry.MetadataStatus status, String leaseExpiry, Integer numAttempts); | ||
public Optional<CmsEntry.Metadata> updateMetadataEntry(CmsEntry.MetadataStatus status, String leaseExpiry, Integer numAttempts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.