-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDDS-7883. [Snapshot] Accommodate FSO, key renames and implement OMSn…
…apshotPurgeRequest for SnapshotDeletingService (#4407)
- Loading branch information
1 parent
4a43f34
commit 184bfc2
Showing
16 changed files
with
685 additions
and
69 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
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
64 changes: 64 additions & 0 deletions
64
...ger/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.apache.hadoop.ozone.om.request.snapshot; | ||
|
||
import org.apache.hadoop.ozone.om.OzoneManager; | ||
import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper; | ||
import org.apache.hadoop.ozone.om.request.OMClientRequest; | ||
import org.apache.hadoop.ozone.om.request.util.OmResponseUtil; | ||
import org.apache.hadoop.ozone.om.response.OMClientResponse; | ||
import org.apache.hadoop.ozone.om.response.snapshot.OMSnapshotPurgeResponse; | ||
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos; | ||
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest; | ||
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.SnapshotPurgeRequest; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Handles OMSnapshotPurge Request. | ||
*/ | ||
public class OMSnapshotPurgeRequest extends OMClientRequest { | ||
|
||
public OMSnapshotPurgeRequest(OMRequest omRequest) { | ||
super(omRequest); | ||
} | ||
|
||
@Override | ||
public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, | ||
long trxnLogIndex, OzoneManagerDoubleBufferHelper omDoubleBufferHelper) { | ||
|
||
OMClientResponse omClientResponse = null; | ||
|
||
OzoneManagerProtocolProtos.OMResponse.Builder omResponse = | ||
OmResponseUtil.getOMResponseBuilder(getOmRequest()); | ||
SnapshotPurgeRequest snapshotPurgeRequest = getOmRequest() | ||
.getSnapshotPurgeRequest(); | ||
|
||
List<String> snapshotDbKeys = snapshotPurgeRequest | ||
.getSnapshotDBKeysList(); | ||
|
||
omClientResponse = new OMSnapshotPurgeResponse(omResponse.build(), | ||
snapshotDbKeys); | ||
addResponseToDoubleBuffer(trxnLogIndex, omClientResponse, | ||
omDoubleBufferHelper); | ||
|
||
return omClientResponse; | ||
} | ||
} |
Oops, something went wrong.