protected static String addressToFilename(Address mbr) { String logical_name=UUID.get(mbr); String name=(addressAsString(mbr) + (logical_name != null? "." + logical_name + SUFFIX : SUFFIX)); return regexp.matcher(name).replaceAll("-"); }
protected static String addressToFilename(Address mbr) { String logical_name=UUID.get(mbr); String name=(addressAsString(mbr) + (logical_name != null? "." + logical_name + SUFFIX : SUFFIX)); return regexp.matcher(name).replaceAll("-"); }
protected static String addressToFilename(Address mbr) { String logical_name=UUID.get(mbr); String name=(addressAsString(mbr) + (logical_name != null? "." + logical_name + SUFFIX : SUFFIX)); return regexp.matcher(name).replaceAll("-"); }
/** Write information about all of the member to file (only if I'm the coord) */ protected void writeAll() { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } write(list, cluster_name); }
/** Write information about all of the member to file (only if I'm the coord) */ protected void writeAll() { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } write(list, cluster_name); }
/** Write information about all of the member to file (only if I'm the coord) */ protected void writeAll() { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } write(list, cluster_name); }
@ManagedOperation(description="Reads data from local caches and dumps them to a file") public void dumpCache(String output_filename) throws Exception { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } OutputStream out=new FileOutputStream(output_filename); write(list, out); }
@ManagedOperation(description="Reads data from local caches and dumps them to a file") public void dumpCache(String output_filename) throws Exception { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } OutputStream out=new FileOutputStream(output_filename); write(list, out); }
@ManagedOperation(description="Reads data from local caches and dumps them to a file") public void dumpCache(String output_filename) throws Exception { Map<Address,PhysicalAddress> cache_contents= (Map<Address,PhysicalAddress>)down_prot.down(new Event(Event.GET_LOGICAL_PHYSICAL_MAPPINGS, false)); List<PingData> list=new ArrayList<>(cache_contents.size()); for(Map.Entry<Address,PhysicalAddress> entry: cache_contents.entrySet()) { Address addr=entry.getKey(); PhysicalAddress phys_addr=entry.getValue(); PingData data=new PingData(addr, true, UUID.get(addr), phys_addr).coord(addr.equals(local_addr)); list.add(data); } OutputStream out=new FileOutputStream(output_filename); write(list, out); }
protected MergeHeader createInfo() { PhysicalAddress physical_addr=local_addr != null? (PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)) : null; return MergeHeader.createInfo(view.getViewId(), UUID.get(local_addr), physical_addr); }
protected MergeHeader createInfo() { PhysicalAddress physical_addr=local_addr != null? (PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)) : null; return MergeHeader.createInfo(view.getViewId(), UUID.get(local_addr), physical_addr); }
protected MergeHeader createInfo() { PhysicalAddress physical_addr=local_addr != null? (PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)) : null; return MergeHeader.createInfo(view.getViewId(), UUID.get(local_addr), physical_addr); }
/** Write my own UUID,logical name and physical address to a file */ protected void writeOwnInformation(boolean overwrite) { PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)); PingData data=new PingData(local_addr, is_server, UUID.get(local_addr), physical_addr).coord(is_coord); writeToDB(data, cluster_name, overwrite); // write my own data to file }
/** Write my own UUID,logical name and physical address to a file */ protected void writeOwnInformation(boolean overwrite) { PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)); PingData data=new PingData(local_addr, is_server, UUID.get(local_addr), physical_addr).coord(is_coord); writeToDB(data, cluster_name, overwrite); // write my own data to file }
/** Write my own UUID,logical name and physical address to a file */ protected void writeOwnInformation(boolean overwrite) { PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)); PingData data=new PingData(local_addr, is_server, UUID.get(local_addr), physical_addr).coord(is_coord); writeToDB(data, cluster_name, overwrite); // write my own data to file }
/** * Sends a SITE-UNREACHABLE message to the sender of the message. Because the sender is always local (we're the * relayer), no routing needs to be done * @param dest * @param target_site */ protected void sendSiteUnreachableTo(Address dest, String target_site) { Message msg=new Message(dest).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL) .src(new SiteUUID((UUID)local_addr, UUID.get(local_addr), site)) .putHeader(id,new Relay2Header(Relay2Header.SITE_UNREACHABLE,new SiteMaster(target_site),null)); down_prot.down(new Event(Event.MSG, msg)); }
/** * Sends a SITE-UNREACHABLE message to the sender of the message. Because the sender is always local (we're the * relayer), no routing needs to be done * @param dest * @param target_site */ protected void sendSiteUnreachableTo(Address dest, String target_site) { Message msg=new Message(dest).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL) .src(new SiteUUID((UUID)local_addr, UUID.get(local_addr), site)) .putHeader(id,new Relay2Header(Relay2Header.SITE_UNREACHABLE,new SiteMaster(target_site),null)); down_prot.down(new Event(Event.MSG, msg)); }
/** * Sends a SITE-UNREACHABLE message to the sender of the message. Because the sender is always local (we're the * relayer), no routing needs to be done * @param dest * @param target_site */ protected void sendSiteUnreachableTo(Address dest, String target_site) { Message msg=new Message(dest).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL) .src(new SiteUUID((UUID)local_addr, UUID.get(local_addr), site)) .putHeader(id,new Relay2Header(Relay2Header.SITE_UNREACHABLE,new SiteMaster(target_site),null)); down_prot.down(new Event(Event.MSG, msg)); }
protected void sendDiscoveryRequest(String cluster_name, List<Address> members_to_find) throws Exception { PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)); // https://issues.jboss.org/browse/JGRP-1670 PingData data=new PingData(local_addr, false, UUID.get(local_addr), physical_addr); PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ).clusterName(cluster_name); if(members_to_find != null && members_to_find.size() <= max_members_in_discovery_request) data.mbrs(members_to_find); // message needs to have DONT_BUNDLE flag: if A sends message M to B, and we need to fetch B's physical // address, then the bundler thread blocks until the discovery request has returned. However, we cannot send // the discovery *request* until the bundler thread has returned from sending M Message msg=new Message(null).putHeader(getId(),hdr).setBuffer(marshal(data)) .setFlag(Message.Flag.INTERNAL,Message.Flag.DONT_BUNDLE,Message.Flag.OOB) .setTransientFlag(Message.TransientFlag.DONT_LOOPBACK); sendMcastDiscoveryRequest(msg); }
protected void sendDiscoveryRequest(String cluster_name, List<Address> members_to_find) throws Exception { PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr)); // https://issues.jboss.org/browse/JGRP-1670 PingData data=new PingData(local_addr, false, UUID.get(local_addr), physical_addr); PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ).clusterName(cluster_name); if(members_to_find != null && members_to_find.size() <= max_members_in_discovery_request) data.mbrs(members_to_find); // message needs to have DONT_BUNDLE flag: if A sends message M to B, and we need to fetch B's physical // address, then the bundler thread blocks until the discovery request has returned. However, we cannot send // the discovery *request* until the bundler thread has returned from sending M Message msg=new Message(null).putHeader(getId(),hdr).setBuffer(marshal(data)) .setFlag(Message.Flag.INTERNAL,Message.Flag.DONT_BUNDLE,Message.Flag.OOB) .setTransientFlag(Message.TransientFlag.DONT_LOOPBACK); sendMcastDiscoveryRequest(msg); }