public void init() throws Exception { super.init(); if(site == null || site.isEmpty()) throw new IllegalArgumentException("\"site\" must be set"); timer=getTransport().getTimer(); JChannel channel=getProtocolStack().getChannel(); if(channel == null) throw new IllegalStateException("channel must be set"); channel.addAddressGenerator(() -> ExtendedUUID.randomUUID().put(SITE_ID, Util.stringToBytes(site))); }
JChannel ch=getProtocolStack().getChannel(); ch.addAddressGenerator(() -> { ExtendedUUID retval=ExtendedUUID.randomUUID(); if(can_become_site_master) retval.setFlag(can_become_site_master_flag);
@Override public Address generateAddress() { ExtendedUUID uuid = ExtendedUUID.randomUUID(); uuid.put(SITE, Util.stringToBytes(this.topology.getSite())); uuid.put(RACK, Util.stringToBytes(this.topology.getRack())); uuid.put(MACHINE, Util.stringToBytes(this.topology.getMachine())); return uuid; } }
public void init() throws Exception { super.init(); if(site == null || site.isEmpty()) throw new IllegalArgumentException("\"site\" must be set"); timer=getTransport().getTimer(); JChannel channel=getProtocolStack().getChannel(); if(channel == null) throw new IllegalStateException("channel must be set"); channel.addAddressGenerator(() -> ExtendedUUID.randomUUID().put(SITE_ID, Util.stringToBytes(site))); }
JChannel ch=getProtocolStack().getChannel(); ch.addAddressGenerator(() -> { ExtendedUUID retval=ExtendedUUID.randomUUID(); if(can_become_site_master) retval.setFlag(can_become_site_master_flag);
@Override public Address generateAddress() { ExtendedUUID uuid = ExtendedUUID.randomUUID(); uuid.put(SITE, Util.stringToBytes(this.topology.getSite())); uuid.put(RACK, Util.stringToBytes(this.topology.getRack())); uuid.put(MACHINE, Util.stringToBytes(this.topology.getMachine())); return uuid; } }
@Override public Address generateAddress() { ExtendedUUID uuid = ExtendedUUID.randomUUID(); uuid.put(SITE, Util.stringToBytes(this.topology.getSite())); uuid.put(RACK, Util.stringToBytes(this.topology.getRack())); uuid.put(MACHINE, Util.stringToBytes(this.topology.getMachine())); return uuid; } }