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 info.unportant.test.testnb; | |
import java.util.concurrent.CyclicBarrier; | |
public class CyclicBarrierExample { | |
static private void sleep(String msg) { | |
int msec = (int) (Math.random() * 1000); | |
System.out.println(msg + " sleep"); | |
try { |
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 bench; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.BenchmarkType; | |
import org.openjdk.jmh.annotations.GenerateMicroBenchmark; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; | |
import org.openjdk.jmh.annotations.State; |
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
# Run progress: 0.00% complete, ETA 00:07:21 | |
# VM invoker: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64/jre/bin/java | |
# VM options: -XX:-RestrictContended | |
# Fork: 1 of 3 | |
# Warmup: 3 iterations, 1 s each | |
# Measurement: 6 iterations, 3 s each | |
# Threads: 4 threads, will synchronize iterations | |
# Benchmark mode: Average time, time/op | |
# Benchmark: gist.contended.Benchmarks.contendedArray | |
# Warmup Iteration 1: 66.198 ns/op |
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 org.openjdk.jol.info.GraphLayout; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.TreeMap; | |
public class Main { | |
static final int SIZE = 1<<18; | |
static final double LOAD_FACTOR = 0.75; |
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 org.apache.hadoop.util.Tool; | |
import org.apache.hadoop.util.ToolRunner; | |
public class Main { | |
private static String TOOL_CL_NAME = "MyTool"; | |
public static void main(String[] args) throws Exception { | |
RunJarClassLoader toolClassLoader = RunJarClassLoader.fromContextClassLoader(); | |
toolClassLoader.installAsContextClassLoader(); |
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 fr.mediametrie.internet.weball.crunch; | |
import java.util.List; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import org.apache.crunch.PipelineResult; | |
import org.apache.crunch.impl.mr.MRPipeline; | |
import org.apache.crunch.impl.mr.MRPipelineExecution; | |
import org.apache.hadoop.conf.Configuration; |
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 info.unportant.gist.jsr310; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; | |
import org.openjdk.jmh.annotations.Param; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.State; |
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 cma.sandox; | |
import com.google.common.reflect.TypeResolver; | |
import org.assertj.core.api.WithAssertions; | |
import org.junit.Test; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import java.util.Arrays; |
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 org.springframework.boot.SpringApplication; | |
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; | |
import org.springframework.boot.logging.LoggingApplicationListener; | |
import org.springframework.boot.logging.LoggingSystem; | |
import org.springframework.boot.logging.logback.LogbackLoggingSystem; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationEvent; | |
import org.springframework.context.event.GenericApplicationListener; | |
import org.springframework.core.ResolvableType; | |
import org.springframework.core.env.ConfigurableEnvironment; |
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 Wither<T extends Record> { | |
default <V> T with( SerializableSupplier<V> accessor, V newValue ) { | |
try { | |
var providedAccessor = accessor.method( ); | |
var components = R.class.getRecordComponents( ); | |
var accessors = Arrays.stream( components ) | |
.map( RecordComponent::getAccessor ) |