Skip to content

Commit

Permalink
Add endpoint to clean up old index backups (#176)
Browse files Browse the repository at this point in the history
* [ISSUE-172] Define delete old indexes backups endpoint

* Implementing delete index backup handler

* Create handler for deleting old resources

* Add tests for deleteIndexBackup operaton

* Cleanup code and fix failing build

* Use Java8 way of dealing with datetime, add tests of DeleteIndexBackupRequestHandler, small code tweaks

* Remove VersionedResourceObject.java which was renamed to VersioneResource.java

* Add multiple versioned resources with different creation dates in the DeleteBackupIndexHandler

* Regenerate grpc-gateway after changing DeleteIndexBackupResponse

* Change the logger string formatting

* Run spotlessapply to reformat code
  • Loading branch information
jedrazb authored Oct 21, 2020
1 parent 5d5f180 commit db42e70
Show file tree
Hide file tree
Showing 18 changed files with 1,577 additions and 699 deletions.
19 changes: 19 additions & 0 deletions clientlib/src/main/proto/yelp/nrtsearch/luceneserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ service LuceneServer {
body: "*"
};
}

rpc deleteIndexBackup (DeleteIndexBackupRequest) returns (DeleteIndexBackupResponse) {
option (google.api.http) = {
post: "/v1/delete_index_backup"
body: "*"
};
}

/* Gets the state of a started index, includes settings, live_settings, search schema, suggest schema */
rpc state (StateRequest) returns (StateResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -743,6 +751,17 @@ message BackupIndexResponse {
string metadataVersionHash = 2; //version identifier for metadata on s3
}

message DeleteIndexBackupRequest {
string indexName = 1; //name of the index to backup
string serviceName = 2; // remote storage namespace qualifier for service
string resourceName = 3; //remote storage namespace qualifier for resource e.g. indexName
int32 nDays = 4; //backups older than nDays will be deleted from s3
}

message DeleteIndexBackupResponse {
repeated string deletedVersionHashes = 1; // version hashes of backups which were deleted
}

message IndicesRequest {
}

Expand Down
2 changes: 1 addition & 1 deletion grpc-gateway/analysis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db42e70

Please sign in to comment.