• Leader of HBase team for LINE Messenger Backend • Contributed to Java 8, 9 • Project Lambda Contributor • Project Kulla (jshell) Committer • JJUG Board member • Recent work • Modernize Java version for HBase/Hadoop • From Java 8 to Java 17 with new HBase/Hadoop version • Evaluate ZGC for HBase
Maybe<T> permits Just, Nothing {} record Just<T>(T value) implements Maybe<T> {} record Nothing<T>() implements Maybe<T> {} Maybe<?> maybe = ...; switch (maybe) { case Just j -> // Pattern for Type in switch cond. String.valueOf(j.value()); case Nothing n -> "Nothing"; // Pattern for Type in switch cond. }
Maybe<T> permits Just, Nothing {} record Just<T>(T value) implements Maybe<T> {} record Nothing<T>() implements Maybe<T> {} Maybe<?> maybe = ...; switch (maybe) { case Just(var s) -> // Pattern for Record in switch cond. String.valueOf(s); case Nothing() -> "Nothing"; // Pattern for Record in switch cond. }
Maybe<T> permits Just, Nothing {} record Just<T>(T value) implements Maybe<T> {} record Nothing<T>() implements Maybe<T> {} Maybe<?> maybe = ...; switch (maybe) { case Just(var s) when s == null -> throw new NullPointerException(); case Just(var s) -> String.valueOf(s); case Nothing n -> "Nothing"; // Pattern for Type in switch cond. case null -> "null" }
Maybe<T> permits Just, Nothing {} record Just<T>(T value) implements Maybe<T> {} record Nothing<T>() implements Maybe<T> {} Maybe<?> maybe = ...; switch (maybe) { // Pattern for Record matching Type in switch cond. case Just(String s) -> "String"; case Just(Integer n) -> "Integer"; case Just j -> "Other"; // Pattern for Type in switch cond. case Nothing n -> "Nothing"; // Pattern for Type in switch cond. }
{ SHRINK, EXPAND } Maybe<Action> action = ...; size += switch (action) { case Just(SHRINK) -> -10; // NG, cannot match with Enum value case Just(EXPAND) -> 10; // NG, cannot match with Enum value case Nothing() -> 0; }
{ SHRINK, EXPAND } Maybe<Action> action = ...; size += switch (action) { case Just(var a) when a == Action.SHRINK -> -10; case Just(var a) when a == Action.EXPAND -> 10; case Just j -> throw new ISE("Added new enum value to Action"); case Nothing() -> 0; }
Attach APIを使ってJava Agentを動的にロードすると警告 • 将来的にはデフォルトでは禁止に • --javaagentで静的にロード:OK • 動的にロードする場合:-XX:+EnableDynamicAgentLoading • Java AgentをロードしないAttachAPIを使用するツール:影響を受けない • jcmd • jconsole • ... WARNING: A {Java,JVM TI} agent has been loaded dynamically (file:/u/bob/agent.jar) WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information WARNING: Dynamic loading of agents will be disallowed by default in a future release
response unpack response unpack response Application thread IO Event handler loop DB request + callback Run callback DB request + callback Run callback DB request + callback Run callback DB DB DB validate DB request + callback DB unpack response
DB access Virtual Thread Thread 1 Java Thread = OS Thread Carrier Thread DB access 3s validate DB done? or yield() validate DB done? or yield() unpack response unpack response validate DB access unpack response validate DB done? or yield() DB done? or yield() unpack response unpack response
var aFuture = readFromDB1(); var bFuture = readFromDB2(); var cFuture = readFromMicroservice(); var a = aFuture.get(); // ... }); • → JEP 453: Structured Concurrency