Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-494

Developer Guid review Chap. 1 - 10

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JDG 7.0.0 CR1
    • None
    • Documentation
    • None

      • 1.3.3. Limitations of Map Methods
        I couldn't find the property infinispan.accurate.bulk.ops described in this chapter in any ISPN sources. It is available under JDG_6.6.0.GA-base tag, but seems that was removed in JDG7, eventhough I couldn't find the corresponding JIRA/commit which removes it.

      should be:

      public int hashCode() {
      

      Also the steps described in points 3 and 4 are not correct. In point 3) in case you will define the newCacheName then in point 3) you can specify that new cache is registered with defined name. In case if you would like to specify the same name for the cache which is defined in the xml, then as far as I know the cache configuration which was defined in xml and was loaded by cachemanager will be overriden.
      For point 4) {{... default cache with custom configuration .. }} is wrong. Either we are getting the newly registered cache or we are getting the cache defined in xml file with custom configuraiton.
      The same refers to Procedure 6.3. Creating a Customized Cache Using a Non-Default Named Cache

      • 6.1.5.3. Globally Customize Thread Pool Executors
        The sample code given in Example 6.3. Customize Thread Pool Executors doesn't compile. The code is outdated - the replicationQueueScheduledExecutor() doesn't exist any more. And as far as I know there are no analog for it.
      • Also I would like to mention the numbering for procedures - is it ok to have repeating numbers for the procedures like 6.1, 6.2, 6.3 then again 6.1 , 6.2 , etc ?
      • 8.5.2. The Cache Listener API
        In the description of Cache API the sync attribute is not described, eventhough it is described in 8.3.3. Don't know if it is worthy to write about it again in 8.5.2.
      • The Example 8.4. Use Case: Filtering and Converting the New York orders doesn't compile. Should be:
        class CityStateFilter implements CacheEventFilter<String, Order> {
           private final String state;
           private final String city;
        
           public boolean accept(String orderId, Order oldOrder, Metadata oldMetadata, Order newOrder, Metadata newMetadata, EventType eventType) {
              switch (eventType.getType()) {
                 // Only send update if the order is going to our city
                 case Type.CACHE_ENTRY_CREATED:
                    return city.equals(newOrder.getCity()) && state.equals(newOrder.getState());
                 // Only send update if our order has changed from our city to elsewhere or if is now going to our city
                 case Type.CACHE_ENTRY_MODIFIED:
                    if (city.equals(oldOrder.getCity()) && state.equals(oldOrder.getState())) {
                       // If old city matches then we have to compare if new order is no longer going to our city
                       return !city.equals(newOrder.getCity()) || !state.equals(newOrder.getState());
                    } else {
                       // If the old city doesn't match ours then only send update if new update does match ours
                       return city.equals(newOrder.getCity()) && state.equals(newOrder.getState());
                    }
                 // On remove we have to send update if our order was originally going to city
                 case Type.CACHE_ENTRY_REMOVED:
                    return city.equals(oldOrder.getCity()) && state.equals(oldOrder.getState());
              }
              return false;
           }
        }
        
        class OrderDateConverter implements CacheEventConverter<String, Order, Date> {
           private final String state;
           private final String city;
        
           public Date convert(String orderId, Order oldValue, Metadata oldMetadata, Order newValue, Metadata newMetadata, EventType eventType) {
              // If remove we do not care about date - this tells listener to remove its data
              if (eventType.isRemove()) {
                 return null;
              } else if (eventType.isModified()) {
                 if (state.equals(newValue.getState()) && city.equals(newValue.getCity())) {
                    // If it is a modification meaning the destination has changed to ours then we allow it
                    return newValue.getDate();
                 } else {
                    // If destination is no longer our city it means it was changed from us so send null
                    return null;
                 }
              } else {
                 // This was a create so we always send date
                 return newValue.getDate();
              }
           }
        }
        
      • 8.5.4. Optimized Cache Filter Converter
        The Example 8.5. CacheEventFilterConverter doesn't compile. The code should be:
            class OrderDateFilterConverter extends AbstractCacheEventFilterConverter<String, Order, Date> {
                private final String state;
                private final String city;
        
                public Date filterAndConvert(String orderId, Order oldValue, Metadata oldMetadata, Order newValue, Metadata newMetadata, EventType eventType) {
                    // Remove if the date is not required - this tells listener to remove its data
                    if (eventType.isRemove()) {
                        return null;
                    } else if (eventType.isModified()) {
                        if (state.equals(newValue.getState()) && city.equals(newValue.getCity())) {
                            // If it is a modification meaning the destination has changed to ours then we allow it
                            return newValue.getDate();
                        } else {
                            // If destination is no longer our city it means it was changed from us so send null
                            return null;
                        }
                    } else {
                        // This was a create so we always send date
                        return newValue.getDate();
                    }
                }
            }
        

            rhn-support-chuffman Christian Huffman
            amanukya@redhat.com Anna Manukyan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: