org.apache.avro.AvroRemoteException Java Examples

The following examples show how to use org.apache.avro.AvroRemoteException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AvroRpcWorkflowManager.java    From oodt with Apache License 2.0 6 votes vote down vote up
@Override
public AvroWorkflowInstancePage paginateWorkflowInstances(int pageNum) throws AvroRemoteException {
    WorkflowInstancePage page = null;
    try {
        page = engine.getInstanceRepository()
                .getPagedWorkflows(pageNum);
    if (page != null) {
        populateWorkflows(page.getPageWorkflows());
        return AvroTypeFactory.getAvroWorkflowInstancePage(page);
    } else
        return AvroTypeFactory.getAvroWorkflowInstancePage(WorkflowInstancePage
                .blankPage());
    } catch (InstanceRepositoryException e) {
        throw new AvroRemoteException(e);
    }

}
 
Example #2
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 6 votes vote down vote up
@Override
public boolean killJob(String jobId) throws AvroRemoteException {
    String resNodeId = scheduler.getBatchmgr().getExecutionNode(jobId);
    if (resNodeId == null) {
        logger.warn("Attempt to kill job: [{}]: cannot find execution node (has the job already finished?)", jobId);
        return false;
    }
    ResourceNode node = null;
    try {
        node = scheduler.getMonitor().getNodeById(resNodeId);
    } catch (MonitorException e) {
        throw new AvroRemoteException(e);
    }
    return scheduler.getBatchmgr().killJob(jobId, node);

}
 
Example #3
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean removeProduct(AvroProduct p) throws AvroRemoteException {
    try {
        return this.fileManager.removeProduct(AvroTypeFactory.getProduct(p));
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #4
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean addQueue(String queueName) throws AvroRemoteException {
    try {
        this.scheduler.getQueueManager().addQueue(queueName);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;

}
 
Example #5
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<String> getQueues() throws AvroRemoteException {
    try {
        return this.scheduler.getQueueManager().getQueues();
    } catch (Exception e) {
        throw new AvroRemoteException(e);
    }
}
 
Example #6
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public String getExecutionNode(String jobId) throws AvroRemoteException {
    String execNode = scheduler.getBatchmgr().getExecutionNode(jobId);
    if (execNode == null) {
        logger.warn("Job: [{}] not currently executing on any known node", jobId);
        return "";
    } else
        return execNode;
}
 
Example #7
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean removeNodeFromQueue(String nodeId, String queueName) throws AvroRemoteException {
    try {
        this.scheduler.getQueueManager().removeNodeFromQueue(nodeId, queueName);
    } catch (QueueManagerException e) {
        throw new AvroRemoteException(e);
    }
    return true;

}
 
Example #8
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<AvroReference> getProductReferences(AvroProduct product) throws AvroRemoteException {
    List<AvroReference> avroProductTypes = new ArrayList<AvroReference>();
    try {
        for (Reference r : this.fileManager.getProductReferences(AvroTypeFactory.getProduct(product))){
            avroProductTypes.add(AvroTypeFactory.getAvroReference(r));
        }
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
    return avroProductTypes;
}
 
Example #9
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public String getNodeLoad(String nodeId) throws AvroRemoteException {
    ResourceNode node = null;
    try {
        node = this.scheduler.getMonitor().getNodeById(nodeId);
        int capacity = node.getCapacity();
        int load = (this.scheduler.getMonitor().getLoad(node)) * -1 + capacity;
        return load + "/" + capacity;
    } catch (MonitorException e) {
        throw new AvroRemoteException(e);
    }
}
 
Example #10
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean addMetadata(AvroProduct product, AvroMetadata met) throws AvroRemoteException {
    try {
        return this.fileManager.addMetadata(AvroTypeFactory.getProduct(product), AvroTypeFactory.getMetadata(met)) != null;
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #11
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public FileTransferStatus getCurrentFileTransfer() throws DataTransferException {
    try {
        return AvroTypeFactory.getFileTransferStatus(this.proxy.getCurrentFileTransfer());
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}
 
Example #12
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<Reference> getProductReferences(Product product) throws CatalogException {
    List<Reference> references = new ArrayList<Reference>();
    try {
        for (AvroReference ar : this.proxy.getProductReferences(AvroTypeFactory.getAvroProduct(product))) {
            references.add(AvroTypeFactory.getReference(ar));
        }
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
    return references;
}
 
Example #13
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public AvroProduct getProductByName(String productName) throws AvroRemoteException {
    try {
        return AvroTypeFactory.getAvroProduct(this.fileManager.getProductByName(productName));
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #14
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<AvroProductType> getProductTypes() throws AvroRemoteException {
    List<AvroProductType> avroProductTypes = new ArrayList<AvroProductType>();
    try {
        for (ProductType pt : this.fileManager.getProductTypes()){
            avroProductTypes.add(AvroTypeFactory.getAvroProductType(pt));
        }
    } catch (RepositoryManagerException e) {
        throw new AvroRemoteException(e.getMessage());
    }
    return avroProductTypes;
}
 
Example #15
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public AvroMetadata getReducedMetadata(AvroProduct product, List<String> elements) throws AvroRemoteException {
    try {
        return AvroTypeFactory.getAvroMetadata(this.fileManager.getReducedMetadata(AvroTypeFactory.getProduct(product), elements));
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #16
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public ProductPage pagedQuery(Query query, ProductType type, int pageNum) throws CatalogException {
    try {

        return AvroTypeFactory.getProductPage(this.proxy.pagedQuery(
                AvroTypeFactory.getAvroQuery(query),
                AvroTypeFactory.getAvroProductType(type),
                pageNum
        ));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example #17
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean hasProduct(String productName) throws AvroRemoteException {
    try {
        return this.fileManager.hasProduct(productName);
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #18
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public AvroProductPage pagedQuery(AvroQuery query, AvroProductType type, int pageNum) throws AvroRemoteException{
    try {
        return AvroTypeFactory.getAvroProductPage(this.fileManager.pagedQuery(
                AvroTypeFactory.getQuery(query),
                AvroTypeFactory.getProductType(type),
                pageNum
        ));
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #19
Source File: AvroRpcResourceManager.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public int getJobQueueCapacity() throws AvroRemoteException {
    try {
        return this.scheduler.getJobQueue().getCapacity();
    } catch (Exception e) {
        throw new AvroRemoteException(new JobRepositoryException("Failed to get capacity of JobQueue : " + e.getMessage(), e));
    }
}
 
Example #20
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public ProductPage getLastPage(ProductType type) throws CatalogException {
    logger.debug("Getting last page for product type: {}", type.toString());
    try {
        return AvroTypeFactory.getProductPage(this.proxy.getLastPage(AvroTypeFactory.getAvroProductType(type)));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example #21
Source File: AvroRpcResourceManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<String> getQueuesWithNode(String nodeId) throws QueueManagerException {
    try {
        return proxy.getQueuesWithNode(nodeId);
    } catch (AvroRemoteException e) {
        throw new QueueManagerException(e);
    }
}
 
Example #22
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean modifyProduct(AvroProduct p) throws AvroRemoteException {
    try {
        return this.fileManager.modifyProduct(AvroTypeFactory.getProduct(p));
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #23
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<AvroProduct> getTopNProductsByProductType(int n, AvroProductType type) throws AvroRemoteException {
    List<AvroProduct> avroProducts = new ArrayList<AvroProduct>();
    try {
        for (Product p : this.fileManager.getTopNProductsByProductType(n, AvroTypeFactory.getProductType(type))){
            avroProducts.add(AvroTypeFactory.getAvroProduct(p));
        }
    } catch (CatalogException e) {
        throw new AvroRemoteException(e.getMessage());
    }
    return avroProducts;
}
 
Example #24
Source File: AvroRpcResourceManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public void setNodeCapacity(String nodeId, int capacity) throws MonitorException {
    try {
        proxy.setNodeCapacity(nodeId, capacity);
    } catch (AvroRemoteException e) {
        throw new MonitorException(e);
    }
}
 
Example #25
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public AvroProductType getProductTypeById(String productTypeId) throws AvroRemoteException {
    try {
        return AvroTypeFactory.getAvroProductType(this.fileManager.getProductTypeById(productTypeId));
    } catch (RepositoryManagerException e) {
        throw new AvroRemoteException(e.getMessage());
    }
}
 
Example #26
Source File: AvroRpcResourceManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public void addNode(ResourceNode node) throws MonitorException {
    try {
        proxy.addNode(AvroTypeFactory.getAvroResourceNode(node));
    } catch (AvroRemoteException e) {
        throw new MonitorException(e);
    }
}
 
Example #27
Source File: AvroFileManagerServer.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public AvroProductPage getFirstPage(AvroProductType type) throws AvroRemoteException {
    logger.debug("Getting first page for type: {}", type.getName());
    ProductPage firstPage = this.fileManager.getFirstPage(AvroTypeFactory.getProductType(type));
    logger.debug("Found first page for product type: {} -> {}", type.getName(), firstPage);
    if (firstPage == null) {
        logger.warn("No first page found for product type: {}", type.getName());
        return null;
    }

    return AvroTypeFactory.getAvroProductPage(firstPage);
}
 
Example #28
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public int getNumProducts(ProductType type) throws CatalogException {
    try {
        return this.proxy.getNumProducts(AvroTypeFactory.getAvroProductType(type));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example #29
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean moveProduct(Product product, String newPath) throws DataTransferException {
    boolean success;
    try {
        success = this.proxy.moveProduct(AvroTypeFactory.getAvroProduct(product), newPath);
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
    return success;
}
 
Example #30
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public void setProductTransferStatus(Product product) throws CatalogException {
    try {
        this.proxy.setProductTransferStatus(AvroTypeFactory.getAvroProduct(product));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}