diff options
author | pawel <pawel@FreeBSD.org> | 2011-10-29 19:03:58 +0800 |
---|---|---|
committer | pawel <pawel@FreeBSD.org> | 2011-10-29 19:03:58 +0800 |
commit | 5a960bed3ce62b95e0ded0c96d9efcfc9dff43de (patch) | |
tree | 3b0ff477b716720a24dc3bca655193f9ec4b4f01 /databases/cassandra | |
parent | ef98845fefe5d66e0bfbdcadcae8f6d6e4162031 (diff) | |
download | freebsd-ports-gnome-5a960bed3ce62b95e0ded0c96d9efcfc9dff43de.tar.gz freebsd-ports-gnome-5a960bed3ce62b95e0ded0c96d9efcfc9dff43de.tar.zst freebsd-ports-gnome-5a960bed3ce62b95e0ded0c96d9efcfc9dff43de.zip |
- Add WITH_MX4J option
- Add repaircluster script
PR: ports/161766
Submitted by: Radim Kolar <hsn@sendmail.cz>
Approved by: maintainer
Diffstat (limited to 'databases/cassandra')
-rw-r--r-- | databases/cassandra/Makefile | 24 | ||||
-rw-r--r-- | databases/cassandra/files/cassandra.in | 2 | ||||
-rw-r--r-- | databases/cassandra/pkg-plist | 4 | ||||
-rw-r--r-- | databases/cassandra/scripts/repaircluster | 9 |
4 files changed, 36 insertions, 3 deletions
diff --git a/databases/cassandra/Makefile b/databases/cassandra/Makefile index 00a9ec3209d6..5a960cfecbd6 100644 --- a/databases/cassandra/Makefile +++ b/databases/cassandra/Makefile @@ -7,6 +7,7 @@ PORTNAME= cassandra PORTVERSION= 0.8.7 +PORTREVISION= 1 CATEGORIES= databases java MASTER_SITES= ${MASTER_SITE_APACHE} MASTER_SITE_SUBDIR= cassandra/${PORTVERSION} @@ -34,12 +35,25 @@ SCRIPTS= cassandra \ cassandra-cli \ json2sstable \ nodetool \ + repaircluster \ sstable2json \ sstablekeys \ sstableloader +OPTIONS= MX4J "Enable HTTP interface for JMX" Off + +.include <bsd.port.options.mk> + +.if defined(WITH_MX4J) +RUN_DEPENDS+= ${JAVAJARDIR}/mx4j-tools.jar:${PORTSDIR}/java/mx4j +PLIST_SUB+= MX4J="" +.else +PLIST_SUB+= MX4J="@comment " +.endif + post-extract: @${RM} ${WRKSRC}/bin/*.bat ${WRKSRC}/bin/stop-server + @${CP} ${SCRIPTDIR}/repaircluster ${WRKSRC}/bin .for i in ${CONFIGS} @${MV} ${WRKSRC}/conf/${i} ${WRKSRC}/conf/${i}.sample .endfor @@ -47,16 +61,22 @@ post-extract: post-patch: @${REINPLACE_CMD} -e 's|/usr/share/cassandra|${DATADIR}/bin|' \ ${WRKSRC}/bin/cassandra-cli \ - ${WRKSRC}/bin/nodetool + ${WRKSRC}/bin/nodetool \ + ${WRKSRC}/bin/sstableloader @${REINPLACE_CMD} -e 's|\`dirname \$$\0\`/..|${DATADIR}|' \ ${WRKSRC}/bin/cassandra.in.sh do-install: @${MKDIR} ${DATADIR} @cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${DATADIR} - @cd ${DATADIR}/bin/ && ${CHMOD} u+x ${SCRIPTS} + @cd ${DATADIR}/bin/ && ${CHMOD} ${BINMODE} ${SCRIPTS} @${LN} -s ${DATADIR}/bin/cassandra-cli ${PREFIX}/bin/cassandra-cli @${LN} -s ${DATADIR}/bin/nodetool ${PREFIX}/bin/nodetool + @${LN} -s ${DATADIR}/bin/sstableloader ${PREFIX}/bin/sstableloader + @${LN} -s ${DATADIR}/bin/repaircluster ${PREFIX}/bin/repaircluster +.ifdef (WITH_MX4J) + @${LN} -s ${LOCALBASE}/share/java/classes/mx4j-tools.jar ${DATADIR}/lib/mx4j-tools.jar +.endif post-install: @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL diff --git a/databases/cassandra/files/cassandra.in b/databases/cassandra/files/cassandra.in index e229e70bd285..48ff7904236c 100644 --- a/databases/cassandra/files/cassandra.in +++ b/databases/cassandra/files/cassandra.in @@ -37,7 +37,7 @@ rcvar=`set_rcvar` load_rc_config $name cassandra_enable=${cassandra_enable:-"NO"} -cassandra_vmargs=${cassandra_vmargs:-"-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:+CMSIncrementalDutyCycle=10"} +cassandra_vmargs=${cassandra_vmargs:-"-ea -javaagent:%%DATADIR%%/lib/jamm-0.2.2.jar -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:+CMSIncrementalDutyCycle=10"} cassandra_memory=${cassandra_memory:-"1000m"} cassandra_newgen=${cassandra_newgen:-"300m"} command=%%DATADIR%%/bin/cassandra diff --git a/databases/cassandra/pkg-plist b/databases/cassandra/pkg-plist index 3bc702ea7d21..9850e71804a2 100644 --- a/databases/cassandra/pkg-plist +++ b/databases/cassandra/pkg-plist @@ -1,6 +1,8 @@ @comment $FreeBSD$ bin/cassandra-cli bin/nodetool +bin/sstableloader +bin/repaircluster %%DATADIR%%/CHANGES.txt %%DATADIR%%/LICENSE.txt %%DATADIR%%/NEWS.txt @@ -14,6 +16,7 @@ bin/nodetool %%DATADIR%%/bin/sstable2json %%DATADIR%%/bin/sstablekeys %%DATADIR%%/bin/sstableloader +%%DATADIR%%/bin/repaircluster %%DATADIR%%/conf/README.txt %%DATADIR%%/conf/access.properties.sample %%DATADIR%%/conf/cassandra-env.sh @@ -1554,6 +1557,7 @@ bin/nodetool %%DATADIR%%/javadoc/resources/inherit.gif %%DATADIR%%/javadoc/serialized-form.html %%DATADIR%%/javadoc/stylesheet.css +%%MX4J%%%%DATADIR%%/lib/mx4j-tools.jar %%DATADIR%%/lib/antlr-3.2.jar %%DATADIR%%/lib/apache-cassandra-0.8.7.jar %%DATADIR%%/lib/apache-cassandra-thrift-0.8.7.jar diff --git a/databases/cassandra/scripts/repaircluster b/databases/cassandra/scripts/repaircluster new file mode 100644 index 000000000000..0d6d1d459efc --- /dev/null +++ b/databases/cassandra/scripts/repaircluster @@ -0,0 +1,9 @@ +#! /bin/sh +set -e +if test $# -eq 0; then + echo "$0 <any node in cluster>" + exit 1; +fi +for i in `nodetool -h $1 ring | cut -d ' ' -f 1 | grep -e '^[0-9]'`; do + nodetool -h $i repair +done |