Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Solandra - make LucandraFieldCache optional #92

Closed
wants to merge 11 commits into from

2 participants

@ceocoder

made your implementation of LucandraFieldCache optional and disabled by default,

on start-up on a bare node FC CF will be created but won't be used

@ceocoder ceocoder closed this
@jhorman

Can I ask (not sure if you answered this somewhere) why you did this. We are experiencing a problem with sorting in solandra, and we aren't yet sure if the LucandraFieldCache is the issue. I am planning on compiling my own version with this change to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 25 additions and 15 deletions.
  1. +3 −0  resources/solandra.properties
  2. +22 −15 src/lucandra/CassandraUtils.java
View
3  resources/solandra.properties
@@ -6,6 +6,9 @@ solandra.compression = false
#The consistency level of solandra reads and writes
solandra.consistency = ONE
+#use custom field cache implementation for solandra
+solandra.custom.fieldcache = false
+
#The number of milliseconds solandra will wait before
#checking to see if it's cache needs to be invalidated
#for a given index
View
37 src/lucandra/CassandraUtils.java
@@ -88,23 +88,30 @@
.name()));
useCompression = Boolean.valueOf(properties.getProperty("solandra.compression", "true"));
-
- try
- {
- setFinalStatic(FieldCache.class.getDeclaredField("DEFAULT"), new org.apache.lucene.search.LucandraFieldCache());
- logger.info("Sucessfully Hijacked FieldCacheImpl");
- }
- catch (SecurityException e)
- {
- logger.info("Unable to hijack the FieldCache");
- }
- catch (NoSuchFieldException e)
- {
- throw new RuntimeException(e);
+
+ if(Boolean.valueOf(properties.getProperty("solandra.custom.fieldcache", "false")))
+ {
+ try
+ {
+ setFinalStatic(FieldCache.class.getDeclaredField("DEFAULT"), new org.apache.lucene.search.LucandraFieldCache());
+ logger.info("Sucessfully Hijacked FieldCacheImpl");
+ }
+ catch (SecurityException e)
+ {
+ logger.info("Unable to hijack the FieldCache");
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new RuntimeException(e);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
}
- catch (Exception e)
+ else
{
- throw new RuntimeException(e);
+ logger.info("not using custom field cache")
}
Something went wrong with that request. Please try again.