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

Minor fixes for local execution #464

Merged
merged 13 commits into from
Jun 26, 2023
Merged

Conversation

sundargates
Copy link
Collaborator

Context

Explain context and other details for this pull request.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

Comment on lines 21 to 22
mantis.taskexecutor.blob-store.storage-dir=file:///localstore_dir
mantis.taskexecutor.blob-store.local-cache=/apps/mantis/mantis-server-agent/mantis-artifacts
mantis.taskexecutor.blob-store.storage-dir=file:///Users/[email protected]/Downloads/
mantis.taskexecutor.blob-store.local-cache=/tmp/mantis/mantis-artifacts
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rewrite this.

Comment on lines 42 to 44
run {
standardInput = System.in
// standardInput = System.in
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Get rid of this block completely

@github-actions
Copy link

github-actions bot commented Jun 18, 2023

Test Results

126 files   - 1  126 suites   - 1   6m 46s ⏱️ +32s
536 tests  - 2  526 ✔️  - 3  8 💤 ±0  2 +1 
538 runs   - 1  528 ✔️  - 2  8 💤 ±0  2 +1 

For more details on these failures, see this check.

Results for commit 7e6ca0a. ± Comparison against base commit b78be8a.

This pull request removes 2 tests.
io.mantisrx.master.resourcecluster.resourceprovider.SimpleFileResourceStorageProviderTests ‑ testResourceClusterRules
io.mantisrx.master.resourcecluster.resourceprovider.SimpleFileResourceStorageProviderTests ‑ testUpdateClusterSpec

♻️ This comment has been updated with latest results.

@sundargates sundargates had a problem deploying to Integrate Pull Request June 22, 2023 22:47 — with GitHub Actions Failure
@@ -668,6 +668,7 @@ private HttpClient<ByteBuf, ServerSentEvent> getRxnettySseClient(String hostname

private WebSocketClient<TextWebSocketFrame, TextWebSocketFrame> getRxnettyWebSocketClient(String host,
int port, String uri) {
logger.info("Creating websocket client for " + host + ":" + port + " uri " + uri + " ...");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Get rid of this change

@sundargates sundargates had a problem deploying to Integrate Pull Request June 22, 2023 22:50 — with GitHub Actions Failure
import io.mantisrx.master.events.LifecycleEventPublisher;
import io.mantisrx.server.master.store.KeyValueStore;

public class InMemoryPersistenceProvider extends KeyValueBasedPersistenceProvider {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move this to tests.

Comment on lines 814 to 838
return null;
}

@Override
public ResourceClusterSpecWritable getResourceClusterSpecWritable(ClusterID id)
throws IOException {
return null;
}

@Override
public ResourceClusterScaleRulesWritable getResourceClusterScaleRules(ClusterID clusterId)
throws IOException {
return null;
}

@Override
public ResourceClusterScaleRulesWritable registerResourceClusterScaleRule(
ResourceClusterScaleRulesWritable ruleSpec) throws IOException {
return null;
}

@Override
public ResourceClusterScaleRulesWritable registerResourceClusterScaleRule(
ResourceClusterScaleSpec rule) throws IOException {
return null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These need to be filled

@@ -89,15 +90,16 @@ public class ResourceClusterNonLeaderRedirectRouteTest extends JUnitRouteTest {
private final ActorSystem system =
ActorSystem.create(ResourceClusterNonLeaderRedirectRouteTest.class.getSimpleName());

private final IMantisPersistenceProvider storageProvider = new FileBasedPersistenceProvider(true);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change this to InMemoryPersistenceProvider

import org.junit.BeforeClass;
import org.junit.Test;

public class ResourceClusterAwareSchedulerActorTest {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Delete this file

when(resProvider.getResponseHandler()).thenReturn(responseHandler);

ActorRef resourceClusterActor = system.actorOf(
ResourceClustersHostManagerActor.props(resProvider, resStorageProvider));
ResourceClustersHostManagerActor.props(resProvider, new FileBasedPersistenceProvider(false)));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replace this with something else.

Comment on lines 228 to 280
class InMemoryStore implements KeyValueStore {

// table -> partitionKey -> secondaryKey -> data
private final Map<String, Map<String, Map<String, String>>> store = new ConcurrentHashMap<>();

@Override
public List<String> getAllPartitionKeys(String tableName) throws IOException {
try {
return store.get(tableName).keySet().stream().collect(Collectors.toList());
} catch (Exception e) {
throw new IOException(e);
}
}

@Override
public Map<String, String> getAll(String tableName, String partitionKey)
throws IOException {
if (store.get(tableName) == null) {
return Collections.emptyMap();
} else if (store.get(tableName).get(partitionKey) == null) {
return Collections.emptyMap();
} else {
return store.get(tableName).get(partitionKey);
}
}

@Override
public boolean upsertAll(String tableName, String partitionKey, Map<String, String> all,
Duration ttl) throws IOException {
store.putIfAbsent(tableName, new ConcurrentHashMap<>());
store.get(tableName).put(partitionKey, new ConcurrentHashMap<>(all));
return true;
}

@Override
public boolean delete(String tableName, String partitionKey, String secondaryKey)
throws IOException {
if (store.containsKey(tableName) && // table exists
store.get(tableName).containsKey(partitionKey) && // partitionKey exists
store.get(tableName).get(partitionKey).containsKey(secondaryKey)) { // secondaryKey exists
store.get(tableName).get(partitionKey).remove(secondaryKey);
return true;
}
return false;
}

@Override
public boolean deleteAll(String tableName, String partitionKey) throws IOException {
if (store.containsKey(tableName) && // table exists
store.get(tableName).containsKey(partitionKey)) { // partitionKey exists
store.get(tableName).remove(partitionKey);
return true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hmit Can you check if the semantics of this is consistent with the KeyValueStore assumptions

Copy link
Collaborator

@hmitnflx hmitnflx left a comment

Choose a reason for hiding this comment

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

looks good, thanks for this change!

@sundargates sundargates had a problem deploying to Integrate Pull Request June 26, 2023 20:36 — with GitHub Actions Failure
@sundargates sundargates had a problem deploying to Integrate Pull Request June 26, 2023 20:51 — with GitHub Actions Failure
@sundargates sundargates merged commit 91791b2 into Netflix:master Jun 26, 2023
1 of 2 checks passed
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.

2 participants