Examples of ApiConfig


Examples of com.cloudera.api.model.ApiConfig

      apiRole.setType(role.getType().getName());
      apiRole.setHostRef(new ApiHostRef(role.getNodeRef()));
      ApiConfigList roleConfigList = new ApiConfigList();
      if (role.getConfiguration() != null) {
         for (String key : role.getConfiguration().keySet()) {
            roleConfigList.add(new ApiConfig(key, role.getConfiguration().get(key)));
         }
      }
      apiRole.setConfig(roleConfigList);
      return apiRole;
   }
View Full Code Here

Examples of com.cloudera.api.model.ApiConfig

      if (isConfigured(cluster)) {
         return;
      }

      apiResourceRootV6.getClouderaManagerResource().updateConfig(
            new ApiConfigList(Arrays.asList(new ApiConfig[]{new ApiConfig("PARCEL_UPDATE_FREQ", "1")})));

      final Set<String> repositoriesRequired = new HashSet<String>();

      for (CmServiceDef serviceDef : cluster.getServices()) {
         repositoriesRequired.add(serviceDef.getType().getRepository().toString(cluster.getVersion()));
      }

      logger.info("parcel repo required: " + repositoriesRequired + " cluster: " + cluster.getName());

      final List<String> repositoriesRequiredOrdered = new ArrayList<String>();
      for (String repository : repositoriesRequired) {
         if (repository.equals(Constants.CDH_REPO_PREFIX)) {
            repositoriesRequiredOrdered.add(0, repository);
         } else {
            repositoriesRequiredOrdered.add(repository);
         }
      }

      // validate this cluster has access to all Parcels it requires
      executeAndReport("Validating parcels availability", addedNodes, null, ProgressSplit.VALIDATE_PARCELS_AVAILABILITY.getProgress(),
            cluster.getCurrentReport(), reportQueue, new StatusPoller() {
         @Override
         public boolean poll() {
            for (ApiParcel parcel : apiResourceRootV6.getClustersResource().getParcelsResource(cluster.getName())
                  .readParcels(DataView.FULL).getParcels()) {
               try {
                  repositoriesRequired.remove(parcel.getProduct());
               } catch (IllegalArgumentException e) {
                  // ignore
               }
            }
            // TODO: if one required parcel is not available, will run forever, need timeout/validation
            return repositoriesRequired.isEmpty();
         }
      }, false);

      apiResourceRootV6.getClouderaManagerResource().updateConfig(
            new ApiConfigList(Arrays.asList(new ApiConfig[]{new ApiConfig("PARCEL_UPDATE_FREQ", "60")})));

      DefaultArtifactVersion expectVersion = null;
      if (cluster.getFullVersion() != null) {
         expectVersion = new DefaultArtifactVersion(cluster.getFullVersion());
      }
View Full Code Here

Examples of com.cloudera.api.model.ApiConfig

                  // Impala needs Llama role to be able to use YARN for resource management, but this
                  // is a new added role and not yet supported well
                  continue;
               }
               if (serviceTypes.contains(dependService)) {
                  apiServiceConfig.add(new ApiConfig(dependency.getConfigKey(), cluster.serviceNameOfType(dependService)));
               }
            }
         }
      }

      if (serviceDef.getConfiguration() != null) {
         for (String key : serviceDef.getConfiguration().keySet()) {
            apiServiceConfig.add(new ApiConfig(key, serviceDef.getConfiguration().get(key)));
         }
      }

      // update configs if service already exist
      if (servicesConfigured
View Full Code Here

Examples of com.cloudera.api.model.ApiConfig

            String roleDisplayName = nameMap.get(roleConfigGroup.getRoleType());
            ApiConfigList configList = new ApiConfigList();
            boolean needUpdate = true;
            switch (roleDisplayName) {
               case "HDFS_NAMENODE":
                  configList.add(new ApiConfig(Constants.CONFIG_DFS_NAME_DIR_LIST, "/tmp/dfs/nn"));
                  break;
               case "HDFS_DATANODE":
                  configList.add(new ApiConfig(Constants.CONFIG_DFS_DATA_DIR_LIST, "/tmp/dfs/dn"));
                  break;
               case "HDFS_SECONDARY_NAMENODE":
                  configList.add(new ApiConfig(Constants.CONFIG_FS_CHECKPOINT_DIR_LIST, "/tmp/dfs/snn"));
                  break;
               case "HDFS_JOURNALNODE":
                  configList.add(new ApiConfig(Constants.CONFIG_DFS_JOURNALNODE_EDITS_DIR, "/tmp/dfs/jn"));
                  break;
               case "YARN_NODE_MANAGER":
                  configList.add(new ApiConfig(Constants.CONFIG_NM_LOCAL_DIRS, "/tmp/yarn/nm"));
                  break;
               case "MAPREDUCE_JOBTRACKER":
                  configList.add(new ApiConfig(Constants.CONFIG_MAPRED_JT_LOCAL_DIR_LIST, "/tmp/mapred/jt"));
                  break;
               case "MAPREDUCE_TASKTRACKER":
                  configList.add(new ApiConfig(Constants.CONFIG_MAPRED_TT_LOCAL_DIR_LIST, "/tmp/mapred/tt"));
                  break;
               default:
                  needUpdate = false;
                  break;
            }
View Full Code Here

Examples of com.google.apphosting.api.ApiProxy.ApiConfig

    return extractSingleEntry(future);
  }

  <T extends ProtocolMessage<T>> Future<T> makeAsyncCall(
      String methodName, ProtocolMessage<?> request, T response) {
      return apiHelper.makeAsyncCall(methodName, request, response, new ApiConfig());
  }
View Full Code Here

Examples of com.google.apphosting.api.ApiProxy.ApiConfig

      if (options.getTag() != null) {
        leaseRequest.setTagAsBytes(options.getTag());
      }
    }

    ApiConfig apiConfig = new ApiConfig();
    if (options.getDeadlineInSeconds() == null) {
      apiConfig.setDeadlineInSeconds(DEFAULT_LEASE_TASKS_DEADLINE_SECONDS);
    } else {
      apiConfig.setDeadlineInSeconds(options.getDeadlineInSeconds());
    }

    Future<TaskQueueQueryAndOwnTasksResponse> responseFuture = apiHelper.makeAsyncCall(
        "QueryAndOwnTasks", leaseRequest, new TaskQueueQueryAndOwnTasksResponse(), apiConfig);
    return new FutureAdapter<TaskQueueQueryAndOwnTasksResponse, List<TaskHandle>>(responseFuture) {
View Full Code Here

Examples of com.google.apphosting.api.ApiProxy.ApiConfig

      if (options.getTag() != null) {
        leaseRequest.setTagAsBytes(options.getTag());
      }
    }

    ApiConfig apiConfig = new ApiConfig();
    if (options.getDeadlineInSeconds() == null) {
      apiConfig.setDeadlineInSeconds(DEFAULT_LEASE_TASKS_DEADLINE_SECONDS);
    } else {
      apiConfig.setDeadlineInSeconds(options.getDeadlineInSeconds());
    }

    Future<TaskQueueQueryAndOwnTasksResponse> responseFuture = apiHelper.makeAsyncCall(
        "QueryAndOwnTasks", leaseRequest, new TaskQueueQueryAndOwnTasksResponse(), apiConfig);
    return new FutureAdapter<TaskQueueQueryAndOwnTasksResponse, List<TaskHandle>>(responseFuture) {
View Full Code Here

Examples of com.google.apphosting.api.ApiProxy.ApiConfig

    return extractSingleEntry(future);
  }

  <T extends ProtocolMessage<T>> Future<T> makeAsyncCall(
      String methodName, ProtocolMessage<?> request, T response) {
      return apiHelper.makeAsyncCall(methodName, request, response, new ApiConfig());
  }
View Full Code Here

Examples of com.google.apphosting.api.ApiProxy.ApiConfig

            delegate.makeAsyncCall(
                env,
                AppEngineTester.DATASTORE_SERVICE,
                AppEngineTester.PUT_METHOD,
                reqPb.toByteArray(),
                new ApiConfig());
        future.get();
        assertThat(tester.count("Hoge"), is(1));
        tester.tearDown();
        ApiProxy.setDelegate(AppEngineTester.apiProxyLocalImpl);
        ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
View Full Code Here

Examples of com.google.apphosting.utils.config.AppEngineWebXml.ApiConfig

    if (backendsXml != null) {
      builder.append(backendsXml.toYaml());
    }

    ApiConfig apiConfig = appEngineWebXml.getApiConfig();
    if (apiConfig != null) {
      builder.append("api_config:\n");
      builder.append("  url: " + apiConfig.getUrl() + "\n");
      builder.append("  script: unused\n");
    }

    if (appEngineWebXml.getPagespeed() != null) {
      builder.append("pagespeed:\n");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.