Consider the following py4j gateway init code:
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
gateway = JavaGateway(GatewayClient(port=gateway_port), auto_convert=False)
java_import(gateway.jvm,'org.apache.hadoop.hbase.client.*')
java_import(gateway.jvm,'org.apache.hadoop.hbase.filter.*')
What code could be invoked on the gateway to view the imports it contains - and/or validate that a given class were available? i.e. something like:
print("Client class: %s\n" %gw.get_class('org.apache.hbase.client.Client').get_name())
There is no public API to retrieve all imported classes, but you can open a feature request.
In the meantime, you can use the internal API, which may change in the future, but this part of the internal API has been stable since early releases: