SlideShare a Scribd company logo
Apache Lucene, Solr and Java 9:
Opportunities and Challenges
Uwe Schindler
SD DataSolutions GmbH / Apache Software Foundation
thetaph1 – https://www.thetaphi.de
My Background
• Committer and PMC member of Apache Lucene and Solr - main focus is on
development of Lucene Core.
• Implemented fast numerical search and maintaining the new attribute-based text
analysis API. Well known as Generics and Sophisticated Backwards Compatibility
👮.
• Elasticsearch lover.
• Working as consultant and software architect at SD DataSolutions GmbH in
Bremen, Germany.
• Maintaining PANGAEA (Data Publisher for Earth & Environmental Science) where I
implemented the portal's geo-spatial retrieval functions with Apache Lucene Core
and Elasticsearch.
What is this talk about?
• History of Java 9 and Apache Lucene/Solr
• Migration and testing your with Java 9’s
module system (Jigsaw)
• Common pitfalls with Java 7 / Java 8 code,
that just used to work
• Performance?
History
Oracle & Apache Lucene
Remember 2011?
Chronology:
Friday, July 29, 2011
6
Reaction
Oracle (Rory O’Donnell) contacted Lucene PMC.
Weekly preview builds.
Other Open Source projects started to test with
preview builds of Java 8 – and later Java 9.
Easy and fast bug reporting!
Lucene, Solr and java 9 - opportunities and challenges
Java 9 and Apache Lucene
Going forward...
Lucene, Solr and java 9 - opportunities and challenges
What changed in Jigsaw?
(module system)
• Strong encapsulation:
– Code only sees classes from packages
exported to your code
– Private APIs are private – especially those in
the JDK!
• Your code behaves as if it will be executed
with a security manager! ☺
What else is wrong with Jigsaw?
#ReflectiveAccessToNonExportedTypes
#AwkwardStrongEncapsulation
• New since build 148 of Java 9
• Prevents reflective access to any class
from Java runtime
#AwkwardStrongEncapsulation: A non-public element of
an exported package can still be accessed via the
AccessibleObject::setAccessible method of the
core reflection API. The only way to strongly encapsulate
such an element is to move it to a non-exported package.
This makes it awkward, at best, to encapsulate the internals
of a package that defines a public API.
Undocumented APIs?
Unsafe, Byte Buffers & Co.
https://issues.apache.org/jira/browse/LUCENE-6989
https://bugs.openjdk.java.net/browse/JDK-4724038
Lucene, Solr and java 9 - opportunities and challenges
Unsafe got a new
method!?
Lucene, Solr and java 9 - opportunities and challenges
Other Changes
Compact Strings & Co.
Compact Strings
Java 9 internally stores strings in compact form,
if they only contain ISO-8859-1 characters
Indyfied String Concat
"Hallo " + 123 + ' ' + object +
" is a concatted string";
• Java 1.0 to 1.8: a chain of StringBuilder.appends()
• Java 9: Invokedynamic with StringConcatFactory:
String concat(String,int,char,Object,String)
Just a funny detail...
Hotspot Changes
Performance
Lucene, Solr and java 9 - opportunities and challenges
Intrinsics
java.util.Objects / java.util.Arrays
classes:
• Bounds checks
• Array comparisons (signed / unsigned)
• Array differences
Know this type of code?
Solution: Multi-Release JAR (JEP 238)
• Lucene adds plain Java implementations of
java.util.Objects and java.util.Arrays to own
codebase (with exact same signatures)
• After compilation all class files are “patched” to use Java 9
signatures and stored in separate folder
• Builds MR-JAR with:
– unmodified Java 8-compatible classes
– Patched classes with Java 9 signatures in extra folder
Garbage Collector!
G1GC
New Default Garbage Collector
• G1GC is now the default
– Previously it was ParallelGC
– No need to care in most cases, as Solr uses a
hardcoded default
• CMS collector deprecated!
– Warning on start of Solr!
– Migrate to G1GC?
$ java -XX:+UseConcMarkSweepGC
Java HotSpot(TM) 64-Bit Server VM
warning: Option UseConcMarkSweepGC was
deprecated in version 9.0 and will likely
be removed in a future release.
Why update your cluster to Java 9 ?
Improvements?
Lucene, Solr and java 9 - opportunities and challenges
Even more security with Elasticsearch!
No risk of bad plugins hacking Java internals!
• Slightly improved performance for some
queries!
• With coming Lucene patch (LUCENE-
7966):
– Compression of large blobs during indexing
(Elasticsearch JSON “_source”)
– Sorting with MMapDirectory
Thank you!
Questions?

More Related Content

PDF
2015 Java update and roadmap, JUG sevilla
PDF
Testing Alfresco extensions
PPTX
Nautilus
PDF
Java 8 in Anger, Devoxx France
PPTX
Designing and Testing Accumulo Iterators
PDF
Vba Macros Interoperability
PDF
Scala Days NYC 2016
PDF
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 
2015 Java update and roadmap, JUG sevilla
Testing Alfresco extensions
Nautilus
Java 8 in Anger, Devoxx France
Designing and Testing Accumulo Iterators
Vba Macros Interoperability
Scala Days NYC 2016
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 

What's hot (20)

PPTX
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
PDF
Microservices are ‘easy’ dependencies are hard
PPTX
Apache Zeppelin + Livy: Bringing Multi Tenancy to Interactive Data Analysis
ODP
Alfresco Devcon 2019 - Lightning Talk - Not-so-smart folders made smart(er)
PDF
轉接器模式與表象模式
PPTX
Java and the JVM
PDF
Refactoring to Java 8 (QCon New York)
PDF
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
PDF
Continuing Evolution of Perl: Highlights of ActivePerl 5.14
PPTX
Informix Java Driver Improvements 4.10.JC8
PDF
Project Jigsaw in JDK 9: Modularity Comes To Java
PPTX
Java 9 Functionality and Tooling
PPTX
Aci programmability
PPTX
Exploring Java Heap Dumps (Oracle Code One 2018)
PPTX
Implementing Micro Services Tasks (service discovery, load balancing etc.) - ...
PDF
How Reactive Streams & Akka Streams change the JVM Ecosystem
PPTX
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
PDF
Java Application Servers Are Dead!
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Microservices are ‘easy’ dependencies are hard
Apache Zeppelin + Livy: Bringing Multi Tenancy to Interactive Data Analysis
Alfresco Devcon 2019 - Lightning Talk - Not-so-smart folders made smart(er)
轉接器模式與表象模式
Java and the JVM
Refactoring to Java 8 (QCon New York)
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
Continuing Evolution of Perl: Highlights of ActivePerl 5.14
Informix Java Driver Improvements 4.10.JC8
Project Jigsaw in JDK 9: Modularity Comes To Java
Java 9 Functionality and Tooling
Aci programmability
Exploring Java Heap Dumps (Oracle Code One 2018)
Implementing Micro Services Tasks (service discovery, load balancing etc.) - ...
How Reactive Streams & Akka Streams change the JVM Ecosystem
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Java Application Servers Are Dead!
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Ad

Similar to Lucene, Solr and java 9 - opportunities and challenges (20)

PDF
The Diabolical Developer's Guide to Surviving Java 9
PPTX
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
PDF
How can your applications benefit from Java 9?
PDF
What to expect from Java 9
PDF
Java 9, JShell, and Modularity
PDF
How can your applications benefit from Java 9?
PDF
What's new in Java 8
PDF
Java 8
PDF
Java EE 8 - An instant snapshot
PDF
Java >= 9
PDF
Java SE 9 modules - an introduction (July 2018)
PPTX
What’s expected in Java 9
PPTX
Java 9 features
PDF
Java SE 9 modules (JPMS) - an introduction
ODP
Java 9 Features
PPTX
The do's and don'ts with java 9 (Devoxx 2017)
PDF
Java 9 preview
PPTX
Java 9 Module System Introduction
PPTX
Apache maven and its impact on java 9 (Java One 2017)
PDF
What's in the Latest Java
The Diabolical Developer's Guide to Surviving Java 9
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
How can your applications benefit from Java 9?
What to expect from Java 9
Java 9, JShell, and Modularity
How can your applications benefit from Java 9?
What's new in Java 8
Java 8
Java EE 8 - An instant snapshot
Java >= 9
Java SE 9 modules - an introduction (July 2018)
What’s expected in Java 9
Java 9 features
Java SE 9 modules (JPMS) - an introduction
Java 9 Features
The do's and don'ts with java 9 (Devoxx 2017)
Java 9 preview
Java 9 Module System Introduction
Apache maven and its impact on java 9 (Java One 2017)
What's in the Latest Java
Ad

More from Charlie Hull (13)

ODP
Finding the Bad Actor: Custom scoring & forensic name matching with Elastics...
PPT
Making sense of big data
ODP
Search Solutions 2015: Towards a new model of search relevance testing
PPT
Elasticsearch for Westcoast
PPT
FIBEP WMIC 2015 - How Infomedia upgraded their closed-source search engine to...
PPT
Enterprise Search Europe 2015: Fishing the big data streams - the future of ...
PPT
BioSolr - Searching the stuff of life - Lucene/Solr Revolution 2015
PPT
Bio solr building a better search for bioinformatics
PPT
Solr and Elasticsearch, a performance study
PPT
Turning search upside down with powerful open source search software
PPT
Intranet show and_tell_2010
PPT
Flax ovum search-across_the_enterprise
ODP
What's the story with Open Source?
Finding the Bad Actor: Custom scoring & forensic name matching with Elastics...
Making sense of big data
Search Solutions 2015: Towards a new model of search relevance testing
Elasticsearch for Westcoast
FIBEP WMIC 2015 - How Infomedia upgraded their closed-source search engine to...
Enterprise Search Europe 2015: Fishing the big data streams - the future of ...
BioSolr - Searching the stuff of life - Lucene/Solr Revolution 2015
Bio solr building a better search for bioinformatics
Solr and Elasticsearch, a performance study
Turning search upside down with powerful open source search software
Intranet show and_tell_2010
Flax ovum search-across_the_enterprise
What's the story with Open Source?

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
history of c programming in notes for students .pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
assetexplorer- product-overview - presentation
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Digital Strategies for Manufacturing Companies
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
System and Network Administration Chapter 2
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Softaken Excel to vCard Converter Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx
How to Migrate SBCGlobal Email to Yahoo Easily
assetexplorer- product-overview - presentation
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Computer Software and OS of computer science of grade 11.pptx
Transform Your Business with a Software ERP System
Digital Strategies for Manufacturing Companies
Adobe Illustrator 28.6 Crack My Vision of Vector Design
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Navsoft: AI-Powered Business Solutions & Custom Software Development
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Designing Intelligence for the Shop Floor.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
System and Network Administration Chapter 2
Reimagine Home Health with the Power of Agentic AI​
Softaken Excel to vCard Converter Software.pdf

Lucene, Solr and java 9 - opportunities and challenges

  • 1. Apache Lucene, Solr and Java 9: Opportunities and Challenges Uwe Schindler SD DataSolutions GmbH / Apache Software Foundation thetaph1 – https://www.thetaphi.de
  • 2. My Background • Committer and PMC member of Apache Lucene and Solr - main focus is on development of Lucene Core. • Implemented fast numerical search and maintaining the new attribute-based text analysis API. Well known as Generics and Sophisticated Backwards Compatibility 👮. • Elasticsearch lover. • Working as consultant and software architect at SD DataSolutions GmbH in Bremen, Germany. • Maintaining PANGAEA (Data Publisher for Earth & Environmental Science) where I implemented the portal's geo-spatial retrieval functions with Apache Lucene Core and Elasticsearch.
  • 3. What is this talk about? • History of Java 9 and Apache Lucene/Solr • Migration and testing your with Java 9’s module system (Jigsaw) • Common pitfalls with Java 7 / Java 8 code, that just used to work • Performance?
  • 7. Reaction Oracle (Rory O’Donnell) contacted Lucene PMC. Weekly preview builds. Other Open Source projects started to test with preview builds of Java 8 – and later Java 9. Easy and fast bug reporting!
  • 9. Java 9 and Apache Lucene Going forward...
  • 11. What changed in Jigsaw? (module system) • Strong encapsulation: – Code only sees classes from packages exported to your code – Private APIs are private – especially those in the JDK! • Your code behaves as if it will be executed with a security manager! ☺
  • 12. What else is wrong with Jigsaw? #ReflectiveAccessToNonExportedTypes #AwkwardStrongEncapsulation • New since build 148 of Java 9 • Prevents reflective access to any class from Java runtime #AwkwardStrongEncapsulation: A non-public element of an exported package can still be accessed via the AccessibleObject::setAccessible method of the core reflection API. The only way to strongly encapsulate such an element is to move it to a non-exported package. This makes it awkward, at best, to encapsulate the internals of a package that defines a public API.
  • 16. Unsafe got a new method!?
  • 19. Compact Strings Java 9 internally stores strings in compact form, if they only contain ISO-8859-1 characters
  • 20. Indyfied String Concat "Hallo " + 123 + ' ' + object + " is a concatted string"; • Java 1.0 to 1.8: a chain of StringBuilder.appends() • Java 9: Invokedynamic with StringConcatFactory: String concat(String,int,char,Object,String)
  • 21. Just a funny detail...
  • 24. Intrinsics java.util.Objects / java.util.Arrays classes: • Bounds checks • Array comparisons (signed / unsigned) • Array differences
  • 25. Know this type of code?
  • 26. Solution: Multi-Release JAR (JEP 238) • Lucene adds plain Java implementations of java.util.Objects and java.util.Arrays to own codebase (with exact same signatures) • After compilation all class files are “patched” to use Java 9 signatures and stored in separate folder • Builds MR-JAR with: – unmodified Java 8-compatible classes – Patched classes with Java 9 signatures in extra folder
  • 28. New Default Garbage Collector • G1GC is now the default – Previously it was ParallelGC – No need to care in most cases, as Solr uses a hardcoded default • CMS collector deprecated! – Warning on start of Solr! – Migrate to G1GC? $ java -XX:+UseConcMarkSweepGC Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
  • 29. Why update your cluster to Java 9 ? Improvements?
  • 31. Even more security with Elasticsearch! No risk of bad plugins hacking Java internals!
  • 32. • Slightly improved performance for some queries! • With coming Lucene patch (LUCENE- 7966): – Compression of large blobs during indexing (Elasticsearch JSON “_source”) – Sorting with MMapDirectory