Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
backport of laziness for Lucene indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
robfrank committed Jul 18, 2017
1 parent 4c9d73a commit 534874f
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 1 deletion.
190 changes: 190 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- ~ Copyright 2010-2016 Luca Garulli (l.garulli(at)orientechnologies.com)
~ ~ Licensed 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. -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-parent</artifactId>
<version>2.2.24-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<artifactId>orientdb-community-spatial</artifactId>

<name>OrientDB Community Distribution with Spatial support</name>

<properties>
<VERSION>${project.version}</VERSION>
<BUILD>${implementation.build}; ${maven.build.timestamp}</BUILD>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-tools</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-lucene</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-spatial</artifactId>
<version>${project.parent.version}</version>
<classifier>dist</classifier>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-community</artifactId>
<version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-test-commons</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unzip-community</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<stripVersion>true</stripVersion>
<artifactItems>
<artifactItem>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-community</artifactId>
<version>${project.parent.version}</version>
<overWrite>true</overWrite>
<type>zip</type>
</artifactItem>
</artifactItems>
<!--<includes>**/databases/demodb</includes>-->
<!--<outputDirectory>${project.build.directory}/databases</outputDirectory>-->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>distribution-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/archive.xml</descriptor>
</descriptors>
<filters>
<filter></filter>
</filters>
<ignoreDirFormatExtensions>false</ignoreDirFormatExtensions>
<tarLongFileMode>gnu</tarLongFileMode>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>start-orient</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="start OrientDB server on localhost">
<exec executable="${project.build.directory}/${project.build.finalName}.dir/${project.build.finalName}/bin/server.sh"
spawn="true">
<env key="ORIENTDB_ROOT_PASSWORD" value="root"/>
</exec>
</target>
</configuration>
</execution>

<execution>
<id>stop-orient</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="stop the running OrientDB server on localhost">
<exec executable="${project.build.directory}/${project.build.finalName}.dir/${project.build.finalName}/bin/shutdown.sh"
spawn="false">
</exec>
</target>
</configuration>

</execution>
</executions>
</plugin>

</plugins>
</build>

</profile>

</profiles>
</project>
34 changes: 34 additions & 0 deletions distribution/src/main/assembly/archive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>

<id>distribution</id>

<formats>
<format>dir</format>
<format>tar.gz</format>
<format>zip</format>
</formats>

<fileSets>
<!--
| copy benchmarks scripts
-->
<fileSet>
<directory>${project.build.directory}/orientdb-community-${project.version}</directory>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
<!--
| all artifacts in a /lib dir
-->
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*:jar:*</include>
</includes>
</dependencySet>

</dependencySets>

</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public Object get(Object key) {

@Override
public Object getInTx(Object key, OLuceneTxChanges changes) {
openIfClosed();
updateLastAccess();

try {
if (key instanceof Map) {
return newGeoSearch((Map<String, Object>) key, changes);
Expand All @@ -90,6 +93,7 @@ private Object newGeoSearch(Map<String, Object> key, OLuceneTxChanges changes) t
public void put(Object key, Object value) {

if (key instanceof OIdentifiable) {
openIfClosed();

ODocument location = ((OIdentifiable) key).getRecord();
Collection<OIdentifiable> container = (Collection<OIdentifiable>) value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.orientechnologies.orient.core.sql.functions.OSQLFunctionFactory;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

Expand All @@ -48,7 +49,7 @@ public class OSpatialFunctionsFactory implements OSQLFunctionFactory {
}

public static void register(final String iName, final Object iImplementation) {
FUNCTIONS.put(iName.toLowerCase(), iImplementation);
FUNCTIONS.put(iName.toLowerCase(Locale.ENGLISH), iImplementation);
}

@Override
Expand Down

0 comments on commit 534874f

Please sign in to comment.