private void initializeListeners() { for (Map.Entry<String, QuorumConfig> configEntry : nodeEngine.getConfig().getQuorumConfigs().entrySet()) { QuorumConfig config = configEntry.getValue(); String instanceName = configEntry.getKey(); for (QuorumListenerConfig listenerConfig : config.getListenerConfigs()) { initializeListenerInternal(instanceName, listenerConfig); } } }
private void initializeListeners() { for (Map.Entry<String, QuorumConfig> configEntry : nodeEngine.getConfig().getQuorumConfigs().entrySet()) { QuorumConfig config = configEntry.getValue(); String instanceName = configEntry.getKey(); for (QuorumListenerConfig listenerConfig : config.getListenerConfigs()) { initializeListenerInternal(instanceName, listenerConfig); } } }
@Override public Object createNew(String name) { DurableExecutorConfig executorConfig = nodeEngine.getConfig().findDurableExecutorConfig(name); String quorumName = executorConfig.getQuorumName(); return quorumName == null ? NULL_OBJECT : quorumName; } };
@Override public ManagedExecutorService createNew(String name) { DurableExecutorConfig cfg = nodeEngine.getConfig().findDurableExecutorConfig(name); return createExecutor(name, cfg.getPoolSize(), Integer.MAX_VALUE, ExecutorType.CACHED); } };
@Override public ManagedExecutorService createNew(String name) { ScheduledExecutorConfig cfg = nodeEngine.getConfig().findScheduledExecutorConfig(name); return createExecutor(name, cfg.getPoolSize(), Integer.MAX_VALUE, ExecutorType.CACHED); } };
@Override public Object createNew(String name) { DurableExecutorConfig executorConfig = nodeEngine.getConfig().findDurableExecutorConfig(name); String quorumName = executorConfig.getQuorumName(); return quorumName == null ? NULL_OBJECT : quorumName; } };
@Override public EventJournalConfig getEventJournalConfig(ObjectNamespace namespace) { return nodeEngine.getConfig().findMapEventJournalConfig(namespace.getObjectName()); }
@Override public ManagedExecutorService createNew(String name) { DurableExecutorConfig cfg = nodeEngine.getConfig().findDurableExecutorConfig(name); return createExecutor(name, cfg.getPoolSize(), Integer.MAX_VALUE, ExecutorType.CACHED); } };
private Map<String, QuorumImpl> initializeQuorums() { Map<String, QuorumImpl> quorums = new HashMap<String, QuorumImpl>(); for (QuorumConfig quorumConfig : nodeEngine.getConfig().getQuorumConfigs().values()) { validateQuorumConfig(quorumConfig); QuorumImpl quorum = new QuorumImpl(quorumConfig, nodeEngine); quorums.put(quorumConfig.getName(), quorum); } return quorums; }
public void createExecutorContainer(String name, TaskRingBuffer ringBuffer) { DurableExecutorConfig durableExecutorConfig = nodeEngine.getConfig().findDurableExecutorConfig(name); int durability = durableExecutorConfig.getDurability(); executorContainerMap.put(name, new DurableExecutorContainer(nodeEngine, name, partitionId, durability, ringBuffer)); }
private AuthenticationStatus authenticate(UsernamePasswordCredentials credentials) { GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); String nodeGroupName = groupConfig.getName(); boolean usernameMatch = nodeGroupName.equals(credentials.getUsername()); return usernameMatch ? AuthenticationStatus.AUTHENTICATED : AuthenticationStatus.CREDENTIALS_FAILED; }
private AuthenticationStatus authenticate(UsernamePasswordCredentials credentials) { GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); String nodeGroupName = groupConfig.getName(); boolean usernameMatch = nodeGroupName.equals(credentials.getUsername()); return usernameMatch ? AUTHENTICATED : CREDENTIALS_FAILED; }
@Override protected void processMessage() { Config config = nodeEngine.getConfig(); ConfigXmlGenerator generator = new ConfigXmlGenerator(); sendResponse(generator.generate(config)); }
@Override public ManagedExecutorService createNew(String name) { ExecutorConfig config = nodeEngine.getConfig().findExecutorConfig(name); int queueCapacity = config.getQueueCapacity() <= 0 ? Integer.MAX_VALUE : config.getQueueCapacity(); return createExecutor(name, config.getPoolSize(), queueCapacity, ExecutorType.CACHED); } };
@Override public ManagedExecutorService createNew(String name) { ExecutorConfig config = nodeEngine.getConfig().findExecutorConfig(name); int queueCapacity = config.getQueueCapacity() <= 0 ? Integer.MAX_VALUE : config.getQueueCapacity(); return createExecutor(name, config.getPoolSize(), queueCapacity, ExecutorType.CACHED); } };
private DurableExecutorContainer createExecutorContainer(String name) { DurableExecutorConfig durableExecutorConfig = nodeEngine.getConfig().findDurableExecutorConfig(name); int durability = durableExecutorConfig.getDurability(); int ringBufferCapacity = durableExecutorConfig.getCapacity(); TaskRingBuffer ringBuffer = new TaskRingBuffer(ringBufferCapacity); return new DurableExecutorContainer(nodeEngine, name, partitionId, durability, ringBuffer); } }
@Override protected ClientMessage encodeResponse(Object response) { final CRDTTimestampedLong resp = (CRDTTimestampedLong) response; final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name); return PNCounterAddCodec.encodeResponse( resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount()); }
@Override protected ClientMessage encodeResponse(Object response) { final CRDTTimestampedLong resp = (CRDTTimestampedLong) response; final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name); return PNCounterGetCodec.encodeResponse( resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount()); }
@Override protected ClientMessage encodeResponse(Object response) { final CRDTTimestampedLong resp = (CRDTTimestampedLong) response; final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name); return PNCounterAddCodec.encodeResponse( resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount()); }
@Override protected ClientMessage encodeResponse(Object response) { final CRDTTimestampedLong resp = (CRDTTimestampedLong) response; final PNCounterConfig counterConfig = nodeEngine.getConfig().findPNCounterConfig(parameters.name); return PNCounterGetCodec.encodeResponse( resp.getValue(), resp.getVectorClock().entrySet(), counterConfig.getReplicaCount()); }