/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { return size() > max_size; }
public void init() throws Exception { int tmp=Util.getNextHigherPowerOfTwo(cipher_pool_size); if(tmp != cipher_pool_size) { log.warn("%s: setting cipher_pool_size (%d) to %d (power of 2) for faster modulo operation", local_addr, cipher_pool_size, tmp); cipher_pool_size=tmp; } key_map=new BoundedHashMap<>(key_map_max_size); encoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); decoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); initSymCiphers(sym_algorithm, secret_key); }
public void init() throws Exception { int tmp=Util.getNextHigherPowerOfTwo(cipher_pool_size); if(tmp != cipher_pool_size) { log.warn("%s: setting cipher_pool_size (%d) to %d (power of 2) for faster modulo operation", local_addr, cipher_pool_size, tmp); cipher_pool_size=tmp; } key_map=new BoundedHashMap<>(key_map_max_size); encoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); decoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); initSymCiphers(sym_algorithm, secret_key); }
/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { return size() > max_size; }
public void init() throws Exception { int tmp=Util.getNextHigherPowerOfTwo(cipher_pool_size); if(tmp != cipher_pool_size) { log.warn("%s: setting cipher_pool_size (%d) to %d (power of 2) for faster modulo operation", local_addr, cipher_pool_size, tmp); cipher_pool_size=tmp; } key_map=new BoundedHashMap<>(key_map_max_size); encoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); decoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); initSymCiphers(sym_algorithm, secret_key); }
/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { return size() > max_size; }
/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender, as the sender in NAKACK will always be * the coordinator. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
/** Total size of all queues of the delivery table */ public int deliveryTableSize() { int retval=0; for(BoundedHashMap<Long,Long> val: delivery_table.values()) retval+=val.size(); return retval; }
/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender, as the sender in NAKACK will always be * the coordinator. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
/** Total size of all queues of the delivery table */ public int deliveryTableSize() { int retval=0; for(BoundedHashMap<Long,Long> val: delivery_table.values()) retval+=val.size(); return retval; }
/** * Checks if seqno has already been received from sender. This weeds out duplicates. * Note that this method is never called concurrently for the same sender, as the sender in NAKACK will always be * the coordinator. */ protected boolean canDeliver(Address sender, long seqno) { BoundedHashMap<Long,Long> seqno_set=delivery_table.get(sender); if(seqno_set == null) { seqno_set=new BoundedHashMap<>(delivery_table_max_size); BoundedHashMap<Long,Long> existing=delivery_table.put(sender,seqno_set); if(existing != null) seqno_set=existing; } return seqno_set.add(seqno, seqno); }
/** Total size of all queues of the delivery table */ public int deliveryTableSize() { int retval=0; for(BoundedHashMap<Long,Long> val: delivery_table.values()) retval+=val.size(); return retval; }