public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null) { evictionAlgorithm = evictionAlgo.toString(); } evictionMaxValue = ea.getMaximum(); }
public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null) { evictionAlgorithm = evictionAlgo.toString(); } evictionMaxValue = ea.getMaximum(); }
atts.addAttribute("", "", ACTION, "", eAction.toString());
@Test public void generatesWithEvictionMaxMemory() { evictionAction = EvictionAction.LOCAL_DESTROY.toString(); evictionMaxMemory = 100; generate(); RegionAttributesType.EvictionAttributes evictionAttributes = config.getRegionAttributes().getEvictionAttributes(); assertThat(evictionAttributes).isNotNull(); assertThat(evictionAttributes.getLruMemorySize().getAction()) .isSameAs(EnumActionDestroyOverflow.LOCAL_DESTROY); assertThat(evictionAttributes.getLruMemorySize().getMaximum()).isEqualTo("100"); }
@Test public void generatesWithEvictionMaxEntry() { evictionAction = EvictionAction.OVERFLOW_TO_DISK.toString(); evictionEntryCount = 1; generate(); RegionAttributesType.EvictionAttributes evictionAttributes = config.getRegionAttributes().getEvictionAttributes(); assertThat(evictionAttributes).isNotNull(); assertThat(evictionAttributes.getLruEntryCount().getAction()) .isSameAs(EnumActionDestroyOverflow.OVERFLOW_TO_DISK); assertThat(evictionAttributes.getLruEntryCount().getMaximum()).isEqualTo("1"); }
new RegionAttributesType.EvictionAttributes(); EnumActionDestroyOverflow action = EnumActionDestroyOverflow.fromValue(this.getAction() .toString()); EvictionAlgorithm algorithm = getAlgorithm(); Optional<String> objectSizerClass = Optional.ofNullable(getObjectSizer())
@Test public void generatesWithEvictionHeapPercentageFlags() { evictionAction = EvictionAction.LOCAL_DESTROY.toString(); evictionObjectSizer = "java.lang.String"; generate(); RegionAttributesType.EvictionAttributes evictionAttributes = config.getRegionAttributes().getEvictionAttributes(); assertThat(evictionAttributes).isNotNull(); assertThat(evictionAttributes.getLruHeapPercentage().getAction()) .isSameAs(EnumActionDestroyOverflow.LOCAL_DESTROY); assertThat(evictionAttributes.getLruHeapPercentage().getClassName()) .isEqualTo("java.lang.String"); }
public static EvictionAttributesData getEvictionAttributesData(RegionAttributes regAttrs) { String algorithm = ""; Integer maximum = null; if (regAttrs.getEvictionAttributes().getAlgorithm() != null) { algorithm = regAttrs.getEvictionAttributes().getAlgorithm().toString(); if (algorithm.equals(EvictionAlgorithm.NONE.toString())) { EvictionAttributesData evictionAttributesData = new EvictionAttributesData(algorithm, null, EvictionAlgorithm.NONE.toString()); return evictionAttributesData; } if (!regAttrs.getEvictionAttributes().getAlgorithm().isLRUHeap()) { maximum = regAttrs.getEvictionAttributes().getMaximum(); } } String action = regAttrs.getEvictionAttributes().getAction().toString(); EvictionAttributesData evictionAttributesData = new EvictionAttributesData(algorithm, maximum, action); return evictionAttributesData; }