Experimenting with RTree – JARs Created and Installed

It is Saturday morning and I am starting the text for this post. The process I used to get the RTree code ready and integrated into a test program that I will use to experiment in the next few days will be covered. As usual issues seem to appear and they need to get resolved.

Yesterday my wife and I brought in from our garage freezer a full pork butt that we purchased a month or so ago at Costco. Not sure how heavy it is but I recall looking for the largest package when we purchased it. Typically we split the butt into the two pieces that are packaged together. This time we decided to cook both at once. That way we can freeze most of it and use it as needed during the next month or two.

Growing up my parents did not consume pork. I learn to eat pork when I was 18 years of age. Since I tried it I liked it. My wife and I roast pork and consume it around half a dozen times a year.

On Friday around 08:00 PM we seasoned the meat, set the oven temperature at 300 F and put the roasts. We then got ready for bed and went to sleep. I woke up shortly after midnight. The pork was roasting at 300 F in our convection oven. We put some apple cider in the pans to add flavor and moisture. When I checked most of the apple cider had evaporated and the pans had a relatively thick layer of syrup. I decided to turn off the oven and went back to bed.

Today around 06:00 AM I added some apple cider to the pans and turned the oven back on. The roasts look very good. I am planning on turning off the oven around 10:30 AM. That would roughly give us 4 + 4 ½ = 8 ½ hours of cooking time. When done we will cut some potatoes and onions and will bake them with some seasoning for an hour at 400 F.

This morning after breakfast my wife and I started the dough to make chocolate cornetto. I enjoy making dough. With time you learn new techniques and are able to simplify and improve on recipes. We always follow the initial recipe down to a T. Once we consume the resulting product we discuss what we could do better on the next pass. We hope to have lunch ready around 01:00 PM. Will take pictures and make comments on my next post.

In this post I will cover the steps I took to get up and running the base scaffolding to experiment with the RTree data structure. I decided to use the davidmoten/rtree2 GitHub repository as a base for the RTree software. The code is written in Java and is rather extensive. The repo has 7 contributors. The RTree data structure is typically used in features in databases that implement Geohashing.

Microsoft Windows [Version 10.0.18363.592]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\John>cd ..

C:\Users>cd ..

C:\>cd users

C:\Users>cd John

C:\Users\John>cd workspace7

C:\Users\John\workspace7>git clone https://github.com/davidmoten/guava-mini.git
Cloning into 'guava-mini'...
remote: Enumerating objects: 281, done.
Rremote: Total 281 (delta 0), reused 0 (delta 0), pack-reused 281eceiving objects:  82% (23
Receiving objects: 100% (281/281), 32.69 KiB | 1.63 MiB/s, done.
Resolving deltas: 100% (88/88), done.

C:\Users\John\workspace7>dir
 Volume in drive C is OS
 Volume Serial Number is 26E8-87B0

 Directory of C:\Users\John\workspace7

01/31/2020  02:55 PM    <DIR>          .
01/31/2020  02:55 PM    <DIR>          ..
01/30/2020  01:32 PM    <DIR>          .metadata
01/31/2020  09:02 AM    <DIR>          .vscode
01/05/2020  07:15 AM    <DIR>          3DSurfaceArea
01/06/2020  11:52 AM    <DIR>          AlmostSorted
01/24/2020  12:49 PM    <DIR>          AStarSearch
12/05/2019  01:23 PM    <DIR>          BiggerIsGreater
12/22/2019  08:35 AM    <DIR>          DeterminingDNAHealth
01/08/2020  07:07 AM    <DIR>          EmasSupercomputer
01/31/2020  02:55 PM    <DIR>          guava-mini
01/31/2020  10:44 AM    <DIR>          HelloMaven
01/23/2020  08:05 AM    <DIR>          LarrysArray
12/03/2019  04:26 PM    <DIR>          MatrixLayerRotation
01/25/2020  08:07 AM    <DIR>          PriorityQ
01/30/2020  01:42 PM    <DIR>          rtree2
01/19/2020  09:16 AM    <DIR>          StacksReverseOrder
01/04/2020  07:51 AM    <DIR>          TheGridSearch
12/11/2019  10:09 AM    <DIR>          ToTrieOrNotToTrie
               0 File(s)              0 bytes
              19 Dir(s)  540,615,483,392 bytes free

C:\Users\John\workspace7>cd guava-mini

C:\Users\John\workspace7\guava-mini>git remote -v
origin  https://github.com/davidmoten/guava-mini.git (fetch)
origin  https://github.com/davidmoten/guava-mini.git (push)

C:\Users\John\workspace7\guava-mini>mvn clean install
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building guava-mini 0.1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.pom (10 KB at 18.4 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.5.1/maven-compiler-plugin-3.5.1.jar (50 KB at 450.0 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/mockito/mockito-core/1.10.8/mockito-core-1.10.8.pom
Downloaded: https://repo.maven.apache.org/maven2/org/mockito/mockito-core/1.10.8/mockito-core-1.10.8.pom (2 KB at 11.7 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom (481 B at 6.1 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom (6 KB at 62.4 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/mockito/mockito-core/1.10.8/mockito-core-1.10.8.jar
Downloaded: https://repo.maven.apache.org/maven2/org/mockito/mockito-core/1.10.8/mockito-core-1.10.8.jar (1123 KB at 4301.4 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ guava-mini ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ guava-mini ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\John\workspace7\guava-mini\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ guava-mini ---
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.7/plexus-compiler-api-2.7.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.7/plexus-compiler-api-2.7.pom (891 B at 10.2 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.7/plexus-compiler-2.7.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.7/plexus-compiler-2.7.pom (5 KB at 48.2 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.7/plexus-compiler-manager-2.7.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.7/plexus-compiler-manager-2.7.pom (711 B at 7.2 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.7/plexus-compiler-javac-2.7.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.7/plexus-compiler-javac-2.7.pom (792 B at 9.4 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compilers/2.7/plexus-compilers-2.7.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compilers/2.7/plexus-compilers-2.7.pom (2 KB at 17.1 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.7/plexus-compiler-manager-2.7.jar
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.7/plexus-compiler-api-2.7.jar
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.7/plexus-compiler-javac-2.7.jar
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.7/plexus-compiler-manager-2.7.jar (5 KB at 29.7 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.7/plexus-compiler-javac-2.7.jar (20 KB at 74.3 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.7/plexus-compiler-api-2.7.jar (26 KB at 81.2 KB/sec)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to C:\Users\John\workspace7\guava-mini\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ guava-mini ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\John\workspace7\guava-mini\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ guava-mini ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to C:\Users\John\workspace7\guava-mini\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ guava-mini ---
[INFO] Surefire report directory: C:\Users\John\workspace7\guava-mini\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.github.davidmoten.guavamini.Collections2Test
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.086 sec
Running com.github.davidmoten.guavamini.IteratorsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running com.github.davidmoten.guavamini.ListsTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running com.github.davidmoten.guavamini.ObjectsTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running com.github.davidmoten.guavamini.OptionalTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running com.github.davidmoten.guavamini.PreconditionsTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running com.github.davidmoten.guavamini.SetsTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec

Results :

Tests run: 47, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ guava-mini ---
[INFO] Building jar: C:\Users\John\workspace7\guava-mini\target\guava-mini-0.1.3-SNAPSHOT.jar
[INFO]
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ guava-mini ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ guava-mini ---
[INFO] Installing C:\Users\John\workspace7\guava-mini\target\guava-mini-0.1.3-SNAPSHOT.jar to C:\Users\John\.m2\repository\com\github\davidmoten\guava-mini\0.1.3-SNAPSHOT\guava-mini-0.1.3-SNAPSHOT.jar
[INFO] Installing C:\Users\John\workspace7\guava-mini\pom.xml to C:\Users\John\.m2\repository\com\github\davidmoten\guava-mini\0.1.3-SNAPSHOT\guava-mini-0.1.3-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.183 s
[INFO] Finished at: 2020-01-31T14:57:29-06:00
[INFO] Final Memory: 26M/309M
[INFO] ------------------------------------------------------------------------

C:\Users\John\workspace7\guava-mini>

I planned on using the Visual Studio Code IDE. In preparation for this post, since the RTree code repo uses Maven, I wrote the post Visual Studio Code for Java Maven (link should be here) in which I describe the steps to install the extensions and verify that Maven works in VSCode.

I typically write the text associated with a link, look up the link, and copy it in parenthesis until I complete the text for the post using MS Word. I use WordPress for my blog. In my previous paragraph when I went to look up the post Visual Studio Code for Java Maven I did not find it. I went back to look in my files and all was ready to be transferred to WordPress. I guess I forgot to generate the post in WordPress. So I will get it done right now and will get back to this post.

Not sure what I was thinking but I messed up with my previous and this post. I apologize in advance if you see some redundancy. Apparently I was working on a single post and left it for the following day. I then started a new one without noticing that I had missed posting the previous one. If you decide to skip this post, I understand. Sorry about that.

OK, back to this post. As you can see in the last few lines of the screen capture the rtree JAR and the pom.xml files were created. We will need the JAR file since it contains the RTree class and associated methods.

In my previous post I also download and build the guava-mini JAR. Once both JARs were created I had to update the pom.xml file for the test scaffolding in the HelloMaven project.

package com.canessa.maven.test;

// **** ****
import com.github.davidmoten.rtree2.RTree;
import com.github.davidmoten.rtree2.geometry.Geometry;
import com.github.davidmoten.rtree2.geometry.Point;

/**
 * Test scaffolding.
 */
public final class App {

    /**
     * 
     */
    private App() {
    }

    /**
     * Test scaffolding.
     */
    public static void main(String[] args) {

        // **** welcome message ****
        System.out.println("main <<< Hello World !!!");

        // // **** ****
        // RTree<String, Point> tree = RTree.maxChildren(5).create();

        // **** ****
        RTree<String, Geometry> tree = RTree.create();

        // **** exit message ****
        System.out.println("main <<< bye bye :o)");
    }
}

The App class implements the test scaffolding. At this point we are able to run the program and instantiate an RTree data structure in different ways. In a future post we will start experimenting with the RTree data structure now that all appears to be ready.

main <<< Hello World !!!
main <<< bye bye :o)

This output just verifies that all is well with the build of the test scaffolding.

I will not put the code in my GitHub repository because it is so short and simple.

If you have comments or questions regarding this, or any other post in this blog, or if you would like for me to serve of assistance with any phase in the SDLC (Software Development Life Cycle) of a project associated with a product or service, please do not hesitate and leave me a note below. If you prefer, send me a private message using the following address:  john.canessa@gmail.com. I will reply as soon as possible.

Keep on reading and experimenting. It is the best way to learn, refresh your knowledge and enhance your developer toolset!

John

Twitter:  @john_canessa

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.