simplify configuration file loading; rename to cassandra.xml

patch by jbellis; reviewed by eevans for CASSANDRA-971

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@934505 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2010-04-15 18:17:42 +00:00
parent 999fb4d3c3
commit dd787f7fcb
9 changed files with 14 additions and 20 deletions

View File

@ -2,12 +2,17 @@ dev
* sstable versioning (CASSANDRA-389)
* bitmask matching in SliceRange queries (CASSANDRA-764)
* switched to slf4j logging (CASSANDRA-625)
* drain method to flush memtables and purge commit log prior to shutdown. (CASSANDRA-880)
* drain method to flush memtables and purge commit log prior to shutdown.
(CASSANDRA-880)
* access levels for authentication/authorization (CASSANDRA-900)
* add ReadRepairChance to CF definition (CASSANDRA-930)
* fix heisenbug in system tests, especially common on OS X (CASSANDRA-944)
* convert to byte[] keys internally and all public APIs (CASSANDRA-767)
* ability to alter schema definitions on a live cluster (CASSANDRA-44)
* renamed configuration file to cassandra.xml, and log4j.properties to
log4j-server.properties, which must now be loaded from
the classpath (which is how our scripts in bin/ have always done it)
(CASSANDRA-971)
0.6.1

View File

@ -3,6 +3,8 @@
Configuraton
------------
- Configuration file renamed to cassandra.xml and log4j.properties to
log4j-server.properties
- The ThriftAddress and ThriftPort directives have been renamed to
RPCAddress and RPCPort respectively.
- The keyspaces defined in storage-conf.xml are ignored on startup as a

View File

@ -104,7 +104,7 @@ launch_service()
foreground=$2
props=$3
class=$4
cassandra_parms="-Dstorage-config=$CASSANDRA_CONF"
cassandra_parms="-Dlog4j.configuration=log4j-server.properties"
if [ "x$pidpath" != "x" ]; then
cassandra_parms="$cassandra_parms -Dcassandra-pidfile=$pidpath"

View File

@ -44,7 +44,7 @@ set JAVA_OPTS=^
REM ***** CLASSPATH library setting *****
REM Ensure that any user defined CLASSPATH variables are not used on startup
set CLASSPATH=
set CLASSPATH=%CASSANDRA_HOME%\conf
REM For each jar in the CASSANDRA_HOME lib directory call append to build the CLASSPATH variable.
for %%i in (%CASSANDRA_HOME%\lib\*.jar) do call :append %%~fi
@ -57,7 +57,7 @@ goto :eof
:okClasspath
REM Include the build\classes directory so it works in development
set CASSANDRA_CLASSPATH=%CLASSPATH%;%CASSANDRA_HOME%\build\classes
set CASSANDRA_PARAMS=-Dcassandra -Dstorage-config="%CASSANDRA_CONF%" -Dcassandra-foreground=yes
set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
goto runDaemon
:runDaemon

View File

@ -50,10 +50,6 @@ public class CassandraDaemon {
private void setup() throws IOException
{
// log4j
String file = System.getProperty("storage-config") + File.separator + "log4j.properties";
PropertyConfigurator.configure(file);
listenPort = DatabaseDescriptor.getRpcPort();
listenAddr = DatabaseDescriptor.getRpcAddress();

View File

@ -33,7 +33,6 @@ import org.apache.cassandra.locator.AbstractReplicationStrategy;
import org.apache.cassandra.io.util.FileUtils;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.UUIDGen;
import org.apache.cassandra.utils.XMLUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -132,7 +131,7 @@ public class DatabaseDescriptor
private static IAuthenticator authenticator = new AllowAllAuthenticator();
private final static String STORAGE_CONF_FILE = "storage-conf.xml";
private final static String STORAGE_CONF_FILE = "cassandra.xml";
private static final UUID INITIAL_VERSION = new UUID(4096, 0); // has type nibble set to 1, everything else to zero.
private static UUID defsVersion = INITIAL_VERSION;
@ -140,17 +139,13 @@ public class DatabaseDescriptor
/**
* Try the storage-config system property, and then inspect the classpath.
*/
static String getStorageConfigPath()
static String getStorageConfigPath() throws ConfigurationException
{
String scp = System.getProperty("storage-config") + File.separator + STORAGE_CONF_FILE;
if (new File(scp).exists())
return scp;
// try the classpath
ClassLoader loader = DatabaseDescriptor.class.getClassLoader();
URL scpurl = loader.getResource(STORAGE_CONF_FILE);
if (scpurl != null)
return scpurl.getFile();
throw new RuntimeException("Cannot locate " + STORAGE_CONF_FILE + " via storage-config system property or classpath lookup.");
throw new ConfigurationException("Cannot locate " + STORAGE_CONF_FILE + " on the classpath");
}
private static int stageQueueSize_ = 4096;

View File

@ -60,10 +60,6 @@ public class CassandraDaemon
private void setup() throws IOException, TTransportException
{
// log4j
String file = System.getProperty("storage-config") + File.separator + "log4j.properties";
PropertyConfigurator.configure(file);
int listenPort = DatabaseDescriptor.getRpcPort();
InetAddress listenAddr = DatabaseDescriptor.getRpcAddress();