本文整理了Java中org.apache.geode.cache.RegionAttributes.getCompressor
方法的一些代码示例,展示了RegionAttributes.getCompressor
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.getCompressor
方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:getCompressor
[英]Returns the compressor used by this region's entry values.
[中]返回此区域的输入值使用的压缩器。
代码示例来源:origin: apache/geode
/**
* Sets the isIndexedPdxKeys flag indicating if all the keys in the index are Strings or
* PdxStrings. Also sets another flag isIndexedPdxKeysFlagSet that indicates isIndexedPdxKeys has
* been set/reset to avoid frequent calculation of map size
*/
synchronized void setPdxStringFlag(Object key) {
// For Null and Undefined keys do not set the isIndexedPdxKeysFlagSet flag
if (isIndexedPdxKeysFlagSet || key == null || key == IndexManager.NULL
|| key == QueryService.UNDEFINED) {
return;
}
if (!this.isIndexedPdxKeys) {
if (key instanceof PdxString && this.region.getAttributes().getCompressor() == null) {
this.isIndexedPdxKeys = true;
}
}
this.isIndexedPdxKeysFlagSet = true;
}
代码示例来源:origin: apache/geode
private boolean hasSameCompressor(final RegionAttributes<?, ?> ra) {
Compressor raCompressor = ra.getCompressor();
if (raCompressor == null) {
return Strings.isNullOrEmpty(getCompressorClassName()) ? true : false;
}
return raCompressor.getClass().getName().equals(getCompressorClassName());
}
代码示例来源:origin: apache/geode
boolean putIfAbsentResultHasSameValue(boolean isClient, Object valueToBePut, Object result) {
if (Token.isInvalid(result) || result == null) {
return valueToBePut == null;
}
boolean isCompressedOffHeap =
isClient ? false : getAttributes().getOffHeap() && getAttributes().getCompressor() != null;
return ValueComparisonHelper.checkEquals(valueToBePut, result, isCompressedOffHeap, getCache());
}
代码示例来源:origin: apache/geode
public static boolean checkExpectedOldValue(@Unretained Object expectedOldValue,
@Unretained Object actualValue, InternalRegion region) {
if (Token.isInvalid(expectedOldValue)) {
return actualValue == null || Token.isInvalid(actualValue);
} else {
boolean isCompressedOffHeap =
region.getAttributes().getOffHeap() && region.getAttributes().getCompressor() != null;
return ValueComparisonHelper
.checkEquals(expectedOldValue, actualValue, isCompressedOffHeap, region.getCache());
}
}
代码示例来源:origin: apache/geode
Boolean.valueOf(other.getCloningEnabled())}));
if (!equal(this.compressor, other.getCompressor())) {
throw new RuntimeException("Compressors are not the same.");
代码示例来源:origin: apache/geode
boolean bridgePutIfAbsentResultHasSameValue(byte[] valueToBePut, boolean isValueToBePutObject,
Object result) {
if (Token.isInvalid(result) || result == null) {
return valueToBePut == null;
}
boolean isCompressedOffHeap =
getAttributes().getOffHeap() && getAttributes().getCompressor() != null;
if (isValueToBePutObject) {
return ValueComparisonHelper.checkEquals(EntryEventImpl.deserialize(valueToBePut), result,
isCompressedOffHeap, getCache());
}
return ValueComparisonHelper.checkEquals(valueToBePut, result, isCompressedOffHeap, getCache());
}
代码示例来源:origin: apache/geode
if (regAttrs.getCompressor() != null) {
compressorClassName = regAttrs.getCompressor().getClass().getCanonicalName();
代码示例来源:origin: apache/geode
regionTimeToLive = ra.getRegionTimeToLive().getTimeout();
Compressor compressor = ra.getCompressor();
if (compressor != null) {
compressorClassName = compressor.getClass().getCanonicalName();
代码示例来源:origin: apache/geode
if ((!(attrs instanceof RegionAttributesCreation)
|| ((RegionAttributesCreation) attrs).hasCompressor())) {
generate(COMPRESSOR, attrs.getCompressor());
代码示例来源:origin: apache/geode
if (null != attrs.getCompressor() && !attrs.getCloningEnabled()) {
throw new IllegalStateException("Cloning cannot be disabled when a compressor is set.");
代码示例来源:origin: apache/geode
this.cloningEnabled = attrs.getCloningEnabled();
this.compressor = attrs.getCompressor();
this.offHeap = attrs.getOffHeap();
if (attrs instanceof UserSpecifiedRegionAttributes) {
代码示例来源:origin: apache/geode
this.compressor = attrs.getCompressor();
代码示例来源:origin: apache/geode
this.regionAttributes.compressor = regionAttributes.getCompressor();
this.regionAttributes.offHeap = regionAttributes.getOffHeap();
代码示例来源:origin: apache/geode
this.gatewaySendersDescs = getDescs(attr.getGatewaySenderIds().toArray());
this.asyncEventQueueDescs = getDescs(attr.getAsyncEventQueueIds().toArray());
this.compressorDesc = getDesc(attr.getCompressor());
this.offHeap = attr.getOffHeap();
代码示例来源:origin: apache/geode
if (parentIsUserSpecified) {
if (parentWithHas.hasCompressor()) {
setCompressor(parent.getCompressor());
setCompressor(parent.getCompressor());
代码示例来源:origin: org.springframework.data/spring-data-geode-test
when(mockRegionAttributes.getCacheWriter()).thenAnswer(newGetter(cacheWriter::get));
when(mockRegionAttributes.getCloningEnabled()).thenAnswer(newGetter(cloningEnabled::get));
when(mockRegionAttributes.getCompressor()).thenAnswer(newGetter(baseRegionAttributes::getCompressor));
when(mockRegionAttributes.getConcurrencyChecksEnabled()).thenAnswer(newGetter(baseRegionAttributes::getConcurrencyChecksEnabled));
when(mockRegionAttributes.getConcurrencyLevel()).thenAnswer(newGetter(baseRegionAttributes::getConcurrencyLevel));
代码示例来源:origin: org.springframework.data/spring-data-gemfire
private Optional<String> configureWithRegionAttributes(ClientRegionFactory<K, V> clientRegionFactory) {
AtomicReference<String> regionAttributesPoolName = new AtomicReference<>(null);
Optional.ofNullable(getAttributes()).ifPresent(regionAttributes -> {
regionAttributesPoolName.set(regionAttributes.getPoolName());
stream(nullSafeArray(regionAttributes.getCacheListeners(), CacheListener.class))
.forEach(clientRegionFactory::addCacheListener);
clientRegionFactory.setCloningEnabled(regionAttributes.getCloningEnabled());
clientRegionFactory.setCompressor(regionAttributes.getCompressor());
clientRegionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled());
clientRegionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel());
clientRegionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout());
clientRegionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive());
clientRegionFactory.setDiskStoreName(regionAttributes.getDiskStoreName());
clientRegionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous());
clientRegionFactory.setEntryIdleTimeout(regionAttributes.getEntryIdleTimeout());
clientRegionFactory.setEntryTimeToLive(regionAttributes.getEntryTimeToLive());
clientRegionFactory.setEvictionAttributes(regionAttributes.getEvictionAttributes());
clientRegionFactory.setInitialCapacity(regionAttributes.getInitialCapacity());
clientRegionFactory.setKeyConstraint(regionAttributes.getKeyConstraint());
clientRegionFactory.setLoadFactor(regionAttributes.getLoadFactor());
clientRegionFactory.setRegionIdleTimeout(regionAttributes.getRegionIdleTimeout());
clientRegionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive());
clientRegionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled());
clientRegionFactory.setValueConstraint(regionAttributes.getValueConstraint());
});
return Optional.ofNullable(regionAttributesPoolName.get()).filter(StringUtils::hasText);
}
代码示例来源:origin: org.springframework.data/spring-data-geode
private Optional<String> configureWithRegionAttributes(ClientRegionFactory<K, V> clientRegionFactory) {
AtomicReference<String> regionAttributesPoolName = new AtomicReference<>(null);
Optional.ofNullable(getAttributes()).ifPresent(regionAttributes -> {
regionAttributesPoolName.set(regionAttributes.getPoolName());
stream(nullSafeArray(regionAttributes.getCacheListeners(), CacheListener.class))
.forEach(clientRegionFactory::addCacheListener);
clientRegionFactory.setCloningEnabled(regionAttributes.getCloningEnabled());
clientRegionFactory.setCompressor(regionAttributes.getCompressor());
clientRegionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled());
clientRegionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel());
clientRegionFactory.setCustomEntryIdleTimeout(regionAttributes.getCustomEntryIdleTimeout());
clientRegionFactory.setCustomEntryTimeToLive(regionAttributes.getCustomEntryTimeToLive());
clientRegionFactory.setDiskStoreName(regionAttributes.getDiskStoreName());
clientRegionFactory.setDiskSynchronous(regionAttributes.isDiskSynchronous());
clientRegionFactory.setEntryIdleTimeout(regionAttributes.getEntryIdleTimeout());
clientRegionFactory.setEntryTimeToLive(regionAttributes.getEntryTimeToLive());
clientRegionFactory.setEvictionAttributes(regionAttributes.getEvictionAttributes());
clientRegionFactory.setInitialCapacity(regionAttributes.getInitialCapacity());
clientRegionFactory.setKeyConstraint(regionAttributes.getKeyConstraint());
clientRegionFactory.setLoadFactor(regionAttributes.getLoadFactor());
clientRegionFactory.setRegionIdleTimeout(regionAttributes.getRegionIdleTimeout());
clientRegionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive());
clientRegionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled());
clientRegionFactory.setValueConstraint(regionAttributes.getValueConstraint());
});
return Optional.ofNullable(regionAttributesPoolName.get()).filter(StringUtils::hasText);
}
代码示例来源:origin: org.springframework.data/spring-data-geode
regionFactory.setCompressor(regionAttributes.getCompressor());
regionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled());
regionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel());
代码示例来源:origin: org.springframework.data/spring-data-gemfire
regionFactory.setCompressor(regionAttributes.getCompressor());
regionFactory.setConcurrencyChecksEnabled(regionAttributes.getConcurrencyChecksEnabled());
regionFactory.setConcurrencyLevel(regionAttributes.getConcurrencyLevel());
内容来源于网络,如有侵权,请联系作者删除!