This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a commit to branch mbtiles-perf
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
The following commit(s) were added to refs/heads/mbtiles-perf by this push:
new 310aac8d Remove batch operation in TileStore
310aac8d is described below
commit 310aac8ddfb1153389acd5afb49333ae4de411ff
Author: Bertil Chapuis <[email protected]>
AuthorDate: Tue Aug 22 17:18:10 2023 +0200
Remove batch operation in TileStore
---
.../baremaps/benchmarks/MBTilesBenchmark.java | 22 ----------------------
.../org/apache/baremaps/tilestore/TileStore.java | 15 ---------------
.../baremaps/tilestore/mbtiles/MBTilesStore.java | 1 -
.../org/apache/baremaps/utils/SqliteUtils.java | 3 +--
.../baremaps/workflow/tasks/ExportVectorTiles.java | 2 +-
5 files changed, 2 insertions(+), 41 deletions(-)
diff --git
a/baremaps-benchmark/src/main/java/org/apache/baremaps/benchmarks/MBTilesBenchmark.java
b/baremaps-benchmark/src/main/java/org/apache/baremaps/benchmarks/MBTilesBenchmark.java
index 8d170729..468e884a 100644
---
a/baremaps-benchmark/src/main/java/org/apache/baremaps/benchmarks/MBTilesBenchmark.java
+++
b/baremaps-benchmark/src/main/java/org/apache/baremaps/benchmarks/MBTilesBenchmark.java
@@ -66,28 +66,6 @@ public class MBTilesBenchmark {
}
}
- @Benchmark
- @BenchmarkMode(Mode.SingleShotTime)
- public void writeMBTilesBatch(MBTilesBenchmark benchmark) throws
TileStoreException {
- var coords = new ArrayList<TileCoord>();
- var buffers = new ArrayList<ByteBuffer>();
- for (int i = 0; i < benchmark.iterations; i++) {
- var bytes = new byte[1 << 16];
- random.nextBytes(bytes);
- coords.add(new TileCoord(0, 0, i));
- buffers.add(ByteBuffer.wrap(bytes));
- if (coords.size() == 100) {
- random.nextBytes(bytes);
- mbTilesStore.write(coords, buffers);
- coords.clear();
- buffers.clear();
- }
- }
- mbTilesStore.write(coords, buffers);
- coords.clear();
- buffers.clear();
- }
-
public static void main(String[] args) throws RunnerException {
Options opt =
new
OptionsBuilder().include(MBTilesBenchmark.class.getSimpleName()).forks(1).build();
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/tilestore/TileStore.java
b/baremaps-core/src/main/java/org/apache/baremaps/tilestore/TileStore.java
index 44681044..55185019 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/tilestore/TileStore.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/tilestore/TileStore.java
@@ -30,21 +30,6 @@ public interface TileStore {
*/
ByteBuffer read(TileCoord tileCoord) throws TileStoreException;
- /**
- * Reads the content of several tiles.
- *
- * @param tileCoords the tile coordinates
- * @return the content of the tiles
- * @throws TileStoreException
- */
- default List<ByteBuffer> read(List<TileCoord> tileCoords) throws
TileStoreException {
- var blobs = new ArrayList<ByteBuffer>(tileCoords.size());
- for (var tileCoord : tileCoords) {
- blobs.add(read(tileCoord));
- }
- return blobs;
- }
-
/**
* Writes the content of a tile.
*
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/tilestore/mbtiles/MBTilesStore.java
b/baremaps-core/src/main/java/org/apache/baremaps/tilestore/mbtiles/MBTilesStore.java
index 7e211dbf..a5cb03e0 100644
---
a/baremaps-core/src/main/java/org/apache/baremaps/tilestore/mbtiles/MBTilesStore.java
+++
b/baremaps-core/src/main/java/org/apache/baremaps/tilestore/mbtiles/MBTilesStore.java
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.baremaps.tilestore.TileCoord;
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/utils/SqliteUtils.java
b/baremaps-core/src/main/java/org/apache/baremaps/utils/SqliteUtils.java
index 468cb95a..d2403146 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/utils/SqliteUtils.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/utils/SqliteUtils.java
@@ -25,6 +25,7 @@ import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
+import javax.sql.DataSource;
import org.sqlite.SQLiteConfig;
import org.sqlite.SQLiteConfig.JournalMode;
import org.sqlite.SQLiteConfig.LockingMode;
@@ -32,8 +33,6 @@ import org.sqlite.SQLiteConfig.SynchronousMode;
import org.sqlite.SQLiteConfig.TempStore;
import org.sqlite.SQLiteDataSource;
-import javax.sql.DataSource;
-
/** A helper class for creating executing sql scripts onto a SQLite database */
public final class SqliteUtils {
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExportVectorTiles.java
b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExportVectorTiles.java
index ab2c3684..8b5f5a84 100644
---
a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExportVectorTiles.java
+++
b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExportVectorTiles.java
@@ -75,7 +75,7 @@ public record ExportVectorTiles(
.peek(new ProgressLogger<>(count, 5000));
StreamUtils.batch(stream, Runtime.getRuntime().availableProcessors() * 2)
- .forEach(new TileChannel(sourceTileStore, targetTileStore));
+ .forEach(new TileChannel(sourceTileStore, targetTileStore));
}
private TileStore sourceTileStore(Tileset tileset, DataSource datasource) {