test_class.declarator: K = 10
test_class.modifier: private static final
test_class.original_string: private static final int K = 10;
test_class.type: int
test_class.var_name: K
test_class.file: rapid/src/test/java/com/vrg/rapid/MembershipViewTest.java
test_class.identifier: MembershipViewTest
test_case.body: @Test
      public void ringDeletionsOnly() {
          final MembershipView mview = new MembershipView(K);
  
          final int numNodes = 10;
          int numThrows = 0;
          for (int i = 0; i < numNodes; i++) {
              try {
                  mview.ringDelete(Utils.hostFromParts("127.0.0.1", i));
              } catch (final MembershipView.NodeNotInRingException e) {
                  numThrows++;
              }
          }
  
          assertEquals(numNodes, numThrows);
      }
test_case.class_method_signature: MembershipViewTest.ringDeletionsOnly()
test_case.full_signature: @Test public void ringDeletionsOnly()
test_case.identifier: ringDeletionsOnly
test_case.invocations: ringDelete hostFromParts assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void ringDeletionsOnly()
focal_class.declarator: K
focal_class.modifier: private final
focal_class.original_string: private final int K;
focal_class.type: int
focal_class.var_name: K
focal_class.declarator: HASH_FUNCTION = LongHashFunction.xx(0)
focal_class.modifier: private static final
focal_class.original_string: private static final LongHashFunction HASH_FUNCTION = LongHashFunction.xx(0);
focal_class.type: LongHashFunction
focal_class.var_name: HASH_FUNCTION
focal_class.declarator: rwLock = new ReentrantReadWriteLock()
focal_class.modifier: private final
focal_class.original_string: private final ReadWriteLock rwLock = new ReentrantReadWriteLock();
focal_class.type: ReadWriteLock
focal_class.var_name: rwLock
focal_class.declarator: addressComparators
focal_class.modifier: @GuardedBy("rwLock") private final
focal_class.original_string: @GuardedBy("rwLock") private final ArrayList<Utils.AddressComparator> addressComparators;
focal_class.type: ArrayList<Utils.AddressComparator>
focal_class.var_name: addressComparators
focal_class.declarator: rings
focal_class.modifier: @GuardedBy("rwLock") private final
focal_class.original_string: @GuardedBy("rwLock") private final ArrayList<NavigableSet<Endpoint>> rings;
focal_class.type: ArrayList<NavigableSet<Endpoint>>
focal_class.var_name: rings
focal_class.declarator: identifiersSeen = new TreeSet<>(NodeIdComparator.INSTANCE)
focal_class.modifier: @GuardedBy("rwLock") private final
focal_class.original_string: @GuardedBy("rwLock") private final Set<NodeId> identifiersSeen = new TreeSet<>(NodeIdComparator.INSTANCE);
focal_class.type: Set<NodeId>
focal_class.var_name: identifiersSeen
focal_class.declarator: cachedObservers = new HashMap<>()
focal_class.modifier: @GuardedBy("rwLock") private final
focal_class.original_string: @GuardedBy("rwLock") private final Map<Endpoint, List<Endpoint>> cachedObservers = new HashMap<>();
focal_class.type: Map<Endpoint, List<Endpoint>>
focal_class.var_name: cachedObservers
focal_class.declarator: allNodes = new HashSet<>()
focal_class.modifier: @GuardedBy("rwLock") private final
focal_class.original_string: @GuardedBy("rwLock") private final Set<Endpoint> allNodes = new HashSet<>();
focal_class.type: Set<Endpoint>
focal_class.var_name: allNodes
focal_class.declarator: currentConfigurationId = -1
focal_class.modifier: @GuardedBy("rwLock") private
focal_class.original_string: @GuardedBy("rwLock") private long currentConfigurationId = -1;
focal_class.type: long
focal_class.var_name: currentConfigurationId
focal_class.declarator: currentConfiguration
focal_class.modifier: @GuardedBy("rwLock") private
focal_class.original_string: @GuardedBy("rwLock") private Configuration currentConfiguration;
focal_class.type: Configuration
focal_class.var_name: currentConfiguration
focal_class.declarator: shouldUpdateConfigurationId = true
focal_class.modifier: @GuardedBy("rwLock") private
focal_class.original_string: @GuardedBy("rwLock") private boolean shouldUpdateConfigurationId = true;
focal_class.type: boolean
focal_class.var_name: shouldUpdateConfigurationId
focal_class.file: rapid/src/main/java/com/vrg/rapid/MembershipView.java
focal_class.identifier: MembershipView
focal_class.class_method_signature: MembershipView.MembershipView(final int K)
focal_class.full_signature:   MembershipView(final int K)
focal_class.identifier: MembershipView
focal_class.parameters: (final int K)
focal_class.signature:  MembershipView(final int K)
focal_class.class_method_signature: MembershipView.MembershipView(final int K, final Collection<NodeId> nodeIds,
                     final Collection<Endpoint> endpoints)
focal_class.full_signature:   MembershipView(final int K, final Collection<NodeId> nodeIds,
                     final Collection<Endpoint> endpoints)
focal_class.identifier: MembershipView
focal_class.parameters: (final int K, final Collection<NodeId> nodeIds,
                     final Collection<Endpoint> endpoints)
focal_class.signature:  MembershipView(final int K, final Collection<NodeId> nodeIds,
                     final Collection<Endpoint> endpoints)
focal_class.class_method_signature: MembershipView.isSafeToJoin(final Endpoint node, final NodeId uuid)
focal_class.full_signature:  JoinStatusCode isSafeToJoin(final Endpoint node, final NodeId uuid)
focal_class.identifier: isSafeToJoin
focal_class.parameters: (final Endpoint node, final NodeId uuid)
focal_class.return: JoinStatusCode
focal_class.signature: JoinStatusCode isSafeToJoin(final Endpoint node, final NodeId uuid)
focal_class.class_method_signature: MembershipView.ringAdd(final Endpoint node, final NodeId nodeId)
focal_class.full_signature:  void ringAdd(final Endpoint node, final NodeId nodeId)
focal_class.identifier: ringAdd
focal_class.parameters: (final Endpoint node, final NodeId nodeId)
focal_class.return: void
focal_class.signature: void ringAdd(final Endpoint node, final NodeId nodeId)
focal_class.class_method_signature: MembershipView.ringDelete(final Endpoint node)
focal_class.full_signature:  void ringDelete(final Endpoint node)
focal_class.identifier: ringDelete
focal_class.parameters: (final Endpoint node)
focal_class.return: void
focal_class.signature: void ringDelete(final Endpoint node)
focal_class.class_method_signature: MembershipView.getObserversOf(final Endpoint node)
focal_class.full_signature:  List<Endpoint> getObserversOf(final Endpoint node)
focal_class.identifier: getObserversOf
focal_class.parameters: (final Endpoint node)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> getObserversOf(final Endpoint node)
focal_class.class_method_signature: MembershipView.computeObserversOf(final Endpoint node)
focal_class.full_signature: private List<Endpoint> computeObserversOf(final Endpoint node)
focal_class.identifier: computeObserversOf
focal_class.modifiers: private
focal_class.parameters: (final Endpoint node)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> computeObserversOf(final Endpoint node)
focal_class.class_method_signature: MembershipView.getSubjectsOf(final Endpoint node)
focal_class.full_signature:  List<Endpoint> getSubjectsOf(final Endpoint node)
focal_class.identifier: getSubjectsOf
focal_class.parameters: (final Endpoint node)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> getSubjectsOf(final Endpoint node)
focal_class.class_method_signature: MembershipView.getExpectedObserversOf(final Endpoint node)
focal_class.full_signature:  List<Endpoint> getExpectedObserversOf(final Endpoint node)
focal_class.identifier: getExpectedObserversOf
focal_class.parameters: (final Endpoint node)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> getExpectedObserversOf(final Endpoint node)
focal_class.class_method_signature: MembershipView.getPredecessorsOf(final Endpoint node)
focal_class.full_signature: private List<Endpoint> getPredecessorsOf(final Endpoint node)
focal_class.identifier: getPredecessorsOf
focal_class.modifiers: private
focal_class.parameters: (final Endpoint node)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> getPredecessorsOf(final Endpoint node)
focal_class.class_method_signature: MembershipView.isHostPresent(final Endpoint address)
focal_class.full_signature:  boolean isHostPresent(final Endpoint address)
focal_class.identifier: isHostPresent
focal_class.parameters: (final Endpoint address)
focal_class.return: boolean
focal_class.signature: boolean isHostPresent(final Endpoint address)
focal_class.class_method_signature: MembershipView.isIdentifierPresent(final NodeId identifier)
focal_class.full_signature:  boolean isIdentifierPresent(final NodeId identifier)
focal_class.identifier: isIdentifierPresent
focal_class.parameters: (final NodeId identifier)
focal_class.return: boolean
focal_class.signature: boolean isIdentifierPresent(final NodeId identifier)
focal_class.class_method_signature: MembershipView.getCurrentConfigurationId()
focal_class.full_signature:  long getCurrentConfigurationId()
focal_class.identifier: getCurrentConfigurationId
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getCurrentConfigurationId()
focal_class.class_method_signature: MembershipView.getRing(final int k)
focal_class.full_signature:  List<Endpoint> getRing(final int k)
focal_class.identifier: getRing
focal_class.parameters: (final int k)
focal_class.return: List<Endpoint>
focal_class.signature: List<Endpoint> getRing(final int k)
focal_class.class_method_signature: MembershipView.getRingNumbers(final Endpoint observer, final Endpoint subject)
focal_class.full_signature:  List<Integer> getRingNumbers(final Endpoint observer, final Endpoint subject)
focal_class.identifier: getRingNumbers
focal_class.parameters: (final Endpoint observer, final Endpoint subject)
focal_class.return: List<Integer>
focal_class.signature: List<Integer> getRingNumbers(final Endpoint observer, final Endpoint subject)
focal_class.class_method_signature: MembershipView.getMembershipSize()
focal_class.full_signature:  int getMembershipSize()
focal_class.identifier: getMembershipSize
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMembershipSize()
focal_class.class_method_signature: MembershipView.updateCurrentConfigurationId()
focal_class.full_signature: @GuardedBy("rwLock") private void updateCurrentConfigurationId()
focal_class.identifier: updateCurrentConfigurationId
focal_class.modifiers: @GuardedBy("rwLock") private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateCurrentConfigurationId()
focal_class.class_method_signature: MembershipView.getConfiguration()
focal_class.full_signature:  Configuration getConfiguration()
focal_class.identifier: getConfiguration
focal_class.parameters: ()
focal_class.return: Configuration
focal_class.signature: Configuration getConfiguration()
focal_method.body: void ringDelete(final Endpoint node) {
          Objects.requireNonNull(node);
          rwLock.writeLock().lock();
          try {
  
              if (!rings.get(0).contains(node)) {
                  throw new NodeNotInRingException(node);
              }
  
              final Set<Endpoint> affectedSubjects = new HashSet<>();
  
              for (int k = 0; k < K; k++) {
                  final NavigableSet<Endpoint> endpoints = rings.get(k);
  
                  final Endpoint oldSubject = endpoints.lower(node);
                  if (oldSubject != null) {
                      affectedSubjects.add(oldSubject);
                  }
  
                  endpoints.remove(node);
  
                  addressComparators.get(k).removeEndpoint(node);
                  cachedObservers.remove(node);
              }
              allNodes.remove(node);
  
              for (final Endpoint subject : affectedSubjects) {
                  cachedObservers.remove(subject);
              }
  
              shouldUpdateConfigurationId = true;
          } finally {
              rwLock.writeLock().unlock();
          }
      }
focal_method.class_method_signature: MembershipView.ringDelete(final Endpoint node)
focal_method.full_signature:  void ringDelete(final Endpoint node)
focal_method.identifier: ringDelete
focal_method.invocations: requireNonNull lock writeLock contains get get lower add remove removeEndpoint get remove remove remove unlock writeLock
focal_method.parameters: (final Endpoint node)
focal_method.return: void
focal_method.signature: void ringDelete(final Endpoint node)