Skip to content

Instantly share code, notes, and snippets.

View Amit88k's full-sized avatar

amit khandelwal Amit88k

View GitHub Profile
Approach 1: Using Map interface
Map in Java stores data in the form of key-value pair. Navigable Map is an extension of Sorted Map. Navigable Map adds functions to navigate for example higherKey method which is used to get the least key strictly greater than the given key.
Heap means the area of memory where Java objects are stored. Heap in general is located at bottom of address space and move upwards. whenever we create object using new operator or by any another means object is allocated memory from Heap and when object dies or garbage collected, memory goes back to Heap space in Java.
A lock is a thread synchronization mechanism like synchronized blocks. Locks are created using synchronized blocks, so it is not like we can get totally rid of the synchronized keyword.
To apply lock, we would import java.util.concurrent.locks.Lock interface.
Algotihm:
@Amit88k
Amit88k / 1. Indexing MongoDB data in Apache Solr
Last active January 5, 2023 21:17
Indexing MongoDB data in Apache Solr
Indexing data for fast and efficient retrieval is one of the important feture, that each application requires. I have used MongoDB to store data and Solr to index the data. Although MongoDB provides built-in full-text search capabilities but does not provide advanced indexing and search features.
I have used Linux OS environment for this Gist. The following softwares are required for this Gist-
- Java
- Python
- Apache Solr
- MongoDB
- Mongo Connector