protected Space getSpaceFromConfig(SpaceConfig config, List<CatalogItem> children) { return new Space( config.getId().getId(), config.getName(), String.valueOf(config.getTag()), config.getCtime(), children ); }
namespace.deleteSpace(new NamespaceKey(space.getName()), space.getTag());
SpaceConfig config = (SpaceConfig) object; String version = config.getTag();
private static CatalogItem fromSpaceConfig(SpaceConfig spaceConfig, CollaborationTag tags) { return new Builder() .setId(spaceConfig.getId().getId()) .setPath(Lists.newArrayList(spaceConfig.getName())) .setTag(String.valueOf(spaceConfig.getTag())) .setType(CatalogItemType.CONTAINER) .setContainerType(ContainerSubType.SPACE) .setTags(tags) .build(); }
public static String getVersion(NamespaceKey namespaceKey, NamespaceService namespaceService) throws NamespaceException { NameSpaceContainer container = namespaceService.getEntities(Arrays.asList(namespaceKey)).get(0); switch (container.getType()) { case SOURCE: return container.getSource().getTag(); case SPACE: return container.getSpace().getTag(); case HOME: return container.getHome().getTag(); case FOLDER: return container.getFolder().getTag(); case DATASET: return container.getDataset().getTag(); default: throw new RuntimeException("Invalid container type"); } } }
public static Space newInstance(SpaceConfig spaceConfig, NamespaceTree contents, int datasetCount) { String id = spaceConfig.getId() != null ? spaceConfig.getId().getId() : null; return new Space(id, spaceConfig.getName(), spaceConfig.getDescription(), spaceConfig.getTag(), contents, datasetCount, spaceConfig.getCtime()); } }
@Override public String getTag(NameSpaceContainer value) { switch (value.getType()) { case DATASET: return value.getDataset().getTag(); case FOLDER: return value.getFolder().getTag(); case HOME: return value.getHome().getTag(); case SOURCE: return value.getSource().getTag(); case SPACE: return value.getSpace().getTag(); default: throw new UnsupportedOperationException("Unknown type: " + value.getType()); } }
@AfterClass public static void after() throws Exception { NamespaceService namespaceService = newNamespaceService(); NamespaceKey namespaceKey = new NamespaceKey("searchSpace"); namespaceService.deleteSpace(namespaceKey, namespaceService.getSpace(namespaceKey).getTag()); }
public void deleteSpace() { NamespaceKey key = new SpacePath(TEST_SPACE).toNamespaceKey(); SpaceConfig config; try { config = getNamespaceService().getSpace(key); if (config != null) { getNamespaceService().deleteSpace(key, config.getTag()); } }catch (NamespaceException e) { } }
@AfterClass public static void shutdown() throws Exception { // setup space NamespaceKey key = new NamespaceKey("mySpace"); SpaceConfig space = newNamespaceService().getSpace(key); newNamespaceService().deleteSpace(key, space.getTag()); }
@AfterClass public static void shutdown() throws Exception { // setup space NamespaceKey key = new NamespaceKey("dsvTest"); SpaceConfig space = newNamespaceService().getSpace(key); newNamespaceService().deleteSpace(key, space.getTag()); }
public static void cleanup(DACDaemon dremioDaemon) throws Exception { final NamespaceService namespaceService = newNamespaceService(); namespaceService.deleteSpace(new SpacePath("testA").toNamespaceKey(), namespaceService.getSpace(new SpacePath("testA").toNamespaceKey()).getTag()); namespaceService.deleteSpace(new SpacePath("testB").toNamespaceKey(), namespaceService.getSpace(new SpacePath("testB").toNamespaceKey()).getTag()); }
@Test public void testCTASReplace() throws Exception { NamespaceKey namespaceKey = new NamespaceKey("ctasSpace"); SpaceConfig spaceConfig = new SpaceConfig(); spaceConfig.setName("ctasSpace"); newNamespaceService().addOrUpdateSpace(namespaceKey, spaceConfig); SqlQuery ctas = getQueryFromSQL("CREATE OR REPLACE VIEW ctasSpace.ctastest AS select * from (VALUES (1))"); Job ctasJob = jobsService.submitJob(JobRequest.newBuilder() .setSqlQuery(ctas) .setQueryType(QueryType.UI_RUN) .build(), NoOpJobStatusListener.INSTANCE); waitForCompletion(ctasJob); ctas = getQueryFromSQL("CREATE OR REPLACE VIEW ctasSpace.ctastest AS select * from (VALUES (2))"); ctasJob = jobsService.submitJob(JobRequest.newBuilder() .setSqlQuery(ctas) .setQueryType(QueryType.UI_RUN) .build(), NoOpJobStatusListener.INSTANCE); waitForCompletion(ctasJob); newNamespaceService().deleteSpace(namespaceKey, newNamespaceService().getSpace(namespaceKey).getTag()); }
namespaceService.deleteSpace(new NamespaceKey("space1"), space1.getTag()); try { namespaceService.getSpace(new NamespaceKey("space1")); } catch (NamespaceNotFoundException nfe) { namespaceService.deleteSpace(new NamespaceKey("space2"), space2.getTag()); try { namespaceService.getSpace(new NamespaceKey("space2"));