Skip to content

Instantly share code, notes, and snippets.

View vblagoje's full-sized avatar
😀

Vladimir Blagojevic vblagoje

😀
View GitHub Profile
public interface Mapper<KIn, VIn, KOut, VOut> extends Serializable {
void map(KIn key, VIn value, Collector<KOut,VOut> collector);
}
public interface Reducer<KOut,VOut> extends Serializable{
VOut reduce(KOut key, Iterator<VOut>);
}
public interface Collator<VOut,R> {
R collate();
@vblagoje
vblagoje / WithinThreadExecutor.java
Created November 9, 2011 15:21
WithinThreadExecutor proposal
public final class WithinThreadExecutor extends AbstractExecutorService {
private volatile boolean shutDown = false;
public void execute(Runnable command) {
command.run();
}
public void shutdown() {
shutDown = true;
}
@vblagoje
vblagoje / gist:1651cb77fba86c738fdb
Created July 25, 2014 13:34
New MapReduceTask execute methods
/**
* Executes this task and stores results in the provided results cache. The results can be
* obtained once the execute method completes i.e., execute method is synchronous.
*
* This variant of execute method minimizes the possibility of the master JVM node exceeding
* its allowed maximum heap, especially if objects that are results of the reduce phase have a
* large memory footprint and/or multiple MapReduceTasks are executed concurrently on the master
* task node.
*
* @param resultsCache
@vblagoje
vblagoje / gist:8da59253c74f03f33422
Created October 19, 2015 09:50
infinispan management console release error
ERROR] npm WARN optional dep failed, continuing utf-8-validate@1.2.1
[ERROR] npm WARN optional dep failed, continuing bufferutil@1.2.1
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project infinispan-management-console: Failed to deploy artifacts: Could not transfer artifact org.infinispan:infinispan-management-console:jar:8.1.0.Alpha2 from/to jboss-releases-repository (https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/): Failed to transfer file: https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/org/infinispan/infinispan-management-console/8.1.0.Alpha2/infinispan-management-console-8.1.0.Alpha2.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
@vblagoje
vblagoje / gist:28caff9d8861fd8748bb
Created January 29, 2016 17:07
console_build_failure
beleza:infinispan-management-console vblagoje$ mvn clean package
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Infinispan Management Console 8.2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
@vblagoje
vblagoje / gist:fa653a62a1754ac123a0
Created February 10, 2016 22:24
Upload file to Wildfly using XMLHttpRequest
ModelControllerClient.prototype.uploadFile = function(op, file, uploadProgress) {
var fd = new FormData();
fd.append('file', file);
var blob = new Blob([JSON.stringify(op)], {type : "application/json"});
fd.append('operation', blob);
console.log('Upload started');
var http = new XMLHttpRequest();
[Host Controller] 17:25:18,523 INFO [org.jboss.as.repository] (management task-1) WFLYDR0001: Content added at location /Users/vblagoje/workspace/infinispan/server/integration/build/target/infinispan-server-8.2.0-SNAPSHOT/domain/data/content/c7/745b7d24fe15ca049520afbac39a495036ca7e/content
[Host Controller] 17:26:46,100 ERROR [io.undertow.request] (management task-5) UT005071: Undertow request failed HttpServerExchange{ POST /management-upload request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], Accept-Language=[en-US,en;q=0.5], Accept-Encoding=[gzip, deflate], User-Agent=[Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:43.0) Gecko/20100101 Firefox/43.0], X-Management-Client-Name=[HAL], Connection=[keep-alive], Authorization=[Digest username="vladimir", realm="ManagementRealm", nonce="z1KZEzyR+fcNMTQ1NTY2MTUwNDU3MUsbhBB02UkL+BHmKkOaoGc=", uri="/management-upload", algorithm=MD5, response="ac9528e2323d7ae906247eb473656aba", opaque="00000000000000000000000000000000", qop=auth, nc
@vblagoje
vblagoje / gist:6a863396f4a3f25855f5
Created February 24, 2016 18:16
CacheMetricsHandler.java issue
13:07:15,576 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 53) WFLYCTL0013: Operation ("read-attribute") failed - address: ([
[Server:server-two] ("subsystem" => "datagrid-infinispan"),
[Server:server-two] ("cache-container" => "clustered"),
[Server:server-two] ("distributed-cache" => "default")
[Server:server-two] ]): java.lang.NullPointerException
[Server:server-two] at org.jboss.as.clustering.infinispan.subsystem.CacheMetricsHandler.executeRuntimeStep(CacheMetricsHandler.java:286)
[Server:server-two] at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:53)
[Server:server-two] at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:890)
[Server:server-two] at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:659)
[Server:server-two] at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:37
<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (serialize_test_component_metadata) @ infinispan-cachestore-leveldb ---
[INFO] skipping execute as per configuraion
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (copy_serialized_test_metadata) @ infinispan-cachestore-leveldb ---
[INFO] Skipping Antrun execution
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ infinispan-cachestore-leveldb ---
[INFO] Tests are skipped.
cloud-user@infinispan-ci-3:~/ci/release/infinispan.github.io [develop|✔]$ ./bin/publish_staging.sh
Processing infinispan
9.0.x
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=400m; support was removed in 8.0
unzip: cannot find or open /mnt/persistent_storage/cloud-user/ci/release/infinispan.github.io/docs/9.0.x/*.zip, /mnt/persistent_storage/cloud-user/ci/release/infinispan.github.io/docs/9.0.x/*.zip.zip or /mnt/persistent_storage/cloud-user/ci/release/infinispan.github.io/docs/9.0.x/*.zip.ZIP.
No zipfiles found.
Alias dev
8.2.x
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=400m; support was removed in 8.0