private void processPartitionResponse(Connection connection, Collection<Map.Entry<Address, List<Integer>>> partitions,
                                          int partitionStateVersion,
                                          boolean partitionStateVersionExist) {

        while (true) {
            PartitionTable current = this.partitionTable.get();
            if (!shouldBeApplied(connection, partitions, partitionStateVersion, partitionStateVersionExist, current)) {
                return;
            }
            Int2ObjectHashMap<Address> newPartitions = convertToPartitionToAddressMap(partitions);
            PartitionTable newMetaData = new PartitionTable(connection, partitionStateVersion, newPartitions);
            if (this.partitionTable.compareAndSet(current, newMetaData)) {
                // partition count is set once at the start. Even if we reset the partition table when switching cluster
                //we want to remember the partition count. That is why it is a different field.
                if (partitionCount == 0) {
                    partitionCount = newPartitions.size();
                }
                if (logger.isFinestEnabled()) {
                    logger.finest("Processed partition response. partitionStateVersion : "
                            + (partitionStateVersionExist ? partitionStateVersion : "NotAvailable")
                            + ", partitionCount :" + newPartitions.size() + ", connection : " + connection);
                }
                return;
            }

        }
    }
private void processPartitionResponse ( Connection connection , Collection < Map . Entry < Address , List < Integer > > > partitions , int partitionStateVersion , boolean partitionStateVersionExist ) { while ( true ) { PartitionTable current = this . partitionTable . get ( ) ; if ( ! shouldBeApplied ( connection , partitions , partitionStateVersion , partitionStateVersionExist , current ) ) { return ; } Int2ObjectHashMap < Address > newPartitions = convertToPartitionToAddressMap ( partitions ) ; PartitionTable newMetaData = new PartitionTable ( connection , partitionStateVersion , newPartitions ) ; if ( this . partitionTable . compareAndSet ( current , newMetaData ) ) { if ( partitionCount == 0 ) { partitionCount = newPartitions . size ( ) ; } if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Processed partition response. partitionStateVersion : " + ( partitionStateVersionExist ? partitionStateVersion : "NotAvailable" ) + ", partitionCount :" + newPartitions . size ( ) + ", connection : " + connection ) ; } return ; } } }
The partitions can be empty on the response, client will not apply the empty partition table,
see {@link ClientPartitionListenerService#getPartitions(PartitionTableView)}