JBoss Community

DistributedCache replication

created by Adrian Brock in JBoss AS7 Development - View the full discussion

I'm trying to create an alternate to the infinispan replicated cache that has 2 key properties that don't seem to be compatible with the current DistributedCache api.

 

1) The version/metadata/timestamp/attributes are stored in a blob together unlike the infinispan cache where they are stored seperately - but automatically using the AtomicMap.

2) The data is stored remotely so retrieving data that I am not told to replicate so as to recreate the full blob is expensive.

 

The issue comes from the following code in SessionBasedClusteredSession

 

    @Override
    protected OutgoingSessionGranularitySessionData getOutgoingSessionData() {
        Map<String, Object> attrs = isSessionAttributeMapDirty() ? getSessionAttributeMap() : null;
        DistributableSessionMetadata metadata = isSessionMetadataDirty() ? getSessionMetadata() : null;
        Long timestamp = attrs != null || metadata != null || getMustReplicateTimestamp() ? Long.valueOf(getSessionTimestamp())
                : null;
        return new OutgoingData(getRealId(), getVersion(), timestamp, metadata, attrs);
    }

 

Where the DistributedCache is not told all the data on subsequent replication requests if has not changed.

 

I'd like to have either;

1) Some way to tell it to always give me all the data - this data is held in the local cache

2) Some way of getting access to the local data so I can retrieve the data that hasn't changed without going to my remote store

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community