com.hazelcast.instance.Node.getSerializationService()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(113)

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

Node.getSerializationService介绍

暂无

代码示例

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

@Override
public InternalSerializationService getSerializationService() {
  return node.getSerializationService();
}

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

@Override
public InternalSerializationService getSerializationService() {
  return node.getSerializationService();
}

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

@Override
public InternalSerializationService getSerializationService() {
  return node.getSerializationService();
}

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

@Override
public InternalSerializationService getSerializationService() {
  return node.getSerializationService();
}

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

@Override
public byte[] toByteArray(Object value) {
  Data data = node.getSerializationService().toData(value);
  return data.toByteArray();
}

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

/**
 * This method has a direct dependency on how objects are serialized.
 * If the stream format is changed, this extraction method must be changed as well.
 * <p>
 * It makes an assumption that the callId is the first long field in the serialized operation.
 */
private long extractOperationCallId(Data data) throws IOException {
  ObjectDataInput input = ((SerializationServiceV1) node.getSerializationService())
      .initDataSerializableInputAndSkipTheHeader(data);
  return input.readLong();
}

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

@Override
public void setNode(Node node) {
  ManagedContext managedContext = node.getSerializationService().getManagedContext();
  managedContext.initialize(task);
}

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

@Override
public byte[] toByteArray(Object value) {
  Data data = node.getSerializationService().toData(value);
  return data.toByteArray();
}

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

/**
 * This method has a direct dependency on how objects are serialized.
 * If the stream format is changed, this extraction method must be changed as well.
 * <p>
 * It makes an assumption that the callId is the first long field in the serialized operation.
 */
private long extractOperationCallId(Data data) throws IOException {
  ObjectDataInput input = ((SerializationServiceV1) node.getSerializationService())
      .initDataSerializableInputAndSkipTheHeader(data);
  return input.readLong();
}

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

@Override
public void setNode(Node node) {
  ManagedContext managedContext = node.getSerializationService().getManagedContext();
  managedContext.initialize(task);
}

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

protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
  this.clientMessage = clientMessage;
  this.logger = node.getLogger(getClass());
  this.node = node;
  this.nodeEngine = node.nodeEngine;
  this.serializationService = node.getSerializationService();
  this.connection = connection;
  this.clientEngine = node.clientEngine;
  this.endpointManager = clientEngine.getEndpointManager();
  this.endpoint = initEndpoint();
}

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

protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
  this.clientMessage = clientMessage;
  this.logger = node.getLogger(getClass());
  this.node = node;
  this.nodeEngine = node.nodeEngine;
  this.serializationService = node.getSerializationService();
  this.connection = connection;
  this.clientEngine = node.clientEngine;
  this.endpointManager = clientEngine.getEndpointManager();
  this.endpoint = initEndpoint();
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

static MemoryStats getMemoryStats(HazelcastInstance hz) {
    // use this method or another way for getting "Node" from a "HazelcastInstance"
    Node node = getNode(hz);
    if (node != null) {
      EnterpriseSerializationService serializationService =
          (EnterpriseSerializationService) node.getSerializationService();
      HazelcastMemoryManager memoryManager = serializationService.getMemoryManager();
      return memoryManager.getMemoryStats();
    } else {
      return new DefaultMemoryStats();
    }
  }
}

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

@Override
  public Object initialize(Object obj) {
    if (obj instanceof HazelcastInstanceAware) {
      ((HazelcastInstanceAware) obj).setHazelcastInstance(instance);
    }
    if (obj instanceof NodeAware) {
      ((NodeAware) obj).setNode(instance.node);
    }
    if (obj instanceof SerializationServiceAware) {
      ((SerializationServiceAware) obj).setSerializationService(instance.node.getSerializationService());
    }

    if (hasExternalContext) {
      return externalContext.initialize(obj);
    }
    return obj;
  }
}

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

@Override
  public Object initialize(Object obj) {
    if (obj instanceof HazelcastInstanceAware) {
      ((HazelcastInstanceAware) obj).setHazelcastInstance(instance);
    }
    if (obj instanceof NodeAware) {
      ((NodeAware) obj).setNode(instance.node);
    }
    if (obj instanceof SerializationServiceAware) {
      ((SerializationServiceAware) obj).setSerializationService(instance.node.getSerializationService());
    }

    if (hasExternalContext) {
      return externalContext.initialize(obj);
    }
    return obj;
  }
}

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

private MulticastService(Node node, MulticastSocket multicastSocket)
    throws Exception {
  this.logger = node.getLogger(MulticastService.class.getName());
  this.node = node;
  this.multicastSocket = multicastSocket;
  NodeIOService nodeIOService = new NodeIOService(node, node.nodeEngine);
  this.inputProcessor = node.getNodeExtension().createMulticastInputProcessor(nodeIOService);
  this.outputProcessor = node.getNodeExtension().createMulticastOutputProcessor(nodeIOService);
  this.sendOutput = node.getSerializationService().createObjectDataOutput(SEND_OUTPUT_SIZE);
  Config config = node.getConfig();
  MulticastConfig multicastConfig = config.getNetworkConfig().getJoin().getMulticastConfig();
  this.datagramPacketSend = new DatagramPacket(new byte[0], 0, InetAddress.getByName(multicastConfig.getMulticastGroup()),
      multicastConfig.getMulticastPort());
  this.datagramPacketReceive = new DatagramPacket(new byte[DATAGRAM_BUFFER_SIZE], DATAGRAM_BUFFER_SIZE);
  Set<String> trustedInterfaces = multicastConfig.getTrustedInterfaces();
  ILogger logger = node.getLogger(JoinMessageTrustChecker.class);
  joinMessageTrustChecker = new JoinMessageTrustChecker(trustedInterfaces, logger);
}

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

private MulticastService(Node node, MulticastSocket multicastSocket)
    throws Exception {
  this.logger = node.getLogger(MulticastService.class.getName());
  this.node = node;
  this.multicastSocket = multicastSocket;
  NodeIOService nodeIOService = new NodeIOService(node, node.nodeEngine);
  this.inputProcessor = node.getNodeExtension().createMulticastInputProcessor(nodeIOService);
  this.outputProcessor = node.getNodeExtension().createMulticastOutputProcessor(nodeIOService);
  this.sendOutput = node.getSerializationService().createObjectDataOutput(SEND_OUTPUT_SIZE);
  Config config = node.getConfig();
  MulticastConfig multicastConfig = config.getNetworkConfig().getJoin().getMulticastConfig();
  this.datagramPacketSend = new DatagramPacket(new byte[0], 0, InetAddress.getByName(multicastConfig.getMulticastGroup()),
      multicastConfig.getMulticastPort());
  this.datagramPacketReceive = new DatagramPacket(new byte[DATAGRAM_BUFFER_SIZE], DATAGRAM_BUFFER_SIZE);
  Set<String> trustedInterfaces = multicastConfig.getTrustedInterfaces();
  ILogger logger = node.getLogger(JoinMessageTrustChecker.class);
  joinMessageTrustChecker = new JoinMessageTrustChecker(trustedInterfaces, logger);
}

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

public ClientEngineImpl(Node node) {
  this.logger = node.getLogger(ClientEngine.class);
  this.node = node;
  this.serializationService = node.getSerializationService();
  this.nodeEngine = node.nodeEngine;
  this.endpointManager = new ClientEndpointManagerImpl(nodeEngine);
  this.executor = newClientExecutor();
  this.queryExecutor = newClientQueryExecutor();
  this.clientManagementExecutor = newClientsManagementExecutor();
  this.messageTaskFactory = new CompositeMessageTaskFactory(nodeEngine);
  this.clientExceptions = initClientExceptionFactory();
  this.endpointRemoveDelaySeconds = node.getProperties().getInteger(GroupProperty.CLIENT_ENDPOINT_REMOVE_DELAY_SECONDS);
  this.partitionListenerService = new ClientPartitionListenerService(nodeEngine);
}

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

public ClientEngineImpl(Node node) {
  this.logger = node.getLogger(ClientEngine.class);
  this.node = node;
  this.serializationService = node.getSerializationService();
  this.nodeEngine = node.nodeEngine;
  this.endpointManager = new ClientEndpointManagerImpl(nodeEngine);
  this.executor = newClientExecutor();
  this.queryExecutor = newClientQueryExecutor();
  this.blockingExecutor = newBlockingExecutor();
  this.clientManagementExecutor = newClientsManagementExecutor();
  this.messageTaskFactory = new CompositeMessageTaskFactory(nodeEngine);
  this.clientExceptions = initClientExceptionFactory();
  this.endpointRemoveDelaySeconds = node.getProperties().getInteger(GroupProperty.CLIENT_ENDPOINT_REMOVE_DELAY_SECONDS);
  this.partitionListenerService = new ClientPartitionListenerService(nodeEngine);
}

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

this.node = node;
try {
  this.serializationService = node.getSerializationService();
  this.loggingService = node.loggingService;
  this.logger = node.getLogger(NodeEngine.class.getName());

相关文章

微信公众号

最新文章

更多