public static Map<String, String> createApiLinks(List<String> fullPath, List<String> displayFullPath, DatasetType datasetType, DatasetVersion datasetVersion, boolean isUnsaved, boolean isDerivedDirectly) { String dottedFullPath = new NamespaceKey(fullPath).toUrlEncodedString(); Map<String, String> links = new HashMap<>(); links.put("self", "/dataset/" + dottedFullPath + "/version/" + datasetVersion); if (!isUnsaved || isDerivedDirectly) { links.put("namespaceEntity", getNamespaceEntityUrlPath(displayFullPath, datasetType)); } return links; }
public ResourceTreeEntity(SpaceConfig spaceConfig) throws UnsupportedEncodingException { this.type = ResourceType.SPACE; this.name = spaceConfig.getName(); this.fullPath = Collections.singletonList(this.name); this.url = "/resourcetree/" + new NamespaceKey(this.fullPath).toUrlEncodedString(); }
public Map<String, String> getApiLinks() throws UnsupportedEncodingException { final NamespaceKey datasetPath = new NamespaceKey(fullPath); final String dottedFullPath = datasetPath.toUrlEncodedString(); final String fullPathString = PathUtils.toFSPath(fullPath).toString(); Map<String, String> links = new HashMap<String, String>(); switch (datasetType) { case VIRTUAL_DATASET: links.put("edit", "/dataset/" + dottedFullPath + "/version/" + datasetVersion + "?view=explore"); //edit dataset links.put("run", "/datasets/new_untitled?parentDataset=" + dottedFullPath + "&newVersion=" + DatasetVersion.newVersion()); //create new dataset break; case PHYSICAL_DATASET_HOME_FILE: links.put("run", "/home/" + fullPath.get(0) + "new_untitled_from_file" + fullPathString); break; case PHYSICAL_DATASET_HOME_FOLDER: // Folder not supported yet break; case PHYSICAL_DATASET_SOURCE_FILE: links.put("run", "/source/" + fullPath.get(0) + "new_untitled_from_file" + fullPathString); break; case PHYSICAL_DATASET_SOURCE_FOLDER: links.put("run", "/source/" + fullPath.get(0) + "new_untitled_from_folder" + fullPathString); break; case PHYSICAL_DATASET: links.put("run", "/source/" + fullPath.get(0) + "new_untitled_from_physical_dataset" + fullPathString); break; default: break; } return links; }
public Map<String, String> getApiLinks() { final Map<String, String> links = Maps.newHashMap(); final NamespaceKey datasetPath = new NamespaceKey(fullPath); final String dottedFullPath = datasetPath.toUrlEncodedString(); final String fullPathString = PathUtils.toFSPath(fullPath).toString();
public ResourceTreeEntity(HomeConfig homeConfig) throws UnsupportedEncodingException { this.type = ResourceType.HOME; this.name = HomeName.getUserHomePath(homeConfig.getOwner()).toString(); this.fullPath = Collections.singletonList(this.name); this.url = "/resourcetree/" + new NamespaceKey(this.fullPath).toUrlEncodedString(); }
public ResourceTreeEntity(FolderConfig folderConfig) throws UnsupportedEncodingException { this.type = ResourceType.FOLDER; this.name = folderConfig.getName(); this.fullPath = folderConfig.getFullPathList(); this.url = "/resourcetree/" + new NamespaceKey(this.fullPath).toUrlEncodedString(); }
@Test public void testTableauPhysical() throws Exception { setSpace(); // create dataset so we get a namespace entry for the physical dataset. DatasetUI ui = saveAs( createDatasetFromParent("cp.\"tpch/supplier.parquet\"").getDataset(), new DatasetPath("spacefoo.boo") ).getDataset(); expectSuccess( getBuilder( getAPIv2() .path("tableau") .path(new NamespaceKey(Arrays.asList("cp", "tpch/supplier.parquet")).toUrlEncodedString()) ) .header("Accept", "*/*") .header("host", "localhost") .buildGet()); }
@Test public void testTableauVirtual() throws Exception { setSpace(); DatasetUI ui = saveAs( createDatasetFromParent("cp.\"tpch/supplier.parquet\"").getDataset(), new DatasetPath("spacefoo.boo") ).getDataset(); expectSuccess( getBuilder( getAPIv2() .path("tableau") .path(new NamespaceKey(ui.getDisplayFullPath()).toUrlEncodedString())) .header("Accept", "*/*") .header("host", "localhost") .buildGet()); }