Package com.tangosol.util

Examples of com.tangosol.util.BinaryEntry


        public Map processAll(Set entries) {
            if (!entries.isEmpty()) {
                Map backingMap = null;
                List<Object> keys = new ArrayList<Object>(entries.size());
                for(Object e: entries) {
                    BinaryEntry entry = (BinaryEntry) e;
                    if (backingMap == null) {
                        backingMap = entry.getBackingMap();
                    }
                    if (!entry.isPresent()) {
                        keys.add(entry.getKey());
//                        keys.add(entry.getBinaryKey());
                    }
                }
               
                ReadWriteBackingMap rwmap = (ReadWriteBackingMap) backingMap;
//                rwmap.getAll(keys);
                Map data = ((CacheStoreWrapper)rwmap.getCacheStore()).getCacheStore().loadAll(keys);
               
                for(Object e: entries) {
                    BinaryEntry entry = (BinaryEntry) e;
                    Object value = data.get(entry.getKey());
                    if (value != null) {
                        // read-through is suggested synthetic update
                        entry.setValue(value, true);
                    }
                }
            }
           
            return Collections.EMPTY_MAP;
View Full Code Here


    }
   
    @SuppressWarnings("rawtypes")
    private Object extractInternal(Entry entry, int target) {
        if (entry instanceof BinaryEntry) {
            BinaryEntry be = (BinaryEntry) entry;
            if (be.getSerializer() instanceof PofContext) {
                PofContext ctx = (PofContext) be.getSerializer();
                Binary bt;
                if (target == AbstractExtractor.KEY) {
                    bt = be.getBinaryKey();
                }
                else if (target == AbstractExtractor.VALUE) {
                    bt = be.getBinaryValue();
                }
                else {
                    //bt = be.getOriginalBinaryValue();
                  throw new IllegalArgumentException("unknown targte: " + target);
                }
View Full Code Here

      this.decorationNo = decorationNo;
    }

    @Override
    public Object process(Entry e) {
      BinaryEntry be = (BinaryEntry)e;
      Binary binaryKey = be.getBinaryKey();
      Binary newValue = values.get(binaryKey);
      if (newValue != null) {
        Binary value = be.getBinaryValue();
        value = ExternalizableHelper.decorate(value, decorationNo, newValue);
        be.updateBinaryValue(value);
      }
      return null;
    }
View Full Code Here

      this.decorationNo = decorationNo;
    }
   
    @Override
    public Object process(Entry e) {
      BinaryEntry be = (BinaryEntry)e;
      Binary oldValue = be.getBinaryValue();
      Binary newValue = ExternalizableHelper.getDecoration(oldValue, decorationNo);
      if (newValue != null) {
        if (newValue.length() == 0) {
          be.remove(false);
        }
        else {
          be.updateBinaryValue(newValue);
        }
      }
      return null;
    }
View Full Code Here

      this.decorationNo = decorationNo;
    }
   
    @Override
    public Object process(Entry e) {
      BinaryEntry be = (BinaryEntry)e;
      Binary oldValue = be.getBinaryValue();
      Binary newValue = ExternalizableHelper.getDecoration(oldValue, decorationNo);
      if (newValue != null) {
        Binary nv = ExternalizableHelper.undecorate(oldValue, decorationNo);
        be.updateBinaryValue(nv);
      }
      return null;
    }
View Full Code Here

TOP

Related Classes of com.tangosol.util.BinaryEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.