[JBoss JIRA] (ISPN-3144) Reduce memory consumption per cache entry
by Galder Zamarreño (JIRA)
Galder Zamarreño created ISPN-3144:
--------------------------------------
Summary: Reduce memory consumption per cache entry
Key: ISPN-3144
URL: https://issues.jboss.org/browse/ISPN-3144
Project: Infinispan
Issue Type: Enhancement
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
Fix For: 5.3.0.Final
Basically, the difference between Hot Rod then (dc6708f) and now (6058358) is: 32 bytes, which is: new metadata object, a reference to it, and 2 unusued longs for immortal entries.
With embedded metadata (~191 bytes per entry): https://dl.dropboxusercontent.com/u/6148072/with-embedded.png
With versioned entries (~159 bytes per entry): https://dl.dropboxusercontent.com/u/6148072/with-versioned.png
And there's more: we have internal cache entries that have a reference to internal cache values, per entry. This is useful for some cases (cache stores…etc), but this extra reference to the value, plus the value object itself, is 16 bytes (how useful is it really to have a separate value instance to keep just the value? Needs reassessing its usefulness...).
So really, I think the minimum Hot Rod overhead we should aim for is ~143 bytes. If each server module could define what the ICE class (well, classes to cover all immortal, mortal…etc cases) to use, which is purely designed for their servers (i.e. hot rod just needs: value + version; memcached needs: value + version + flags), we could get to this level…
You still want the metadata to be passed from the client, but for those specialised use cases in Infinispan, we could have a mapping between the metadata type and the type of ICEs created…
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months
[JBoss JIRA] (ISPN-3143) Cannot store custom objects via HotRod and read via REST
by Martin Gencur (JIRA)
Martin Gencur created ISPN-3143:
-----------------------------------
Summary: Cannot store custom objects via HotRod and read via REST
Key: ISPN-3143
URL: https://issues.jboss.org/browse/ISPN-3143
Project: Infinispan
Issue Type: Feature Request
Affects Versions: 5.3.0.Beta2
Reporter: Martin Gencur
Assignee: Galder Zamarreño
Fix For: 5.3.0.Final
The following test fails when added to EmbeddedRestHotRodTest
{code:java}
public void testCustomObjectHotRodPutEmbeddedRestGet() throws Exception{
final String key = "4";
Person p = new Person("Martin");
// 1. Put with Hot Rod
RemoteCache<String, Object> remote = cacheFactory.getHotRodCache();
assertEquals(null, remote.withFlags(Flag.FORCE_RETURN_VALUE).put(key, p));
// 2. Get with Embedded
assertTrue(cacheFactory.getEmbeddedCache().get(key) instanceof Person);
assertEquals(p.getName(), ((Person) cacheFactory.getEmbeddedCache().get(key)).getName());
// 3. Get with REST
HttpMethod get = new GetMethod(cacheFactory.getRestUrl() + "/" + key);
cacheFactory.getRestClient().executeMethod(get);
assertEquals(HttpServletResponse.SC_OK, get.getStatusCode());
//^^^ fails here - status code 500, status text: NullPointerException
Object returnedPerson = remote.getRemoteCacheManager().getMarshaller().objectFromByteBuffer(get.getResponseBodyAsString().getBytes());
assertTrue(returnedPerson instanceof Person);
assertEquals(p.getName(), ((Person) returnedPerson).getName());
}
public static class Person implements Serializable {
private String name;
public Person(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
{code}
Storing and retrieving String keys works correctly.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months
[JBoss JIRA] (ISPN-3141) Conditional commands with Flag.IGNORE_RETURN_VALUES cause NPEs
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3141?page=com.atlassian.jira.plugin.... ]
Mircea Markus updated ISPN-3141:
--------------------------------
Labels: 5.2.x (was: )
> Conditional commands with Flag.IGNORE_RETURN_VALUES cause NPEs
> ---------------------------------------------------------------
>
> Key: ISPN-3141
> URL: https://issues.jboss.org/browse/ISPN-3141
> Project: Infinispan
> Issue Type: Bug
> Components: Core API
> Affects Versions: 5.2.6.Final
> Reporter: Mircea Markus
> Assignee: Mircea Markus
> Labels: 5.2.x
> Fix For: 5.3.0.CR1, 5.3.0.Final
>
>
> The root cause of the exception below is:
> - when Flag.IGNORE_RETURN_VALUES is used the node on which the operation is executed returns NULL
> - the operation being conditional return boolean to the user. The null above is unboxed to a boolean which causes a NPE
> The solution is to ignore the Flag.IGNORE_RETURN_VALUES for conditional operations (remove(k, prevValue) replace(k, prevValue,newValue)) and return the result of the operation: this is a boolean, so the network payload is the same as for null.
> {quote}
> 14:07:57,149 WARN [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (Incoming-2,shared=tcp) ISPN000071: Caught exception when handling command SingleRpcCommand{cacheName='default', command=ReplaceCommand{key=name, oldValue=[B0x42656c61..(4), newValue=[B0x42656c61..(4), metadata=MimeMetadata(text/plain; charset=UTF-8,-1,SECONDS,-1,SECONDS,null,null), flags=null, successful=true, ignorePreviousValue=false}}: java.lang.NullPointerException
> at org.infinispan.CacheImpl.replaceInternal(CacheImpl.java:880)
> at org.infinispan.CacheImpl.replace(CacheImpl.java:871)
> at org.infinispan.DecoratedCache.replace(DecoratedCache.java:551)
> at org.infinispan.xsite.BackupReceiverImpl$BackupCacheUpdater.visitReplaceCommand(BackupReceiverImpl.java:113)
> at org.infinispan.commands.write.ReplaceCommand.acceptVisitor(ReplaceCommand.java:76)
> at org.infinispan.xsite.BackupReceiverImpl.handleRemoteCommand(BackupReceiverImpl.java:76)
> at org.infinispan.xsite.BackupReceiverRepositoryImpl.handleRemoteCommand(BackupReceiverRepositoryImpl.java:87)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.executeCommandFromRemoteSite(CommandAwareRpcDispatcher.java:255)
> at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:230)
> at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:460) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:377) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:247) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:665) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.blocks.mux.MuxUpHandler.up(MuxUpHandler.java:130) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.JChannel.up(JChannel.java:719) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1008) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.deliver(RELAY2.java:607) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.route(RELAY2.java:507) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.handleMessage(RELAY2.java:482) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.RELAY2.handleRelayMessage(RELAY2.java:463) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.protocols.relay.Relayer$Bridge.receive(Relayer.java:302) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.JChannel.up(JChannel.java:749) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1012) [jgroups-3.3.0.CR2.jar:3.3.0.CR2]
> {quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months