protected void setLastTableIndex(List<Data> segment, int lastTableIndex) { if (isNotEmpty(segment)) { this.lastTableIndex = lastTableIndex; } }
protected void setLastTableIndex(List<Data> segment, int lastTableIndex) { if (isNotEmpty(segment)) { this.lastTableIndex = lastTableIndex; } }
protected boolean advance() { if (lastTableIndex < 0) { lastTableIndex = Integer.MAX_VALUE; return false; } segment = fetch(); if (isNotEmpty(segment)) { index = 0; return true; } return false; }
protected boolean advance() { if (lastTableIndex < 0) { lastTableIndex = Integer.MAX_VALUE; return false; } segment = fetch(); if (isNotEmpty(segment)) { index = 0; return true; } return false; }
public MapGetInvalidationMetaDataOperation(List<String> mapNames) { checkTrue(isNotEmpty(mapNames), "mapNames cannot be null or empty"); this.mapNames = mapNames; }
public MapGetInvalidationMetaDataOperation(List<String> mapNames) { checkTrue(isNotEmpty(mapNames), "mapNames cannot be null or empty"); this.mapNames = mapNames; }
public CacheGetInvalidationMetaDataOperation(List<String> names) { checkTrue(isNotEmpty(names), "names cannot be null or empty"); this.names = names; }
public CacheGetInvalidationMetaDataOperation(List<String> names) { checkTrue(isNotEmpty(names), "names cannot be null or empty"); this.names = names; }
private List<DelayedEntry> processEntriesOneByOne(Collection<DelayedEntry> delayedEntries, StoreOperationType operationType) { List<DelayedEntry> totalFailures = null; for (DelayedEntry delayedEntry : delayedEntries) { List<DelayedEntry> failures = callSingleStoreWithListeners(delayedEntry, operationType); // this `if` is used to initialize totalFailures list, since we don't want unneeded object creation. if (isNotEmpty(failures)) { if (totalFailures == null) { totalFailures = failures; } else { totalFailures.addAll(failures); } } } return totalFailures == null ? Collections.EMPTY_LIST : totalFailures; }
private List<DelayedEntry> processEntriesOneByOne(Collection<DelayedEntry> delayedEntries, StoreOperationType operationType) { List<DelayedEntry> totalFailures = null; for (DelayedEntry delayedEntry : delayedEntries) { List<DelayedEntry> failures = callSingleStoreWithListeners(delayedEntry, operationType); // this `if` is used to initialize totalFailures list, since we don't want unneeded object creation. if (isNotEmpty(failures)) { if (totalFailures == null) { totalFailures = failures; } else { totalFailures.addAll(failures); } } } return totalFailures == null ? Collections.EMPTY_LIST : totalFailures; }
private AddressDefinition getMatchingAddress(Collection<InterfaceDefinition> interfaces, InetAddress inetAddress) { if (isNotEmpty(interfaces)) { return match(inetAddress, interfaces); } else if (!inetAddress.isLoopbackAddress()) { return new AddressDefinition(inetAddress); } return null; }
private AddressDefinition getMatchingAddress(Collection<InterfaceDefinition> interfaces, InetAddress inetAddress) { if (isNotEmpty(interfaces)) { return match(inetAddress, interfaces); } else if (!inetAddress.isLoopbackAddress()) { return new AddressDefinition(inetAddress); } return null; }
private static void appendItemListenerConfigs(XmlGenerator gen, Collection<ItemListenerConfig> configs) { if (CollectionUtil.isNotEmpty(configs)) { gen.open("item-listeners"); for (ItemListenerConfig lc : configs) { gen.node("item-listener", lc.getClassName(), "include-value", lc.isIncludeValue()); } gen.close(); } }
private static void appendItemListenerConfigs(XmlGenerator gen, Collection<ItemListenerConfig> configs) { if (CollectionUtil.isNotEmpty(configs)) { gen.open("item-listeners"); for (ItemListenerConfig lc : configs) { gen.node("item-listener", lc.getClassName(), "include-value", lc.isIncludeValue()); } gen.close(); } }
private static void partitionGroupXmlGenerator(XmlGenerator gen, Config config) { PartitionGroupConfig pg = config.getPartitionGroupConfig(); if (pg == null) { return; } gen.open("partition-group", "enabled", pg.isEnabled(), "group-type", pg.getGroupType()); Collection<MemberGroupConfig> configs = pg.getMemberGroupConfigs(); if (CollectionUtil.isNotEmpty(configs)) { for (MemberGroupConfig mgConfig : configs) { gen.open("member-group"); for (String iface : mgConfig.getInterfaces()) { gen.node("interface", iface); } gen.close(); } } gen.close(); }
private static void discoveryStrategyConfigXmlGenerator(XmlGenerator gen, DiscoveryConfig c) { if (c == null) { return; } gen.open("discovery-strategies"); String nodeFilterClass = classNameOrImplClass(c.getNodeFilterClass(), c.getNodeFilter()); if (nodeFilterClass != null) { gen.node("node-filter", null, "class", nodeFilterClass); } Collection<DiscoveryStrategyConfig> configs = c.getDiscoveryStrategyConfigs(); if (CollectionUtil.isNotEmpty(configs)) { for (DiscoveryStrategyConfig config : configs) { gen.open("discovery-strategy", "class", classNameOrImplClass(config.getClassName(), config.getDiscoveryStrategyFactory()), "enabled", "true") .appendProperties(config.getProperties()) .close(); } } gen.close(); }
private static void servicesXmlGenerator(XmlGenerator gen, Config config) { ServicesConfig c = config.getServicesConfig(); if (c == null) { return; } gen.open("services", "enable-defaults", c.isEnableDefaults()); if (CollectionUtil.isNotEmpty(c.getServiceConfigs())) { for (ServiceConfig serviceConfig : c.getServiceConfigs()) { gen.open("service", "enabled", serviceConfig.isEnabled()) .node("name", serviceConfig.getName()) .node("class-name", classNameOrImplClass(serviceConfig.getClassName(), serviceConfig.getImplementation())) .appendProperties(serviceConfig.getProperties()) .close(); } } gen.close(); }
private static void servicesXmlGenerator(XmlGenerator gen, Config config) { ServicesConfig c = config.getServicesConfig(); if (c == null) { return; } gen.open("services", "enable-defaults", c.isEnableDefaults()); if (CollectionUtil.isNotEmpty(c.getServiceConfigs())) { for (ServiceConfig serviceConfig : c.getServiceConfigs()) { gen.open("service", "enabled", serviceConfig.isEnabled()) .node("name", serviceConfig.getName()) .node("class-name", classNameOrImplClass(serviceConfig.getClassName(), serviceConfig.getImplementation())) .appendProperties(serviceConfig.getProperties()) .close(); } } gen.close(); }
@SuppressWarnings("unchecked") private static void collectionXmlGenerator(XmlGenerator gen, String type, Collection<? extends CollectionConfig> configs) { if (CollectionUtil.isNotEmpty(configs)) { for (CollectionConfig<? extends CollectionConfig> config : configs) { gen.open(type, "name", config.getName()) .node("statistics-enabled", config.isStatisticsEnabled()) .node("max-size", config.getMaxSize()) .node("backup-count", config.getBackupCount()) .node("async-backup-count", config.getAsyncBackupCount()) .node("quorum-ref", config.getQuorumName()); appendItemListenerConfigs(gen, config.getItemListenerConfigs()); MergePolicyConfig mergePolicyConfig = config.getMergePolicyConfig(); gen.node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()) .close(); } } }
@SuppressWarnings("unchecked") private static void collectionXmlGenerator(XmlGenerator gen, String type, Collection<? extends CollectionConfig> configs) { if (CollectionUtil.isNotEmpty(configs)) { for (CollectionConfig<? extends CollectionConfig> config : configs) { gen.open(type, "name", config.getName()) .node("statistics-enabled", config.isStatisticsEnabled()) .node("max-size", config.getMaxSize()) .node("backup-count", config.getBackupCount()) .node("async-backup-count", config.getAsyncBackupCount()) .node("quorum-ref", config.getQuorumName()); appendItemListenerConfigs(gen, config.getItemListenerConfigs()); MergePolicyConfig mergePolicyConfig = config.getMergePolicyConfig(); gen.node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()) .close(); } } }