@Override public String getDescription() { return "Personal space for user " + homeConfig.getOwner(); } }
public SpaceConfig newMessage() { return new SpaceConfig(); }
public ExtendedConfig newMessage() { return new ExtendedConfig(); }
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()); } }
public static SpaceConfig getSpaceConfig(Space space) { SpaceConfig config = new SpaceConfig(); config.setName(space.getName()); config.setId(new EntityId(space.getId())); if (space.getTag() != null) { config.setTag(space.getTag()); } config.setCtime(space.getCreatedAt()); return config; }
@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()); } }
public static void addSpace(NamespaceService ns, String name) throws Exception { final SpaceConfig space = new SpaceConfig(); space.setName(name); ns.addOrUpdateSpace(new NamespaceKey(name), space); }
public static void addHome(NamespaceService ns, String name) throws Exception { final HomeConfig homeConfig = new HomeConfig(); homeConfig.setOwner(name); ns.addOrUpdateHome(new NamespaceKey("@" + name), homeConfig); }
public HomeConfig newMessage() { return new HomeConfig(); }
public FolderConfig newMessage() { return new FolderConfig(); }
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(); }
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 String getId() { return homeConfig.getId().getId(); }
@Override public Long getVersion(NameSpaceContainer value) { switch (value.getType()) { case DATASET: return value.getDataset().getVersion(); case FOLDER: return value.getFolder().getVersion(); case HOME: return value.getHome().getVersion(); case SOURCE: return value.getSource().getVersion(); case SPACE: return value.getSpace().getVersion(); default: throw new UnsupportedOperationException("Unknown type: " + value.getType()); } }
public void writeTo(Output output, NameSpaceContainer message) throws IOException { if(message.fullPath != null) { for(String fullPath : message.fullPath) { if(fullPath != null) output.writeString(1, fullPath, true); } } if(message.type != null) output.writeEnum(2, message.type.number, false); if(message.source != null) output.writeObject(3, message.source, com.dremio.service.namespace.source.proto.SourceConfig.getSchema(), false); if(message.space != null) output.writeObject(4, message.space, com.dremio.service.namespace.space.proto.SpaceConfig.getSchema(), false); if(message.folder != null) output.writeObject(5, message.folder, com.dremio.service.namespace.space.proto.FolderConfig.getSchema(), false); if(message.dataset != null) output.writeObject(6, message.dataset, com.dremio.service.namespace.dataset.proto.DatasetConfig.getSchema(), false); if(message.home != null) output.writeObject(7, message.home, com.dremio.service.namespace.space.proto.HomeConfig.getSchema(), false); }
public void writeTo(Output output, Spaces message) throws IOException { if(message.spaces != null) { for(SpaceConfig spaces : message.spaces) { if(spaces != null) output.writeObject(1, spaces, SpaceConfig.getSchema(), true); } } if(message.homeSpaces != null) { for(HomeConfig homeSpaces : message.homeSpaces) { if(homeSpaces != null) output.writeObject(2, homeSpaces, HomeConfig.getSchema(), true); } } }
@Override public Long getCtime() { return homeConfig.getCtime(); }
public Spaces newMessage() { return new Spaces(); }
@Override public String getName() { return "@" + homeConfig.getOwner(); }
public String getOwner() { return homeConfig.getOwner(); }