Skip to content

Commit 101a4c2

Browse files
olim7tadutra
authored andcommitted
JAVA-2159: Update code example in API conventions manual page
1 parent 68815e0 commit 101a4c2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

manual/api_conventions/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ generally have to go through an explicit cast:
2727
import com.datastax.oss.driver.api.core.context.DriverContext;
2828

2929
import com.datastax.oss.driver.internal.core.context.InternalDriverContext;
30-
import com.datastax.oss.driver.internal.core.config.ForceReloadConfigEvent;
30+
import com.datastax.oss.driver.internal.core.metadata.TopologyEvent;
3131

3232
// Public API:
3333
DriverContext context = session.getContext();
3434

35-
// Switch to the internal API to force a reload of the configuration:
35+
// Switch to the internal API to force a node down:
3636
InternalDriverContext internalContext = (InternalDriverContext) context;
37-
internalContext.getEventBus().fire(ForceReloadConfigEvent.INSTANCE);
37+
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 9042);
38+
internalContext.getEventBus().fire(TopologyEvent.forceDown(address));
3839
```
3940

4041
So the risk of unintentionally using the internal API is very low. To double-check, you can always

0 commit comments

Comments
 (0)