mirror of https://github.com/apache/cassandra
Fix trigger directory detection code
Patch by Vijay, reviewed by jebllis for CASSANDRA-5826
This commit is contained in:
parent
98214bb6a0
commit
4f2fdc2e73
|
|
@ -6,6 +6,7 @@ conf/cassandra-rackdc.properties etc/cassandra
|
|||
conf/commitlog_archiving.properties etc/cassandra
|
||||
conf/cassandra-topology.properties etc/cassandra
|
||||
conf/log4j-tools.properties etc/cassandra
|
||||
conf/triggers/* etc/cassandra/triggers
|
||||
debian/cassandra.in.sh usr/share/cassandra
|
||||
debian/cassandra.conf etc/security/limits.d
|
||||
debian/cassandra-sysctl.conf etc/sysctl.d
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Installation:
|
|||
============
|
||||
change directory to <cassandra_src_dir>/examples/triggers
|
||||
run "ant jar"
|
||||
Copy build/trigger-example.jar to <cassandra_home>/triggers/
|
||||
Copy build/trigger-example.jar to <cassandra_conf>/triggers/
|
||||
Copy conf/* to <cassandra_home>/conf/
|
||||
Create column family configured in InvertedIndex.properties
|
||||
Example: Keyspace1.InvertedIndex as configured in InvertedIndex.properties
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class TriggerExecutor
|
|||
|
||||
private final Map<String, ITrigger> cachedTriggers = Maps.newConcurrentMap();
|
||||
private final ClassLoader parent = Thread.currentThread().getContextClassLoader();
|
||||
private final File triggerDirectory = new File(FBUtilities.cassandraHomeDir(), "triggers");
|
||||
private final File triggerDirectory = FBUtilities.cassandraTriggerDir();
|
||||
private volatile ClassLoader customClassLoader;
|
||||
|
||||
private TriggerExecutor()
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ public class FBUtilities
|
|||
private static ObjectMapper jsonMapper = new ObjectMapper(new JsonFactory());
|
||||
|
||||
public static final BigInteger TWO = new BigInteger("2");
|
||||
private static final String DEFAULT_TRIGGER_DIR = "triggers";
|
||||
|
||||
private static volatile InetAddress localInetAddress;
|
||||
private static volatile InetAddress broadcastInetAddress;
|
||||
|
|
@ -341,10 +342,16 @@ public class FBUtilities
|
|||
return scpurl.getFile();
|
||||
}
|
||||
|
||||
public static File cassandraHomeDir()
|
||||
public static File cassandraTriggerDir()
|
||||
{
|
||||
String libDir = new File(FBUtilities.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParent();
|
||||
return new File(new File(libDir).getParent());
|
||||
File triggerDir;
|
||||
if (System.getProperty("cassandra.triggers_dir") != null)
|
||||
triggerDir = new File(System.getProperty("cassandra.triggers_dir"));
|
||||
else
|
||||
triggerDir = new File(FBUtilities.class.getClassLoader().getResource(DEFAULT_TRIGGER_DIR).getFile());
|
||||
if (!triggerDir.exists())
|
||||
throw new RuntimeException("Trigger Directory doesnt exist, please create inside conf.");
|
||||
return triggerDir;
|
||||
}
|
||||
|
||||
public static String getReleaseVersionString()
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue