@Override protected InvocationBuilder getInvocationBuilder(Operation op) { final InternalOperationService operationService = nodeEngine.getOperationService(); return operationService.createInvocationBuilder(getServiceName(), op, parameters.address); }
public MetricsPlugin(NodeEngineImpl nodeEngine) { this(nodeEngine.getLogger(MetricsPlugin.class), nodeEngine.getMetricsRegistry(), nodeEngine.getProperties()); }
private void registerCoreServices() { logger.finest("Registering core services..."); Node node = nodeEngine.getNode(); registerService(ClusterServiceImpl.SERVICE_NAME, node.getClusterService()); registerService(InternalPartitionService.SERVICE_NAME, node.getPartitionService()); registerService(ProxyServiceImpl.SERVICE_NAME, nodeEngine.getProxyService()); registerService(TransactionManagerServiceImpl.SERVICE_NAME, nodeEngine.getTransactionManagerService()); registerService(ClientEngineImpl.SERVICE_NAME, node.clientEngine); registerService(QuorumServiceImpl.SERVICE_NAME, nodeEngine.getQuorumService()); registerService(WanReplicationService.SERVICE_NAME, nodeEngine.getWanReplicationService()); registerService(EventServiceImpl.SERVICE_NAME, nodeEngine.getEventService()); }
@Override protected InvocationBuilder getInvocationBuilder(Operation operation) { return nodeEngine.getOperationService().createInvocationBuilder(JetService.SERVICE_NAME, operation, nodeEngine.getMasterAddress()); }
@Override protected InvocationBuilder getInvocationBuilder(Operation operation) { return nodeEngine.getOperationService().createInvocationBuilder( // SnowcastConstants.SERVICE_NAME, operation, nodeEngine.getThisAddress()); }
public ClientEndpointManagerImpl(NodeEngine nodeEngine) { this.logger = nodeEngine.getLogger(ClientEndpointManager.class); this.eventService = nodeEngine.getEventService(); MetricsRegistry metricsRegistry = ((NodeEngineImpl) nodeEngine).getMetricsRegistry(); metricsRegistry.scanAndRegister(this, "client.endpoint"); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
@Override protected ClientMessage encodeResponse(Object response) { Data data = nodeEngine.getSerializationService().toData(response); return ScheduledExecutorGetResultFromPartitionCodec.encodeResponse(data); }
public OverloadedConnectionsPlugin(NodeEngineImpl nodeEngine) { super(nodeEngine.getLogger(OverloadedConnectionsPlugin.class)); this.nodeEngine = nodeEngine; this.serializationService = nodeEngine.getSerializationService(); this.defaultFormat.setMinimumFractionDigits(3); HazelcastProperties props = nodeEngine.getProperties(); this.periodMillis = props.getMillis(PERIOD_SECONDS); this.threshold = props.getInteger(THRESHOLD); this.samples = props.getInteger(SAMPLES); }
public TransactionManagerServiceImpl(NodeEngineImpl nodeEngine) { this.nodeEngine = nodeEngine; this.logger = nodeEngine.getLogger(TransactionManagerService.class); this.finalizeExceptionHandler = logAllExceptions(logger, "Error while rolling-back tx!", Level.WARNING); nodeEngine.getMetricsRegistry().scanAndRegister(this, "transactions"); }
private Set<TcpIpConnection> getTcpIpConnections() { ConnectionManager connectionManager = nodeEngine.getNode().getConnectionManager(); if (connectionManager instanceof TcpIpConnectionManager) { return ((TcpIpConnectionManager) connectionManager).getActiveConnections(); } else { return emptySet(); } }
@SuppressWarnings("unchecked") public <S> S getService(String serviceName) { return (S) node.nodeEngine.getService(serviceName); }
private void createAndPublishEvent(Collection<Member> memberList, boolean presence) { QuorumEvent quorumEvent = new QuorumEvent(nodeEngine.getThisAddress(), size, memberList, presence); eventService.publishEvent(QuorumServiceImpl.SERVICE_NAME, quorumName, quorumEvent, quorumEvent.hashCode()); }
private Operation createConsumerOperation(int partitionId, Queue<Accumulator> accumulators) { PublisherContext publisherContext = context.getPublisherContext(); NodeEngineImpl nodeEngine = (NodeEngineImpl) publisherContext.getNodeEngine(); Operation operation = new AccumulatorConsumerOperation(accumulators, MAX_PROCESSABLE_ACCUMULATOR_COUNT); operation .setNodeEngine(nodeEngine) .setCallerUuid(nodeEngine.getLocalMember().getUuid()) .setPartitionId(partitionId) .setValidateTarget(false) .setService(nodeEngine.getService(MapService.SERVICE_NAME)); return operation; }
public void sendPartitionLostEvent(int partitionId, int lostReplicaIndex) { final IPartitionLostEvent event = new IPartitionLostEvent(partitionId, lostReplicaIndex, nodeEngine.getThisAddress()); final InternalPartitionLostEventPublisher publisher = new InternalPartitionLostEventPublisher(nodeEngine, event); nodeEngine.getExecutionService().execute(SYSTEM_EXECUTOR, publisher); }
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 Operation getPreJoinOperation() { Set<Member> members = nodeEngine.getClusterService().getMembers(); HashSet<String> liveMemberUUIDs = new HashSet<String>(); for (Member member : members) { liveMemberUUIDs.add(member.getUuid()); } Map<String, String> liveMappings = new HashMap<String, String>(ownershipMappings); liveMappings.values().retainAll(liveMemberUUIDs); return liveMappings.isEmpty() ? null : new OnJoinClientOperation(liveMappings); }
@Override public void run() { final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); final Node node = nodeEngine.getNode(); final ILogger logger = nodeEngine.getLogger("com.hazelcast.security"); logger.severe("Node could not join cluster. Authentication failed on master node! Node is going to shutdown now!"); node.shutdown(true); }
public void destroyLocalDistributedObject(String serviceName, String name, boolean fireEvent) { ProxyRegistry registry = registries.get(serviceName); if (registry != null) { registry.destroyProxy(name, fireEvent); destroyedCounter.inc(); } RemoteService service = nodeEngine.getService(serviceName); service.destroyDistributedObject(name); String message = "DistributedObject[" + service + " -> " + name + "] has been destroyed!"; Throwable cause = new DistributedObjectDestroyedException(message); nodeEngine.getOperationParker().cancelParkedOperations(serviceName, name, cause); }
public OperationParkerImpl(NodeEngineImpl nodeEngine) { this.nodeEngine = nodeEngine; Node node = nodeEngine.getNode(); this.logger = node.getLogger(OperationParker.class); this.expirationExecutor = Executors.newSingleThreadExecutor( new SingleExecutorThreadFactory(node.getConfigClassLoader(), createThreadName(nodeEngine.getHazelcastInstance().getName(), "operation-parker"))); this.expirationTaskFuture = expirationExecutor.submit(new ExpirationTask()); }