New port: databases/cassandra3: Highly scalable distributed database

Versions 1.X and 2.X existed previously, but were removed due to build issues.

PR:		226377
Submitted by:	Angelo Polo <language.devel@gmail.com>
This commit is contained in:
Yuri Victorovich 2019-01-28 06:12:18 +00:00
parent d450d456e4
commit bef05937a8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=491455
20 changed files with 871 additions and 2 deletions

2
GIDs
View File

@ -791,7 +791,7 @@ domoticz:*:847:
graylog:*:848:
chronyd:*:849:
qbittorrent:*:850:
# free: 851
cassandra:*:851:
# free: 852
_geodns:*:853:
# free: 854

2
UIDs
View File

@ -797,7 +797,7 @@ domoticz:*:847:847::0:0:domoticz user:/nonexistent:/usr/sbin/nologin
graylog:*:848:848::0:0:Graylog user:/nonexistent:/usr/sbin/nologin
chronyd:*:849:849::0:0:chronyd user:/nonexistent:/usr/sbin/nologin
qbittorrent:*:850:850::0:0:qBittorrent Daemon User:/var/db/qbittorrent/conf:/usr/sbin/nologin
# free: 851
cassandra:*:851:851::0:0:Cassandra DB Daemon User:/var/db/cassandra:/usr/sbin/nologin
# free: 852
_geodns:*:853:853::0:0:GeoDNS User:/var/empty:/usr/sbin/nologin
# free: 854

View File

@ -28,6 +28,7 @@
SUBDIR += buzhug
SUBDIR += c3p0
SUBDIR += cassandra-cpp-driver
SUBDIR += cassandra3
SUBDIR += casstcl
SUBDIR += cayley
SUBDIR += cdb

View File

@ -0,0 +1,125 @@
# $FreeBSD$
PORTNAME= cassandra
DISTVERSION= 3.11.3
CATEGORIES= databases java
MASTER_SITES= APACHE/cassandra/${PORTVERSION}:apache \
LOCAL/yuri:repo
PKGNAMESUFFIX= 3
DISTNAME= apache-${PORTNAME}-${PORTVERSION}-src
DISTFILES= ${DISTNAME}.tar.gz:apache \
apache-${PORTNAME}-${PORTVERSION}-repo.tar.gz:repo
MAINTAINER= language.devel@gmail.com
COMMENT= Highly scalable distributed database
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
RUN_DEPENDS= snappyjava>=0:archivers/snappy-java
USES= python:2.7
USE_JAVA= yes
USE_ANT= yes
USE_RC_SUBR= cassandra
JAVA_VERSION= 1.8
JAVA_VENDOR= openjdk
REINPLACE_ARGS= -i ''
SUB_LIST= JAVA_HOME=${JAVA_HOME}
USERS= cassandra
GROUPS= cassandra
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
DIST_DIR= ${WRKSRC}/build/dist
REPO_DIR= ${WRKDIR}/repository
CONFIG_FILES= cassandra-env.sh \
cassandra-jaas.config \
cassandra-rackdc.properties \
cassandra-topology.properties \
cassandra.yaml \
commitlog_archiving.properties \
hotspot_compiler \
jvm.options \
logback-tools.xml \
logback.xml
SCRIPT_FILES= cassandra \
cqlsh \
nodetool \
sstableloader \
sstablescrub \
sstableupgrade \
sstableutil \
sstableverify
PLIST_SUB= PORTVERSION=${PORTVERSION}
OPTIONS_DEFINE= SIGAR DOCS
OPTIONS_DEFAULT= SIGAR
OPTIONS_SUB= yes
SIGAR_DESC= Use SIGAR to collect system information
SIGAR_RUN_DEPENDS= java-sigar>=1.6.4:java/sigar
DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx \
${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme
PORTDOCS= *
do-build:
@${DO_NADA} # Do nothing: Prevent USE_ANT from running a default build target.
do-build-DOCS-on:
@cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocalm2=${REPO_DIR} -Dpycmd=${PYTHON_CMD} freebsd-stage-doc
do-build-DOCS-off:
@cd ${WRKSRC} && ${ANT} -Dmaven.repo.local=${REPO_DIR} -Dlocalm2=${REPO_DIR} freebsd-stage
post-build:
.for f in ${SCRIPT_FILES}
@${REINPLACE_CMD} -e 's|/usr/share/cassandra|${DATADIR}/bin|' ${DIST_DIR}/bin/${f}
.endfor
@${REINPLACE_CMD} -e 's|\`dirname "\$$\0"\`/..|${DATADIR}|' ${DIST_DIR}/bin/cassandra.in.sh
@${REINPLACE_CMD} -e 's|\$$\CASSANDRA_HOME/lib/sigar-bin|${JAVAJARDIR}|' ${DIST_DIR}/bin/cassandra.in.sh
@${REINPLACE_CMD} -e 's|\$$\CASSANDRA_HOME/lib/sigar-bin|${JAVAJARDIR}|' ${DIST_DIR}/conf/cassandra-env.sh
@${REINPLACE_CMD} -e 's|\$$\CASSANDRA_HOME/conf|${ETCDIR}|' ${DIST_DIR}/bin/cassandra.in.sh
@${REINPLACE_CMD} -e 's|\$$\CASSANDRA_HOME/conf|${ETCDIR}|' ${DIST_DIR}/conf/cassandra-env.sh
.for f in ${CONFIG_FILES}
@${MV} ${DIST_DIR}/conf/${f} ${DIST_DIR}/conf/${f}.sample
.endfor
@${RM} ${DIST_DIR}/lib/licenses/sigar*
@${RMDIR} ${DIST_DIR}/lib/sigar-bin
do-install:
${MKDIR} ${STAGEDIR}${DATADIR}
.for f in CHANGES LICENSE NEWS NOTICE
cd ${DIST_DIR} && ${INSTALL_DATA} ${f}.txt ${STAGEDIR}${DATADIR}/
.endfor
.for d in interface lib pylib tools
cd ${DIST_DIR} && ${COPYTREE_SHARE} ${d} ${STAGEDIR}${DATADIR}/ "! -path '*/bin/*'"
.endfor
${MKDIR} ${STAGEDIR}${ETCDIR}
cd ${DIST_DIR}/conf && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}/
cd ${DIST_DIR} && ${COPYTREE_BIN} bin ${STAGEDIR}${DATADIR}
cd ${DIST_DIR} && ${INSTALL_DATA} bin/cassandra.in.sh ${STAGEDIR}${DATADIR}/bin/
cd ${DIST_DIR} && ${COPYTREE_BIN} tools/bin ${STAGEDIR}${DATADIR}/
cd ${DIST_DIR} && ${INSTALL_DATA} tools/bin/cassandra.in.sh ${STAGEDIR}${DATADIR}/tools/bin/
.for f in ${SCRIPT_FILES}
${RLN} ${STAGEDIR}${DATADIR}/bin/${f} ${STAGEDIR}${PREFIX}/bin/${f}
.endfor
${LN} -s ${JAVAJARDIR}/snappy-java.jar ${STAGEDIR}${DATADIR}/lib/snappy-java.jar
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for d in doc javadoc
cd ${DIST_DIR} && ${COPYTREE_SHARE} ${d} ${STAGEDIR}${DOCSDIR}/
.endfor
post-install-SIGAR-on:
${LN} -s ${JAVAJARDIR}/sigar.jar ${STAGEDIR}${DATADIR}/lib/sigar.jar
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
TIMESTAMP = 1538922434
SHA256 (apache-cassandra-3.11.3-src.tar.gz) = f4c7a3627e04ff9505a626334eb113ef6dbe310e8b69b747cc4c488eac8b558f
SIZE (apache-cassandra-3.11.3-src.tar.gz) = 34885851
SHA256 (apache-cassandra-3.11.3-repo.tar.gz) = da696b7bdc5c36e131bf480e11cae092e88dc65bc3098aa5aa7f01202b6ce584
SIZE (apache-cassandra-3.11.3-repo.tar.gz) = 44530570

View File

@ -0,0 +1,41 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: cassandra
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Be sure to configure full settings in %%ETCDIR%% prior to enabling daemon.
#
# Add the following lines to /etc/rc.conf or /etc/.conf.local to
# enable the Cassandra daemon:
# cassandra_enable: Set to "YES" to enable the daemon.
# cassandra_user: The user under which to run the daemon.
# Defaults to "cassandra".
. /etc/rc.subr
name=cassandra
rcvar=cassandra_enable
desc="Cassandra daemon"
load_rc_config $name
: ${cassandra_enable:=NO}
: ${cassandra_user:=cassandra}
command=%%PREFIX%%/bin/cassandra
command_args="-p /var/run/cassandra/cassandra.pid >/dev/null 2>/dev/null"
start_precmd="${name}_prestart"
procname=%%PREFIX%%/openjdk8/bin/java
pidfile=/var/run/cassandra/cassandra.pid
cassandra_prestart()
{
export JAVA_HOME=%%JAVA_HOME%%
install -d -o ${cassandra_user} /var/run/cassandra
}
run_rc_command "$1"

View File

@ -0,0 +1,11 @@
--- bin/cassandra.orig 2018-09-07 13:43:49 UTC
+++ bin/cassandra
@@ -189,7 +189,7 @@ launch_service()
props="$3"
class="$4"
cassandra_parms="-Dlogback.configurationFile=logback.xml"
- cassandra_parms="$cassandra_parms -Dcassandra.logdir=$CASSANDRA_HOME/logs"
+ cassandra_parms="$cassandra_parms -Dcassandra.logdir=/var/log/cassandra"
cassandra_parms="$cassandra_parms -Dcassandra.storagedir=$cassandra_storagedir"
if [ "x$pidpath" != "x" ]; then

View File

@ -0,0 +1,22 @@
--- bin/cassandra.in.sh.orig 2018-03-01 13:35:20 UTC
+++ bin/cassandra.in.sh
@@ -26,8 +26,8 @@ fi
# This can be the path to a jar file, or a directory containing the
# compiled classes. NOTE: This isn't needed by the startup script,
# it's just used here in constructing the classpath.
-cassandra_bin="$CASSANDRA_HOME/build/classes/main"
-cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift"
+#cassandra_bin="$CASSANDRA_HOME/build/classes/main"
+#cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift"
#cassandra_bin="$CASSANDRA_HOME/build/cassandra.jar"
# the default location for commitlogs, sstables, and saved caches
@@ -38,7 +38,7 @@ cassandra_storagedir="$CASSANDRA_HOME/da
#JAVA_HOME=/usr/local/jdk6
# The java classpath (required)
-CLASSPATH="$CASSANDRA_CONF:$cassandra_bin"
+CLASSPATH="$CASSANDRA_CONF"
for jar in "$CASSANDRA_HOME"/lib/*.jar; do
CLASSPATH="$CLASSPATH:$jar"

View File

@ -0,0 +1,183 @@
--- build.xml.orig 2018-10-07 14:44:46 UTC
+++ build.xml
@@ -23,6 +23,7 @@
<property file="build.properties" />
<property file="build.properties.default" />
<property name="debuglevel" value="source,lines,vars"/>
+ <property name="pycmd" value="python"/>
<!-- default version and SCM information -->
<property name="base.version" value="3.11.3"/>
@@ -75,14 +76,14 @@
<condition property="version" value="${base.version}">
<isset property="release"/>
</condition>
- <property name="version" value="${base.version}-SNAPSHOT"/>
+ <property name="version" value="${base.version}"/>
<property name="version.properties.dir"
value="${build.src.resources}/org/apache/cassandra/config/" />
<property name="final.name" value="${ant.project.name}-${version}"/>
<!-- details of what version of Maven ANT Tasks to fetch -->
<property name="maven-ant-tasks.version" value="2.1.3" />
- <property name="maven-ant-tasks.local" value="${user.home}/.m2/repository/org/apache/maven/maven-ant-tasks"/>
+ <property name="maven-ant-tasks.local" value="${localm2}/org/apache/maven/maven-ant-tasks"/>
<property name="maven-ant-tasks.url"
value="http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks" />
<!-- details of how and which Maven repository we publish to -->
@@ -244,8 +245,7 @@
<artifact:dependencies pathId="wikitext.classpath">
<dependency groupId="com.datastax.wikitext" artifactId="wikitext-core-ant" version="1.3"/>
<dependency groupId="org.fusesource.wikitext" artifactId="textile-core" version="1.3"/>
- <remoteRepository refid="central"/>
- <remoteRepository refid="apache"/>
+ <localRepository path="${localm2}"/>
</artifact:dependencies>
<taskdef classpathref="wikitext.classpath" resource="wikitexttasks.properties" />
<wikitext-to-html markupLanguage="Textile">
@@ -258,6 +258,7 @@
<target name="gen-doc" depends="maven-ant-tasks-init" description="Generate documentation">
<exec executable="make" osfamily="unix" dir="${doc.dir}">
<arg value="html"/>
+ <arg value="PYTHON_CMD=${pycmd}"/>
</exec>
<exec executable="cmd" osfamily="dos" dir="${doc.dir}">
<arg value="/c"/>
@@ -300,10 +301,6 @@
description="Initialize Maven ANT Tasks">
<typedef uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
- <!-- define the remote repositories we use -->
- <artifact:remoteRepository id="central" url="${artifact.remoteRepository.central}"/>
- <artifact:remoteRepository id="apache" url="${artifact.remoteRepository.apache}"/>
-
<macrodef name="install">
<attribute name="pomFile"/>
<attribute name="file"/>
@@ -682,16 +679,14 @@
filesetId="build-dependency-jars"
cacheDependencyRefs="true"
dependencyRefsBuildFile="${build.dir}/build-dependencies.xml">
- <remoteRepository refid="central"/>
- <remoteRepository refid="apache"/>
+ <localRepository path="${localm2}"/>
</artifact:dependencies>
<!-- retrieve -source.jar artifacts using the reference-pom with the artifacts that have these -->
<artifact:dependencies pomRefId="build-deps-pom-sources"
sourcesFilesetId="build-dependency-sources"
cacheDependencyRefs="true"
dependencyRefsBuildFile="${build.dir}/build-dependencies-sources.xml">
- <remoteRepository refid="central"/>
- <remoteRepository refid="apache"/>
+ <localRepository path="${localm2}"/>
</artifact:dependencies>
<copy todir="${build.dir.lib}/jars">
<fileset refid="build-dependency-jars"/>
@@ -704,7 +699,7 @@
<!-- code coverage tools -->
<artifact:dependencies pomRefId="coverage-deps-pom"
filesetId="coverage-dependency-jars">
- <remoteRepository refid="central"/>
+ <localRepository path="${localm2}"/>
</artifact:dependencies>
<copy todir="${build.dir.lib}/jars">
<fileset refid="coverage-dependency-jars"/>
@@ -725,8 +720,7 @@
sourcesFilesetId="test-dependency-sources"
cacheDependencyRefs="true"
dependencyRefsBuildFile="${build.dir}/test-dependencies.xml">
- <remoteRepository refid="apache"/>
- <remoteRepository refid="central"/>
+ <localRepository path="${localm2}"/>
</artifact:dependencies>
<copy todir="${test.lib}/jars">
<fileset refid="test-dependency-jars"/>
@@ -1021,6 +1015,88 @@
</jar>
</target>
+ <!-- FreeBSD for staging -->
+ <target name="freebsd-stage" depends="jar"
+ description="Create Cassandra directory structure for staging">
+ <mkdir dir="${dist.dir}"/>
+ <copy todir="${dist.dir}/lib">
+ <fileset dir="${build.lib}">
+ <exclude name="sigar*.jar"/>
+ <exclude name="sigar-bin/*"/>
+ <exclude name="snappy*.jar"/>
+ <exclude name="licenses/snappy*.txt"/>
+ </fileset>
+ <fileset dir="${build.dir}">
+ <include name="${final.name}.jar" />
+ <include name="${ant.project.name}-thrift-${version}.jar" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/bin">
+ <fileset dir="bin">
+ <exclude name="*.bat" />
+ <exclude name="*.ps1" />
+ <exclude name="*.orig" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/conf">
+ <fileset dir="conf">
+ <exclude name="*.ps1" />
+ <exclude name="*.orig" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/interface">
+ <fileset dir="interface">
+ <include name="**/*.thrift" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/pylib">
+ <fileset dir="pylib">
+ <include name="**" />
+ <exclude name="**/*.pyc" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/">
+ <fileset dir="${basedir}">
+ <include name="*.txt" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/tools/bin">
+ <fileset dir="${basedir}/tools/bin">
+ <exclude name="*.bat" />
+ <exclude name="*.ps1" />
+ <exclude name="*.orig" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/tools/">
+ <fileset dir="${basedir}/tools/">
+ <include name="*.yaml"/>
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/tools/lib">
+ <fileset dir="${build.dir}/tools/lib/">
+ <include name="*.jar" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="freebsd-stage-doc" depends="freebsd-stage,javadoc,gen-doc"
+ description="Create Cassandra directory structure for staging, including docs">
+ <copy todir="${dist.dir}/javadoc">
+ <fileset dir="${javadoc.dir}"/>
+ </copy>
+ <copy todir="${dist.dir}/doc">
+ <fileset dir="doc">
+ <include name="cql3/CQL.html" />
+ <include name="cql3/CQL.css" />
+ <include name="SASI.md" />
+ </fileset>
+ </copy>
+ <copy todir="${dist.dir}/doc/html">
+ <fileset dir="doc" />
+ <globmapper from="build/html/*" to="*"/>
+ </copy>
+ </target>
+
<!-- creates release tarballs -->
<target name="artifacts" depends="jar,javadoc,gen-doc"
description="Create Cassandra release artifacts">

View File

@ -0,0 +1,11 @@
--- conf/cassandra-env.sh.orig 2018-09-07 21:30:15 UTC
+++ conf/cassandra-env.sh
@@ -122,7 +122,7 @@ case "$jvm" in
esac
#GC log path has to be defined here because it needs to access CASSANDRA_HOME
-JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
+JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
# Here we create the arguments that will get passed to the jvm when
# starting cassandra.

View File

@ -0,0 +1,68 @@
--- conf/cassandra.yaml.orig 2018-02-14 20:43:59 UTC
+++ conf/cassandra.yaml
@@ -70,7 +70,7 @@ max_hints_delivery_threads: 2
# Directory where Cassandra should store hints.
# If not set, the default directory is $CASSANDRA_HOME/data/hints.
-# hints_directory: /var/lib/cassandra/hints
+hints_directory: /var/db/cassandra/hints
# How often hints should be flushed from the internal buffers to disk.
# Will *not* trigger fsync.
@@ -187,13 +187,13 @@ partitioner: org.apache.cassandra.dht.Mu
# will spread data evenly across them, subject to the granularity of
# the configured compaction strategy.
# If not set, the default directory is $CASSANDRA_HOME/data/data.
-# data_file_directories:
-# - /var/lib/cassandra/data
+data_file_directories:
+ - /var/db/cassandra/data
# commit log. when running on magnetic HDD, this should be a
# separate spindle than the data directories.
# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
-# commitlog_directory: /var/lib/cassandra/commitlog
+commitlog_directory: /var/db/cassandra/commitlog
# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
# for write path allocation rejection (standard: never reject. cdc: reject Mutation
@@ -204,7 +204,7 @@ cdc_enabled: false
# segment contains mutations for a CDC-enabled table. This should be placed on a
# separate spindle than the data directories. If not set, the default directory is
# $CASSANDRA_HOME/data/cdc_raw.
-# cdc_raw_directory: /var/lib/cassandra/cdc_raw
+cdc_raw_directory: /var/db/cassandra/cdc_raw
# Policy for data disk failures:
#
@@ -305,20 +305,12 @@ key_cache_save_period: 14400
# Row cache implementation class name. Available implementations:
#
-# org.apache.cassandra.cache.OHCProvider
-# Fully off-heap row cache implementation (default).
-#
# org.apache.cassandra.cache.SerializingCacheProvider
# This is the row cache implementation availabile
# in previous releases of Cassandra.
-# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
+# row_cache_class_name: org.apache.cassandra.cache.SerializingCacheProvider
# Maximum size of the row cache in memory.
-# Please note that OHC cache implementation requires some additional off-heap memory to manage
-# the map structures and some in-flight memory during operations before/after cache entries can be
-# accounted against the cache capacity. This overhead is usually small compared to the whole capacity.
-# Do not specify more memory that the system can afford in the worst usual situation and leave some
-# headroom for OS block level cache. Do never allow your system to swap.
#
# Default value is 0, to disable row caching.
row_cache_size_in_mb: 0
@@ -365,7 +357,7 @@ counter_cache_save_period: 7200
# saved caches
# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
-# saved_caches_directory: /var/lib/cassandra/saved_caches
+saved_caches_directory: /var/db/cassandra/saved_caches
# commitlog_sync may be either "periodic" or "batch."
#

View File

@ -0,0 +1,20 @@
--- doc/Makefile.orig 2018-02-22 15:43:58 UTC
+++ doc/Makefile
@@ -3,7 +3,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
-SPHINXBUILD = sphinx-build
+SPHINXBUILD = sphinx-build-2.7
PAPER =
BUILDDIR = build
@@ -17,7 +17,7 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $
YAML_DOC_INPUT=../conf/cassandra.yaml
YAML_DOC_OUTPUT=source/configuration/cassandra_config_file.rst
-MAKE_CASSANDRA_YAML = python convert_yaml_to_rst.py $(YAML_DOC_INPUT) $(YAML_DOC_OUTPUT)
+MAKE_CASSANDRA_YAML = ${PYTHON_CMD} convert_yaml_to_rst.py $(YAML_DOC_INPUT) $(YAML_DOC_OUTPUT)
WEB_SITE_PRESENCE_FILE='source/.build_for_website'

View File

@ -0,0 +1,11 @@
--- src/java/org/apache/cassandra/config/Config.java.orig 2018-03-06 21:16:18 UTC
+++ src/java/org/apache/cassandra/config/Config.java
@@ -252,7 +252,7 @@ public class Config
public volatile int key_cache_save_period = 14400;
public volatile int key_cache_keys_to_save = Integer.MAX_VALUE;
- public String row_cache_class_name = "org.apache.cassandra.cache.OHCProvider";
+ public String row_cache_class_name = "org.apache.cassandra.cache.SerializingCacheProvider";
public long row_cache_size_in_mb = 0;
public volatile int row_cache_save_period = 0;
public volatile int row_cache_keys_to_save = Integer.MAX_VALUE;

View File

@ -0,0 +1,18 @@
--- src/java/org/apache/cassandra/service/StartupChecks.java.orig 2018-02-14 20:43:59 UTC
+++ src/java/org/apache/cassandra/service/StartupChecks.java
@@ -263,7 +263,14 @@ public class StartupChecks
{
public void execute()
{
- SigarLibrary.instance.warnIfRunningInDegradedMode();
+ try {
+ @SuppressWarnings("unused")
+ Class<?> loadMe = org.hyperic.sigar.SigarException.class;
+
+ SigarLibrary.instance.warnIfRunningInDegradedMode();
+ } catch (NoClassDefFoundError e) {
+ logger.info("Could not initialize SIGAR library: SIGAR option not selected during install or jar no longer available.");
+ }
}
};

View File

@ -0,0 +1,108 @@
--- src/java/org/apache/cassandra/utils/FastByteOperations.java.orig 2018-03-01 05:02:12 UTC
+++ src/java/org/apache/cassandra/utils/FastByteOperations.java
@@ -179,6 +179,20 @@ public class FastByteOperations
static final boolean BIG_ENDIAN = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN);
+ private static byte unsafeGetByte(Object o, long offset)
+ {
+ return o == null
+ ? theUnsafe.getByte(offset)
+ : theUnsafe.getByte(o, offset);
+ }
+
+ private static long unsafeGetLong(Object o, long offset)
+ {
+ return o == null
+ ? theUnsafe.getLong(offset)
+ : theUnsafe.getLong(o, offset);
+ }
+
public int compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
{
return compareTo(buffer1, BYTE_ARRAY_BASE_OFFSET + offset1, length1,
@@ -197,7 +211,7 @@ public class FastByteOperations
else
{
obj1 = null;
- offset1 = theUnsafe.getLong(buffer1, DIRECT_BUFFER_ADDRESS_OFFSET);
+ offset1 = unsafeGetLong(buffer1, DIRECT_BUFFER_ADDRESS_OFFSET);
}
int length1;
{
@@ -219,7 +233,7 @@ public class FastByteOperations
if (src.hasArray())
System.arraycopy(src.array(), src.arrayOffset() + srcPosition, trg, trgPosition, length);
else
- copy(null, srcPosition + theUnsafe.getLong(src, DIRECT_BUFFER_ADDRESS_OFFSET), trg, trgPosition, length);
+ copy(null, srcPosition + unsafeGetLong(src, DIRECT_BUFFER_ADDRESS_OFFSET), trg, trgPosition, length);
}
public void copy(ByteBuffer srcBuf, int srcPosition, ByteBuffer trgBuf, int trgPosition, int length)
@@ -234,7 +248,7 @@ public class FastByteOperations
else
{
src = null;
- srcOffset = theUnsafe.getLong(srcBuf, DIRECT_BUFFER_ADDRESS_OFFSET);
+ srcOffset = unsafeGetLong(srcBuf, DIRECT_BUFFER_ADDRESS_OFFSET);
}
copy(src, srcOffset + srcPosition, trgBuf, trgPosition, length);
}
@@ -244,7 +258,7 @@ public class FastByteOperations
if (trgBuf.hasArray())
copy(src, srcOffset, trgBuf.array(), trgBuf.arrayOffset() + trgPosition, length);
else
- copy(src, srcOffset, null, trgPosition + theUnsafe.getLong(trgBuf, DIRECT_BUFFER_ADDRESS_OFFSET), length);
+ copy(src, srcOffset, null, trgPosition + unsafeGetLong(trgBuf, DIRECT_BUFFER_ADDRESS_OFFSET), length);
}
public static void copy(Object src, long srcOffset, byte[] trg, int trgPosition, int length)
@@ -252,7 +266,7 @@ public class FastByteOperations
if (length <= MIN_COPY_THRESHOLD)
{
for (int i = 0 ; i < length ; i++)
- trg[trgPosition + i] = theUnsafe.getByte(src, srcOffset + i);
+ trg[trgPosition + i] = unsafeGetByte(src, srcOffset + i);
}
else
{
@@ -291,7 +305,7 @@ public class FastByteOperations
else
{
obj1 = null;
- offset1 = theUnsafe.getLong(buffer1, DIRECT_BUFFER_ADDRESS_OFFSET);
+ offset1 = unsafeGetLong(buffer1, DIRECT_BUFFER_ADDRESS_OFFSET);
}
offset1 += buffer1.position();
length1 = buffer1.remaining();
@@ -314,7 +328,7 @@ public class FastByteOperations
else
{
obj2 = null;
- offset2 = theUnsafe.getLong(buffer, DIRECT_BUFFER_ADDRESS_OFFSET);
+ offset2 = unsafeGetLong(buffer, DIRECT_BUFFER_ADDRESS_OFFSET);
}
int length2 = limit - position;
offset2 += position;
@@ -347,8 +361,8 @@ public class FastByteOperations
int wordComparisons = minLength & ~7;
for (int i = 0; i < wordComparisons ; i += Longs.BYTES)
{
- long lw = theUnsafe.getLong(buffer1, memoryOffset1 + i);
- long rw = theUnsafe.getLong(buffer2, memoryOffset2 + i);
+ long lw = unsafeGetLong(buffer1, memoryOffset1 + i);
+ long rw = unsafeGetLong(buffer2, memoryOffset2 + i);
if (lw != rw)
{
@@ -361,8 +375,8 @@ public class FastByteOperations
for (int i = wordComparisons ; i < minLength ; i++)
{
- int b1 = theUnsafe.getByte(buffer1, memoryOffset1 + i) & 0xFF;
- int b2 = theUnsafe.getByte(buffer2, memoryOffset2 + i) & 0xFF;
+ int b1 = unsafeGetByte(buffer1, memoryOffset1 + i) & 0xFF;
+ int b2 = unsafeGetByte(buffer2, memoryOffset2 + i) & 0xFF;
if (b1 != b2)
return b1 - b2;
}

View File

@ -0,0 +1,10 @@
--- test/conf/cassandra.yaml.orig 2018-03-06 21:24:02 UTC
+++ test/conf/cassandra.yaml
@@ -40,7 +40,6 @@ server_encryption_options:
incremental_backups: true
concurrent_compactors: 4
compaction_throughput_mb_per_sec: 0
-row_cache_class_name: org.apache.cassandra.cache.OHCProvider
row_cache_size_in_mb: 16
enable_user_defined_functions: true
enable_scripted_user_defined_functions: true

View File

@ -0,0 +1,24 @@
--- tools/bin/cassandra.in.sh.orig 2018-03-01 14:02:52 UTC
+++ tools/bin/cassandra.in.sh
@@ -26,9 +26,9 @@ fi
# This can be the path to a jar file, or a directory containing the
# compiled classes. NOTE: This isn't needed by the startup script,
# it's just used here in constructing the classpath.
-cassandra_bin="$CASSANDRA_HOME/build/classes/main"
-cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/stress"
-cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift"
+#cassandra_bin="$CASSANDRA_HOME/build/classes/main"
+#cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/stress"
+#cassandra_bin="$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift"
#cassandra_bin="$cassandra_home/build/cassandra.jar"
# the default location for commitlogs, sstables, and saved caches
@@ -39,7 +39,7 @@ cassandra_storagedir="$CASSANDRA_HOME/da
#JAVA_HOME=/usr/local/jdk6
# The java classpath (required)
-CLASSPATH="$CASSANDRA_CONF:$cassandra_bin"
+CLASSPATH="$CASSANDRA_CONF"
for jar in "$CASSANDRA_HOME"/tools/lib/*.jar; do
CLASSPATH="$CLASSPATH:$jar"

View File

@ -0,0 +1,14 @@
Apache Cassandra is a free and open-source distributed database.
It is a Java-based, highly scalable, eventually consistent, wide
column store. Cassandra database clusters are masterless with no
single point of failure. Replication can be configured across
multiple data centers.
Originally influenced by Dynamo and BigTable, Cassandra was initially
developed at and open sourced by Facebook before becoming a top-level
Apache project.
The CQL query language offers SQL-like data access and management.
Drivers are available for a number of languages.
WWW: https://cassandra.apache.org/

View File

@ -0,0 +1,8 @@
======================================================================
Entries for this machine's hostname may need to be set in /etc/hosts
if you get a "Local host name unknown" exception on startup
(see https://issues.apache.org/jira/browse/CASSANDRA-2380):
::1 localhost localhost.your.domain your-host-name
127.0.0.1 localhost localhost.your.domain your-host-name
======================================================================

View File

@ -0,0 +1,189 @@
%%DATADIR%%/bin/cassandra
%%DATADIR%%/bin/cassandra.in.sh
%%DATADIR%%/bin/cqlsh
%%DATADIR%%/bin/cqlsh.py
%%DATADIR%%/bin/debug-cql
%%DATADIR%%/bin/nodetool
%%DATADIR%%/bin/sstableloader
%%DATADIR%%/bin/sstablescrub
%%DATADIR%%/bin/sstableupgrade
%%DATADIR%%/bin/sstableutil
%%DATADIR%%/bin/sstableverify
%%DATADIR%%/bin/stop-server
%%DATADIR%%/CHANGES.txt
%%DATADIR%%/interface/cassandra.thrift
%%DATADIR%%/lib/airline-0.6.jar
%%DATADIR%%/lib/antlr-runtime-3.5.2.jar
%%DATADIR%%/lib/apache-cassandra-%%PORTVERSION%%.jar
%%DATADIR%%/lib/apache-cassandra-thrift-%%PORTVERSION%%.jar
%%DATADIR%%/lib/asm-5.0.4.jar
%%DATADIR%%/lib/caffeine-2.2.6.jar
%%DATADIR%%/lib/cassandra-driver-core-3.0.1-shaded.jar
%%DATADIR%%/lib/cassandra-driver-internal-only-3.10.zip
%%DATADIR%%/lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip
%%DATADIR%%/lib/commons-cli-1.1.jar
%%DATADIR%%/lib/commons-codec-1.9.jar
%%DATADIR%%/lib/commons-lang3-3.1.jar
%%DATADIR%%/lib/commons-math3-3.2.jar
%%DATADIR%%/lib/compress-lzf-0.8.4.jar
%%DATADIR%%/lib/concurrent-trees-2.4.0.jar
%%DATADIR%%/lib/concurrentlinkedhashmap-lru-1.4.jar
%%DATADIR%%/lib/disruptor-3.0.1.jar
%%DATADIR%%/lib/ecj-4.4.2.jar
%%DATADIR%%/lib/futures-2.1.6-py2.py3-none-any.zip
%%DATADIR%%/lib/guava-18.0.jar
%%DATADIR%%/lib/HdrHistogram-2.1.9.jar
%%DATADIR%%/lib/high-scale-lib-1.0.6.jar
%%DATADIR%%/lib/hppc-0.5.4.jar
%%DATADIR%%/lib/jackson-core-asl-1.9.13.jar
%%DATADIR%%/lib/jackson-mapper-asl-1.9.13.jar
%%DATADIR%%/lib/jamm-0.3.0.jar
%%DATADIR%%/lib/javax.inject.jar
%%DATADIR%%/lib/jbcrypt-0.3m.jar
%%DATADIR%%/lib/jcl-over-slf4j-1.7.7.jar
%%DATADIR%%/lib/jctools-core-1.2.1.jar
%%DATADIR%%/lib/jflex-1.6.0.jar
%%DATADIR%%/lib/jna-4.2.2.jar
%%DATADIR%%/lib/joda-time-2.4.jar
%%DATADIR%%/lib/json-simple-1.1.jar
%%DATADIR%%/lib/jstackjunit-0.0.1.jar
%%DATADIR%%/lib/libthrift-0.9.2.jar
%%DATADIR%%/lib/licenses/airline-0.6.txt
%%DATADIR%%/lib/licenses/antlr-runtime-3.5.2.txt
%%DATADIR%%/lib/licenses/asm-5.0.4.txt
%%DATADIR%%/lib/licenses/caffeine-2.2.6.txt
%%DATADIR%%/lib/licenses/cassandra-driver-3.0.1.txt
%%DATADIR%%/lib/licenses/commons-cli-1.1.txt
%%DATADIR%%/lib/licenses/commons-codec-1.9.txt
%%DATADIR%%/lib/licenses/commons-lang3-3.1.txt
%%DATADIR%%/lib/licenses/commons-math3-3.2.txt
%%DATADIR%%/lib/licenses/compress-lzf-0.8.4.txt
%%DATADIR%%/lib/licenses/concurrent-trees-2.4.0.txt
%%DATADIR%%/lib/licenses/concurrentlinkedhashmap-lru-1.4.txt
%%DATADIR%%/lib/licenses/disruptor-3.0.1.txt
%%DATADIR%%/lib/licenses/ecj-4.4.2.txt
%%DATADIR%%/lib/licenses/futures-2.1.6.txt
%%DATADIR%%/lib/licenses/guava-18.0.txt
%%DATADIR%%/lib/licenses/hdrhistogram-2.1.9.txt
%%DATADIR%%/lib/licenses/high-scale-lib-1.0.6.txt
%%DATADIR%%/lib/licenses/hppc-0.5.4.txt
%%DATADIR%%/lib/licenses/jackson-core-asl-1.9.13.txt
%%DATADIR%%/lib/licenses/jackson-mapper-asl-1.9.13.txt
%%DATADIR%%/lib/licenses/jamm-0.3.0.txt
%%DATADIR%%/lib/licenses/javax.inject.txt
%%DATADIR%%/lib/licenses/jbcrypt-0.3m.txt
%%DATADIR%%/lib/licenses/jcl-over-slf4j-1.7.7.txt
%%DATADIR%%/lib/licenses/jctools-core-1.2.1.txt
%%DATADIR%%/lib/licenses/jflex-1.6.0.txt
%%DATADIR%%/lib/licenses/jna-4.2.2.txt
%%DATADIR%%/lib/licenses/joda-time-2.4.txt
%%DATADIR%%/lib/licenses/json-simple-1.1.txt
%%DATADIR%%/lib/licenses/jstackjunit-0.0.1.txt
%%DATADIR%%/lib/licenses/libthrift-0.9.2.txt
%%DATADIR%%/lib/licenses/log4j-over-slf4j-1.7.7.txt
%%DATADIR%%/lib/licenses/logback-classic-1.1.3.txt
%%DATADIR%%/lib/licenses/logback-core-1.1.3.txt
%%DATADIR%%/lib/licenses/lz4-1.3.0.txt
%%DATADIR%%/lib/licenses/metrics-core-3.1.5.txt
%%DATADIR%%/lib/licenses/metrics-jvm-3.1.5.txt
%%DATADIR%%/lib/licenses/metrics-logback-3.1.5.txt
%%DATADIR%%/lib/licenses/netty-all-4.0.44.Final.txt
%%DATADIR%%/lib/licenses/ohc-0.4.4.txt
%%DATADIR%%/lib/licenses/reporter-config-base-3.0.3.txt
%%DATADIR%%/lib/licenses/reporter-config3-3.0.3.txt
%%DATADIR%%/lib/licenses/six-1.7.3.txt
%%DATADIR%%/lib/licenses/slf4j-api-1.7.7.txt
%%DATADIR%%/lib/licenses/snakeyaml-1.11.txt
%%DATADIR%%/lib/licenses/snowball-stemmer-1.3.0.581.1.txt
%%DATADIR%%/lib/licenses/ST4-4.0.8.txt
%%DATADIR%%/lib/licenses/stream-2.5.2.txt
%%DATADIR%%/lib/licenses/thrift-server-0.3.7.txt
%%DATADIR%%/lib/log4j-over-slf4j-1.7.7.jar
%%DATADIR%%/lib/logback-classic-1.1.3.jar
%%DATADIR%%/lib/logback-core-1.1.3.jar
%%DATADIR%%/lib/lz4-1.3.0.jar
%%DATADIR%%/lib/metrics-core-3.1.5.jar
%%DATADIR%%/lib/metrics-jvm-3.1.5.jar
%%DATADIR%%/lib/metrics-logback-3.1.5.jar
%%DATADIR%%/lib/netty-all-4.0.44.Final.jar
%%DATADIR%%/lib/ohc-core-0.4.4.jar
%%DATADIR%%/lib/ohc-core-j8-0.4.4.jar
%%DATADIR%%/lib/reporter-config-base-3.0.3.jar
%%DATADIR%%/lib/reporter-config3-3.0.3.jar
%%DATADIR%%/lib/six-1.7.3-py2.py3-none-any.zip
%%DATADIR%%/lib/slf4j-api-1.7.7.jar
%%DATADIR%%/lib/snakeyaml-1.11.jar
%%DATADIR%%/lib/snappy-java.jar
%%DATADIR%%/lib/snowball-stemmer-1.3.0.581.1.jar
%%DATADIR%%/lib/ST4-4.0.8.jar
%%DATADIR%%/lib/stream-2.5.2.jar
%%DATADIR%%/lib/thrift-server-0.3.7.jar
%%DATADIR%%/LICENSE.txt
%%DATADIR%%/NEWS.txt
%%DATADIR%%/NOTICE.txt
%%DATADIR%%/pylib/cqlshlib/__init__.py
%%DATADIR%%/pylib/cqlshlib/copyutil.py
%%DATADIR%%/pylib/cqlshlib/cql3handling.py
%%DATADIR%%/pylib/cqlshlib/cqlhandling.py
%%DATADIR%%/pylib/cqlshlib/cqlshhandling.py
%%DATADIR%%/pylib/cqlshlib/displaying.py
%%DATADIR%%/pylib/cqlshlib/formatting.py
%%DATADIR%%/pylib/cqlshlib/helptopics.py
%%DATADIR%%/pylib/cqlshlib/pylexotron.py
%%DATADIR%%/pylib/cqlshlib/saferscanner.py
%%DATADIR%%/pylib/cqlshlib/sslhandling.py
%%DATADIR%%/pylib/cqlshlib/test/__init__.py
%%DATADIR%%/pylib/cqlshlib/test/ansi_colors.py
%%DATADIR%%/pylib/cqlshlib/test/basecase.py
%%DATADIR%%/pylib/cqlshlib/test/cassconnect.py
%%DATADIR%%/pylib/cqlshlib/test/run_cqlsh.py
%%DATADIR%%/pylib/cqlshlib/test/test_cql_parsing.py
%%DATADIR%%/pylib/cqlshlib/test/test_cqlsh_commands.py
%%DATADIR%%/pylib/cqlshlib/test/test_cqlsh_completion.py
%%DATADIR%%/pylib/cqlshlib/test/test_cqlsh_invocation.py
%%DATADIR%%/pylib/cqlshlib/test/test_cqlsh_output.py
%%DATADIR%%/pylib/cqlshlib/test/test_cqlsh_parsing.py
%%DATADIR%%/pylib/cqlshlib/test/test_keyspace_init.cql
%%DATADIR%%/pylib/cqlshlib/test/winpty.py
%%DATADIR%%/pylib/cqlshlib/tracing.py
%%DATADIR%%/pylib/cqlshlib/util.py
%%DATADIR%%/pylib/cqlshlib/wcwidth.py
%%DATADIR%%/pylib/setup.py
%%DATADIR%%/tools/bin/cassandra-stress
%%DATADIR%%/tools/bin/cassandra-stressd
%%DATADIR%%/tools/bin/cassandra.in.sh
%%DATADIR%%/tools/bin/compaction-stress
%%DATADIR%%/tools/bin/sstabledump
%%DATADIR%%/tools/bin/sstableexpiredblockers
%%DATADIR%%/tools/bin/sstablelevelreset
%%DATADIR%%/tools/bin/sstablemetadata
%%DATADIR%%/tools/bin/sstableofflinerelevel
%%DATADIR%%/tools/bin/sstablerepairedset
%%DATADIR%%/tools/bin/sstablesplit
%%DATADIR%%/tools/cqlstress-counter-example.yaml
%%DATADIR%%/tools/cqlstress-example.yaml
%%DATADIR%%/tools/cqlstress-insanity-example.yaml
%%DATADIR%%/tools/lib/stress.jar
%%ETCDIR%%/metrics-reporter-config-sample.yaml
%%ETCDIR%%/README.txt
%%ETCDIR%%/triggers/README.txt
%%SIGAR%%%%DATADIR%%/lib/sigar.jar
@sample %%ETCDIR%%/cassandra-env.sh.sample
@sample %%ETCDIR%%/cassandra-jaas.config.sample
@sample %%ETCDIR%%/cassandra-rackdc.properties.sample
@sample %%ETCDIR%%/cassandra-topology.properties.sample
@sample %%ETCDIR%%/cassandra.yaml.sample
@sample %%ETCDIR%%/commitlog_archiving.properties.sample
@sample %%ETCDIR%%/cqlshrc.sample
@sample %%ETCDIR%%/hotspot_compiler.sample
@sample %%ETCDIR%%/jvm.options.sample
@sample %%ETCDIR%%/logback-tools.xml.sample
@sample %%ETCDIR%%/logback.xml.sample
bin/cassandra
bin/cqlsh
bin/nodetool
bin/sstableloader
bin/sstablescrub
bin/sstableupgrade
bin/sstableutil
bin/sstableverify