com.hazelcast.config.Config.findQueueConfig()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(142)

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

Config.findQueueConfig介绍

[英]Returns a read-only com.hazelcast.core.IQueue configuration for the given name.

The name is matched by pattern to the configuration and by stripping the partition ID qualifier from the given name. If there is no config found by the name, it will return the configuration with the name default.
[中]返回只读com。黑泽尔卡斯特。果心给定名称的IQueue配置。
该名称通过模式与配置匹配,并从给定名称中剥离分区ID限定符。如果没有通过名称找到配置,它将返回名为default的配置。

代码示例

代码示例来源:origin: com.hazelcast/hazelcast-all

private int handleQueue(MemberStateImpl memberState, int count, Config config, Map<String, LocalQueueStats> queues) {
  for (Map.Entry<String, LocalQueueStats> entry : queues.entrySet()) {
    String name = entry.getKey();
    if (config.findQueueConfig(name).isStatisticsEnabled()) {
      LocalQueueStats stats = entry.getValue();
      memberState.putLocalQueueStats(name, stats);
      ++count;
    }
  }
  return count;
}

代码示例来源:origin: hazelcast/hazelcast-jet

private int handleQueue(MemberStateImpl memberState, int count, Config config, Map<String, LocalQueueStats> queues) {
  for (Map.Entry<String, LocalQueueStats> entry : queues.entrySet()) {
    String name = entry.getKey();
    if (config.findQueueConfig(name).isStatisticsEnabled()) {
      LocalQueueStats stats = entry.getValue();
      memberState.putLocalQueueStats(name, stats);
      ++count;
    }
  }
  return count;
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
  public Object createNew(String name) {
    QueueConfig queueConfig = nodeEngine.getConfig().findQueueConfig(name);
    String quorumName = queueConfig.getQuorumName();
    return quorumName == null ? NULL_OBJECT : quorumName;
  }
};

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
  public Object createNew(String name) {
    QueueConfig queueConfig = nodeEngine.getConfig().findQueueConfig(name);
    String quorumName = queueConfig.getQuorumName();
    return quorumName == null ? NULL_OBJECT : quorumName;
  }
};

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public void run() {
  QueueService service = getService();
  NodeEngine nodeEngine = getNodeEngine();
  Config config = nodeEngine.getConfig();
  for (Map.Entry<String, QueueContainer> entry : migrationData.entrySet()) {
    String name = entry.getKey();
    QueueContainer container = entry.getValue();
    QueueConfig conf = config.findQueueConfig(name);
    container.setConfig(conf, nodeEngine, service);
    service.addContainer(name, container);
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public void run() {
  QueueService service = getService();
  NodeEngine nodeEngine = getNodeEngine();
  Config config = nodeEngine.getConfig();
  for (Map.Entry<String, QueueContainer> entry : migrationData.entrySet()) {
    String name = entry.getKey();
    QueueContainer container = entry.getValue();
    QueueConfig conf = config.findQueueConfig(name);
    container.setConfig(conf, nodeEngine, service);
    service.addContainer(name, container);
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

public QueueContainer getOrCreateContainer(final String name, boolean fromBackup) {
  QueueContainer container = containerMap.get(name);
  if (container != null) {
    return container;
  }
  container = new QueueContainer(name, nodeEngine.getConfig().findQueueConfig(name), nodeEngine, this);
  QueueContainer existing = containerMap.putIfAbsent(name, container);
  if (existing != null) {
    container = existing;
  } else {
    container.init(fromBackup);
    container.getStore().instrument(nodeEngine);
  }
  return container;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

public QueueContainer getOrCreateContainer(final String name, boolean fromBackup) {
  QueueContainer container = containerMap.get(name);
  if (container != null) {
    return container;
  }
  container = new QueueContainer(name, nodeEngine.getConfig().findQueueConfig(name), nodeEngine, this);
  QueueContainer existing = containerMap.putIfAbsent(name, container);
  if (existing != null) {
    container = existing;
  } else {
    container.init(fromBackup);
    container.getStore().instrument(nodeEngine);
  }
  return container;
}

代码示例来源:origin: hazelcast/hazelcast-jet

TransactionalQueueProxySupport(NodeEngine nodeEngine, QueueService service, String name, Transaction tx) {
  super(nodeEngine, service, tx);
  this.name = name;
  partitionId = nodeEngine.getPartitionService().getPartitionId(getNameAsPartitionAwareData());
  config = nodeEngine.getConfig().findQueueConfig(name);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public QueueProxyImpl createDistributedObject(String objectId) {
  QueueConfig queueConfig = nodeEngine.getConfig().findQueueConfig(objectId);
  checkQueueConfig(queueConfig, nodeEngine.getSplitBrainMergePolicyProvider());
  return new QueueProxyImpl(objectId, this, nodeEngine, queueConfig);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public QueueProxyImpl createDistributedObject(String objectId) {
  QueueConfig queueConfig = nodeEngine.getConfig().findQueueConfig(objectId);
  checkQueueConfig(queueConfig, nodeEngine.getSplitBrainMergePolicyProvider());
  return new QueueProxyImpl(objectId, this, nodeEngine, queueConfig);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

TransactionalQueueProxySupport(NodeEngine nodeEngine, QueueService service, String name, Transaction tx) {
  super(nodeEngine, service, tx);
  this.name = name;
  partitionId = nodeEngine.getPartitionService().getPartitionId(getNameAsPartitionAwareData());
  config = nodeEngine.getConfig().findQueueConfig(name);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@ManagedAnnotation("config")
@ManagedDescription("QueueConfig")
public String getConfig() {
  String managedObjectName = managedObject.getName();
  Config config = service.instance.getConfig();
  QueueConfig queueConfig = config.findQueueConfig(managedObjectName);
  return queueConfig.toString();
}

代码示例来源:origin: hazelcast/hazelcast-jet

@ManagedAnnotation("config")
@ManagedDescription("QueueConfig")
public String getConfig() {
  String managedObjectName = managedObject.getName();
  Config config = service.instance.getConfig();
  QueueConfig queueConfig = config.findQueueConfig(managedObjectName);
  return queueConfig.toString();
}

相关文章

Config类方法