diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterApiV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterApiV13.java new file mode 100644 index 00000000..1b8a572a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterApiV13.java @@ -0,0 +1,99 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +import com.qubole.qds.sdk.java.entities.ClusterStateV13; +import com.qubole.qds.sdk.java.entities.ClusterV13; +import com.qubole.qds.sdk.java.entities.ClustersV13; +import com.qubole.qds.sdk.java.entities.Message; + +/** + * Corresponds to http://www.qubole.com/docs/documentation/cluster-api/ + */ +public interface ClusterApiV13 +{ + /** + * Corresponds to http://www.qubole.com/docs/list-clusters/ + * + * @return new builder + */ + public InvokableBuilder list(); + + /** + * Corresponds to http://www.qubole.com/docs/get-cluster-state/ + * + * @param labelOrId the Cluster label/id + * @return new builder + */ + public InvokableBuilder state(String labelOrId); + + /** + * Corresponds to http://www.qubole.com/docs/get-cluster-information/ + * + * @param labelOrId the Cluster label/id + * @return new builder + */ + public InvokableBuilder information(String labelOrId); + + /** + * Corresponds to http://www.qubole.com/docs/start-terminate-cluster/ for "start" + * + * @param labelOrId the Cluster label/id + * @return new builder + */ + public InvokableBuilder start(String labelOrId); + + /** + * Corresponds to http://www.qubole.com/docs/start-terminate-cluster/ for "terminate" + * + * @param labelOrId the Cluster label/id + * @return new builder + */ + public InvokableBuilder terminate(String labelOrId); + + /** + * Corresponds to http://www.qubole.com/docs/edit-cluster/ + * + * @param labelOrId the Cluster label/id + * @param configBuilder config values - use {@link #clusterConfig()} + * @return new builder + */ + public InvokableBuilder edit(String labelOrId, ClusterConfigBuilderV13 configBuilder); + + /** + * Corresponds to http://www.qubole.com/docs/create-new-cluster/ + * + * @param configBuilder config values - use {@link #clusterConfig()} + * @return new builder + */ + public InvokableBuilder create(ClusterConfigBuilderV13 configBuilder); + + /** + * Corresponds to http://www.qubole.com/docs/delete-cluster/ + * + * @param labelOrId the Cluster label/id + * @return new builder + */ + public InvokableBuilder delete(String labelOrId); + + /** + * Return a new cluster config builder. Can be used with + * apis such as {@link ClusterApi#edit(String, ClusterConfigBuilderV13)} + * + * @return builder + */ + public ClusterConfigBuilderV13 clusterConfig(); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterConfigBuilderV13.java new file mode 100644 index 00000000..37bbec96 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterConfigBuilderV13.java @@ -0,0 +1,45 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +import java.util.List; + +public interface ClusterConfigBuilderV13 +{ + public ClusterConfigBuilderV13 label(List label); + + public ClusterConfigBuilderV13 id(int id); + + public ClusterConfigBuilderV13 spark_version(String spark_version); + + public ClusterConfigBuilderV13 disallow_cluster_termination(boolean disallow_cluster_termination); + + public ClusterConfigBuilderV13 enable_ganglia_monitoring(boolean enable_ganglia_monitoring); + + public ClusterConfigBuilderV13 node_bootstrap_file(String node_bootstrap_file); + + public ClusterConfigBuilderV13 state(String state); + + public ClusterEc2ConfigBuilderV13 ec2_settings(); + + public ClusterNodeConfigurationBuilderV13 node_configuration(); + + public ClusterHadoopConfigurationBuilderV13 hadoop_settings(); + + public ClusterSecurityConfigBuilderV13 security_settings(); + + public ClusterPrestoConfigBuilderV13 presto_settings(); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilder.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilder.java index 340e2fcc..f5ffb028 100644 --- a/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilder.java +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilder.java @@ -18,10 +18,16 @@ public interface ClusterEc2ConfigBuilder { public ClusterConfigBuilder compute_secret_key(String compute_secret_key); + public ClusterConfigBuilder compute_validated(boolean compute_validated); + public ClusterConfigBuilder compute_access_key(String compute_access_key); + public ClusterConfigBuilder aws_region(String aws_region); + public ClusterConfigBuilder aws_preferred_availability_zone(String aws_preferred_availability_zone); + public ClusterConfigBuilder subnet_id(String subnet_id); + public ClusterConfigBuilder vpc_id(String vpc_id); } diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilderV13.java new file mode 100644 index 00000000..c2b714ad --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterEc2ConfigBuilderV13.java @@ -0,0 +1,33 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterEc2ConfigBuilderV13 +{ + public ClusterConfigBuilderV13 compute_secret_key(String compute_secret_key); + + public ClusterConfigBuilderV13 compute_validated(boolean compute_validated); + + public ClusterConfigBuilderV13 compute_access_key(String compute_access_key); + + public ClusterConfigBuilderV13 aws_region(String aws_region); + + public ClusterConfigBuilderV13 aws_preferred_availability_zone(String aws_preferred_availability_zone); + + public ClusterConfigBuilderV13 subnet_id(String subnet_id); + + public ClusterConfigBuilderV13 vpc_id(String vpc_id); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterFairSchedulerConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterFairSchedulerConfigBuilderV13.java new file mode 100644 index 00000000..67d80ae0 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterFairSchedulerConfigBuilderV13.java @@ -0,0 +1,23 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterFairSchedulerConfigBuilderV13 +{ + public ClusterConfigBuilderV13 default_pool(String default_pool); + + public ClusterConfigBuilderV13 fairscheduler_config_xml(String fairscheduler_config_xml); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigBuilder.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigBuilder.java index 20024658..06027386 100644 --- a/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigBuilder.java +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigBuilder.java @@ -18,12 +18,20 @@ public interface ClusterHadoopConfigBuilder { public ClusterConfigBuilder master_instance_type(String master_instance_type); + public ClusterFairSchedulerConfigBuilder fairscheduler_settings(); + public ClusterConfigBuilder max_nodes(int max_nodes); + public ClusterConfigBuilder slave_instance_type(String slave_instance_type); + public ClusterConfigBuilder slave_request_type(String slave_request_type); + public ClusterConfigBuilder use_hadoop2(boolean use_hadoop2); + public ClusterConfigBuilder initial_nodes(int initial_nodes); + public ClusterConfigBuilder custom_config(String custom_config); + public ClusterSpotInstanceConfigBuilder spot_instance_settings(); } diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigurationBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigurationBuilderV13.java new file mode 100644 index 00000000..4da23526 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterHadoopConfigurationBuilderV13.java @@ -0,0 +1,31 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterHadoopConfigurationBuilderV13 +{ + public ClusterConfigBuilderV13 use_hadoop2(boolean use_hadoop2); + + public ClusterConfigBuilderV13 use_spark(boolean use_spark); + + public ClusterConfigBuilderV13 use_hbase(boolean use_hbase); + + public ClusterConfigBuilderV13 use_qubole_placement_policy(boolean use_qubole_placement_policy); + + public ClusterConfigBuilderV13 custom_config(String custom_config); + + public ClusterFairSchedulerConfigBuilderV13 fairscheduler_settings(); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterNodeConfigurationBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterNodeConfigurationBuilderV13.java new file mode 100644 index 00000000..75d7ce9a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterNodeConfigurationBuilderV13.java @@ -0,0 +1,30 @@ +package com.qubole.qds.sdk.java.api; + +import java.util.Map; + +public interface ClusterNodeConfigurationBuilderV13 +{ + public ClusterConfigBuilderV13 master_instance_type(String master_instance_type); + + public ClusterConfigBuilderV13 slave_instance_type(String slave_instance_type); + + public ClusterConfigBuilderV13 initial_nodes(int initial_nodes); + + public ClusterConfigBuilderV13 max_nodes(int max_nodes); + + public ClusterConfigBuilderV13 slave_request_type(String slave_request_type); + + public ClusterConfigBuilderV13 fallback_to_ondemand(boolean fallback_to_ondemand); + + public ClusterConfigBuilderV13 ebs_volume_type(String ebs_volume_type); + + public ClusterConfigBuilderV13 ebs_volume_size(String ebs_volume_size); + + public ClusterConfigBuilderV13 ebs_volume_count(int ebs_volume_count); + + public ClusterConfigBuilderV13 custom_ec2_tags(Map custom_ec2_tags); + + public ClusterSpotInstanceConfigBuilderV13 spot_instance_settings(); + + public ClusterStableSpotInstanceConfigBuilderV13 stable_spot_instance_settings(); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterPrestoConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterPrestoConfigBuilderV13.java new file mode 100644 index 00000000..15a2b731 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterPrestoConfigBuilderV13.java @@ -0,0 +1,25 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterPrestoConfigBuilderV13 +{ + public ClusterConfigBuilderV13 enable_presto(boolean enable_presto); + + public ClusterConfigBuilderV13 custom_config(String custom_config); + + public ClusterConfigBuilderV13 jvm_config(String jvm_config); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterSecurityConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSecurityConfigBuilderV13.java new file mode 100644 index 00000000..220fdc09 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSecurityConfigBuilderV13.java @@ -0,0 +1,25 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterSecurityConfigBuilderV13 +{ + public ClusterConfigBuilderV13 encrypted_ephemerals(boolean encrypted_ephemerals); + + public ClusterConfigBuilderV13 ssh_public_key(String ssh_public_key); + + public ClusterConfigBuilderV13 persistent_security_group(String persistent_security_group); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilder.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilder.java index 9bbdc2b7..792b1300 100644 --- a/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilder.java +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilder.java @@ -18,6 +18,8 @@ public interface ClusterSpotInstanceConfigBuilder { public ClusterConfigBuilder maximum_bid_price_percentage(String maximum_bid_price_percentage); + public ClusterConfigBuilder timeout_for_request(int timeout_for_request); + public ClusterConfigBuilder maximum_spot_instance_percentage(int maximum_spot_instance_percentage); } diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilderV13.java new file mode 100644 index 00000000..0abd448a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterSpotInstanceConfigBuilderV13.java @@ -0,0 +1,25 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterSpotInstanceConfigBuilderV13 +{ + public ClusterConfigBuilderV13 maximum_bid_price_percentage(String maximum_bid_price_percentage); + + public ClusterConfigBuilderV13 timeout_for_request(int timeout_for_request); + + public ClusterConfigBuilderV13 maximum_spot_instance_percentage(int maximum_spot_instance_percentage); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/api/ClusterStableSpotInstanceConfigBuilderV13.java b/src/main/java/com/qubole/qds/sdk/java/api/ClusterStableSpotInstanceConfigBuilderV13.java new file mode 100644 index 00000000..ee0486d0 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/api/ClusterStableSpotInstanceConfigBuilderV13.java @@ -0,0 +1,23 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.api; + +public interface ClusterStableSpotInstanceConfigBuilderV13 +{ + public ClusterConfigBuilderV13 maximum_bid_price_percentage(String maximum_bid_price_percentage); + + public ClusterConfigBuilderV13 timeout_for_request(int timeout_for_request); +} diff --git a/src/main/java/com/qubole/qds/sdk/java/client/DefaultQdsConfiguration.java b/src/main/java/com/qubole/qds/sdk/java/client/DefaultQdsConfiguration.java index ad228998..34a2d2c9 100644 --- a/src/main/java/com/qubole/qds/sdk/java/client/DefaultQdsConfiguration.java +++ b/src/main/java/com/qubole/qds/sdk/java/client/DefaultQdsConfiguration.java @@ -37,11 +37,13 @@ public class DefaultQdsConfiguration implements QdsConfiguration { private final String apiEndpoint; + private final String apiVersion; private final String apiToken; private final ClientConfig jerseyConfiguration; public static final String API_ENDPOINT = "https://api.qubole.com/api"; public static final String API_VERSION = "v1.2"; + public static final String API_VERSION_13 = "v1.3"; private static final int DEFAULT_CONNECTION_TIMEOUT = (int)TimeUnit.SECONDS.toMillis(10); private static final int DEFAULT_READ_TIMEOUT = (int)TimeUnit.SECONDS.toMillis(30); @@ -51,7 +53,7 @@ public class DefaultQdsConfiguration implements QdsConfiguration */ public DefaultQdsConfiguration(String apiToken) { - this(API_ENDPOINT, apiToken, null, new StandardRetry(), newRetryConnectorAllocator()); + this(API_ENDPOINT, API_VERSION, apiToken, null, new StandardRetry(), newRetryConnectorAllocator()); } /** @@ -60,7 +62,17 @@ public DefaultQdsConfiguration(String apiToken) */ public DefaultQdsConfiguration(String apiEndpoint, String apiToken) { - this(apiEndpoint, apiToken, null, new StandardRetry(), newRetryConnectorAllocator()); + this(apiEndpoint, API_VERSION, apiToken, null, new StandardRetry(), newRetryConnectorAllocator()); + } + + /** + * @param apiEndpoint endpoint + * @param apiVersion version of api v1.2 or v1.3 etc + * @param apiToken your API token + */ + public DefaultQdsConfiguration(String apiEndpoint, String apiVersion, String apiToken) + { + this(apiEndpoint, apiVersion, apiToken, null, new StandardRetry(), newRetryConnectorAllocator()); } /** @@ -70,7 +82,7 @@ public DefaultQdsConfiguration(String apiEndpoint, String apiToken) */ public DefaultQdsConfiguration(String apiEndpoint, String apiToken, ClientConfig jerseyConfiguration) { - this(apiEndpoint, apiToken, jerseyConfiguration, new StandardRetry(), newRetryConnectorAllocator()); + this(apiEndpoint, API_VERSION, apiToken, jerseyConfiguration, new StandardRetry(), newRetryConnectorAllocator()); } @VisibleForTesting @@ -91,18 +103,32 @@ public RetryConnector newRetryConnector(Connector parentConnector, Retry retry) } }; } - + + public DefaultQdsConfiguration(String apiEndpoint, String apiToken, ClientConfig jerseyConfiguration, final Retry retry, final RetryConnectorAllocator retryConnectorAllocator) + { + this(apiEndpoint, API_VERSION, apiToken, jerseyConfiguration, retry, retryConnectorAllocator); + } + /** * @param apiEndpoint endpoint * @param apiToken your API token * @param jerseyConfiguration jersey client configuration or null for default * @param retry the retry to use */ - public DefaultQdsConfiguration(String apiEndpoint, String apiToken, ClientConfig jerseyConfiguration, final Retry retry, final RetryConnectorAllocator retryConnectorAllocator) + public DefaultQdsConfiguration(String apiEndpoint, String apiVersion, String apiToken, ClientConfig jerseyConfiguration, final Retry retry, final RetryConnectorAllocator retryConnectorAllocator) { this.apiEndpoint = Preconditions.checkNotNull(apiEndpoint, "apiEndpoint cannot be null"); this.apiToken = Preconditions.checkNotNull(apiToken, "apiToken cannot be null"); - + + if (apiVersion == null) + { + this.apiVersion = API_VERSION; + } + else + { + this.apiVersion = apiVersion; + } + if ( jerseyConfiguration == null ) { jerseyConfiguration = new ClientConfig(); @@ -148,6 +174,12 @@ public String getApiEndpoint() @Override public String getApiVersion() { - return API_VERSION; + return apiVersion; + } + + @Override + public String getApiVersionV13() + { + return API_VERSION_13; } } diff --git a/src/main/java/com/qubole/qds/sdk/java/client/QdsClient.java b/src/main/java/com/qubole/qds/sdk/java/client/QdsClient.java index 7356f9d7..9246fdb2 100644 --- a/src/main/java/com/qubole/qds/sdk/java/client/QdsClient.java +++ b/src/main/java/com/qubole/qds/sdk/java/client/QdsClient.java @@ -16,6 +16,7 @@ package com.qubole.qds.sdk.java.client; import com.qubole.qds.sdk.java.api.ClusterApi; +import com.qubole.qds.sdk.java.api.ClusterApiV13; import com.qubole.qds.sdk.java.api.CommandApi; import com.qubole.qds.sdk.java.api.DbTapApi; import com.qubole.qds.sdk.java.api.HiveMetadataApi; @@ -39,6 +40,13 @@ public interface QdsClient extends Closeable * @return cluster api factory */ public ClusterApi cluster(); + + /** + * Return cluster api factory + * + * @return cluster api factory + */ + public ClusterApiV13 clusterV13(); /** * Return command api factory diff --git a/src/main/java/com/qubole/qds/sdk/java/client/QdsConfiguration.java b/src/main/java/com/qubole/qds/sdk/java/client/QdsConfiguration.java index 4bd92bec..4394a544 100644 --- a/src/main/java/com/qubole/qds/sdk/java/client/QdsConfiguration.java +++ b/src/main/java/com/qubole/qds/sdk/java/client/QdsConfiguration.java @@ -49,4 +49,11 @@ public interface QdsConfiguration * @return version */ public String getApiVersion(); + + /** + * Return the API version v1.3 + * + * @return version + */ + public String getApiVersionV13(); } diff --git a/src/main/java/com/qubole/qds/sdk/java/details/ClusterApiV13Impl.java b/src/main/java/com/qubole/qds/sdk/java/details/ClusterApiV13Impl.java new file mode 100644 index 00000000..b190733a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/details/ClusterApiV13Impl.java @@ -0,0 +1,96 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.details; + +import com.qubole.qds.sdk.java.api.*; +import com.qubole.qds.sdk.java.client.QdsClient; +import com.qubole.qds.sdk.java.entities.ClusterStateV13; +import com.qubole.qds.sdk.java.entities.ClusterV13; +import com.qubole.qds.sdk.java.entities.ClustersV13; +import com.qubole.qds.sdk.java.entities.Message; +import com.qubole.qds.sdk.java.entities.State; +import javax.ws.rs.core.GenericType; + +class ClusterApiV13Impl implements ClusterApiV13 +{ + private final QdsClient client; + + @Override + public InvokableBuilder state(String labelOrId) + { + return new GenericInvokableBuilderImpl(client, RequestDetails.retry(), ClusterStateV13.class, "clusters", labelOrId, "state"); + } + + @Override + public InvokableBuilder list() + { + GenericType type = new GenericType(){}; + return new GenericInvokableBuilderImpl(client, RequestDetails.retry(), type, "clusters"); + } + + @Override + public InvokableBuilder information(String labelOrId) + { + return new GenericInvokableBuilderImpl(client, RequestDetails.retry(), ClusterV13.class, "clusters", labelOrId); + } + + @Override + public InvokableBuilder start(String labelOrId) + { + RequestDetails entity = new RequestDetails(new State("start"), RequestDetails.Method.PUT); + return new GenericInvokableBuilderImpl(client, entity, Message.class, "clusters", labelOrId, "state"); + } + + @Override + public InvokableBuilder terminate(String labelOrId) + { + RequestDetails entity = new RequestDetails(new State("terminate"), RequestDetails.Method.PUT); + return new GenericInvokableBuilderImpl(client, entity, Message.class, "clusters", labelOrId, "state"); + } + + @Override + public InvokableBuilder edit(String labelOrId, ClusterConfigBuilderV13 configBuilder) + { + RequestDetails entity = new RequestDetails(configBuilder.toString(), RequestDetails.Method.PUT); + return new GenericInvokableBuilderImpl(client, entity, ClusterV13.class, "clusters", labelOrId); + } + + @Override + public InvokableBuilder create(ClusterConfigBuilderV13 configBuilder) + { + RequestDetails entity = new RequestDetails(configBuilder.toString(), RequestDetails.Method.POST); + return new GenericInvokableBuilderImpl(client, entity, ClusterV13.class, "clusters"); + } + + @Override + public InvokableBuilder delete(String labelOrId) + { + RequestDetails entity = new RequestDetails(null, RequestDetails.Method.DELETE); + + return new GenericInvokableBuilderImpl(client, entity, Message.class, "clusters", labelOrId); + } + + @Override + public ClusterConfigBuilderV13 clusterConfig() + { + return new ClusterConfigBuilderV13Impl(); + } + + ClusterApiV13Impl(QdsClient client) + { + this.client = client; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/details/ClusterConfigBuilderV13Impl.java b/src/main/java/com/qubole/qds/sdk/java/details/ClusterConfigBuilderV13Impl.java new file mode 100644 index 00000000..35f3f953 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/details/ClusterConfigBuilderV13Impl.java @@ -0,0 +1,456 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.details; + +import com.qubole.qds.sdk.java.api.ClusterConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterEc2ConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterFairSchedulerConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterHadoopConfigurationBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterNodeConfigurationBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterPrestoConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterSecurityConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterSpotInstanceConfigBuilderV13; +import com.qubole.qds.sdk.java.api.ClusterStableSpotInstanceConfigBuilderV13; +import org.codehaus.jackson.node.ObjectNode; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +class ClusterConfigBuilderV13Impl implements ClusterConfigBuilderV13 +{ + private final ObjectNode node = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode presto_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode security_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode node_configuration = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode spot_instance_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode stable_spot_instance_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode hadoop_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode fairscheduler_settings = QdsClientImpl.getMapper().createObjectNode(); + private final ObjectNode ec2_settings = QdsClientImpl.getMapper().createObjectNode(); + + public ObjectNode getNode() + { + ObjectNode clusterNode = QdsClientImpl.getMapper().createObjectNode(); + clusterNode.put("cluster", node); + return clusterNode; + } + + @Override + public String toString() + { + try + { + return QdsClientImpl.getMapper().writer().writeValueAsString(node); + } + catch ( IOException e ) + { + throw new RuntimeException("Could not serialize: " + node, e); + } + } + + @Override + public ClusterConfigBuilderV13 state(String state) + { + node.put("state", state); + return this; + } + + @Override + public ClusterConfigBuilderV13 spark_version(String spark_version) + { + node.put("spark_version", spark_version); + return this; + } + + @Override + public ClusterConfigBuilderV13 disallow_cluster_termination(boolean disallow_cluster_termination) + { + node.put("disallow_cluster_termination", disallow_cluster_termination); + return this; + } + + @Override + public ClusterConfigBuilderV13 enable_ganglia_monitoring(boolean enable_ganglia_monitoring) + { + node.put("enable_ganglia_monitoring", enable_ganglia_monitoring); + return this; + } + + @Override + public ClusterConfigBuilderV13 node_bootstrap_file(String node_bootstrap_file) + { + node.put("node_bootstrap_file", node_bootstrap_file); + return this; + } + + @Override + public ClusterConfigBuilderV13 label(List label) + { + node.putPOJO("label", label); + return this; + } + + @Override + public ClusterConfigBuilderV13 id(int id) + { + node.put("id", id); + return this; + } + + @Override + public ClusterPrestoConfigBuilderV13 presto_settings() + { + if ( !node.has("presto_settings") ) + { + node.put("presto_settings", presto_settings); + } + + return new ClusterPrestoConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 enable_presto(boolean enable_presto) + { + presto_settings.put("enable_presto", enable_presto); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 custom_config(String custom_config) + { + presto_settings.put("custom_config", custom_config); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 jvm_config(String jvm_config) + { + presto_settings.put("jvm_config", jvm_config); + return ClusterConfigBuilderV13Impl.this; + } + }; + } + + @Override + public ClusterSecurityConfigBuilderV13 security_settings() + { + if ( !node.has("security_settings") ) + { + node.put("security_settings", security_settings); + } + + return new ClusterSecurityConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 encrypted_ephemerals(boolean encrypted_ephemerals) + { + security_settings.put("encrypted_ephemerals", encrypted_ephemerals); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 ssh_public_key(String ssh_public_key) + { + security_settings.put("ssh_public_key", ssh_public_key); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 persistent_security_group(String persistent_security_group) + { + security_settings.put("persistent_security_group", persistent_security_group); + return ClusterConfigBuilderV13Impl.this; + } + }; + } + + @Override + public ClusterHadoopConfigurationBuilderV13 hadoop_settings() + { + if ( !node.has("hadoop_settings") ) + { + node.put("hadoop_settings", hadoop_settings); + } + + return new ClusterHadoopConfigurationBuilderV13() + { + @Override + public ClusterConfigBuilderV13 custom_config(String custom_config) + { + hadoop_settings.put("custom_config", custom_config); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 use_hadoop2(boolean use_hadoop2) + { + hadoop_settings.put("use_hadoop2", use_hadoop2); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 use_hbase(boolean use_hbase) + { + hadoop_settings.put("use_hbase", use_hbase); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 use_spark(boolean use_spark) + { + hadoop_settings.put("use_spark", use_spark); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 use_qubole_placement_policy(boolean use_qubole_placement_policy) + { + hadoop_settings.put("use_qubole_placement_policy", use_qubole_placement_policy); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterFairSchedulerConfigBuilderV13 fairscheduler_settings() + { + if ( !hadoop_settings.has("fairscheduler_settings") ) + { + hadoop_settings.put("fairscheduler_settings", fairscheduler_settings); + } + return new ClusterFairSchedulerConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 default_pool(String default_pool) + { + fairscheduler_settings.put("default_pool", default_pool); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 fairscheduler_config_xml(String fairscheduler_config_xml) + { + fairscheduler_settings.put("fairscheduler_config_xml", fairscheduler_config_xml); + return ClusterConfigBuilderV13Impl.this; + } + }; + } + }; + } + + @Override + public ClusterEc2ConfigBuilderV13 ec2_settings() + { + if ( !node.has("ec2_settings") ) + { + node.put("ec2_settings", ec2_settings); + } + + return new ClusterEc2ConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 compute_secret_key(String compute_secret_key) + { + ec2_settings.put("compute_secret_key", compute_secret_key); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 compute_validated(boolean compute_validated) + { + ec2_settings.put("compute_validated", compute_validated); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 compute_access_key(String compute_access_key) + { + ec2_settings.put("compute_access_key", compute_access_key); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 aws_region(String aws_region) + { + ec2_settings.put("aws_region", aws_region); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 aws_preferred_availability_zone(String aws_preferred_availability_zone) + { + ec2_settings.put("aws_preferred_availability_zone", aws_preferred_availability_zone); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 subnet_id(String subnet_id) + { + ec2_settings.put("subnet_id", subnet_id); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 vpc_id(String vpc_id) + { + ec2_settings.put("vpc_id", vpc_id); + return ClusterConfigBuilderV13Impl.this; + } + + }; + } + + @Override + public ClusterNodeConfigurationBuilderV13 node_configuration() + { + if ( !node.has("node_configuration") ) + { + node.put("node_configuration", node_configuration); + } + + return new ClusterNodeConfigurationBuilderV13() + { + + @Override + public ClusterConfigBuilderV13 master_instance_type(String master_instance_type) + { + node_configuration.put("master_instance_type", master_instance_type); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 slave_instance_type(String slave_instance_type) + { + node_configuration.put("slave_instance_type", slave_instance_type); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 initial_nodes(int initial_nodes) + { + node_configuration.put("initial_nodes", initial_nodes); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 max_nodes(int max_nodes) + { + node_configuration.put("max_nodes", max_nodes); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 slave_request_type(String slave_request_type) + { + node_configuration.put("slave_request_type", slave_request_type); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 fallback_to_ondemand(boolean fallback_to_ondemand) + { + node_configuration.put("fallback_to_ondemand", fallback_to_ondemand); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 ebs_volume_type(String ebs_volume_type) + { + node_configuration.put("ebs_volume_type", ebs_volume_type); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 ebs_volume_size(String ebs_volume_size) + { + node_configuration.put("ebs_volume_size", ebs_volume_size); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 ebs_volume_count(int ebs_volume_count) + { + node_configuration.put("ebs_volume_count", ebs_volume_count); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 custom_ec2_tags(Map custom_ec2_tags) + { + node_configuration.putPOJO("custom_ec2_tags", custom_ec2_tags); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterSpotInstanceConfigBuilderV13 spot_instance_settings() + { + if ( !node_configuration.has("spot_instance_settings") ) + { + node_configuration.put("spot_instance_settings", spot_instance_settings); + } + + return new ClusterSpotInstanceConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 maximum_bid_price_percentage(String maximum_bid_price_percentage) + { + spot_instance_settings.put("maximum_bid_price_percentage", maximum_bid_price_percentage); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 timeout_for_request(int timeout_for_request) + { + spot_instance_settings.put("timeout_for_request", timeout_for_request); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 maximum_spot_instance_percentage(int maximum_spot_instance_percentage) + { + spot_instance_settings.put("maximum_spot_instance_percentage", maximum_spot_instance_percentage); + return ClusterConfigBuilderV13Impl.this; + } + }; + } + + @Override + public ClusterStableSpotInstanceConfigBuilderV13 stable_spot_instance_settings() + { + if ( !node_configuration.has("stable_spot_instance_settings") ) + { + node_configuration.put("stable_spot_instance_settings", stable_spot_instance_settings); + } + + return new ClusterStableSpotInstanceConfigBuilderV13() + { + @Override + public ClusterConfigBuilderV13 maximum_bid_price_percentage(String maximum_bid_price_percentage) + { + stable_spot_instance_settings.put("maximum_bid_price_percentage", maximum_bid_price_percentage); + return ClusterConfigBuilderV13Impl.this; + } + + @Override + public ClusterConfigBuilderV13 timeout_for_request(int timeout_for_request) + { + stable_spot_instance_settings.put("timeout_for_request", timeout_for_request); + return ClusterConfigBuilderV13Impl.this; + } + }; + } + + }; + + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/details/QdsClientImpl.java b/src/main/java/com/qubole/qds/sdk/java/details/QdsClientImpl.java index 3ac9c5ad..6e93a163 100644 --- a/src/main/java/com/qubole/qds/sdk/java/details/QdsClientImpl.java +++ b/src/main/java/com/qubole/qds/sdk/java/details/QdsClientImpl.java @@ -18,6 +18,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.qubole.qds.sdk.java.api.ClusterApi; +import com.qubole.qds.sdk.java.api.ClusterApiV13; import com.qubole.qds.sdk.java.api.CommandApi; import com.qubole.qds.sdk.java.api.DbTapApi; import com.qubole.qds.sdk.java.api.HiveMetadataApi; @@ -49,13 +50,15 @@ public class QdsClientImpl implements QdsClient private final QdsConfiguration configuration; private final Client client; private final AtomicBoolean isClosed = new AtomicBoolean(false); - private final WebTarget target; private final CommandApiImpl commandApi; private final ClusterApiImpl clusterApi; + private final ClusterApiV13Impl clusterApiV13; private final HiveMetadataApiImpl hiveMetadataApi; private final DbTapApiImpl dbTapsApi; private final ReportApiImpl reportApi; private final SchedulerApiImpl schedulerApi; + private final WebTarget target, targetv13; + private boolean versionIsV13=false; private static final ObjectMapper mapper = new ObjectMapper(); @@ -69,8 +72,10 @@ public QdsClientImpl(QdsConfiguration configuration) this.configuration = Preconditions.checkNotNull(configuration, "configuration cannot be null"); client = configuration.newClient(); target = client.target(configuration.getApiEndpoint()).path(configuration.getApiVersion()); + targetv13 = client.target(configuration.getApiEndpoint()).path(configuration.getApiVersionV13()); commandApi = new CommandApiImpl(this); clusterApi = new ClusterApiImpl(this); + clusterApiV13 = new ClusterApiV13Impl(this); hiveMetadataApi = new HiveMetadataApiImpl(this); dbTapsApi = new DbTapApiImpl(this); reportApi = new ReportApiImpl(this); @@ -90,6 +95,13 @@ public ClusterApi cluster() { return clusterApi; } + + @Override + public ClusterApiV13 clusterV13() + { + versionIsV13 = true; + return clusterApiV13; + } @Override public CommandApi command() @@ -188,6 +200,11 @@ protected Future invokePreparedRequest(RequestDetails entity, GenericType protected WebTarget prepareTarget(ForPage forPage, RequestDetails entity, String[] additionalPaths) { WebTarget localTarget = target; + + if (versionIsV13) + localTarget = targetv13; + versionIsV13 = false; + if ( additionalPaths != null ) { for ( String path : additionalPaths ) diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/Cluster.java b/src/main/java/com/qubole/qds/sdk/java/entities/Cluster.java index b38e15d4..994f9a02 100644 --- a/src/main/java/com/qubole/qds/sdk/java/entities/Cluster.java +++ b/src/main/java/com/qubole/qds/sdk/java/entities/Cluster.java @@ -22,6 +22,7 @@ public class Cluster { private String state; + private String spark_version; private PrestoSettings presto_settings; private boolean disallow_cluster_termination; private SecuritySettings security_settings; @@ -36,9 +37,10 @@ public Cluster() { } - public Cluster(String state, PrestoSettings presto_settings, boolean disallow_cluster_termination, SecuritySettings security_settings, boolean enable_ganglia_monitoring, HadoopSettings hadoop_settings, String node_bootstrap_file, List label, int id, Ec2Settings ec2_settings) + public Cluster(String state, PrestoSettings presto_settings, String spark_version, boolean disallow_cluster_termination, SecuritySettings security_settings, boolean enable_ganglia_monitoring, HadoopSettings hadoop_settings, String node_bootstrap_file, List label, int id, Ec2Settings ec2_settings) { this.state = state; + this.spark_version = spark_version; this.presto_settings = presto_settings; this.disallow_cluster_termination = disallow_cluster_termination; this.security_settings = security_settings; @@ -59,6 +61,16 @@ public void setState(String state) { this.state = state; } + + public String getSpark_version() + { + return spark_version; + } + + public void setSpark_version(String spark_version) + { + this.spark_version = spark_version; + } public PrestoSettings getPresto_settings() { diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/ClusterItemV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterItemV13.java new file mode 100644 index 00000000..71052a38 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterItemV13.java @@ -0,0 +1,43 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClusterItemV13 +{ + private ClusterV13 cluster; + + public ClusterItemV13() + { + } + + public ClusterItemV13(ClusterV13 cluster) + { + this.cluster = cluster; + } + + public ClusterV13 getCluster() + { + return cluster; + } + + public void setCluster(ClusterV13 cluster) + { + this.cluster = cluster; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/ClusterNodeV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterNodeV13.java new file mode 100644 index 00000000..30c2c2c3 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterNodeV13.java @@ -0,0 +1,151 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClusterNodeV13 +{ + private String instance_type; + private String ec2_instance_id; + private boolean is_spot_instance; + private String up_time; + private String private_ip; + private String last_seen_time; + private String role; + private String down_time; + private String hostname; + private String status; + + public ClusterNodeV13() + { + } + + public ClusterNodeV13(String status, String instance_type, String ec2_instance_id, boolean is_spot_instance, String up_time, String private_ip, String last_seen_time, String role, String down_time, String hostname) + { + this.status = status; + this.instance_type = instance_type; + this.ec2_instance_id = ec2_instance_id; + this.is_spot_instance = is_spot_instance; + this.up_time = up_time; + this.private_ip = private_ip; + this.last_seen_time = last_seen_time; + this.role = role; + this.down_time = down_time; + this.hostname = hostname; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getInstance_type() + { + return instance_type; + } + + public void setInstance_type(String instance_type) + { + this.instance_type = instance_type; + } + + public String getEc2_instance_id() + { + return ec2_instance_id; + } + + public void setEc2_instance_id(String ec2_instance_id) + { + this.ec2_instance_id = ec2_instance_id; + } + + public boolean isIs_spot_instance() + { + return is_spot_instance; + } + + public void setIs_spot_instance(boolean is_spot_instance) + { + this.is_spot_instance = is_spot_instance; + } + + public String getUp_time() + { + return up_time; + } + + public void setUp_time(String up_time) + { + this.up_time = up_time; + } + + public String getPrivate_ip() + { + return private_ip; + } + + public void setPrivate_ip(String private_ip) + { + this.private_ip = private_ip; + } + + public String getLast_seen_time() + { + return last_seen_time; + } + + public void setLast_seen_time(String last_seen_time) + { + this.last_seen_time = last_seen_time; + } + + public String getRole() + { + return role; + } + + public void setRole(String role) + { + this.role = role; + } + + public String getDown_time() + { + return down_time; + } + + public void setDown_time(String down_time) + { + this.down_time = down_time; + } + + public String getHostname() + { + return hostname; + } + + public void setHostname(String hostname) + { + this.hostname = hostname; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/ClusterStateV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterStateV13.java new file mode 100644 index 00000000..b8027c96 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterStateV13.java @@ -0,0 +1,141 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClusterStateV13 +{ + + private String start_at; + private String down_at; + private String terminate_reason; + private String last_health_check_action; + private String last_health_check_action_at; + private long cluster_id; + private long config_id; + private String state; + private List nodes; + + public ClusterStateV13() + { + } + + public ClusterStateV13(String state, String last_health_check_action_at, String start_at, String down_at, long cluster_id, String terminate_reason, List nodes, String last_health_check_action, long config_id) + { + this.state = state; + this.last_health_check_action_at = last_health_check_action_at; + this.start_at = start_at; + this.down_at = down_at; + this.cluster_id = cluster_id; + this.terminate_reason = terminate_reason; + this.nodes = nodes; + this.last_health_check_action = last_health_check_action; + this.config_id = config_id; + } + + public String getState() + { + return state; + } + + public void setState(String state) + { + this.state = state; + } + + public String getLast_health_check_action_at() + { + return last_health_check_action_at; + } + + public void setLast_health_check_action_at(String last_health_check_action_at) + { + this.last_health_check_action_at = last_health_check_action_at; + } + + public String getStart_at() + { + return start_at; + } + + public void setStart_at(String start_at) + { + this.start_at = start_at; + } + + public String getDown_at() + { + return down_at; + } + + public void setDown_at(String down_at) + { + this.down_at = down_at; + } + + public long getCluster_id() + { + return cluster_id; + } + + public void setCluster_id(long cluster_id) + { + this.cluster_id = cluster_id; + } + + public String getTerminate_reason() + { + return terminate_reason; + } + + public void setTerminate_reason(String terminate_reason) + { + this.terminate_reason = terminate_reason; + } + + public List getNodes() + { + return nodes; + } + + public void setNodes(List nodes) + { + this.nodes = nodes; + } + + public String getLast_health_check_action() + { + return last_health_check_action; + } + + public void setLast_health_check_action(String last_health_check_action) + { + this.last_health_check_action = last_health_check_action; + } + + public long getConfig_id() + { + return config_id; + } + + public void setConfig_id(long config_id) + { + this.config_id = config_id; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/ClusterV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterV13.java new file mode 100644 index 00000000..fa891812 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/ClusterV13.java @@ -0,0 +1,164 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClusterV13 +{ + private List label; + private int id; + private String state; + private boolean disallow_cluster_termination; + private boolean enable_ganglia_monitoring; + private String node_bootstrap_file; + private PrestoSettingsV13 presto_settings; + private SecuritySettingsV13 security_settings; + private HadoopSettingsV13 hadoop_settings; + private Ec2SettingsV13 ec2_settings; + private NodeConfigurationV13 node_configuration; + + public ClusterV13() + { + } + + public ClusterV13(String state, NodeConfigurationV13 node_configuration, PrestoSettingsV13 presto_settings, boolean disallow_cluster_termination, SecuritySettingsV13 security_settings, boolean enable_ganglia_monitoring, HadoopSettingsV13 hadoop_settings, String node_bootstrap_file, List label, int id, Ec2SettingsV13 ec2_settings) + { + this.state = state; + this.presto_settings = presto_settings; + this.disallow_cluster_termination = disallow_cluster_termination; + this.security_settings = security_settings; + this.enable_ganglia_monitoring = enable_ganglia_monitoring; + this.hadoop_settings = hadoop_settings; + this.node_bootstrap_file = node_bootstrap_file; + this.label = label; + this.id = id; + this.ec2_settings = ec2_settings; + this.node_configuration = node_configuration; + } + + public String getState() + { + return state; + } + + public void setState(String state) + { + this.state = state; + } + + public PrestoSettingsV13 getPresto_settings() + { + return presto_settings; + } + + public void setPresto_settings(PrestoSettingsV13 presto_settings) + { + this.presto_settings = presto_settings; + } + + public boolean isDisallow_cluster_termination() + { + return disallow_cluster_termination; + } + + public void setDisallow_cluster_termination(boolean disallow_cluster_termination) + { + this.disallow_cluster_termination = disallow_cluster_termination; + } + + public SecuritySettingsV13 getSecurity_settings() + { + return security_settings; + } + + public void setSecurity_settings(SecuritySettingsV13 security_settings) + { + this.security_settings = security_settings; + } + + public boolean isEnable_ganglia_monitoring() + { + return enable_ganglia_monitoring; + } + + public void setEnable_ganglia_monitoring(boolean enable_ganglia_monitoring) + { + this.enable_ganglia_monitoring = enable_ganglia_monitoring; + } + + public HadoopSettingsV13 getHadoop_settings() + { + return hadoop_settings; + } + + public void setHadoop_settings(HadoopSettingsV13 hadoop_settings) + { + this.hadoop_settings = hadoop_settings; + } + + public String getNode_bootstrap_file() + { + return node_bootstrap_file; + } + + public void setNode_bootstrap_file(String node_bootstrap_file) + { + this.node_bootstrap_file = node_bootstrap_file; + } + + public List getLabel() + { + return label; + } + + public void setLabel(List label) + { + this.label = label; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public Ec2SettingsV13 getEc2_settings() + { + return ec2_settings; + } + + public void setEc2_settings(Ec2SettingsV13 ec2_settings) + { + this.ec2_settings = ec2_settings; + } + + public NodeConfigurationV13 getNode_configuration() + { + return node_configuration; + } + + public void setNode_configuration(NodeConfigurationV13 node_configuration) + { + this.node_configuration = node_configuration; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/ClustersV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/ClustersV13.java new file mode 100644 index 00000000..b7bb1369 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/ClustersV13.java @@ -0,0 +1,56 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import java.util.List; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class ClustersV13 +{ + private List clusters; + private PagingInfo paging_info; + + public ClustersV13() + { + } + + public ClustersV13(List clusters, PagingInfo paging_info) + { + this.clusters = clusters; + this.paging_info = paging_info; + } + + public List getClusters() + { + return clusters; + } + + public void setClusters(List clusters) + { + this.clusters = clusters; + } + + public PagingInfo getPaging_info() + { + return paging_info; + } + + public void setPaging_info(PagingInfo paging_info) + { + this.paging_info = paging_info; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/Ec2SettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/Ec2SettingsV13.java new file mode 100644 index 00000000..1ec6496a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/Ec2SettingsV13.java @@ -0,0 +1,115 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class Ec2SettingsV13 +{ + private String compute_secret_key; + private boolean compute_validated; + private String compute_access_key; + private String aws_region; + private String aws_preferred_availability_zone; + private String vpc_id; + private String subnet_id; + + public Ec2SettingsV13() + { + } + + public Ec2SettingsV13(String compute_secret_key, boolean compute_validated, String compute_access_key, String aws_region, String aws_preferred_availability_zone, String vpc_id, String subnet_id) + { + this.compute_secret_key = compute_secret_key; + this.compute_validated = compute_validated; + this.compute_access_key = compute_access_key; + this.aws_region = aws_region; + this.aws_preferred_availability_zone = aws_preferred_availability_zone; + this.vpc_id = vpc_id; + this.subnet_id = subnet_id; + } + + public String getCompute_secret_key() + { + return compute_secret_key; + } + + public void setCompute_secret_key(String compute_secret_key) + { + this.compute_secret_key = compute_secret_key; + } + + public boolean isCompute_validated() + { + return compute_validated; + } + + public void setCompute_validated(boolean compute_validated) + { + this.compute_validated = compute_validated; + } + + public String getCompute_access_key() + { + return compute_access_key; + } + + public void setCompute_access_key(String compute_access_key) + { + this.compute_access_key = compute_access_key; + } + + public String getAws_region() + { + return aws_region; + } + + public void setAws_region(String aws_region) + { + this.aws_region = aws_region; + } + + public String getAws_preferred_availability_zone() + { + return aws_preferred_availability_zone; + } + + public void setAws_preferred_availability_zone(String aws_preferred_availability_zone) + { + this.aws_preferred_availability_zone = aws_preferred_availability_zone; + } + + public String getVpc_id() + { + return vpc_id; + } + + public void setVpc_id(String vpc_id) + { + this.vpc_id = vpc_id; + } + + public String getSubnet_id() + { + return subnet_id; + } + + public void setSubnet_id(String subnet_id) + { + this.subnet_id = subnet_id; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/FairSchedulerSettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/FairSchedulerSettingsV13.java new file mode 100644 index 00000000..e00d3528 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/FairSchedulerSettingsV13.java @@ -0,0 +1,55 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class FairSchedulerSettingsV13 +{ + private String default_pool; + private String fairscheduler_config_xml; + + public FairSchedulerSettingsV13() + { + } + + public FairSchedulerSettingsV13(String default_pool, String fairscheduler_config_xml) + { + this.default_pool = default_pool; + this.fairscheduler_config_xml = fairscheduler_config_xml; + } + + public String getDefault_pool() + { + return default_pool; + } + + public void setDefault_pool(String default_pool) + { + this.default_pool = default_pool; + } + + public String getFairscheduler_config_xml() + { + return fairscheduler_config_xml; + } + + public void setFairscheduler_config_xml(String fairscheduler_config_xml) + { + this.fairscheduler_config_xml = fairscheduler_config_xml; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/HadoopSettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/HadoopSettingsV13.java new file mode 100644 index 00000000..ef7d062a --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/HadoopSettingsV13.java @@ -0,0 +1,103 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class HadoopSettingsV13 +{ + private boolean use_hadoop2; + private boolean use_spark; + private boolean use_hbase; + private boolean use_qubole_placement_policy; + private String custom_config; + private FairSchedulerSettingsV13 fairscheduler_settings; + + public HadoopSettingsV13() + { + } + + public HadoopSettingsV13(String custom_config, FairSchedulerSettingsV13 fairscheduler_settings, boolean use_qubole_placement_policy, boolean use_hbase, boolean use_spark, boolean use_hadoop2) + { + this.use_hadoop2 = use_hadoop2; + this.fairscheduler_settings = fairscheduler_settings; + this.use_spark = use_spark; + this.use_hbase = use_hbase; + this.use_qubole_placement_policy = use_qubole_placement_policy; + this.custom_config = custom_config; + } + + public FairSchedulerSettingsV13 getFairscheduler_settings() + { + return fairscheduler_settings; + } + + public void setFairscheduler_settings(FairSchedulerSettingsV13 fairscheduler_settings) + { + this.fairscheduler_settings = fairscheduler_settings; + } + + public String getCustom_config() + { + return custom_config; + } + + public void setCustom_config(String custom_config) + { + this.custom_config = custom_config; + } + + public boolean getUse_hadoop2() + { + return use_hadoop2; + } + + public void setUse_hadoop2(boolean use_hadoop2) + { + this.use_hadoop2 = use_hadoop2; + } + + public boolean getUse_spark() + { + return use_spark; + } + + public void setUse_spark(boolean use_spark) + { + this.use_spark = use_spark; + } + + public boolean getUse_hbase() + { + return use_hbase; + } + + public void setUse_hbase(boolean use_hbase) + { + this.use_hbase = use_hbase; + } + + public boolean getUse_qubole_placement_policy() + { + return use_qubole_placement_policy; + } + + public void setUse_qubole_placement_policy(boolean use_qubole_placement_policy) + { + this.use_qubole_placement_policy = use_qubole_placement_policy; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/NodeConfigurationV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/NodeConfigurationV13.java new file mode 100644 index 00000000..10b0fb44 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/NodeConfigurationV13.java @@ -0,0 +1,176 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import java.util.Map; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class NodeConfigurationV13 +{ + private String master_instance_type; + private String slave_instance_type; + private int initial_nodes; + private int max_nodes; + private String slave_request_type; + private String fallback_to_ondemand; + private String ebs_volume_type; + private String ebs_volume_size; + private int ebs_volume_count; + private Map custom_ec2_tags; + private SpotInstanceSettingsV13 spot_instance_settings; + private StableSpotInstanceSettingsV13 stable_spot_instance_settings; + + public NodeConfigurationV13() + { + } + + public NodeConfigurationV13(String master_instance_type, String slave_instance_type, int initial_nodes, int max_nodes, String slave_request_type,String fallback_to_ondemand, String ebs_volume_type, String ebs_volume_size, int ebs_volume_count, Map custom_ec2_tags, SpotInstanceSettingsV13 spot_instance_settings, StableSpotInstanceSettingsV13 stable_spot_instance_settings) + { + this.master_instance_type = master_instance_type; + this.slave_instance_type = slave_instance_type; + this.initial_nodes = initial_nodes; + this.max_nodes = max_nodes; + this.slave_request_type = slave_request_type; + this.fallback_to_ondemand = fallback_to_ondemand; + this.ebs_volume_type = ebs_volume_type; + this.ebs_volume_size = ebs_volume_size; + this.ebs_volume_count = ebs_volume_count; + this.custom_ec2_tags = custom_ec2_tags; + this.spot_instance_settings = spot_instance_settings; + this.stable_spot_instance_settings = stable_spot_instance_settings; + } + + public SpotInstanceSettingsV13 getSpot_instance_settings() + { + return spot_instance_settings; + } + + public void setSpot_instance_settings(SpotInstanceSettingsV13 spot_instance_settings) + { + this.spot_instance_settings = spot_instance_settings; + } + + public StableSpotInstanceSettingsV13 getStable_spot_instance_settings() + { + return stable_spot_instance_settings; + } + + public void setStable_spot_instance_settings(StableSpotInstanceSettingsV13 stable_spot_instance_settings) + { + this.stable_spot_instance_settings = stable_spot_instance_settings; + } + + public Map getCustom_ec2_tags() + { + return custom_ec2_tags; + } + + public void setCustom_ec2_tags(Map custom_ec2_tags) + { + this.custom_ec2_tags = custom_ec2_tags; + } + + public int getEbs_volume_count() + { + return ebs_volume_count; + } + + public void setEbs_volume_count(int ebs_volume_count) + { + this.ebs_volume_count = ebs_volume_count; + } + + public int getInitial_nodes() + { + return initial_nodes; + } + + public void setInitial_nodes(int initial_nodes) + { + this.initial_nodes = initial_nodes; + } + + public int getMax_nodes() + { + return max_nodes; + } + + public void setMax_nodes(int max_nodes) + { + this.max_nodes = max_nodes; + } + + public String getMaster_instance_type() + { + return master_instance_type; + } + + public void setMaster_instance_type(String master_instance_type) + { + this.master_instance_type = master_instance_type; + } + + public String getSlave_instance_type() + { + return slave_instance_type; + } + + public void setSlave_instance_type(String slave_instance_type) + { + this.slave_instance_type = slave_instance_type; + } + + public String getSlave_request_type() + { + return slave_request_type; + } + + public void setSlave_request_type(String slave_request_type) + { + this.slave_request_type = slave_request_type; + } + + public String getFallback_to_ondemand() + { + return fallback_to_ondemand; + } + + public void setFallback_to_ondemand(String fallback_to_ondemand) + { + this.fallback_to_ondemand = fallback_to_ondemand; + } + + public String getEbs_volume_type() + { + return ebs_volume_type; + } + + public void setEbs_volume_type(String ebs_volume_type) + { + this.ebs_volume_type = ebs_volume_type; + } + + public String getEbs_volume_size() + { + return ebs_volume_size; + } + + public void setEbs_volume_size(String ebs_volume_size) + { + this.ebs_volume_size = ebs_volume_size; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/PrestoSettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/PrestoSettingsV13.java new file mode 100644 index 00000000..11217b95 --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/PrestoSettingsV13.java @@ -0,0 +1,67 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class PrestoSettingsV13 +{ + private boolean enable_presto; + private String custom_config; + private String jvm_config; + + public PrestoSettingsV13() + { + } + + public PrestoSettingsV13(boolean enable_presto, String custom_config, String jvm_config) + { + this.enable_presto = enable_presto; + this.custom_config = custom_config; + this.jvm_config = jvm_config; + } + + public boolean isEnable_presto() + { + return enable_presto; + } + + public void setEnable_presto(boolean enable_presto) + { + this.enable_presto = enable_presto; + } + + public String getCustom_config() + { + return custom_config; + } + + public void setCustom_config(String custom_config) + { + this.custom_config = custom_config; + } + + public String getJvm_config() + { + return jvm_config; + } + + public void setJvm_config(String jvm_config) + { + this.jvm_config = jvm_config; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/SecuritySettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/SecuritySettingsV13.java new file mode 100644 index 00000000..10b50e2b --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/SecuritySettingsV13.java @@ -0,0 +1,67 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class SecuritySettingsV13 +{ + private boolean encrypted_ephemerals; + private String ssh_public_key; + private String persistent_security_group; + + public SecuritySettingsV13() + { + } + + public SecuritySettingsV13(boolean encrypted_ephemerals, String ssh_public_key, String persistent_security_group) + { + this.encrypted_ephemerals = encrypted_ephemerals; + this.ssh_public_key = ssh_public_key; + this.persistent_security_group = persistent_security_group; + } + + public boolean isEncrypted_ephemerals() + { + return encrypted_ephemerals; + } + + public void setEncrypted_ephemerals(boolean encrypted_ephemerals) + { + this.encrypted_ephemerals = encrypted_ephemerals; + } + + public String getSsh_public_key() + { + return ssh_public_key; + } + + public void setSsh_public_key(String ssh_public_key) + { + this.ssh_public_key = ssh_public_key; + } + + public String getPersistent_security_group() + { + return persistent_security_group; + } + + public void setPersistent_security_group(String persistent_security_group) + { + this.persistent_security_group = persistent_security_group; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/SpotInstanceSettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/SpotInstanceSettingsV13.java new file mode 100644 index 00000000..dc476fbe --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/SpotInstanceSettingsV13.java @@ -0,0 +1,67 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class SpotInstanceSettingsV13 +{ + private String maximum_bid_price_percentage; + private int timeout_for_request; + private int maximum_spot_instance_percentage; + + public SpotInstanceSettingsV13() + { + } + + public SpotInstanceSettingsV13(String maximum_bid_price_percentage, int timeout_for_request, int maximum_spot_instance_percentage) + { + this.maximum_bid_price_percentage = maximum_bid_price_percentage; + this.timeout_for_request = timeout_for_request; + this.maximum_spot_instance_percentage = maximum_spot_instance_percentage; + } + + public String getMaximum_bid_price_percentage() + { + return maximum_bid_price_percentage; + } + + public void setMaximum_bid_price_percentage(String maximum_bid_price_percentage) + { + this.maximum_bid_price_percentage = maximum_bid_price_percentage; + } + + public int getTimeout_for_request() + { + return timeout_for_request; + } + + public void setTimeout_for_request(int timeout_for_request) + { + this.timeout_for_request = timeout_for_request; + } + + public int getMaximum_spot_instance_percentage() + { + return maximum_spot_instance_percentage; + } + + public void setMaximum_spot_instance_percentage(int maximum_spot_instance_percentage) + { + this.maximum_spot_instance_percentage = maximum_spot_instance_percentage; + } +} diff --git a/src/main/java/com/qubole/qds/sdk/java/entities/StableSpotInstanceSettingsV13.java b/src/main/java/com/qubole/qds/sdk/java/entities/StableSpotInstanceSettingsV13.java new file mode 100644 index 00000000..7ed7189f --- /dev/null +++ b/src/main/java/com/qubole/qds/sdk/java/entities/StableSpotInstanceSettingsV13.java @@ -0,0 +1,55 @@ +/** + * Copyright 2014- Qubole Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.qubole.qds.sdk.java.entities; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) +public class StableSpotInstanceSettingsV13 +{ + private String maximum_bid_price_percentage; + private int timeout_for_request; + + public StableSpotInstanceSettingsV13() + { + } + + public StableSpotInstanceSettingsV13(String maximum_bid_price_percentage, int timeout_for_request) + { + this.maximum_bid_price_percentage = maximum_bid_price_percentage; + this.timeout_for_request = timeout_for_request; + } + + public String getMaximum_bid_price_percentage() + { + return maximum_bid_price_percentage; + } + + public void setMaximum_bid_price_percentage(String maximum_bid_price_percentage) + { + this.maximum_bid_price_percentage = maximum_bid_price_percentage; + } + + public int getTimeout_for_request() + { + return timeout_for_request; + } + + public void setTimeout_for_request(int timeout_for_request) + { + this.timeout_for_request = timeout_for_request; + } +} diff --git a/src/test/java/com/qubole/qds/sdk/java/details/MockClient.java b/src/test/java/com/qubole/qds/sdk/java/details/MockClient.java index 81a4b92c..99e2cd37 100644 --- a/src/test/java/com/qubole/qds/sdk/java/details/MockClient.java +++ b/src/test/java/com/qubole/qds/sdk/java/details/MockClient.java @@ -17,6 +17,7 @@ import com.google.common.collect.Queues; import com.qubole.qds.sdk.java.api.ClusterApi; +import com.qubole.qds.sdk.java.api.ClusterApiV13; import com.qubole.qds.sdk.java.api.CommandApi; import com.qubole.qds.sdk.java.api.DbTapApi; import com.qubole.qds.sdk.java.api.HiveMetadataApi; @@ -147,6 +148,12 @@ public SchedulerApi scheduler() { return new SchedulerApiImpl(this); } + + @Override + public ClusterApiV13 clusterV13() + { + return new ClusterApiV13Impl(this); + } @Override public void close()