Search in sources :

Example 16 with FileMapping

use of com.baidu.hugegraph.entity.load.FileMapping in project incubator-hugegraph-toolchain by apache.

the class FileMappingController method addVertexMapping.

@PostMapping("{id}/vertex-mappings")
public FileMapping addVertexMapping(@PathVariable("connId") int connId, @PathVariable("id") int id, @RequestBody VertexMapping newEntity) {
    FileMapping mapping = this.service.get(id);
    if (mapping == null) {
        throw new ExternalException("load.file-mapping.not-exist.id", id);
    }
    this.checkVertexMappingValid(connId, newEntity, mapping);
    newEntity.setId(HubbleUtil.generateSimpleId());
    mapping.getVertexMappings().add(newEntity);
    this.service.update(mapping);
    return mapping;
}
Also used : FileMapping(com.baidu.hugegraph.entity.load.FileMapping) ExternalException(com.baidu.hugegraph.exception.ExternalException) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

FileMapping (com.baidu.hugegraph.entity.load.FileMapping)16 ExternalException (com.baidu.hugegraph.exception.ExternalException)11 PostMapping (org.springframework.web.bind.annotation.PostMapping)6 JobManager (com.baidu.hugegraph.entity.load.JobManager)5 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)4 LoadTask (com.baidu.hugegraph.entity.load.LoadTask)3 EdgeMapping (com.baidu.hugegraph.entity.load.EdgeMapping)2 VertexMapping (com.baidu.hugegraph.entity.load.VertexMapping)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 ReadWriteLock (java.util.concurrent.locks.ReadWriteLock)2 ReentrantReadWriteLock (java.util.concurrent.locks.ReentrantReadWriteLock)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 PutMapping (org.springframework.web.bind.annotation.PutMapping)2 MultipartFile (org.springframework.web.multipart.MultipartFile)2 GraphConnection (com.baidu.hugegraph.entity.GraphConnection)1 FileSetting (com.baidu.hugegraph.entity.load.FileSetting)1 FileUploadResult (com.baidu.hugegraph.entity.load.FileUploadResult)1 JobManagerReasonResult (com.baidu.hugegraph.entity.load.JobManagerReasonResult)1 LoadParameter (com.baidu.hugegraph.entity.load.LoadParameter)1