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

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

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

RegionAttributes.getAsyncEventQueueIds介绍

[英]Returns a set of AsyncEventQueueIds added to the region
[中]返回添加到区域的一组AsyncEventQueueID

代码示例

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

@Test
public void executeFunctionGivenARegionWithNonJdbcAsyncEventQueueDoesNotRemoveTheQueueName() {
 when(regionAttributes.getAsyncEventQueueIds())
   .thenReturn(Collections.singleton("nonJdbcQueue"));
 when(service.getMappingForRegion(eq(regionName))).thenReturn(mapping);
 function.executeFunction(context);
 verify(regionMutator, never()).removeAsyncEventQueueId(any());
}

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

@Test
public void executeFunctionGivenARegionWithJdbcAsyncEventQueueRemovesTheQueueName() {
 String queueName = CreateMappingCommand.createAsyncEventQueueName(regionName);
 when(regionAttributes.getAsyncEventQueueIds()).thenReturn(Collections.singleton(queueName));
 when(service.getMappingForRegion(eq(regionName))).thenReturn(mapping);
 function.executeFunction(context);
 verify(regionMutator, times(1)).removeAsyncEventQueueId(queueName);
}

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

@Override
public RegionAttributes beforeCreate(Region parent, String regionName, RegionAttributes attrs,
  InternalRegionArguments internalRegionArgs) {
 RegionAttributes updatedRA = attrs;
 String path = parent == null ? "/" + regionName : parent.getFullPath() + "/" + regionName;
 if (path.equals(this.regionPath) && this.beforeCreateInvoked.compareAndSet(false, true)) {
  LuceneServiceImpl.validateRegionAttributes(attrs);
  String aeqId = LuceneServiceImpl.getUniqueIndexName(this.indexName, this.regionPath);
  if (!attrs.getAsyncEventQueueIds().contains(aeqId)) {
   AttributesFactory af = new AttributesFactory(attrs);
   af.addAsyncEventQueueId(aeqId);
   updatedRA = af.create();
  }
  // Add index creation profile
  internalRegionArgs.addCacheServiceProfile(new LuceneIndexCreationProfile(this.indexName,
    this.regionPath, this.fields, this.analyzer, this.fieldAnalyzers, serializer));
  luceneIndex = this.service.beforeDataRegionCreated(this.indexName, this.regionPath, attrs,
    this.analyzer, this.fieldAnalyzers, aeqId, serializer, this.fields);
  // Add internal async event id
  internalRegionArgs.addInternalAsyncEventQueueId(aeqId);
 }
 return updatedRA;
}

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

@Test
 public void beforeDataRegionCreatedShouldHaveSerializer() {
  String name = "indexName";
  String regionPath = "regionName";
  String[] fields = {"field1", "field2"};
  String aeqId = LuceneServiceImpl.getUniqueIndexName(name, regionPath);
  InternalCache cache = Fakes.cache();
  final Region region = Fakes.region(regionPath, cache);
  RegionAttributes attributes = region.getAttributes();
  DataPolicy policy = attributes.getDataPolicy();
  when(policy.withPartitioning()).thenReturn(true);
  EvictionAttributes evictionAttributes = mock(EvictionAttributes.class);
  when(attributes.getEvictionAttributes()).thenReturn(evictionAttributes);
  CopyOnWriteArraySet set = new CopyOnWriteArraySet();
  set.add(aeqId);
  when(attributes.getAsyncEventQueueIds()).thenReturn(set);
  when(evictionAttributes.getAlgorithm()).thenReturn(EvictionAlgorithm.NONE);
  LuceneServiceImpl service = mock(LuceneServiceImpl.class);
  Analyzer analyzer = mock(Analyzer.class);
  LuceneSerializer serializer = mock(LuceneSerializer.class);
  InternalRegionArguments internalRegionArgs = mock(InternalRegionArguments.class);
  when(internalRegionArgs.addCacheServiceProfile(any())).thenReturn(internalRegionArgs);

  LuceneRegionListener listener = new LuceneRegionListener(service, cache, name, "/" + regionPath,
    fields, analyzer, null, serializer);
  listener.beforeCreate(null, regionPath, attributes, internalRegionArgs);
  verify(service).beforeDataRegionCreated(eq(name), eq("/" + regionPath), eq(attributes),
    eq(analyzer), any(), eq(aeqId), eq(serializer), any());
 }
}

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

asyncEventQueueIDs = ra.getAsyncEventQueueIds();
gatewaySenderIDs = ra.getGatewaySenderIds();

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

boolean offheap = regAttrs.getOffHeap();
Set<String> eventQueueIds = regAttrs.getAsyncEventQueueIds();
Set<String> gatewaySenderIds = regAttrs.getGatewaySenderIds();

代码示例来源: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

if ((!(attrs instanceof RegionAttributesCreation)
  || ((RegionAttributesCreation) attrs).hasAsyncEventListeners())) {
 Set<String> asyncEventQueueIds = new HashSet<String>(attrs.getAsyncEventQueueIds());
 StringBuilder asyncEventQueueStringBuff = new StringBuilder();
 if (asyncEventQueueIds.size() != 0) {

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

this.cacheListeners = new ArrayList(Arrays.asList(attrs.getCacheListeners()));
this.gatewaySenderIds = new HashSet<String>(attrs.getGatewaySenderIds());
this.asyncEventQueueIds = new HashSet<String>(attrs.getAsyncEventQueueIds());
this.cacheLoader = attrs.getCacheLoader();
this.cacheWriter = attrs.getCacheWriter();

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

this.earlyAck = attrs.getEarlyAck();
this.gatewaySenderIds = attrs.getGatewaySenderIds();
this.asyncEventQueueIds = attrs.getAsyncEventQueueIds();
initializeVisibleAsyncEventQueueIds(internalRegionArgs);
setAllGatewaySenderIds();

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

new CopyOnWriteArraySet<String>(regionAttributes.getGatewaySenderIds());
this.regionAttributes.asyncEventQueueIds =
  new CopyOnWriteArraySet<String>(regionAttributes.getAsyncEventQueueIds());
this.regionAttributes.isLockGrantor = regionAttributes.isLockGrantor(); // fix for bug 47067
if (regionAttributes instanceof UserSpecifiedRegionAttributes) {

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

this.isDiskSynchronous = attr.isDiskSynchronous();
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.hasAsyncEventListeners()) {
  initAsyncEventQueues(parent.getAsyncEventQueueIds());
 initAsyncEventQueues(parent.getAsyncEventQueueIds());

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

mock(RegionAttributes.class, mockObjectIdentifier("MockRegionAttributes"));
when(mockRegionAttributes.getAsyncEventQueueIds()).thenReturn(asyncEventQueueIds);

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

new CopyOnWriteArrayList<>(nullSafeSet(baseRegionAttributes.getAsyncEventQueueIds()));
when(mockRegionAttributes.getAsyncEventQueueIds())
  .thenAnswer(invocation -> asSet(asyncEventQueueIds.toArray(new String[asyncEventQueueIds.size()])));

相关文章

微信公众号

最新文章

更多

RegionAttributes类方法