Comments (6)
This is a good suggestion, thanks. And fairly easy to implement.
I'll look into adding some proper support as suggested over the next few days.
However in the meantime, there is a way to achieve this in the current release,
even though it's a bit awkward. (I guess you might have done this already...)
You can subclass HashIndex as (say) CustomHashIndex, and override the
getIndexMap() method. That method should return the same ConcurrentMap every
time it's called, but you can construct the map with concurrency/load factor
however you like. Your effectively custom index would then be usable with
CQEngine as normal.
Expect less awkward support for this in the next few days, in the built-in
HashIndex and others. Hopefully I'll get time to package this as a 1.0.1
release at the weekend.
Original comment by [email protected]
on 12 Nov 2012 at 1:47
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from cqengine.
EDIT: actually subclassing alone won't be enough. The current code access the
map field directly. Grrr. Theoretically for [unvalidated] performance reasons.
So the temporary workaround might be to copy and paste the code into a
subclass. ...yes better support for this is definitely required.
Original comment by [email protected]
on 12 Nov 2012 at 1:54
from cqengine.
Thanks, looking forward to the 1.0.1.
Original comment by [email protected]
on 12 Nov 2012 at 1:59
from cqengine.
Original comment by [email protected]
on 13 Nov 2012 at 11:24
- Changed state: Started
from cqengine.
Changes in trunk, will prepare 1.0.1 release over the next few days.
Original comment by [email protected]
on 16 Nov 2012 at 12:02
from cqengine.
Done.
HashIndex, NavigableIndex and CompoundIndex now optionally accept Factories to
customize the construction of maps and sets which those indexes use internally.
Example of new methods added to HashIndex:
public static <A,O> HashIndex<A,O> onAttribute(
Factory<ConcurrentMap<A,StoredResultSet<O>>> indexMapFactory,
Factory<StoredResultSet<O>> valueSetFactory,
Attribute<O,A> attribute)
Release 1.0.1 is queued for sync with maven central.
Original comment by [email protected]
on 17 Nov 2012 at 11:29
- Changed state: Done
from cqengine.
Related Issues (20)
- Reenable cached hashCode
- Support for java.util.Optional
- [Question] How does CQEngine pick the appropriate index to query?
- most longest prefix value exist in the column value but it doesn't intersect with other columns values in the query that we need part of query retrieval HOT 7
- Support STRICT_REPLACEMENT in ObjectLockingIndexedCollection/ConcurrentIndexedCollection
- TransactionalIndexedCollection support for UniqueIndex is broken
- Support for attribute accessors for Java record type HOT 1
- Kryo generates InaccessibleObjectException - Make Dependencies "Java 17 compatible"
- Bug in AttributeOrdersComparator HOT 5
- Offheap cache visibility HOT 1
- Support for ANTLR 4.10.1 HOT 12
- Does it support SQL statistics queries HOT 3
- Thread blocked when using Materialized View Sort For the Longest Prefix for CSV that contain more than 11 K rows HOT 3
- Error while parsing SQL NOT LIKE query HOT 1
- Error while parsing SQL LIKE '%%%' query
- java.lang.IllegalStateException thrown in the getGenericType(Member member) method of AttributeBytecodeGenerator.java
- CQNGrammar Sources missing from master HOT 1
- What is use of sqlite-jdbc in cqengine HOT 2
- Index updated even though objectStore is not modified during IndexedCollection add HOT 2
- Does CQEngine compatible with Java 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cqengine.