You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by bc...@apache.org on 2023/08/22 15:20:07 UTC
[incubator-baremaps] branch mbtiles-perf updated (310aac8d -> c793110f)
This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a change to branch mbtiles-perf
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
discard 310aac8d Remove batch operation in TileStore
new c793110f Remove batch operation in TileStore
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (310aac8d)
\
N -- N -- N refs/heads/mbtiles-perf (c793110f)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/main/java/org/apache/baremaps/benchmarks/MBTilesBenchmark.java | 1 -
.../src/main/java/org/apache/baremaps/tilestore/TileStore.java | 2 --
2 files changed, 3 deletions(-)
[incubator-baremaps] 01/01: Remove batch operation in TileStore
Posted by bc...@apache.org.
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
commit c793110fc96dd36da8aa0bcbe5bd011bda23114b
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Tue Aug 22 17:18:10 2023 +0200
Remove batch operation in TileStore
---
.../baremaps/benchmarks/MBTilesBenchmark.java | 23 ----------------------
.../org/apache/baremaps/tilestore/TileStore.java | 17 ----------------
.../baremaps/tilestore/mbtiles/MBTilesStore.java | 1 -
.../org/apache/baremaps/utils/SqliteUtils.java | 3 +--
.../baremaps/workflow/tasks/ExportVectorTiles.java | 2 +-
5 files changed, 2 insertions(+), 44 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..18435fb3 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
@@ -18,7 +18,6 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.SecureRandom;
-import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import org.apache.baremaps.tilestore.TileCoord;
import org.apache.baremaps.tilestore.TileStoreException;
@@ -66,28 +65,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..c7288383 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
@@ -15,8 +15,6 @@ package org.apache.baremaps.tilestore;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
/** Represents a store for tiles. */
public interface TileStore {
@@ -30,21 +28,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) {