Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public class OmMetadataManagerImpl implements OMMetadataManager,
private final Map<String, TableCacheMetrics> tableCacheMetricsMap =
new HashMap<>();
private SnapshotChainManager snapshotChainManager;
private final S3Batcher s3Batcher = new S3SecretBatcher();

/**
* OmMetadataManagerImpl constructor.
Expand Down Expand Up @@ -1958,25 +1959,7 @@ public void revokeSecret(String kerberosId) throws IOException {

@Override
public S3Batcher batcher() {
return new S3Batcher() {
@Override
public void addWithBatch(AutoCloseable batchOperator,
String id, S3SecretValue s3SecretValue)
throws IOException {
if (batchOperator instanceof BatchOperation) {
s3SecretTable.putWithBatch((BatchOperation) batchOperator,
id, s3SecretValue);
}
}

@Override
public void deleteWithBatch(AutoCloseable batchOperator, String id)
throws IOException {
if (batchOperator instanceof BatchOperation) {
s3SecretTable.deleteWithBatch((BatchOperation) batchOperator, id);
}
}
};
return s3Batcher;
}

@Override
Expand Down Expand Up @@ -2188,4 +2171,23 @@ public boolean containsIncompleteMPUs(String volume, String bucket)

return false;
}

private final class S3SecretBatcher implements S3Batcher {
@Override
public void addWithBatch(AutoCloseable batchOperator, String id, S3SecretValue s3SecretValue)
throws IOException {
if (batchOperator instanceof BatchOperation) {
s3SecretTable.putWithBatch((BatchOperation) batchOperator,
id, s3SecretValue);
}
}

@Override
public void deleteWithBatch(AutoCloseable batchOperator, String id)
throws IOException {
if (batchOperator instanceof BatchOperation) {
s3SecretTable.deleteWithBatch((BatchOperation) batchOperator, id);
}
}
}
}