- Download all files.
- Build the Crystal part:
crystal build --release --cross-compile --prelude ./no_main library.cr
^ You can leave this out
^ We want to link ourselves!
^ Use our custom prelude!
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project | |
| xmlns="http://maven.apache.org/POM/4.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.foo</groupId> | |
| <artifactId>bar</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> |
| machine: | |
| environment: | |
| CRYSTAL_VERSION: "0.20.1" # Replace version to which you're using | |
| PATH: "${PATH}:${HOME}/.crystal/bin" | |
| CRYSTAL_URL: "https://github.com/crystal-lang/crystal/releases/download/${CRYSTAL_VERSION}/crystal-${CRYSTAL_VERSION}-1-linux-x86_64.tar.gz" | |
| dependencies: | |
| cache_directories: | |
| - ~/.crystal | |
| - lib | |
| - .shards |
| #!/usr/bin/env bash | |
| # | |
| # gh-dl-release! It works! | |
| # | |
| # This script downloads an asset from latest or specific Github release of a | |
| # private repo. Feel free to extract more of the variables into command line | |
| # parameters. | |
| # | |
| # PREREQUISITES | |
| # |
$ echo "2015/07/27: 明日は晴れだ" | mecab -Oyomi | nkf -w --hiragana
2015/07/27: あしたははれだ
| #[link(name = "logger")] | |
| extern { | |
| fn CrystalLog(text: *const u8); | |
| } | |
| fn log(text: &'static str) { | |
| unsafe{ CrystalLog(text.as_bytes().as_ptr()) }; | |
| } | |
| fn main() { |
| package org.iainhull.akka | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.event.Logging | |
| import akka.pattern.ask | |
| import akka.util.Timeout | |
| import akka.persistence.{PersistentView, AtLeastOnceDelivery, PersistentActor} |
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |