Package org.apache.falcon.client

Examples of org.apache.falcon.client.FalconCLIException


        } else if (optionsList.contains(CONTINUE_OPT)) {
            result = client.rerunInstances(type, entity, start, end, colo, clusters, sourceClusters);
        } else if (optionsList.contains(LOG_OPT)) {
            result = client.getLogsOfInstances(type, entity, start, end, colo, runid);
        } else {
            throw new FalconCLIException("Invalid command");
        }

        OUT.get().println(result);
    }
View Full Code Here


    private void validateInstanceCommands(Set<String> optionsList,
                                          String entity, String type,
                                          String start, String colo) throws FalconCLIException {

        if (entity == null || entity.equals("")) {
            throw new FalconCLIException("Missing argument: name");
        }

        if (type == null || type.equals("")) {
            throw new FalconCLIException("Missing argument: type");
        }

        if (colo == null || colo.equals("")) {
            throw new FalconCLIException("Missing argument: colo");
        }

        if (!optionsList.contains(RUNNING_OPT)) {
            if (start == null || start.equals("")) {
                throw new FalconCLIException("Missing argument: start");
            }
        }

        if (optionsList.contains(CLUSTERS_OPT)) {
            if (optionsList.contains(RUNNING_OPT)
                    || optionsList.contains(LOG_OPT)
                    || optionsList.contains(STATUS_OPT)) {
                throw new FalconCLIException("Invalid argument: clusters");
            }
        }

        if (optionsList.contains(SOURCECLUSTER_OPT)) {
            if (optionsList.contains(RUNNING_OPT)
                    || optionsList.contains(LOG_OPT)
                    || optionsList.contains(STATUS_OPT) || !type.equals("feed")) {
                throw new FalconCLIException("Invalid argument: sourceClusters");
            }
        }
    }
View Full Code Here

            validateColo(optionsList);
            result = client.getEntityList(entityType);
        } else if (optionsList.contains(HELP_CMD)) {
            OUT.get().println("Falcon Help");
        } else {
            throw new FalconCLIException("Invalid command");
        }
        OUT.get().println(result);
    }
View Full Code Here

    private void validateFilePath(String filePath)
        throws FalconCLIException {

        if (filePath == null || filePath.equals("")) {
            throw new FalconCLIException("Missing argument: file");
        }
    }
View Full Code Here

    private void validateColo(Set<String> optionsList)
        throws FalconCLIException {

        if (optionsList.contains(COLO_OPT)) {
            throw new FalconCLIException("Invalid argument : " + COLO_OPT);
        }
    }
View Full Code Here

    private void validateEntityName(String entityName)
        throws FalconCLIException {

        if (entityName == null || entityName.equals("")) {
            throw new FalconCLIException("Missing argument: name");
        }
    }
View Full Code Here

    private void validateEntityType(String entityType)
        throws FalconCLIException {

        if (entityType == null || entityType.equals("")) {
            throw new FalconCLIException("Missing argument: type");
        }
    }
View Full Code Here

            if (prop.containsKey("falcon.url")) {
                url = prop.getProperty("falcon.url");
            }
        }
        if (url == null) {
            throw new FalconCLIException("Failed to get falcon url from cmdline, or environment or client properties");
        }

        return url;
    }
View Full Code Here

        } else if (optionsList.contains(CONTINUE_OPT)) {
            result = client.rerunInstances(type, entity, start, end, colo, clusters, sourceClusters);
        } else if (optionsList.contains(LOG_OPT)) {
            result = client.getLogsOfInstances(type, entity, start, end, colo, runid);
        } else {
            throw new FalconCLIException("Invalid command");
        }

        OUT.get().println(result);
    }
View Full Code Here

    private void validateInstanceCommands(Set<String> optionsList,
                                          String entity, String type,
                                          String start, String colo) throws FalconCLIException {

        if (entity == null || entity.equals("")) {
            throw new FalconCLIException("Missing argument: name");
        }

        if (type == null || type.equals("")) {
            throw new FalconCLIException("Missing argument: type");
        }

        if (colo == null || colo.equals("")) {
            throw new FalconCLIException("Missing argument: colo");
        }

        if (!optionsList.contains(RUNNING_OPT)) {
            if (start == null || start.equals("")) {
                throw new FalconCLIException("Missing argument: start");
            }
        }

        if (optionsList.contains(CLUSTERS_OPT)) {
            if (optionsList.contains(RUNNING_OPT)
                    || optionsList.contains(LOG_OPT)
                    || optionsList.contains(STATUS_OPT)
                    || optionsList.contains(SUMMARY_OPT)) {
                throw new FalconCLIException("Invalid argument: clusters");
            }
        }

        if (optionsList.contains(SOURCECLUSTER_OPT)) {
            if (optionsList.contains(RUNNING_OPT)
                    || optionsList.contains(LOG_OPT)
                    || optionsList.contains(STATUS_OPT)
                    || optionsList.contains(SUMMARY_OPT) || !type.equals("feed")) {
                throw new FalconCLIException("Invalid argument: sourceClusters");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.falcon.client.FalconCLIException

Copyright © 2018 www.massapicom. 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.