Package org.apache.oozie.service

Examples of org.apache.oozie.service.ShareLibService


        String[] argsCreate = { "create", "-fs", outPath, "-locallib", libDirectory.getParentFile().getAbsolutePath() };
        assertEquals(0, execOozieSharelibCLICommands(argsCreate));

        FileSystem fs = getTargetFileSysyem();
        ShareLibService sharelibService = getServices().get(ShareLibService.class);

        // test files in new folder
        assertEquals(9, fs.getFileStatus(new Path(sharelibService.getLatestLibPath(getDistPath(),
                ShareLibService.SHARED_LIB_PREFIX), "file1")).getLen());
        assertEquals(10, fs.getFileStatus(new Path(sharelibService.getLatestLibPath(getDistPath(),
                ShareLibService.SHARED_LIB_PREFIX), "file2")).getLen());

    }
View Full Code Here


    protected void addShareLib(Configuration conf, String[] actionShareLibNames)
            throws ActionExecutorException {
        if (actionShareLibNames != null) {
            try {
                ShareLibService shareLibService = Services.get().get(ShareLibService.class);
                FileSystem fs = shareLibService.getFileSystem();
                if (fs != null) {
                  for (String actionShareLibName : actionShareLibNames) {
                        List<Path> listOfPaths = shareLibService.getShareLibJars(actionShareLibName);
                        if (listOfPaths != null && !listOfPaths.isEmpty()) {

                            for (Path actionLibPath : listOfPaths) {
                                JobUtils.addFileToClassPath(actionLibPath, conf, fs);
                                DistributedCache.createSymlink(conf);
View Full Code Here

            }
        }
    }

    protected void addSystemShareLibForAction(Configuration conf) throws ActionExecutorException {
        ShareLibService shareLibService = Services.get().get(ShareLibService.class);
        // ShareLibService is null for test cases
        if (shareLibService != null) {
            try {
                List<Path> listOfPaths = shareLibService.getSystemLibJars(JavaActionExecutor.OOZIE_COMMON_LIBDIR);
                if (listOfPaths == null || listOfPaths.isEmpty()) {
                    throw new ActionExecutorException(ActionExecutorException.ErrorType.FAILED, "EJ001",
                            "Could not locate Oozie sharelib");
                }
                FileSystem fs = listOfPaths.get(0).getFileSystem(conf);
                for (Path actionLibPath : listOfPaths) {
                    JobUtils.addFileToClassPath(actionLibPath, conf, fs);
                    DistributedCache.createSymlink(conf);
                }
                listOfPaths = shareLibService.getSystemLibJars(getType());
                if (listOfPaths != null) {
                    for (Path actionLibPath : listOfPaths) {
                        JobUtils.addFileToClassPath(actionLibPath, conf, fs);
                        DistributedCache.createSymlink(conf);
                    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private JSONObject getShareLib(String sharelibKey) throws IOException {
        JSONObject json = new JSONObject();

        ShareLibService shareLibService = Services.get().get(ShareLibService.class);

        // for testcases.
        if (shareLibService == null) {
            return json;
        }
        JSONArray shareLibList = new JSONArray();

        Map<String, List<Path>> shareLibLauncherMap = shareLibService.getShareLib();
        if (sharelibKey != null && !sharelibKey.isEmpty()) {
            Pattern pattern = Pattern.compile(sharelibKey);
            for (String key : shareLibLauncherMap.keySet()) {
                if (pattern.matcher(key).matches() == true) {
                    JSONObject object = new JSONObject();
View Full Code Here

        }
    }

    @SuppressWarnings("unchecked")
    private JSONObject updateLocalShareLib(HttpServletRequest request) {
        ShareLibService shareLibService = Services.get().get(ShareLibService.class);
        JSONObject json = new JSONObject();
        json.put(JsonTags.SHARELIB_UPDATE_HOST, ConfigUtils.getOozieEffectiveUrl());
        try {
            json.putAll(shareLibService.updateShareLib());
            json.put(JsonTags.SHARELIB_UPDATE_STATUS, "Successful");
        }
        catch (Exception e) {
            json.put(JsonTags.SHARELIB_UPDATE_STATUS, e.getClass().getName() + ": " + e.getMessage());
        }
View Full Code Here

TOP

Related Classes of org.apache.oozie.service.ShareLibService

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.