Skip to content

Commit

Permalink
resolve all the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brycezhongqing committed Sep 17, 2024
1 parent dad7e09 commit c60be22
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions d2/src/main/java/com/linkedin/d2/xds/XdsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,17 @@ final ResourceType getType()
*/
public abstract void onReconnect();

/**
* Called when a resource is added or updated.
* @param resourceName the name of the resource that was added or updated.
* @param update the new data {@link ResourceUpdate} for the resource.
*/
abstract void onChanged(String resourceName, ResourceUpdate update);

/**
* Called when a resource is removed.
* @param resourceName the name of the resource that was removed.
*/
public abstract void onRemoval(String resourceName);
}

Expand All @@ -135,6 +144,11 @@ public WildcardNodeResourceWatcher()
super(ResourceType.NODE);
}

/**
* Called when a node resource is added or updated.
* @param resourceName the resource name of the {@link NodeUpdate} that was added or updated.
* @param update the new data for the {@link NodeUpdate}, including D2 cluster and service information.
*/
public abstract void onChanged(String resourceName, NodeUpdate update);

@Override
Expand All @@ -151,6 +165,13 @@ public WildcardD2URIMapResourceWatcher()
super(ResourceType.D2_URI_MAP);
}

/**
* Called when a {@link D2URIMapUpdate} resource is added or updated.
* @param resourceName the resource name of the {@link D2URIMapUpdate} map resource that was added or updated.
* like the
* /d2/uris/clusterName
* @param update the new data for the {@link D2URIMapUpdate} resource
*/
public abstract void onChanged(String resourceName, D2URIMapUpdate update);

@Override
Expand Down

0 comments on commit c60be22

Please sign in to comment.