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

Reintegrate Main #3657

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
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 @@ -221,7 +221,7 @@ public SingletonStore<EntityIdMap> createIdMappingStore(String pathName, ObjectM

openStoresInEnv.put(bigStore.getDataXodusStore().getEnvironment(), bigStore.getDataXodusStore());
openStoresInEnv.put(bigStore.getMetaXodusStore().getEnvironment(), bigStore.getMetaXodusStore());
return new SingletonStore<>(bigStore);
return new SingletonStore<>(new CachedStore<>(bigStore));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ public class AdminProcessor {
private final ObjectWriter jsonWriter = Jackson.MAPPER.writer();
private final Supplier<Collection<ShardNodeInformation>> nodeProvider;

public void addRoles(List<Role> roles) {

for (Role role : roles) {
try {
addRole(role);
}
catch (Exception e) {
log.error(String.format("Failed to add Role: %s", role), e);
}
}
}

public synchronized void addRole(Role role) throws JSONException {
ValidatorHelper.failOnError(log, validator.validate(role));
log.trace("New role:\tLabel: {}\tName: {}\tId: {} ", role.getLabel(), role.getName(), role.getId());
Expand Down Expand Up @@ -296,7 +284,7 @@ public Object executeScript(String script) {
groovy.setProperty("managerNode", getManagerNode());
groovy.setProperty("datasetRegistry", getDatasetRegistry());
groovy.setProperty("jobManager", getJobManager());
groovy.setProperty("config", getConfig());
groovy.setProperty("conqueryConfig", getConfig());
groovy.setProperty("storage", getStorage());

try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.bakdata.conquery.integration.tests;

import static org.assertj.core.api.Assertions.assertThat;

import java.net.URI;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;

import com.bakdata.conquery.integration.IntegrationTest;
import com.bakdata.conquery.io.storage.MetaStorage;
import com.bakdata.conquery.resources.admin.rest.AdminResource;
import com.bakdata.conquery.resources.hierarchies.HierarchyHelper;
import com.bakdata.conquery.util.support.StandaloneSupport;

public class ScriptEndTest extends IntegrationTest.Simple implements ProgrammaticIntegrationTest {
@Override
public void execute(StandaloneSupport conquery) throws Exception {
final URI scriptUri = HierarchyHelper.hierarchicalPath(conquery.defaultAdminURIBuilder()
, AdminResource.class, "executeScript")
.build();

try(Response resp = conquery.getClient().target(scriptUri).request(MediaType.TEXT_PLAIN_TYPE).post(Entity.entity("storage", MediaType.TEXT_PLAIN_TYPE))){
assertThat(resp.getStatusInfo().getFamily()).isEqualTo(Response.Status.Family.SUCCESSFUL);

assertThat(resp.readEntity(String.class))
.contains(MetaStorage.class.getSimpleName());
}
}
}
Loading