Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ public static void main(String[] args) throws Exception {
apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build();
apiClient.setHttpClient(httpClient);

SharedInformerFactory factory = new SharedInformerFactory();
SharedInformerFactory factory = new SharedInformerFactory(apiClient);

// Node informer
SharedIndexInformer<V1Node> nodeInformer =
factory.sharedIndexInformerFor(
(CallGeneratorParams params) -> {
// **NOTE**:
// The following "CallGeneratorParams" lambda merely generates a stateless
// HTTPs requests, the effective apiClient is the one specified when constructing
// the informer-factory.
return coreV1Api.listNodeCall(
null,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ public static void main(String[] args) throws Exception {
apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build();
apiClient.setHttpClient(httpClient);

SharedInformerFactory factory = new SharedInformerFactory();
SharedInformerFactory factory = new SharedInformerFactory(apiClient);

// Node informer
SharedIndexInformer<V1Node> nodeInformer =
factory.sharedIndexInformerFor(
(CallGeneratorParams params) -> {
// **NOTE**:
// The following "CallGeneratorParams" lambda merely generates a stateless
// HTTPs requests, the effective apiClient is the one specified when constructing
// the informer-factory.
return coreV1Api.listNodeCall(
null,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ public static void main(String[] args) throws Exception {
apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build();
apiClient.setHttpClient(httpClient);

SharedInformerFactory factory = new SharedInformerFactory();
SharedInformerFactory factory = new SharedInformerFactory(apiClient);

// Node informer
SharedIndexInformer<V1Node> nodeInformer =
factory.sharedIndexInformerFor(
// **NOTE**:
// The following "CallGeneratorParams" lambda merely generates a stateless
// HTTPs requests, the effective apiClient is the one specified when constructing
// the informer-factory.
(CallGeneratorParams params) -> {
return coreV1Api.listNodeCall(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class SharedInformerFactory {
private ApiClient apiClient;

/** Constructor w/ default thread pool. */
/** DEPRECATE: In favor of explicit apiClient constructor to avoid misguiding */
@Deprecated
public SharedInformerFactory() {
this(Configuration.getDefaultApiClient().setReadTimeout(0), Executors.newCachedThreadPool());
}
Expand Down