Skip to content

Instantly share code, notes, and snippets.

@kelemen
kelemen / SparkTest.java
Created Jun 5, 2020
Replicating Spark slowness with structs
View SparkTest.java
package sparktest;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.apache.spark.SparkConf;
import org.apache.spark.sql.Column;
@kelemen
kelemen / .gitignore
Created Sep 11, 2017
NetBeans hgignore -> gitignore port
View .gitignore
~
build
dist
nbproject/private
nbproject/sqe.properties
nbproject/findbugs.settings
nbproject/*.mk
nbproject/*.bash
test/coverage
test/lib
@kelemen
kelemen / tooling-api-18-LinkageError
Created Sep 17, 2013
LinkageError stacktrace after using the Tooling API
View tooling-api-18-LinkageError
java.lang.LinkageError: loader constraint violation: loader (instance of org/netbeans/StandardModule$OneModuleClassLoader) previously initiated loading for a different type with name "com/sun/jdi/VirtualMachineManager"
at org.netbeans.api.debugger.jpda.AttachingDICookie.findAttachingConnector(AttachingDICookie.java:250)
at org.netbeans.api.debugger.jpda.AttachingDICookie.create(AttachingDICookie.java:123)
at org.netbeans.api.debugger.jpda.JPDADebugger.attach(JPDADebugger.java:301)
at org.netbeans.gradle.project.tasks.AttacherListener.doAttach(AttacherListener.java:91)
at org.netbeans.gradle.project.tasks.AttacherListener.access$000(AttacherListener.java:28)
at org.netbeans.gradle.project.tasks.AttacherListener$1.run(AttacherListener.java:100)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
@kelemen
kelemen / tooling-api-18-exception
Created Aug 10, 2013
Exception thrown by the Tooling API when using the new API.
View tooling-api-18-exception
Failed to load Gradle project: gradle-multi-level
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'http://services.gradle.org/distributions-snapshots/gradle-1.8-20130809022440+0000-bin.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:59)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
View gradle-tooling.java
// Assuming there is a "ConsumerActionExecutor actionExecutor(ActionExecutorContext context)" in ProjectConnection.
final class ActionExecutorContext {
// Properties, like JavaHome, JvmArguments, Std[Err/Out/In] redirection
// I recommend this class to be immutable (created by a Builder).
}
interface ConsumerActionExecutor {
// After this method returns the actionListener will no longer be notified
// and the action has been executed.
@kelemen
kelemen / stacktrace.log
Created Nov 15, 2012
Gradle 1.3 rc-1 connection failure.
View stacktrace.log
Failed to load Gradle project: single1
org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'IdeaProject' using Gradle installation 'C:\Program Files\Gradle\gradle-1.3-rc-1'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:81)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Could not connect to server [bcda3279-d354-4c2e-ba17-f51be0cb45d2 port:7072, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]. Tried addresses: [/127.0.0.1, /0:0:0:0:0:0:0:1].
at org.gradle.messaging.remote.internal.inet.TcpOutgoingConnector.connect(
@kelemen
kelemen / TcpOutgoingConnector.java
Created Sep 23, 2012
A proposed fix for GRADLE-2495
View TcpOutgoingConnector.java
/*
* Copyright 2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@kelemen
kelemen / gradle-connect-failure-1.3-20120917220018
Created Sep 22, 2012
Stacktrace of Gradle daemon connection failure in 1.3-20120917220018+0000
View gradle-connect-failure-1.3-20120917220018
org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'IdeaProject' using Gradle installation 'C:\Program Files\Gradle\gradle-1.3-20120917220018+0000'.
org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55),
org.gradle.tooling.internal.consumer.async.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:81),
org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66),
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886),
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908),
java.lang.Thread.run(Thread.java:662)
Caused by:
java.lang.RuntimeException: Could not connect to server [5a6f5d02-dbb9-4c01-bf77-dbbbd42e0a41 port:10159, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]. Tried addresses: [/127.0.0.1, /0:0:0:0:0:0:0:1].