Skip to content

Commit

Permalink
removing unused members
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <soosinha@amazon.com>
  • Loading branch information
soosinha committed Jun 8, 2024
1 parent acacbea commit a2aafaa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package org.opensearch.common.remote;

import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.core.action.ActionListener;

import java.io.IOException;
Expand All @@ -18,6 +19,7 @@
* @param <T> The object type which can be uploaded to or downloaded from remote storage.
* @param <U> The wrapper entity which provides methods for serializing/deserializing entity T.
*/
@ExperimentalApi
public interface RemoteWritableEntityStore<T, U extends RemoteWriteableEntity<T>> {

public void writeAsync(U entity, ActionListener<Void> listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

package org.opensearch.common.remote;

import org.opensearch.common.annotation.ExperimentalApi;

import java.io.IOException;
import java.io.InputStream;

Expand All @@ -17,6 +19,7 @@
*
* @param <T> The object type which can be uploaded to or downloaded from remote storage.
*/
@ExperimentalApi
public interface RemoteWriteableEntity<T> {
/**
* @return An InputStream created by serializing the entity T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class RemoteClusterMetadataManifest extends AbstractRemoteWritableBlobEnt

public static final String METADATA_MANIFEST_NAME_FORMAT = "%s";
public static final int MANIFEST_CURRENT_CODEC_VERSION = ClusterMetadataManifest.CODEC_V3;
public static final String COMMITTED = "C";
public static final String PUBLISHED = "P";

/**
* Manifest format compatible with older codec v0, where codec version was missing.
Expand Down Expand Up @@ -93,11 +95,10 @@ public String generateBlobFileName() {
MANIFEST,
RemoteStoreUtils.invertLong(clusterMetadataManifest.getClusterTerm()),
RemoteStoreUtils.invertLong(clusterMetadataManifest.getStateVersion()),
(clusterMetadataManifest.isCommitted() ? "C" : "P"), // C for committed and P for published
(clusterMetadataManifest.isCommitted() ? COMMITTED : PUBLISHED),
RemoteStoreUtils.invertLong(System.currentTimeMillis()),
String.valueOf(clusterMetadataManifest.getCodecVersion()) // Keep the codec version at last place only, during read we reads
// last place to
// determine codec version.
String.valueOf(clusterMetadataManifest.getCodecVersion())
// Keep the codec version at last place only, during we read last place to determine codec version.
);
this.blobFileName = blobFileName;
return blobFileName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import static org.opensearch.gateway.remote.RemoteClusterStateUtils.METADATA_NAME_FORMAT;

/**
* Wrapper class for uploading/downloading global metadata ({@link Metadata}) to/from remote blob store
*/
public class RemoteGlobalMetadata extends AbstractRemoteWritableBlobEntity<Metadata> {

public static final ChecksumBlobStoreFormat<Metadata> GLOBAL_METADATA_FORMAT = new ChecksumBlobStoreFormat<>(
Expand All @@ -30,9 +33,6 @@ public class RemoteGlobalMetadata extends AbstractRemoteWritableBlobEntity<Metad
Metadata::fromXContent
);

private Metadata metadata;
private final String blobName;

public RemoteGlobalMetadata(
final String blobName,
final String clusterUUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void testGetUploadedMetadata() throws IOException {
try (InputStream inputStream = remoteObjectForUpload.serialize()) {
remoteObjectForUpload.setFullBlobName(new BlobPath().add(TEST_BLOB_PATH));
UploadedMetadata uploadedMetadata = remoteObjectForUpload.getUploadedMetadata();
assertThat(uploadedMetadata.getUploadedFilename(), is(remoteObjectForUpload.getFullBlobName()));
assertThat(uploadedMetadata.getUploadedFilename(), is(remoteObjectForUpload.getBlobFileName()));
}
}

Expand Down

0 comments on commit a2aafaa

Please sign in to comment.