[JBoss JIRA] (ISPN-7784) BytesObjectInput doesn't implement ObjectInput properly
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-7784?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-7784:
-------------------------------
Summary: BytesObjectInput doesn't implement ObjectInput properly (was: BytesObjectInput doesn't implement DataInput properly)
> BytesObjectInput doesn't implement ObjectInput properly
> -------------------------------------------------------
>
> Key: ISPN-7784
> URL: https://issues.jboss.org/browse/ISPN-7784
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 9.0.0.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Fix For: 9.1.0.Final
>
>
> The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
> Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7784) BytesObjectInput doesn't implement DataInput properly
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-7784?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-7784:
-------------------------------
Summary: BytesObjectInput doesn't implement DataInput properly (was: BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end)
> BytesObjectInput doesn't implement DataInput properly
> -----------------------------------------------------
>
> Key: ISPN-7784
> URL: https://issues.jboss.org/browse/ISPN-7784
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 9.0.0.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Fix For: 9.1.0.Final
>
>
> The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
> Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7784) BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-7784?page=com.atlassian.jira.plugin.... ]
Dan Berindei commented on ISPN-7784:
------------------------------------
{{BytesObjectInput#readByte()}} is also incorrect, it should throw {{EOFException}} at the end of the buffer but it throws the same {{ArrayIndexOutOfBoundsException}}.
> BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
> ------------------------------------------------------------------------
>
> Key: ISPN-7784
> URL: https://issues.jboss.org/browse/ISPN-7784
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 9.0.0.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Fix For: 9.1.0.Final
>
>
> The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
> Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7784) BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
by Dan Berindei (JIRA)
Dan Berindei created ISPN-7784:
----------------------------------
Summary: BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
Key: ISPN-7784
URL: https://issues.jboss.org/browse/ISPN-7784
Project: Infinispan
Issue Type: Bug
Components: Core
Affects Versions: 9.0.0.Final
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 9.1.0.Final
The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7784) BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-7784?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-7784:
-------------------------------
Status: Open (was: New)
> BytesObjectInput.read() throws ArrayIndexOutOfBoundsException at the end
> ------------------------------------------------------------------------
>
> Key: ISPN-7784
> URL: https://issues.jboss.org/browse/ISPN-7784
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 9.0.0.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Fix For: 9.1.0.Final
>
>
> The {{java.io.ObjectInput#read()}} javadoc says implementations should return -1 if the end of the stream is reached, but {{BytesObjectInput}} throws an {{ArrayIndexOutOfBoundsException}}.
> Actually, {{read()}} is only used because {{ExternalJBossMarshaller.JBossByteInput}} doesn't implement {{read(byte[])}}. This makes unmarshalling of external objects slower than it should be, because {{InputStream.read(byte[])}} fills the buffer by repeatedly calling {{read()}}.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7783) ClassCastException in case of configured read-through cache with some cache loader
by Roman Chigvintsev (JIRA)
[ https://issues.jboss.org/browse/ISPN-7783?page=com.atlassian.jira.plugin.... ]
Roman Chigvintsev updated ISPN-7783:
------------------------------------
Steps to Reproduce:
1). Configure cache in invalidation mode in XML:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:8.2">
<cache-container default-cache="default">
<transport cluster="jcache-cluster"/>
<invalidation-cache-configuration name="user" mode="SYNC" statistics="true"/>
</cache-container>
</infinispan>
{code}
2). Provide cache loader configuration through JCache API:
{code:java}
new MutableConfiguration<String, User>()
.setReadThrough(true).setStoreByValue(true)
.setCacheLoaderFactory(FactoryBuilder.factoryOf(UserCacheLoader.class));
{code}
Cache loader can be trivial:
{code:java}
public class UserCacheLoader implements CacheLoader<String, User> {
@Override
public User load(String username) {
return new User(username);
}
}
{code}
3). Load serveral users into the cache.
4). Call `javax.cache.Cache.removeAll()` method on the cache instance.
was:
*Configure cache in invalidation mode in XML:*
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:8.2">
<cache-container default-cache="default">
<transport cluster="jcache-cluster"/>
<invalidation-cache-configuration name="user" mode="SYNC" statistics="true"/>
</cache-container>
</infinispan>
{code}
*Provide cache loader configuration through JCache API:*
{code:java}
new MutableConfiguration<String, User>()
.setReadThrough(true).setStoreByValue(true)
.setCacheLoaderFactory(FactoryBuilder.factoryOf(UserCacheLoader.class));
{code}
Cache loader can be trivial:
{code:java}
public class UserCacheLoader implements CacheLoader<String, User> {
@Override
public User load(String username) {
return new User(username);
}
}
{code}
*Load serveral users into the cache.*
*Call `javax.cache.Cache.removeAll()` method on the cache instance.*
> ClassCastException in case of configured read-through cache with some cache loader
> ----------------------------------------------------------------------------------
>
> Key: ISPN-7783
> URL: https://issues.jboss.org/browse/ISPN-7783
> Project: Infinispan
> Issue Type: Bug
> Components: JCache
> Affects Versions: 8.2.1.Final, 9.0.0.Final
> Reporter: Roman Chigvintsev
>
> When cache is configured through JCache API as a read-through cache with some cache loader Infinispan puts cache values provided by that loader in place of keys. It causes `java.lang.ClassCastException` after calling of `javax.cache.Cache.removeAll` method. Iteration on cache also turns out to be broken.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7783) ClassCastException in case of configured read-through cache with some cache loader
by Roman Chigvintsev (JIRA)
[ https://issues.jboss.org/browse/ISPN-7783?page=com.atlassian.jira.plugin.... ]
Roman Chigvintsev updated ISPN-7783:
------------------------------------
Steps to Reproduce:
*Configure cache in invalidation mode in XML:*
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:8.2">
<cache-container default-cache="default">
<transport cluster="jcache-cluster"/>
<invalidation-cache-configuration name="user" mode="SYNC" statistics="true"/>
</cache-container>
</infinispan>
{code}
*Provide cache loader configuration through JCache API:*
{code:java}
new MutableConfiguration<String, User>()
.setReadThrough(true).setStoreByValue(true)
.setCacheLoaderFactory(FactoryBuilder.factoryOf(UserCacheLoader.class));
{code}
Cache loader can be trivial:
{code:java}
public class UserCacheLoader implements CacheLoader<String, User> {
@Override
public User load(String username) {
return new User(username);
}
}
{code}
*Load serveral users into the cache.*
*Call `javax.cache.Cache.removeAll()` method on the cache instance.*
was:
# Configure cache in invalidation mode in XML:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:8.2">
<cache-container default-cache="default">
<transport cluster="jcache-cluster"/>
<invalidation-cache-configuration name="user" mode="SYNC" statistics="true"/>
</cache-container>
</infinispan>
{code}
# Provide cache loader configuration through JCache API:
{code:java}
new MutableConfiguration<String, User>()
.setReadThrough(true).setStoreByValue(true)
.setCacheLoaderFactory(FactoryBuilder.factoryOf(UserCacheLoader.class));
{code}
Cache loader can be trivial:
{code:java}
public class UserCacheLoader implements CacheLoader<String, User> {
@Override
public User load(String username) {
return new User(username);
}
}
{code}
# Load serveral users into the cache.
# Call `javax.cache.Cache.removeAll()` method on the cache instance.
> ClassCastException in case of configured read-through cache with some cache loader
> ----------------------------------------------------------------------------------
>
> Key: ISPN-7783
> URL: https://issues.jboss.org/browse/ISPN-7783
> Project: Infinispan
> Issue Type: Bug
> Components: JCache
> Affects Versions: 8.2.1.Final, 9.0.0.Final
> Reporter: Roman Chigvintsev
>
> When cache is configured through JCache API as a read-through cache with some cache loader Infinispan puts cache values provided by that loader in place of keys. It causes `java.lang.ClassCastException` after calling of `javax.cache.Cache.removeAll` method. Iteration on cache also turns out to be broken.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months
[JBoss JIRA] (ISPN-7783) ClassCastException in case of configured read-through cache with some cache loader
by Roman Chigvintsev (JIRA)
Roman Chigvintsev created ISPN-7783:
---------------------------------------
Summary: ClassCastException in case of configured read-through cache with some cache loader
Key: ISPN-7783
URL: https://issues.jboss.org/browse/ISPN-7783
Project: Infinispan
Issue Type: Bug
Components: JCache
Affects Versions: 9.0.0.Final, 8.2.1.Final
Reporter: Roman Chigvintsev
When cache is configured through JCache API as a read-through cache with some cache loader Infinispan puts cache values provided by that loader in place of keys. It causes `java.lang.ClassCastException` after calling of `javax.cache.Cache.removeAll` method. Iteration on cache also turns out to be broken.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 7 months