Examples of IvoryException


Examples of org.apache.ivory.IvoryException

            instance.cluster = cluster;
            instances[0] = instance;
            return new InstancesResult("Instance for workflow id:" + jobId,
                    instances);
        } catch (Exception e) {
            throw new IvoryException(e);
        }

    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

            retentionWorkflow.setConfiguration(getCoordConfig(props));
            retentionAction.setWorkflow(retentionWorkflow);
            return retentionAction;
        } catch (Exception e) {
            throw new IvoryException("Unable to create parent/retention workflow", e);
        }
    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

            } else {
                inputDataset.setDoneFlag(feed.getAvailabilityFlag());
            }

        } catch (IvoryException e) {
            throw new IvoryException("Cannot unmarshall replication coordinator template", e);
        }

        Path wfPath = getCoordPath(bundlePath, coordName);
        replicationCoord.setAction(getReplicationWorkflowAction(srcCluster, trgCluster, wfPath, coordName));
        return replicationCoord;
View Full Code Here

Examples of org.apache.ivory.IvoryException

            props.put("ivoryInPaths", pathsWithPartitions.toString());
            props.put("ivoryInputFeeds", feed.getName());
            replicationWF.setConfiguration(getCoordConfig(props));
            replicationAction.setWorkflow(replicationWF);
        } catch (Exception e) {
            throw new IvoryException("Unable to create replication workflow", e);
        }
        return replicationAction;

    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

        }
    }

    private void validateUpdate(Entity oldEntity, Entity newEntity) throws IvoryException {
        if (oldEntity.getEntityType() != newEntity.getEntityType() || !oldEntity.equals(newEntity))
            throw new IvoryException(oldEntity.toShortString() + " can't be updated with " + newEntity.toShortString());

        if (oldEntity.getEntityType() == EntityType.CLUSTER)
            throw new IvoryException("Update not supported for clusters");

        String[] props = oldEntity.getEntityType().getImmutableProperties();
        for (String prop : props) {
            Object oldProp, newProp;
            try {
                oldProp = PropertyUtils.getProperty(oldEntity, prop);
                newProp = PropertyUtils.getProperty(newEntity, prop);
            } catch (Exception e) {
                throw new IvoryException(e);
            }
            if (!ObjectUtils.equals(oldProp, newProp))
                throw new ValidationException(oldEntity.toShortString() + ": " + prop + " can't be changed");
        }
    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

        if (referencedBy != null && referencedBy.length > 0) {
            StringBuffer messages = new StringBuffer();
            for (Pair<String, EntityType> ref : referencedBy) {
                messages.append(ref).append("\n");
            }
            throw new IvoryException(entity.getName() + "(" + entity.getEntityType() + ") cant " + "be removed as it is referred by "
                    + messages);
        }
    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

    public static void pushLibsToHDFS(String path, Cluster cluster, IvoryPathFilter pathFilter) throws IOException, IvoryException {
        String localPaths = StartupProperties.get().getProperty("system.lib.location");
        assert localPaths != null && !localPaths.isEmpty() : "Invalid value for system.lib.location";
        if (!new File(localPaths).isDirectory()) {
            throw new IvoryException(localPaths + " configured for system.lib.location doesn't contain any valid libs");
        }
       
        Configuration conf = ClusterHelper.getConfiguration(cluster);
        conf.setInt("ipc.client.connect.max.retries", 10);
    FileSystem fs = null;
    try {
      fs = FileSystem.get(conf);
    } catch (Exception e) {
      throw new IvoryException("Unable to connect to HDFS: "
          + ClusterHelper.getStorageUrl(cluster));
    }
        Path clusterPath = new Path(path);
        if(!fs.exists(clusterPath))
            fs.mkdirs(clusterPath);
View Full Code Here

Examples of org.apache.ivory.IvoryException

                fs.mkdirs(libPath);

            SharedLibraryHostingService.pushLibsToHDFS(libPath.toString(), cluster, ivoryJarFilter);
        } catch (IOException e) {
            LOG.error("Failed to copy shared libs on cluster " + cluster.getName(), e);
            throw new IvoryException("Failed to copy shared libs on cluster " + cluster.getName(),e);
        }
    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

                LOG.debug(writer.getBuffer());
            }

            LOG.info("Marshalled " + jaxbElement.getDeclaredType() + " to " + outPath);
        } catch (Exception e) {
            throw new IvoryException("Unable to marshall app object", e);
        }
    }
View Full Code Here

Examples of org.apache.ivory.IvoryException

            FileSystem fs = coordPath.getFileSystem(ClusterHelper.getConfiguration(cluster));
            Path tempDir = new Path(coordPath, "../../logs");
            fs.mkdirs(tempDir);
            fs.setPermission(tempDir, new FsPermission((short) 511));
        } catch (Exception e) {
            throw new IvoryException("Unable to create temp dir in " + coordPath, e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.