This file contains 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.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.List; | |
import java.util.concurrent.CopyOnWriteArrayList; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.TimeUnit; |
This file contains 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 org.xbib.netty.http.server.test.simple; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.ChannelInboundHandlerAdapter; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.ChannelPipeline; |
This file contains 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 org.xbib.netty.http.client.test.simple; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.SimpleChannelInboundHandler; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.SocketChannel; |
This file contains 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
java -version | |
openjdk version "1.8.0_112" | |
OpenJDK Runtime Environment (Zulu 8.19.0.1-linux64) (build 1.8.0_112-b16) | |
OpenJDK 64-Bit Server VM (Zulu 8.19.0.1-linux64) (build 25.112-b16, mixed mode) | |
Looks a bit like https://bugs.openjdk.java.net/browse/JDK-8143898 but it's another issue: there is no safety mechanism | |
(or a failing mechanism) in the Java compiler to guard against massive nested method calls like a.add(b).add(c)... | |
on tight thread stack size. It happened on a Linux 40 core CPU machine with 64 GB RAM when >700 nested method calls | |
are parsed by javac. Default on Linux is -J-Xss1m which is exceeded, -J-Xss2m works. Also smaller machines (laptops) | |
with lower CPU core count and lower RAM size are exempted from this error. javac reads the total amount of RAM |
This file contains 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
@Grab(group='org.elasticsearch.client', module='transport', version='5.0.2') | |
@Grab(group='org.apache.logging.log4j', module='log4j-core', version='2.6.2') | |
@Grab(group='org.apache.logging.log4j', module='log4j-api', version='2.6.2') | |
import org.elasticsearch.action.admin.indices.create.CreateIndexAction | |
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder | |
import org.elasticsearch.action.index.IndexAction | |
import org.elasticsearch.action.index.IndexRequestBuilder | |
import org.elasticsearch.action.search.SearchResponse | |
import org.elasticsearch.action.support.WriteRequest |
This file contains 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
uname -a | |
Darwin Jorg-Prantes-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64 | |
java -version | |
java version "1.8.0_102" | |
Java(TM) SE Runtime Environment (build 1.8.0_102-b14) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) | |
env | grep JAVA | |
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home |
This file contains 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
DELETE /myindex | |
PUT /myindex/ | |
{ | |
"mappings": { | |
"error" : { | |
"_parent" : { | |
"type" : "activitytype" | |
} | |
} |
This file contains 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.net.InetAddress; | |
import java.net.NetworkInterface; | |
import java.util.Collections; | |
import java.util.Enumeration; | |
public class NetworkInterfaceTester { | |
public static void main(String[] args) throws Exception { | |
Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces(); | |
for (NetworkInterface netint : Collections.list(nets)) { |
This file contains 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
DELETE /test | |
PUT /test | |
POST /test/doc/_mapping | |
{ | |
"properties": { | |
"message": { | |
"type": "string", "analyzer" : "simple" | |
} |
This file contains 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
DELETE /test | |
PUT /test/ | |
{ | |
"settings": { | |
"analysis": { | |
"filter" : { | |
"heart" : { | |
"type" : "synonym", | |
"synonyms" : [ |
NewerOlder