Examples of CountingListener


Examples of org.locationtech.geogig.storage.BulkOpListener.CountingListener

                            return revFeature;
                        }

                    });

            CountingListener countingListener = BulkOpListener.newCountingListener();
            try {
                indexDatabase.putAll(objects, BulkOpListener.composite(listener, countingListener));
            } finally {
                features.close();
            }
            return countingListener.inserted();
        }
View Full Code Here

Examples of org.locationtech.geogig.storage.BulkOpListener.CountingListener

    private void copy(Set<ObjectId> ids, ObjectDatabase from, ObjectDatabase to,
            ProgressListener progress) {
        if (ids.isEmpty()) {
            return;
        }
        CountingListener countingListener = BulkOpListener.newCountingListener();
        to.putAll(from.getAll(ids), countingListener);
        int inserted = countingListener.inserted();
        progress.setProgress(progress.getProgress() + inserted);
    }
View Full Code Here

Examples of org.locationtech.geogig.storage.BulkOpListener.CountingListener

        PacketReadingIterator readingIterator = new PacketReadingIterator(in);

        Iterator<RevObject> asObjects = asObjects(readingIterator, callback);

        ObjectDatabase objectDatabase = repository.objectDatabase();
        CountingListener listener = BulkOpListener.newCountingListener();
        objectDatabase.putAll(asObjects, listener);
        LOGGER.info("Ingested %,d objects. Inserted: %,d. Already existing: %,d\n",
                listener.inserted() + listener.found(), listener.inserted(), listener.found());
        this.filtered = readingIterator.isFiltered();
    }
View Full Code Here

Examples of org.locationtech.geogig.storage.BulkOpListener.CountingListener

                    }
                });
            }
        };

        CountingListener countingListener = BulkOpListener.newCountingListener();
        listener = BulkOpListener.composite(countingListener, listener);
        database.putAll(objects, listener);
        return new IngestResults(countingListener.inserted(), countingListener.found());
    }
View Full Code Here

Examples of org.reactfx.inhibeans.value.CountingListener

                fireValueChangedEvent();
            }
        }

        A a = new A();
        CountingListener counter = new CountingListener(a);
        Guard g = a.block();
        a.set("x");
        assertEquals(0, counter.get());
        Guard h = a.block();
        g.close();
        assertEquals(0, counter.get());
        g.close();
        assertEquals(0, counter.get());
        h.close();
        assertEquals(1, counter.get());
    }
View Full Code Here

Examples of org.reactfx.inhibeans.value.CountingListener

public class IndicatorTest {

    @Test
    public void test() {
        Indicator indicator = new Indicator();
        CountingListener counter = new CountingListener(indicator);

        Guard g = indicator.on();

        assertEquals(1, counter.get());

        indicator.onWhile(() -> {});

        assertEquals(1, counter.get());

        g.close();

        assertEquals(2, counter.get());
    }
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.