Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FileCopy based bootstrap] GetMetadata Api #2991

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

DevenAhluwalia
Copy link
Contributor

No description provided.

@DevenAhluwalia DevenAhluwalia self-assigned this Jan 22, 2025
@@ -110,7 +110,7 @@ public static class LocalChannelRequest implements NetworkRequest {
private long startTimeInMs;
private int processorId;

LocalChannelRequest(RequestInfo requestInfo, int processorId) {
public LocalChannelRequest(RequestInfo requestInfo, int processorId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this diff

logInfos.size(), logInfos, ServerErrorCode.No_Error);

// TODO: Add metrics for this operation
Histogram dummyHistogram = new Histogram(new Reservoir() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this histogram and add metrics for this api

requestResponseChannel.sendResponse(response, request, serverNetworkResponseMetrics);
}

private List<LogInfo> convertStoreToProtocolLogInfo(List<com.github.ambry.store.LogInfo> logSegments) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figure out if there is a better place to keep this conversion util.

@@ -484,6 +494,30 @@ public void startup() throws InstantiationException {
}
}

private void testGetMetadataApi() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test code. To be reverted.

@@ -229,7 +230,8 @@ public AmbryServerRequestsTest(boolean validateRequestOnStoreState, boolean enab

@Parameterized.Parameters
public static List<Object[]> data() {
return Arrays.asList(new Object[][]{{false, false}, {true, false}, {false, true}, {true, true}});
// return Arrays.asList(new Object[][]{{false, false}, {true, false}, {false, true}, {true, true}});
return Arrays.asList(new Object[][]{{false, false}});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.

@@ -1645,6 +1647,17 @@ public void healthCheckTest() throws InterruptedException, StoreException, IOExc
setPropertyToAmbryRequests(currentProperties, "disk.manager.disk.healthcheck.enabled", "false");
}

@Test
public void fileCopyGetMetaDataRequestTest() throws IOException, InterruptedException {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests TBA.

@@ -326,7 +328,8 @@ public void start() throws StoreException {
}
metrics.storeStartFailure.inc();
String err = String.format("Error while starting store for dir %s due to %s", dataDir, e.getMessage());
throw new StoreException(err, e, StoreErrorCodes.Initialization_Error);
// [Dw-remove]
// throw new StoreException(err, e, StoreErrorCodes.Initialization_Error);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.

List<FileInfo> sealedLogsAndMetaDataFiles = getLogSegments(includeActiveLogSegment);
if (null != sealedLogsAndMetaDataFiles) {
for (FileInfo E : sealedLogsAndMetaDataFiles) {
logger.info("[Dw] LS file: {} size: {}", E.getFileName(), E.getFileSize());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix logging statements. Remove Dw prefix.

@@ -195,6 +196,9 @@ void start(boolean shouldRemoveUnexpectedDirs) throws InterruptedException {
Thread thread = Utils.newThread("store-startup-" + partitionAndStore.getKey(), () -> {
try {
partitionAndStore.getValue().start();
// [Dw remove]
// logger.info("[Dw] PrintUtil for PartitionId: " + partitionAndStore.getKey().getId());
// partitionAndStore.getValue().printAndReturnFiles();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant