Query Pattern | Feature Type | Comment |
---|---|---|
Point lookup (query) | Entity Feature Family | 1 entity key → 1 row |
Batch query by a context | Context Feature Family | N context keys → N rows |
Recall candidates by a context | Candidate Feature Family | 1 entity key → N rows |
This is a Scala script that reads a hex string from the system clipboard and compute the length of it.
It's mainly a utility for blob. Our data is stored in Cassandra (or ScyllaDB) as blob, but sometimes we need to analyze the data.
- Install
scala-cli
in your system. - Copy the hex string to your clipboard.
- Run the script via
scala-cli hex-length.scala
.
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: coder | |
spec: | |
replicas: 1 | |
strategy: | |
type: Recreate | |
template: | |
spec: |
In the latest release of JDK 21, virtual threads have become a stable feature, revolutionizing the way we write concurrent programs in Java. With virtual threads, it is now easier than ever to create highly performant and scalable applications. In this blog post, we will explore how to build a minimal yet fully functional HTTP server from scratch using virtual threads.
Virtual threads, also known as fibers, are lightweight threads that can be scheduled cooperatively by the JVM. Unlike traditional threads, which are managed by the operating system, virtual threads are managed at the application level, resulting in reduced overhead and improved scalability. By leveraging virtual threads, we can achieve higher concurrency without the need for complex thread management.
.phony: run | |
run: thread.wasm | |
wasmtime run --wasm-features threads --wasi-modules experimental-wasi-threads ./thread.wasm | |
thread.wasm: thread.wat | |
wat2wasm --debug-names --enable-threads thread.wat |
public class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello, World!"); | |
} | |
} |
- Install go if it's not there.
- Install tailscale commands.
go install tailscale.com/cmd/[email protected] go install tailscale.com/cmd/[email protected]
Since this linux is an old version, it still use sysv scripts for service management. To run tailscaled
as a daemon (service), follow the procedure below.
# builtin functions | |
# graph is a builtin module exposed by the host environment | |
# graph.nodes = {} | |
# graph.edges = [] | |
def node(name, operation, conf={}, predicate=None): | |
""" | |
:rtype: str the node name is returned |
package example | |
import com.google.common.collect.{ImmutableCollection, ImmutableList, ImmutableMap} | |
import net.starlark.java.annot.{Param, StarlarkBuiltin, StarlarkMethod} | |
import net.starlark.java.eval.{Dict, EvalException, Module, Mutability, Starlark, StarlarkFunction, StarlarkInt, StarlarkList, StarlarkSemantics, StarlarkThread, Structure, Tuple} | |
import net.starlark.java.syntax.{FileOptions, ParserInput} | |
import scala.collection.mutable.ListBuffer | |
object StarlarkDemo extends App { |
-
Install wazero with the following commmand.
go get github.com/tetratelabs/wazero@latest
-
Download the wasm file of a Javascript interpreter. For simplicity, the following ways are listed.
- If you have wapm installed, you could download one with