kopia lustrzana https://github.com/onthegomap/planetiler
fix CloseableConsumer class name (#454)
rodzic
4ea87224af
commit
b97d9d0e79
|
@ -554,7 +554,7 @@ public class VectorTile {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A vector tile encoded as a list of commands according to the
|
* A vector geometry encoded as a list of commands according to the
|
||||||
* <a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#43-geometry-encoding">vector tile
|
* <a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#43-geometry-encoding">vector tile
|
||||||
* specification</a>.
|
* specification</a>.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.onthegomap.planetiler.stats.Stats;
|
||||||
import com.onthegomap.planetiler.stats.Timer;
|
import com.onthegomap.planetiler.stats.Timer;
|
||||||
import com.onthegomap.planetiler.util.BinPack;
|
import com.onthegomap.planetiler.util.BinPack;
|
||||||
import com.onthegomap.planetiler.util.ByteBufferUtil;
|
import com.onthegomap.planetiler.util.ByteBufferUtil;
|
||||||
import com.onthegomap.planetiler.util.CloseableConusmer;
|
import com.onthegomap.planetiler.util.CloseableConsumer;
|
||||||
import com.onthegomap.planetiler.util.FileUtils;
|
import com.onthegomap.planetiler.util.FileUtils;
|
||||||
import com.onthegomap.planetiler.worker.WorkerPipeline;
|
import com.onthegomap.planetiler.worker.WorkerPipeline;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
|
@ -138,7 +138,7 @@ class ExternalMergeSort implements FeatureSort {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CloseableConusmer<SortableFeature> writerForThread() {
|
public CloseableConsumer<SortableFeature> writerForThread() {
|
||||||
return new ThreadLocalWriter();
|
return new ThreadLocalWriter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ class ExternalMergeSort implements FeatureSort {
|
||||||
|
|
||||||
/** Writer that a single thread can use to write features independent of writers used in other threads. */
|
/** Writer that a single thread can use to write features independent of writers used in other threads. */
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
private class ThreadLocalWriter implements CloseableConusmer<SortableFeature> {
|
private class ThreadLocalWriter implements CloseableConsumer<SortableFeature> {
|
||||||
|
|
||||||
private Chunk currentChunk;
|
private Chunk currentChunk;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.onthegomap.planetiler.geo.GeometryType;
|
||||||
import com.onthegomap.planetiler.geo.TileCoord;
|
import com.onthegomap.planetiler.geo.TileCoord;
|
||||||
import com.onthegomap.planetiler.render.RenderedFeature;
|
import com.onthegomap.planetiler.render.RenderedFeature;
|
||||||
import com.onthegomap.planetiler.stats.Stats;
|
import com.onthegomap.planetiler.stats.Stats;
|
||||||
import com.onthegomap.planetiler.util.CloseableConusmer;
|
import com.onthegomap.planetiler.util.CloseableConsumer;
|
||||||
import com.onthegomap.planetiler.util.CommonStringEncoder;
|
import com.onthegomap.planetiler.util.CommonStringEncoder;
|
||||||
import com.onthegomap.planetiler.util.DiskBacked;
|
import com.onthegomap.planetiler.util.DiskBacked;
|
||||||
import com.onthegomap.planetiler.util.LayerStats;
|
import com.onthegomap.planetiler.util.LayerStats;
|
||||||
|
@ -243,7 +243,7 @@ public final class FeatureGroup implements Iterable<FeatureGroup.TileFeatures>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a new feature writer that can be used for a single thread. */
|
/** Returns a new feature writer that can be used for a single thread. */
|
||||||
public CloseableConusmer<SortableFeature> writerForThread() {
|
public CloseableConsumer<SortableFeature> writerForThread() {
|
||||||
return sorter.writerForThread();
|
return sorter.writerForThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.onthegomap.planetiler.collection;
|
package com.onthegomap.planetiler.collection;
|
||||||
|
|
||||||
import com.onthegomap.planetiler.stats.Stats;
|
import com.onthegomap.planetiler.stats.Stats;
|
||||||
import com.onthegomap.planetiler.util.CloseableConusmer;
|
import com.onthegomap.planetiler.util.CloseableConsumer;
|
||||||
import com.onthegomap.planetiler.util.DiskBacked;
|
import com.onthegomap.planetiler.util.DiskBacked;
|
||||||
import com.onthegomap.planetiler.util.MemoryEstimator;
|
import com.onthegomap.planetiler.util.MemoryEstimator;
|
||||||
import com.onthegomap.planetiler.worker.WeightedHandoffQueue;
|
import com.onthegomap.planetiler.worker.WeightedHandoffQueue;
|
||||||
|
@ -45,7 +45,7 @@ interface FeatureSort extends Iterable<SortableFeature>, DiskBacked, MemoryEstim
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CloseableConusmer<SortableFeature> writerForThread() {
|
public CloseableConsumer<SortableFeature> writerForThread() {
|
||||||
return list::add;
|
return list::add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ interface FeatureSort extends Iterable<SortableFeature>, DiskBacked, MemoryEstim
|
||||||
* Returns a new writer that can be used to write features from a single thread independent of writers used from other
|
* Returns a new writer that can be used to write features from a single thread independent of writers used from other
|
||||||
* threads.
|
* threads.
|
||||||
*/
|
*/
|
||||||
CloseableConusmer<SortableFeature> writerForThread();
|
CloseableConsumer<SortableFeature> writerForThread();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default Iterator<SortableFeature> iterator() {
|
default Iterator<SortableFeature> iterator() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface CloseableConusmer<T> extends Consumer<T>, Closeable {
|
public interface CloseableConsumer<T> extends Consumer<T>, Closeable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void close() throws IOException {}
|
default void close() throws IOException {}
|
|
@ -14,7 +14,7 @@ import com.onthegomap.planetiler.geo.GeometryType;
|
||||||
import com.onthegomap.planetiler.geo.TileCoord;
|
import com.onthegomap.planetiler.geo.TileCoord;
|
||||||
import com.onthegomap.planetiler.render.RenderedFeature;
|
import com.onthegomap.planetiler.render.RenderedFeature;
|
||||||
import com.onthegomap.planetiler.stats.Stats;
|
import com.onthegomap.planetiler.stats.Stats;
|
||||||
import com.onthegomap.planetiler.util.CloseableConusmer;
|
import com.onthegomap.planetiler.util.CloseableConsumer;
|
||||||
import com.onthegomap.planetiler.util.Gzip;
|
import com.onthegomap.planetiler.util.Gzip;
|
||||||
import com.onthegomap.planetiler.writer.TileArchiveWriter;
|
import com.onthegomap.planetiler.writer.TileArchiveWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -40,7 +40,7 @@ class FeatureGroupTest {
|
||||||
|
|
||||||
private final FeatureSort sorter = FeatureSort.newInMemory();
|
private final FeatureSort sorter = FeatureSort.newInMemory();
|
||||||
private FeatureGroup features = new FeatureGroup(sorter, new Profile.NullProfile(), Stats.inMemory());
|
private FeatureGroup features = new FeatureGroup(sorter, new Profile.NullProfile(), Stats.inMemory());
|
||||||
private CloseableConusmer<SortableFeature> featureWriter = features.writerForThread();
|
private CloseableConsumer<SortableFeature> featureWriter = features.writerForThread();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testEmpty() {
|
void testEmpty() {
|
||||||
|
|
Ładowanie…
Reference in New Issue