Package org.apache.falcon.entity.v0.feed

Examples of org.apache.falcon.entity.v0.feed.Location


        assertLibs(fs, new Path("/project/falcon/working/libext/FEED/retention"));
        assertLibs(fs, new Path("/project/falcon/working/libext/PROCESS"));

        String tmpFileName = TestContext.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Feed feed = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(new File(tmpFileName));
        Location location = new Location();
        location.setPath("fsext://global:00/falcon/test/input/${YEAR}/${MONTH}/${DAY}/${HOUR}");
        location.setType(LocationType.DATA);
        Cluster cluster = feed.getClusters().getClusters().get(0);
        cluster.setLocations(new Locations());
        feed.getClusters().getClusters().get(0).getLocations().getLocations().add(location);

        File tmpFile = TestContext.getTempFile();
View Full Code Here


            String path = uri.getPath();
            final String finalPath = path.replaceAll(DOLLAR_EXPR_START_NORMALIZED, DOLLAR_EXPR_START_REGEX)
                                         .replaceAll(EXPR_CLOSE_NORMALIZED, EXPR_CLOSE_REGEX);

            Location location = new Location();
            location.setPath(finalPath);
            location.setType(LocationType.valueOf(typeAndPath[0]));
            rawLocations.add(location);
        }

        this.storageUrl = rawStorageUrl;
        this.locations = rawLocations;
View Full Code Here

        return feedBasePaths.toString();
    }

    @Override
    public String getUriTemplate(LocationType locationType) {
        Location locationForType = null;
        for (Location location : locations) {
            if (location.getType() == locationType) {
                locationForType = location;
                break;
            }
        }

        if (locationForType == null) {
            return "/tmp";
        }

        // normalize the path so trailing and double '/' are removed
        Path locationPath = new Path(locationForType.getPath());
        locationPath = locationPath.makeQualified(getDefaultUri(), getWorkingDir());

        if (isRelativePath(locationPath)) {
            locationPath = new Path(storageUrl + locationPath);
        }
View Full Code Here

            if (loc.getType() == type) {
                return loc;
            }
        }

        Location loc = new Location();
        loc.setPath("/tmp");
        loc.setType(type);
        return loc;
    }
View Full Code Here

        CurrentUser.authenticate(USER);
    }

    @Test
    public void testGetType() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar");
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage(FileSystemStorage.FILE_SYSTEM_URL, locations);
        Assert.assertEquals(storage.getType(), Storage.TYPE.FILESYSTEM);
View Full Code Here

        for (Location loc : locations.getLocations()) {
            if (loc.getType() == type) {
                return loc;
            }
        }
        Location loc = new Location();
        loc.setPath("/tmp");
        loc.setType(type);
        return loc;
    }
View Full Code Here

                storage.getUriTemplate(LocationType.META));
    }

    @Test
    public void testGetUriTemplateForData() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar");
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("jail://global:00", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "jail://global:00/foo/bar");
View Full Code Here

        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "jail://global:00/foo/bar");
    }

    @Test
    public void testFSHomeDir() {
        final Location location = new Location();
        location.setPath("foo/bar"); // relative path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getWorkingDir().toString(), "/user/falcon");
View Full Code Here

        Assert.assertEquals(storage.getWorkingDir().toString(), "/user/falcon");
    }

    @Test
    public void testGetUriTemplateForDataWithRelativePath() throws Exception {
        final Location location = new Location();
        location.setPath("foo/bar"); // relative path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA),
View Full Code Here

                "hdfs://localhost:41020/user/" + USER + "/foo/bar");
    }

    @Test
    public void testGetUriTemplateForDataWithAbsolutePath() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar"); // absolute path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "hdfs://localhost:41020/foo/bar");
View Full Code Here

TOP

Related Classes of org.apache.falcon.entity.v0.feed.Location

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.