Skip to content

Instantly share code, notes, and snippets.

View galderz's full-sized avatar

Galder Zamarreño galderz

  • IBM
  • Switzerland
View GitHub Profile
ClientCacheEntryCreatedEvent(key=1,dataVersion=1)
ClientCacheEntryModifiedEvent(key=1,dataVersion=2)
ClientCacheEntryRemovedEvent(key=1)
import org.infinispan.client.hotrod.*;
RemoteCacheManager rcm = new RemoteCacheManager();
RemoteCache<Integer, String> cache = rcm.getCache();
EventLogListener listener = new EventLogListener();
try {
cache.addClientListener(listener);
cache.put(1, "one");
cache.put(1, "new-one");
cache.remove(1);
import org.infinispan.client.hotrod.annotation.*;
import org.infinispan.client.hotrod.event.*;
@ClientListener
public class EventLogListener {
@ClientCacheEntryCreated
@ClientCacheEntryModified
@ClientCacheEntryRemoved
public void handleRemoteEvent(ClientEvent event) {
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
<version>${infinispan.version}</version>
</dependency>
#!/usr/bin/env scalas
/***
// $ cs sbt/sbt --branch 0.13.2b
// $ export CONSCRIPT_OPTS="-XX:MaxPermSize=512M -Dfile.encoding=UTF-8"
// $ chmod -x scripts.scala
scalaVersion := "2.10.4"
resolvers += Resolver.url("typesafe-ivy-repo", url("http://typesafe.artifactoryonline.com/typesafe/releases"))(Resolver.ivyStylePatterns)
@galderz
galderz / HotRodSegmentsProposal
Last active August 29, 2015 13:57 — forked from danberindei/HotRodSegmentsProposal
Here's an updated version of the segments proposal.
Response header with topology change marker
Topology Id [vInt]
Num servers in topology [vInt]
m1: Host/IP length [vInt] m1: Host/IP address [string] m1: Port [2b - unsigned short]
m2: Host/IP length [vInt] m2: Host/IP address [string] m2: Port [2b - unsigned short]
Hash Function Version [1b]
Num segments in topology [vInt]
s1: Num owners [1b] s1: 1st owner's index [vInt] s1: 2nd owner's index [vInt]
s2: Num owners [1b] s2: 1st owner's index [vInt] s2: 2nd owner's index [vInt]
...
Tests run: 114, Failures: 6, Errors: 0, Skipped: 31, Time elapsed: 23.843 sec <<< FAILURE!
createBeforeMethod(org.infinispan.lucene.cachestore.CacheLoaderAPITest) Time elapsed: 0.008 sec <<< FAILURE!
java.lang.AssertionError: couldn't create directory for test
at org.infinispan.lucene.cachestore.CacheLoaderAPITest.createCacheManager(CacheLoaderAPITest.java:71)
at org.infinispan.test.SingleCacheManagerTest.setup(SingleCacheManagerTest.java:53)
at org.infinispan.test.SingleCacheManagerTest.createBeforeMethod(SingleCacheManagerTest.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
"org.jboss.arquillian.config" % "arquillian-config-impl-base" % "1.0.3.Final" exclude("org.jboss.shrinkwrap.descriptors", "shrinkwrap-descriptors-spi")
class PlayDescriptor(appName: String, appPath: String) extends Descriptor {
def exportAsString(): String =
s"""
| play:
| path: ${appPath}
""".stripMargin
def exportTo(output: OutputStream) {
output.write(exportAsString().getBytes(Charset.forName("UTF-8")))
21:28:51,682 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-1) Service request (GET) /helloworld-default/ArquillianServletRunner returned 404, took 196 Milliseconds
21:28:51,682 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-2) Service request (GET) /helloworld-default/ArquillianServletRunner returned 404, took 196 Milliseconds
21:28:51,700 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-3) Service request (GET) /helloworld-default/ArquillianServletRunner returned 404, took 9 Milliseconds
21:28:51,799 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-3) Service request (GET) /helloworld-default/ArquillianServletRunner returned 404, took 10 Milliseconds
21:28:51,899 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-3) Service request (GET) /helloworld-default/ArquillianServletRunner returned 404, took 10 Milliseconds
21:28:51,899 INFO [net.liftweb.util.TimeHelpers] (http-/127.0.0.1:8080-2) Service request (GET) /h