org.apache.geode.cache.RegionAttributes.getCacheWriter()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中org.apache.geode.cache.RegionAttributes.getCacheWriter方法的一些代码示例,展示了RegionAttributes.getCacheWriter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RegionAttributes.getCacheWriter方法的具体详情如下:
包路径:org.apache.geode.cache.RegionAttributes
类名称:RegionAttributes
方法名:getCacheWriter

RegionAttributes.getCacheWriter介绍

[英]Returns the cache writer associated with this region.
[中]返回与此区域关联的缓存写入程序。

代码示例

代码示例来源:origin: apache/geode

@Override
public String getCacheWriter() {
 Object o = this.ra.getCacheWriter();
 if (o == null) {
  return "";
 } else {
  return o.toString();
 }
}

代码示例来源:origin: apache/geode

@Override
public boolean isMappingSynchronous(String regionName, Cache cache) {
 Region<?, ?> region = cache.getRegion(regionName);
 if (region == null) {
  throw new IllegalStateException("Region for mapping could not be found.");
 }
 // If our region has a Jdbc Writer set as the cache writer then we know it is syncronous
 return region.getAttributes().getCacheWriter() != null
   && region.getAttributes().getCacheWriter() instanceof JdbcWriter;
}

代码示例来源:origin: apache/geode

@Test
public void executeFunctionGivenARegionWithNonJdbcWriterDoesNotRemoveTheWriter() {
 when(regionAttributes.getCacheWriter()).thenReturn(mock(CacheWriter.class));
 when(service.getMappingForRegion(eq(regionName))).thenReturn(mapping);
 function.executeFunction(context);
 verify(regionMutator, never()).setCacheWriter(null);
}

代码示例来源:origin: apache/geode

@Test
public void executeFunctionGivenARegionWithJdbcWriterRemovesTheWriter() {
 when(regionAttributes.getCacheWriter()).thenReturn(mock(JdbcWriter.class));
 when(service.getMappingForRegion(eq(regionName))).thenReturn(mapping);
 function.executeFunction(context);
 verify(regionMutator, times(1)).setCacheWriter(null);
}

代码示例来源:origin: apache/geode

new Object[] {this.pr.getName()}));
if (n.isCacheWriterAttached() && pr.getAttributes().getCacheWriter() == null) {
 throw new IllegalStateException(
   String.format(
     new Object[] {this.pr.getName()}));
if (!n.isCacheWriterAttached() && pr.getAttributes().getCacheWriter() != null) {
 throw new IllegalStateException(
   String.format(

代码示例来源:origin: apache/geode

CacheWriter writer = ra.getCacheWriter();
if (writer != null) {
 allCacheWriters.add(writer.toString());

代码示例来源:origin: apache/geode

(ExportLogsCacheWriter) region.getAttributes().getCacheWriter();

代码示例来源:origin: apache/geode

throw new RuntimeException("CacheLoader are not the same");
if (!equal(this.cacheWriter, other.getCacheWriter())) {
 throw new RuntimeException("CacheWriter is not the same");

代码示例来源:origin: apache/geode

if (regAttrs.getCacheWriter() != null) {
 cacheWriteClassName = regAttrs.getCacheWriter().getClass().getCanonicalName();

代码示例来源:origin: apache/geode

CacheWriter<?, ?> cacheWriter = ra.getCacheWriter();

代码示例来源:origin: apache/geode

generate(CACHE_WRITER, attrs.getCacheWriter());

代码示例来源:origin: apache/geode

private void cleanupRegionAndQueue(Cache cache, String regionName) {
  String queueName = CreateMappingCommand.createAsyncEventQueueName(regionName);

  Region<?, ?> region = cache.getRegion(regionName);
  if (region != null) {
   CacheLoader<?, ?> loader = region.getAttributes().getCacheLoader();
   if (loader instanceof JdbcLoader) {
    region.getAttributesMutator().setCacheLoader(null);
   }
   CacheWriter<?, ?> writer = region.getAttributes().getCacheWriter();
   if (writer instanceof JdbcWriter) {
    region.getAttributesMutator().setCacheWriter(null);
   }
   Set<String> queueIds = region.getAttributes().getAsyncEventQueueIds();
   if (queueIds.contains(queueName)) {
    region.getAttributesMutator().removeAsyncEventQueueId(queueName);
   }
  }

  InternalAsyncEventQueue queue = (InternalAsyncEventQueue) cache.getAsyncEventQueue(queueName);
  if (queue != null) {
   queue.stop();
   queue.destroy();
  }
 }
}

代码示例来源:origin: apache/geode

byte writerByte = (byte) (getAttributes().getCacheWriter() != null ? 0x02 : 0x00);
 this.node.setLoaderWriterByte((byte) (loaderByte + writerByte));
} else {

代码示例来源:origin: apache/geode

this.asyncEventQueueIds = new HashSet<String>(attrs.getAsyncEventQueueIds());
this.cacheLoader = attrs.getCacheLoader();
this.cacheWriter = attrs.getCacheWriter();
this.entryIdleTimeout = attrs.getEntryIdleTimeout();
this.customEntryIdleTimeout = attrs.getCustomEntryIdleTimeout();

代码示例来源:origin: apache/geode

assignCacheWriter(attrs.getCacheWriter());
this.regionTimeToLive = attrs.getRegionTimeToLive().getTimeout();
this.regionTimeToLiveExpirationAction = attrs.getRegionTimeToLive().getAction();

代码示例来源:origin: apache/geode

this.regionAttributes.cacheWriter = regionAttributes.getCacheWriter();
this.regionAttributes.regionTimeToLive = regionAttributes.getRegionTimeToLive().getTimeout();
this.regionAttributes.regionTimeToLiveExpirationAction =

代码示例来源:origin: apache/geode

this.cacheWriterDesc = getDesc(attr.getCacheWriter());
this.cacheListenerDescs = getDescs(attr.getCacheListeners());
this.keyConstraint = attr.getKeyConstraint();

代码示例来源:origin: apache/geode

RegionAttributes attrs = factory.create();
assertNull(attrs.getCacheLoader());
assertNull(attrs.getCacheWriter());
assertNull(attrs.getCacheListener());
assertEquals(Arrays.asList(new CacheListener[0]), Arrays.asList(attrs.getCacheListeners()));

代码示例来源:origin: apache/geode

if (parentIsUserSpecified) {
 if (parentWithHas.hasCacheWriter()) {
  setCacheWriter(parent.getCacheWriter());
 setCacheWriter(parent.getCacheWriter());

代码示例来源:origin: org.springframework.data/spring-data-geode-test

AtomicReference<CacheWriter<K, V>> cacheWriter = new AtomicReference<>(baseRegionAttributes.getCacheWriter());
  .when(mockAttributesMutator).setCacheLoader(any(CacheLoader.class));
doAnswer(newSetter(cacheWriter, baseRegionAttributes.getCacheWriter()))
  .when(mockAttributesMutator).setCacheWriter(any(CacheWriter.class));
when(mockRegionAttributes.getCacheWriter()).thenAnswer(newGetter(cacheWriter::get));
when(mockRegionAttributes.getCloningEnabled()).thenAnswer(newGetter(cloningEnabled::get));
when(mockRegionAttributes.getCompressor()).thenAnswer(newGetter(baseRegionAttributes::getCompressor));

相关文章

微信公众号

最新文章

更多

RegionAttributes类方法