Skip to content

Instantly share code, notes, and snippets.

View tallpsmith's full-sized avatar

Paul Smith tallpsmith

  • Everest Engineering
  • Melbourne, Australia
View GitHub Profile
@tallpsmith
tallpsmith / Listing JMX beans from ActiveMQ using Jolokia
Last active April 28, 2022 08:49
Jolokia REST example using ActiveMQ
#curl -XGET --user USERNAME:PASSWORD http://localhost:8161/api/jolokia/list | python -m json.tool
#
{
"request": {
"type": "list"
},
"status": 200,
"timestamp": 1420595652,
"value": {
"JMImplementation": {
@tallpsmith
tallpsmith / gist:1440329
Created December 6, 2011 22:27
runaway ES client threads
Suspiciously Bad Thread (one of 10 looping around in similar stack elements)
New I/O client worker #1-10 daemon (tid:26262/0x6696)
at org.elasticsearch.common.netty.util.internal.LinkedTransferQueue.xfer(LinkedTransferQueue.java:630)
at org.elasticsearch.common.netty.util.internal.LinkedTransferQueue.poll(LinkedTransferQueue.java:1175)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processWriteTaskQueue(NioWorker.java:263)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:199)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
@tallpsmith
tallpsmith / gist:1372395
Created November 17, 2011 04:56
Despite disable_flush and snapshot_interval set to 0, snapshotting to the filesystem is being done.
[2011-11-17 15:14:57,509][INFO ][index.translog ] [index4.qa.acx] [snaptest][0] updating disable_flush from [false] to [true]
[2011-11-17 15:14:57,509][INFO ][index.translog ] [index4.qa.acx] [snaptest][1] updating disable_flush from [false] to [true]
[2011-11-17 15:14:57,509][INFO ][index.translog ] [index4.qa.acx] [snaptest][2] updating disable_flush from [false] to [true]
[2011-11-17 15:15:19,369][DEBUG][index.gateway ] [index4.qa.acx] [snaptest][1] snapshot (scheduled) to fs:///mnt/esgateway/[qa4][indices][snaptest][1] ...
[2011-11-17 15:15:19,408][DEBUG][index.gateway ] [index4.qa.acx] [snaptest][1] snapshot (scheduled) completed to fs:///mnt/esgateway/[qa4][indices][snaptest][1], took [38ms]
index : version [1321492168154], number_of_files [1] with total_size [712b], took [7ms]
translog : id [1321492168152], number_of_operations [1], took [4ms]
[2011-11-17 15:19:33,265][INFO ][index.gateway ] [index4.qa.acx] [qa4][0] updating
BulkRequest bulkRequest = new BulkRequestBuilder(client).request();
URL bulkIndexRequest = this.getClass().getResource("es-bulkindex.json");
CountingOutputStream countingOutputStream = new CountingOutputStream(new NullOutputStream());
ByteStreams.copy(bulkIndexRequest.openStream(), countingOutputStream);
long numBytes = countingOutputStream.getCount();
bulkRequest.add(ByteStreams.toByteArray(bulkIndexRequest.openStream()), 0, (int) numBytes, true);
@tallpsmith
tallpsmith / gist:1283195
Created October 13, 2011 02:36
Parent/Child Mapping example of a Document meta-data record and it's child file content
export ES_HOST=http://localhost:9200
# delete & recreate index with defaults
curl -XDELETE $ES_HOST/projects
curl -XPUT $ES_HOST/projects
# configure the Parent mapping type, a 'doc' with a document number and title field to simulate common meta data
curl -XPUT $ES_HOST/projects/doc/_mapping -d'
{
[2011-09-01 16:16:58,050][ERROR][bootstrap ] [Man-Beast] {elasticsearch/0.18.0-SNAPSHOT/2011-09-01T02:38:23}: Startup Failed ...
- ProvisionException[Guice provision errors:
1) Error injecting constructor, java.lang.RuntimeException: java.lang.NullPointerException
at com.aconex.elasticsearch.plugin.pcp.ParfaitNetworkService.<init>(Unknown Source)
while locating com.aconex.elasticsearch.plugin.pcp.ParfaitNetworkService
1 error]
RuntimeException[java.lang.NullPointerException]
@tallpsmith
tallpsmith / gist:1150846
Created August 17, 2011 05:06
reason for needing bindInterceptor
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("create", Engine.Create.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("index", Engine.Index.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("flush", Engine.Flush.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("delete", Engine.Delete.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("delete", Engine.DeleteByQuery.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("optimize", Engine.Optimize.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("refresh", Engine.Refresh.class));
bindEngineMethodToCounterAndAction(parfaitService, RobinEngine.class.getMethod("snapshot", Engine.SnapshotHandler.class));...