Skip to content

Commit

Permalink
Upgrade dlog deps (apache#254)
Browse files Browse the repository at this point in the history
* Upgrade dlog dependency

* Make pulsar functions work after rebase

- bump zk version 3.5
- use the same dlog version as bookkeeper
- change standalone to use sorted ledger storage manager

(this is a temp fix to address the issues after rebase)
  • Loading branch information
sijie committed Mar 4, 2018
1 parent bbc1242 commit b7d3083
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 80 deletions.
2 changes: 1 addition & 1 deletion bin/pulsar
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ elif [ $COMMAND == "websocket" ]; then
exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.websocket.service.WebSocketServiceStarter $PULSAR_WEBSOCKET_CONF $@
elif [ $COMMAND == "standalone" ]; then
PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"pulsar-standalone.log"}
exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.PulsarStandaloneStarter --config $PULSAR_STANDALONE_CONF $@
exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE -Dzookeeper.4lw.commands.whitelist='*' org.apache.pulsar.PulsarStandaloneStarter --config $PULSAR_STANDALONE_CONF $@
elif [ $COMMAND == "initialize-cluster-metadata" ]; then
exec $JAVA $OPTS org.apache.pulsar.PulsarClusterMetadataSetup $@
elif [ $COMMAND == "zookeeper-shell" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ flexible messaging model and an intuitive client API.</description>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<bookkeeper.version>4.7.0-SNAPSHOT</bookkeeper.version>
<zookeeper.version>3.4.10</zookeeper.version>
<zookeeper.version>3.5.3-beta</zookeeper.version>
<netty.version>4.1.21.Final</netty.version>
<storm.version>1.0.5</storm.version>
<jetty.version>9.3.11.v20160721</jetty.version>
Expand Down
75 changes: 1 addition & 74 deletions pulsar-functions/worker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,80 +123,7 @@
<dependency>
<groupId>org.apache.distributedlog</groupId>
<artifactId>distributedlog-core</artifactId>
<type>jar</type>
<version>0.5.0</version>
<!--
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</exclusion>
<exclusion>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
</exclusion>
<exclusion>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.distributedlog</groupId>
<artifactId>distributedlog-protocol</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.distributedlog</groupId>
<artifactId>distributedlog-common</artifactId>
</exclusion>
</exclusions>
-->
<version>${bookkeeper.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.apache.pulsar.functions.worker;

import lombok.extern.slf4j.Slf4j;
import org.apache.bookkeeper.conf.ClientConfiguration;
import org.apache.distributedlog.AppendOnlyStreamWriter;
import org.apache.distributedlog.DistributedLogConfiguration;
import org.apache.distributedlog.api.DistributedLogManager;
Expand All @@ -32,7 +31,6 @@
import org.apache.pulsar.functions.proto.Function;
import org.apache.pulsar.functions.worker.dlog.DLInputStream;
import org.apache.pulsar.functions.worker.dlog.DLOutputStream;
import org.apache.zookeeper.KeeperException.Code;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -45,6 +43,7 @@
import java.net.URI;
import java.net.URL;
import java.util.UUID;
import org.apache.zookeeper.KeeperException.Code;

@Slf4j
public final class Utils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.concurrent.TimeUnit;

import org.apache.bookkeeper.bookie.BookieException.InvalidCookieException;
import org.apache.bookkeeper.bookie.SortedLedgerStorage;
import org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage;
import org.apache.bookkeeper.conf.ServerConfiguration;
import org.apache.bookkeeper.proto.BookieServer;
Expand Down Expand Up @@ -211,7 +212,8 @@ public void start() throws Exception {
ServerConfiguration conf = new ServerConfiguration();
conf.setLedgerManagerFactoryClassName("org.apache.bookkeeper.meta.HierarchicalLedgerManagerFactory");
// Use minimal configuration requiring less memory for unit tests
conf.setLedgerStorageClass(DbLedgerStorage.class.getName());
// conf.setLedgerStorageClass(DbLedgerStorage.class.getName());
conf.setLedgerStorageClass(SortedLedgerStorage.class.getName());
conf.setProperty("dbStorage_writeCacheMaxSizeMb", 2);
conf.setProperty("dbStorage_readAheadCacheMaxSizeMb", 1);
conf.setProperty("dbStorage_rocksDB_writeBufferSizeMB", 1);
Expand All @@ -228,7 +230,8 @@ public void startStandalone() throws Exception {
LOG.debug("Local ZK/BK starting ...");
ServerConfiguration conf = new ServerConfiguration();
conf.setLedgerManagerFactoryClassName("org.apache.bookkeeper.meta.HierarchicalLedgerManagerFactory");
conf.setLedgerStorageClass(DbLedgerStorage.class.getName());
// conf.setLedgerStorageClass(DbLedgerStorage.class.getName());
conf.setLedgerStorageClass(SortedLedgerStorage.class.getName());
conf.setProperty("dbStorage_writeCacheMaxSizeMb", 256);
conf.setProperty("dbStorage_readAheadCacheMaxSizeMb", 64);
conf.setFlushInterval(60000);
Expand Down

0 comments on commit b7d3083

Please sign in to comment.