docker run --name scyllaU -d scylladb/scylla:3.0.10
docker exec -it scyllaU nodetool status
docker exec -it scyllaU cqlsh
CREATE KEYSPACE Pets_Clinic WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
use Pets_Clinic;
CREATE TABLE heartrate_v1 (
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val publishUpdate = taskKey[Unit]("Publish update files to webdavserv/dir/dir/version") | |
publishUpdate := { | |
val puf = new File("publishUpdate.sh").getCanonicalPath+" "+version.value | |
puf ! | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/ | |
# GENERAL | |
# print lines begining with range of letters | |
grep ^[A-D] table.txt | |
# REGEX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* library dependecies | |
"org.xerial" % "sqlite-jdbc" % "3.23.1", | |
"org.tpolecat" %% "doobie-core" % "0.5.3", | |
"org.tpolecat" %% "doobie-hikari" % "0.5.3", // HikariCP transactor. | |
"org.tpolecat" %% "doobie-specs2" % "0.5.3", // Specs2 support for typechecking statements. | |
"org.tpolecat" %% "doobie-scalatest" % "0.5.3", // ScalaTest support for typechecking statements. | |
*/ | |
object TryDoobie extends App { | |
import doobie._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* "org.jetbrains.xodus" % "xodus-openAPI" % "1.2.3", | |
"org.jetbrains.xodus" % "xodus-entity-store" % "1.2.3", | |
*/ | |
object XodusApp extends App { | |
import jetbrains.exodus.bindings.StringBinding.{entryToString, stringToEntry} | |
import jetbrains.exodus.env.StoreConfig.WITHOUT_DUPLICATES | |
val env = Environments.newInstance("data") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.{ActorSystem, Props} | |
import akka.stream.{ActorMaterializer, OverflowStrategy} | |
import akka.stream.scaladsl.{Flow, Sink, Source} | |
import com.typesafe.config.ConfigFactory | |
import jetbrains.exodus.entitystore.{PersistentEntityStoreImpl, PersistentEntityStores} | |
import jetbrains.exodus.env.{Environments, Store} | |
import org.apache.commons.lang3.SerializationUtils | |
import collection.JavaConverters._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DaoOperationsSyntax { | |
val dao: DaoDatabase | |
fun User.queryUser() = | |
dao.query("SELECT * from Users where userId = ${this.id}") | |
fun Company.queryCompany() = | |
dao.query("SELECT * from Companies where companyId = ${this.id}") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import reactor.core.publisher.Flux; | |
import reactor.core.scheduler.Schedulers; | |
Flux.fromIterable(Arrays.asList(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)) | |
.groupBy(x -> x.hashCode() % 5) | |
.parallel(10) | |
.runOn(Schedulers.parallel()) | |
.flatMap(g -> g.collectMap(y -> {log.info(" g: "+g.key()+" y: "+ y); return y;}).log("subscr")) | |
.subscribe(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.my.helpers | |
import io.github.serpro69.kfaker.faker | |
import mu.KLogging | |
import org.apache.avro.SchemaBuilder | |
import org.apache.avro.generic.GenericData | |
import org.apache.avro.generic.GenericRecord | |
import org.apache.avro.reflect.ReflectData | |
import org.apache.parquet.avro.AvroParquetWriter | |
import org.apache.parquet.hadoop.ParquetFileReader |
OlderNewer