public String toStringRep() { return "lru-entry-count: " + this.lruEntryCount.getMaximum() + ", " + this.lruEntryCount.getAction().toString() + ", " + "\nlru-heap-percentage: " + this.lruHeapPercentage.getAction().toString() + "\nlru-memory-size: " + this.lruMemorySize.getMaximum() + this.lruMemorySize.getAction().toString(); }
public static EnumActionDestroyOverflow fromValue(String v) { for (EnumActionDestroyOverflow c : EnumActionDestroyOverflow.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
public RegionAttributesType.EvictionAttributes convertToConfigEvictionAttributes() { RegionAttributesType.EvictionAttributes configAttributes = new RegionAttributesType.EvictionAttributes(); EnumActionDestroyOverflow action = EnumActionDestroyOverflow.fromValue(this.getAction() .toString()); EvictionAlgorithm algorithm = getAlgorithm();
evictionAttributes .setAction(EvictionAction.parseAction(configAttributes.getLruMemorySize().getAction() .value())); } else if (configAttributes.getLruEntryCount() != null) { evictionAttributes .setAction(EvictionAction.parseAction(configAttributes.getLruEntryCount().getAction() .value())); } else if (configAttributes.getLruHeapPercentage() != null) { evictionAttributes .setAction(EvictionAction.parseAction(configAttributes.getLruHeapPercentage().getAction() .value())); } else { evictionAttributes.setAction(EvictionAction.NONE);
private RegionAttributesType.EvictionAttributes generateEvictionAttributes(String evictionAction, Integer maxMemory, Integer maxEntryCount, String objectSizer) { RegionAttributesType.EvictionAttributes configAttributes = new RegionAttributesType.EvictionAttributes(); EnumActionDestroyOverflow action = EnumActionDestroyOverflow.fromValue(evictionAction); if (maxMemory == null && maxEntryCount == null) { RegionAttributesType.EvictionAttributes.LruHeapPercentage heapPercentage = new RegionAttributesType.EvictionAttributes.LruHeapPercentage(); heapPercentage.setAction(action); heapPercentage.setClassName(objectSizer); configAttributes.setLruHeapPercentage(heapPercentage); } else if (maxMemory != null) { RegionAttributesType.EvictionAttributes.LruMemorySize memorySize = new RegionAttributesType.EvictionAttributes.LruMemorySize(); memorySize.setAction(action); memorySize.setClassName(objectSizer); memorySize.setMaximum(maxMemory.toString()); configAttributes.setLruMemorySize(memorySize); } else { RegionAttributesType.EvictionAttributes.LruEntryCount entryCount = new RegionAttributesType.EvictionAttributes.LruEntryCount(); entryCount.setAction(action); entryCount.setMaximum(maxEntryCount.toString()); configAttributes.setLruEntryCount(entryCount); } return configAttributes; }