commit | a5f7a66cfde97ab0aa3bfcf662d827a4aeb324e1 | [log] [tgz] |
---|---|---|
author | Cameron Lee <calee@linkedin.com> | Mon Jun 15 15:40:13 2020 -0700 |
committer | GitHub <noreply@github.com> | Mon Jun 15 15:40:13 2020 -0700 |
tree | 9bb2bb6ea7701c15bed92dc384ad4d05d2513562 | |
parent | 0b65dbf0e25a030c249791a485f3b46d79cec64f [diff] |
SAMZA-2516: Migrate BaseKeyValueStorageEngineFactory to be an abstract class instead of trait (#1352) API changes: BaseKeyValueStorageEngineFactory is no longer a Scala trait, so that could potentially impact existing inheritors: 1. Any existing Scala classes which uses the with syntax to mix in BaseKeyValueStorageEngineFactory will need to be updated to use BaseKeyValueStorageEngineFactory as an abstract class instead. If an existing Scala class used extends BaseKeyValueStorageEngineFactory (such as how InMemoryKeyValueStorageEngineFactory and RocksDbKeyValueStorageEngineFactory uses BaseKeyValueStorageEngineFactory), then it should not need to change. 2. Scala 2.12 compiles traits into interfaces with default methods, so a Java class built against the Scala 2.12 version of BaseKeyValueStorageEngineFactory won't be able to use it as an interface. A Java class will need to use BaseKeyValueStorageEngineFactory as an abstract class. I suppose BaseKeyValueStorageEngineFactory could work as an interface with a default implementation for getStorageEngine, but it seems like abstract class fits the pattern better, since getKVStore shouldn't be a public method. Upgrade instructions: Any custom implementation of BaseKeyValueStorageEngineFactory needs to treat it as an abstract class, not a trait/interface. If it is necessary to make changes, only class inheritance structure should need to be changed. The functionality/signature of getStorageEngine and the usage of the getKVStore abstract method are the same, so those pieces should stay the same.
Apache Samza is a distributed stream processing framework. It uses Apache Kafka for messaging, and Apache Hadoop YARN to provide fault tolerance, processor isolation, security, and resource management.
Samza's key features include:
Check out Hello Samza to try Samza. Read the Background page to learn more about Samza.
To build Samza from a git checkout, run:
./gradlew clean build
To build Samza from a source release, it is first necessary to download the gradle wrapper script above. This bootstrapping process requires Gradle to be installed on the source machine. Gradle is available through most package managers or directly from its website. To bootstrap the wrapper, run:
gradle -b bootstrap.gradle
After the bootstrap script has completed, the regular gradlew instructions below are available.
Samza builds with Scala 2.11 or 2.12 and YARN 2.6.1, by default. Use the -PscalaSuffix switches to change Scala versions. Samza supports building Scala with 2.11 and 2.12.
./gradlew -PscalaSuffix=2.11 clean build
To run all tests:
./gradlew clean test
To run a single test:
./gradlew clean :samza-test:test -Dtest.single=TestStatefulTask
To run key-value performance tests:
./gradlew samza-shell:kvPerformanceTest -PconfigPath=file://$PWD/samza-test/src/main/config/perf/kv-perf.properties
To run yarn integration tests:
./bin/integration-tests.sh <dir> yarn-integration-tests
To run standalone integration tests:
./bin/integration-tests.sh <dir> standalone-integration-tests
./gradlew checkstyleMain checkstyleTest
To run a job (defined in a properties file):
./gradlew samza-shell:runJob -PconfigPath=/path/to/job/config.properties
To inspect a job's latest checkpoint:
./gradlew samza-shell:checkpointTool -PconfigPath=/path/to/job/config.properties
To modify a job's checkpoint (assumes that the job is not currently running), give it a file with the new offset for each partition, in the format systems.<system>.streams.<topic>.partitions.<partition>=<offset>
:
./gradlew samza-shell:checkpointTool -PconfigPath=/path/to/job/config.properties \ -PnewOffsets=file:///path/to/new/offsets.properties
To get Eclipse projects, run:
./gradlew eclipse
For IntelliJ, run:
./gradlew idea
To start contributing on Samza please read Rules and Contributor Corner. Notice that Samza git repository does not support git pull request.
Apache Samza is a top level project of the Apache Software Foundation.