Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.RevObject


            // Get Response
            InputStream is = HttpUtils.getResponseStream(connection);
            try {
                ObjectReader<RevObject> reader = DataStreamSerializationFactoryV1.INSTANCE
                        .createObjectReader();
                RevObject revObject = reader.read(objectId, is);
                if (localRepository != null) {
                    localRepository.objectDatabase().put(revObject);
                }
                object = Optional.of(revObject);
            } finally {
View Full Code Here


        while (!toSend.isEmpty()) {
            try {
                BinaryPackedObjects.Callback callback = new BinaryPackedObjects.Callback() {
                    @Override
                    public void callback(Supplier<RevObject> supplier) {
                        RevObject object = supplier.get();
                        progress.setProgress(progress.getProgress() + 1);
                        if (object instanceof RevCommit) {
                            RevCommit commit = (RevCommit) object;
                            toSend.remove(commit.getId());
                            roots.removeAll(commit.getParentIds());
View Full Code Here

        BinaryPackedObjects unpacker = new BinaryPackedObjects(localRepository.objectDatabase());
        BinaryPackedObjects.Callback callback = new BinaryPackedObjects.Callback() {
            @Override
            public void callback(Supplier<RevObject> supplier) {
                RevObject object = supplier.get();
                progress.setProgress(progress.getProgress() + 1);
                if (object instanceof RevCommit) {
                    RevCommit commit = (RevCommit) object;
                    want.remove(commit.getId());
                    have.removeAll(commit.getParentIds());
View Full Code Here

        LOGGER.info("PostOrderIterator.range took {}", sw.stop());

        try {
            LOGGER.info("writing objects to remote...");
            while (objects.hasNext()) {
                RevObject object = objects.next();
                funnel.funnel(object);
                objectCount++;
                callback.callback(Suppliers.ofInstance(object));
            }
        } catch (IOException e) {
View Full Code Here

        return new AbstractIterator<RevObject>() {
            @Override
            protected RevObject computeNext() {
                try {
                    ObjectId id = readObjectId(in);
                    RevObject revObj = objectReader.read(id, in);
                    return revObj;
                } catch (EOFException eof) {
                    return endOfData();
                } catch (IOException e) {
                    Throwables.propagate(e);
View Full Code Here

            return cache.getIfPresent(id, super.subject.get());
        }

        @Override
        public @Nullable <T extends RevObject> T getIfPresent(ObjectId id, Class<T> type) {
            RevObject object = cache.getIfPresent(id, super.subject.get());
            return object == null ? null : type.cast(object);
        }
View Full Code Here

            this.db = db;
        }

        @Override
        public RevObject call() throws Exception {
            RevObject object = db.get(id);
            return object;
        }
View Full Code Here

        @Nullable
        public RevObject getIfPresent(ObjectId id, ObjectDatabase db)
                throws IllegalArgumentException {
            final Cache<ObjectId, RevObject> cache = cacheProvider.get().get();
            RevObject obj = cache.getIfPresent(id);
            if (obj == null) {
                obj = db.getIfPresent(id);
                if (obj != null && isCacheable(obj, cacheFeatures)) {
                    cache.put(id, obj);
                }
View Full Code Here

        public <T extends RevObject> T get(ObjectId id, Class<T> type, ObjectDatabase db)
                throws IllegalArgumentException {

            final Cache<ObjectId, RevObject> cache = cacheProvider.get().get();

            RevObject object;
            try {
                object = cache.get(id, new ValueLoader(id, db));
            } catch (ExecutionException | UncheckedExecutionException e) {
                Throwable cause = e.getCause();
                Throwables.propagateIfInstanceOf(cause, IllegalArgumentException.class);
View Full Code Here

                    private Iterator<RevObject> delegate = db.getAll(miss, listener);

                    @Override
                    protected RevObject computeNext() {
                        if (delegate.hasNext()) {
                            RevObject next = delegate.next();
                            if (isCacheable(next, cacheFeatures)) {
                                cache.put(next.getId(), next);
                            }
                            return next;
                        }
                        return endOfData();
                    }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.RevObject

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.