forked from apache/jena
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-3026: spatial index per graph and kryo serialization
- Loading branch information
Showing
43 changed files
with
2,710 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.jena.system; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.jena.query.ReadWrite; | ||
import org.apache.jena.query.TxnType; | ||
import org.apache.jena.sparql.core.Transactional; | ||
|
||
/** | ||
* Txn variant for use with try-with-resources. Allows raising | ||
* checked exceptions in an idiomatic way. Closing the TxnCtl | ||
* instance will by default abort the transaction unless it | ||
* has been manually committed. | ||
* <p> | ||
* | ||
* Usage example: | ||
* <pre> | ||
* public void myMethod() throws IOException { | ||
* try (TxnCtl txn = TxnCtl.begin(dataset, TxnType.WRITE)) { | ||
* // Do work | ||
* // Must manually call commit on success. | ||
* txn.commit(); | ||
* } | ||
* } | ||
* </per> | ||
* | ||
* @param txn The transactional. | ||
* @param txnType The transaction type. | ||
* @return An instance of AutoCloseable that commits the transaction on success. | ||
*/ | ||
public class TxnCtl | ||
implements AutoCloseable | ||
{ | ||
private Transactional txn; | ||
private boolean b; | ||
|
||
private TxnCtl(Transactional txn, boolean b) { | ||
super(); | ||
this.txn = txn; | ||
this.b = b; | ||
} | ||
|
||
public static TxnCtl begin(Transactional txn, ReadWrite readWrite) { | ||
return begin(txn, TxnType.convert(readWrite)); | ||
} | ||
|
||
public static TxnCtl begin(Transactional txn, TxnType txnType) { | ||
Objects.requireNonNull(txn); | ||
Objects.requireNonNull(txnType); | ||
boolean b = txn.isInTransaction(); | ||
if ( b ) | ||
TxnOp.compatibleWithPromote(txnType, txn); | ||
else | ||
txn.begin(txnType); | ||
return new TxnCtl(txn, b); | ||
} | ||
|
||
public void commit() { | ||
if ( txn.isInTransaction() ) { | ||
|
||
// May have been explicit commit or abort. | ||
txn.commit(); | ||
} | ||
} | ||
|
||
@Override | ||
public void close() { | ||
if ( !b ) { | ||
if ( txn.isInTransaction() ) | ||
// May have been explicit commit or abort. | ||
txn.abort(); | ||
txn.end(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[INFO] Scanning for projects... | ||
[INFO] | ||
[INFO] -------------------< org.apache.jena:jena-geosparql >------------------- | ||
[INFO] Building Apache Jena - GeoSPARQL Engine 5.4.0-SNAPSHOT | ||
[INFO] --------------------------------[ jar ]--------------------------------- | ||
[INFO] | ||
[INFO] --- maven-dependency-plugin:3.7.1:tree (default-cli) @ jena-geosparql --- | ||
[INFO] org.apache.jena:jena-geosparql:jar:5.4.0-SNAPSHOT | ||
[INFO] +- io.github.galbiston:expiring-map:jar:1.0.2:compile | ||
[INFO] | \- org.slf4j:slf4j-api:jar:2.0.16:compile | ||
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile | ||
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile | ||
[INFO] +- org.apache.jena:jena-arq:jar:5.4.0-SNAPSHOT:compile | ||
[INFO] | +- org.apache.jena:jena-core:jar:5.4.0-SNAPSHOT:compile | ||
[INFO] | | +- org.apache.jena:jena-base:jar:5.4.0-SNAPSHOT:compile | ||
[INFO] | | | +- org.apache.commons:commons-csv:jar:1.13.0:compile | ||
[INFO] | | | +- commons-io:commons-io:jar:2.18.0:compile | ||
[INFO] | | | +- commons-codec:commons-codec:jar:1.18.0:compile | ||
[INFO] | | | +- org.apache.commons:commons-compress:jar:1.27.1:compile | ||
[INFO] | | | \- com.github.andrewoma.dexx:collection:jar:0.7:compile | ||
[INFO] | | +- org.apache.jena:jena-iri3986:jar:5.4.0-SNAPSHOT:compile | ||
[INFO] | | +- org.apache.jena:jena-iri:jar:5.4.0-SNAPSHOT:compile | ||
[INFO] | | \- org.roaringbitmap:RoaringBitmap:jar:1.3.0:compile | ||
[INFO] | +- com.google.code.gson:gson:jar:2.12.1:compile | ||
[INFO] | | \- com.google.errorprone:error_prone_annotations:jar:2.36.0:compile | ||
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:2.0.16:compile | ||
[INFO] | +- com.apicatalog:titanium-json-ld:jar:1.5.0:compile | ||
[INFO] | +- org.glassfish:jakarta.json:jar:2.0.1:compile | ||
[INFO] | +- com.google.protobuf:protobuf-java:jar:4.29.3:compile | ||
[INFO] | +- org.apache.thrift:libthrift:jar:0.21.0:compile | ||
[INFO] | \- org.apache.commons:commons-lang3:jar:3.17.0:compile | ||
[INFO] +- org.apache.sis.core:sis-referencing:jar:1.4:compile | ||
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.2:compile | ||
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:2.1.3:compile | ||
[INFO] | \- org.apache.sis.core:sis-metadata:jar:1.4:compile | ||
[INFO] | \- org.apache.sis.core:sis-utility:jar:1.4:compile | ||
[INFO] | +- org.opengis:geoapi:jar:3.0.2:compile | ||
[INFO] | \- javax.measure:unit-api:jar:2.1.3:compile | ||
[INFO] +- org.slf4j:jul-to-slf4j:jar:2.0.16:compile | ||
[INFO] +- org.locationtech.jts:jts-core:jar:1.20.0:compile | ||
[INFO] +- org.locationtech.jts.io:jts-io-common:jar:1.20.0:compile | ||
[INFO] | \- com.googlecode.json-simple:json-simple:jar:1.1.1:compile | ||
[INFO] +- org.jdom:jdom2:jar:2.0.6.1:compile | ||
[INFO] +- org.apache.commons:commons-collections4:jar:4.4:compile | ||
[INFO] +- org.apache.sedona:sedona-common:jar:1.6.0:compile | ||
[INFO] | +- org.apache.commons:commons-math3:jar:3.6.1:compile | ||
[INFO] | +- org.wololo:jts2geojson:jar:0.16.1:compile | ||
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.2:compile | ||
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.12.2:compile | ||
[INFO] | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.2:compile | ||
[INFO] | +- org.locationtech.spatial4j:spatial4j:jar:0.8:compile | ||
[INFO] | +- com.google.geometry:s2-geometry:jar:2.0.0:compile | ||
[INFO] | | \- com.google.guava:guava:jar:33.4.0-jre:compile | ||
[INFO] | | +- com.google.guava:failureaccess:jar:1.0.2:compile | ||
[INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile | ||
[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile | ||
[INFO] | | \- com.google.j2objc:j2objc-annotations:jar:3.0.0:compile | ||
[INFO] | +- com.uber:h3:jar:4.1.1:compile | ||
[INFO] | +- net.sf.geographiclib:GeographicLib-Java:jar:1.52:compile | ||
[INFO] | \- com.github.ben-manes.caffeine:caffeine:jar:3.2.0:compile | ||
[INFO] | \- org.jspecify:jspecify:jar:1.0.0:compile | ||
[INFO] +- com.esotericsoftware:kryo:jar:4.0.2:compile | ||
[INFO] | +- com.esotericsoftware:reflectasm:jar:1.11.3:compile | ||
[INFO] | +- com.esotericsoftware:minlog:jar:1.3.0:compile | ||
[INFO] | \- org.objenesis:objenesis:jar:2.5.1:compile | ||
[INFO] +- org.ow2.asm:asm:jar:8.0.1:compile | ||
[INFO] +- org.apache.sis.non-free:sis-embedded-data:jar:1.4:test | ||
[INFO] | +- org.apache.derby:derby:jar:10.15.2.0:test | ||
[INFO] | | \- org.apache.derby:derbyshared:jar:10.15.2.0:test | ||
[INFO] | \- org.apache.derby:derbytools:jar:10.15.2.0:test | ||
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.11.4:test | ||
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.11.4:test | ||
[INFO] | | +- org.opentest4j:opentest4j:jar:1.3.0:test | ||
[INFO] | | \- org.junit.platform:junit-platform-commons:jar:1.11.4:test | ||
[INFO] | +- junit:junit:jar:4.13.2:test | ||
[INFO] | | \- org.hamcrest:hamcrest-core:jar:1.3:test | ||
[INFO] | \- org.apiguardian:apiguardian-api:jar:1.1.2:test | ||
[INFO] \- org.apache.logging.log4j:log4j-slf4j2-impl:jar:2.24.3:test | ||
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.24.3:test (optional) | ||
[INFO] \- org.apache.logging.log4j:log4j-core:jar:2.24.3:test (optional) | ||
[INFO] ------------------------------------------------------------------------ | ||
[INFO] BUILD SUCCESS | ||
[INFO] ------------------------------------------------------------------------ | ||
[INFO] Total time: 0.634 s | ||
[INFO] Finished at: 2025-02-26T13:11:11+01:00 | ||
[INFO] ------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.