Tabnine Logo
GossipData.serializedSize
Code IndexAdd Tabnine to your IDE (free)

How to use
serializedSize
method
in
org.jgroups.stack.GossipData

Best Java code snippets using org.jgroups.stack.GossipData.serializedSize (Showing top 10 results out of 315)

origin: wildfly/wildfly

protected synchronized void writeRequest(GossipData req) throws Exception {
  int size=req.serializedSize();
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(size+5);
  req.writeTo(out);
  client.send(remote, out.buffer(), 0, out.position());
}
origin: wildfly/wildfly

protected void handleGetMembersRequest(Address sender, DataInput in) {
  GossipData req=readRequest(in, GossipType.GET_MBRS);
  if(req == null)
    return;
  GossipData rsp=new GossipData(GossipType.GET_MBRS_RSP, req.getGroup(), null);
  Map<Address,Entry> members=address_mappings.get(req.getGroup());
  if(members != null) {
    for(Map.Entry<Address,Entry> entry : members.entrySet()) {
      Address logical_addr=entry.getKey();
      PhysicalAddress phys_addr=entry.getValue().phys_addr;
      String logical_name=entry.getValue().logical_name;
      PingData data=new PingData(logical_addr, true, logical_name, phys_addr);
      rsp.addPingData(data);
    }
  }
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(rsp.serializedSize());
  try {
    rsp.writeTo(out);
    server.send(sender, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending %d to %s: %s", GossipType.GET_MBRS_RSP, sender, ex);
  }
}
origin: wildfly/wildfly

protected void sendToMember(Address dest, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
    server.send(dest, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending unicast message to %s: %s", dest, ex);
  }
}
origin: wildfly/wildfly

protected void sendToAllMembersInGroup(Set<Map.Entry<Address,Entry>> dests, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
  }
  catch(Exception ex) {
    log.error("failed marshalling gossip data %s: %s; dropping request", request, ex);
    return;
  }
  for(Map.Entry<Address,Entry> entry: dests) {
    Entry e=entry.getValue();
    if(e == null /* || e.phys_addr == null */)
      continue;
    try {
      server.send(e.client_addr, out.buffer(), 0, out.position());
    }
    catch(Exception ex) {
      log.error("failed sending message to %s (%s): %s", e.logical_name, e.phys_addr, ex);
    }
  }
}
origin: wildfly/wildfly

ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
request.writeTo(out);
route(request.group, request.addr, out.buffer(), 0, out.position());
origin: org.jboss.eap/wildfly-client-all

protected synchronized void writeRequest(GossipData req) throws Exception {
  int size=req.serializedSize();
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(size+5);
  req.writeTo(out);
  client.send(remote, out.buffer(), 0, out.position());
}
origin: org.jboss.eap/wildfly-client-all

protected void handleGetMembersRequest(Address sender, DataInput in) {
  GossipData req=readRequest(in, GossipType.GET_MBRS);
  if(req == null)
    return;
  GossipData rsp=new GossipData(GossipType.GET_MBRS_RSP, req.getGroup(), null);
  Map<Address,Entry> members=address_mappings.get(req.getGroup());
  if(members != null) {
    for(Map.Entry<Address,Entry> entry : members.entrySet()) {
      Address logical_addr=entry.getKey();
      PhysicalAddress phys_addr=entry.getValue().phys_addr;
      String logical_name=entry.getValue().logical_name;
      PingData data=new PingData(logical_addr, true, logical_name, phys_addr);
      rsp.addPingData(data);
    }
  }
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(rsp.serializedSize());
  try {
    rsp.writeTo(out);
    server.send(sender, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending %d to %s: %s", GossipType.GET_MBRS_RSP, sender, ex);
  }
}
origin: org.jboss.eap/wildfly-client-all

protected void sendToMember(Address dest, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
    server.send(dest, out.buffer(), 0, out.position());
  }
  catch(Exception ex) {
    log.error("failed sending unicast message to %s: %s", dest, ex);
  }
}
origin: org.jboss.eap/wildfly-client-all

protected void sendToAllMembersInGroup(Set<Map.Entry<Address,Entry>> dests, GossipData request) {
  ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
  try {
    request.writeTo(out);
  }
  catch(Exception ex) {
    log.error("failed marshalling gossip data %s: %s; dropping request", request, ex);
    return;
  }
  for(Map.Entry<Address,Entry> entry: dests) {
    Entry e=entry.getValue();
    if(e == null /* || e.phys_addr == null */)
      continue;
    try {
      server.send(e.client_addr, out.buffer(), 0, out.position());
    }
    catch(Exception ex) {
      log.error("failed sending message to %s (%s): %s", e.logical_name, e.phys_addr, ex);
    }
  }
}
origin: org.jboss.eap/wildfly-client-all

ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(request.serializedSize());
request.writeTo(out);
route(request.group, request.addr, out.buffer(), 0, out.position());
org.jgroups.stackGossipDataserializedSize

Popular methods of GossipData

  • <init>
  • getAddress
  • getGroup
  • getType
  • readFrom
  • writeTo
  • addPingData
  • getBuffer
  • getLogicalName
  • getPhysicalAddress
  • getPingData
  • getSender
  • getPingData,
  • getSender,
  • setSender

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now