congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ClusterOperationRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
ClusterOperationRequest
in
co.cask.coopr.http.request

Best Java code snippets using co.cask.coopr.http.request.ClusterOperationRequest (Showing top 8 results out of 315)

origin: caskdata/coopr

 @Override
 public ClusterOperationRequest deserialize(JsonElement json, Type type, JsonDeserializationContext context)
  throws JsonParseException {
  JsonObject jsonObj = json.getAsJsonObject();

  Map<String, Object> providerFields =
   context.deserialize(jsonObj.get("providerFields"), new TypeToken<Map<String, Object>>() { }.getType());
  return new ClusterOperationRequest(providerFields);
 }
}
origin: caskdata/coopr

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ClusterConfigureRequest that = (ClusterConfigureRequest) o;
 return super.equals(that) &&
  Objects.equal(restart, that.restart) &&
  Objects.equal(config, that.config);
}
origin: caskdata/coopr

@Override
public int hashCode() {
 return Objects.hashCode(super.hashCode(), name, description, clusterTemplate, numMachines, provider,
             services, hardwaretype, imagetype, initialLeaseDuration, dnsSuffix, config);
}
origin: caskdata/coopr

String clusterId = cluster.getId();
Map<String, Object> providerFields = request == null ?
 Maps.<String, Object>newHashMap() : request.getProviderFields();
origin: caskdata/coopr

 private void expireClusters(long currentTime) {
  try {
   LOG.debug("Expiring clusters older than {}", currentTime);

   Set<Cluster> clusters = clusterStore.getExpiringClusters(currentTime);

   if (clusters.isEmpty()) {
    LOG.debug("Got 0 clusters to be expired for time {}", currentTime);
    return;
   }

   LOG.debug("Got {} possible clusters to expire for time {}", clusters.size(), currentTime);

   for (Cluster cluster : clusters) {
    // mod check done here instead of db to avoid full table scan.
    if (Long.valueOf(cluster.getId()) % incrementBy == myMod) {
     LOG.debug("Deleting cluster {} with expire time {}", cluster.getId(), cluster.getExpireTime());
     clusterService.requestClusterDelete(cluster.getId(), cluster.getAccount(), new ClusterOperationRequest(null));
    }
   }
  } catch (Throwable e) {
   LOG.error("Got exception: ", e);
  }
 }
}
origin: caskdata/coopr

 @Override
 public int hashCode() {
  return Objects.hashCode(super.hashCode(), restart, config);
 }
}
origin: caskdata/coopr

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (o == null || getClass() != o.getClass()) {
  return false;
 }
 ClusterCreateRequest other = (ClusterCreateRequest) o;
 return super.equals(other) &&
  Objects.equal(name, other.name) &&
  Objects.equal(description, other.description) &&
  Objects.equal(clusterTemplate, other.clusterTemplate) &&
  Objects.equal(numMachines, other.numMachines) &&
  Objects.equal(provider, other.provider) &&
  Objects.equal(services, other.services) &&
  Objects.equal(hardwaretype, other.hardwaretype) &&
  Objects.equal(imagetype, other.imagetype) &&
  Objects.equal(initialLeaseDuration, other.initialLeaseDuration) &&
  Objects.equal(dnsSuffix, other.dnsSuffix) &&
  Objects.equal(config, other.config);
}
origin: caskdata/coopr

@Test
public void testSensitiveUserFields() throws Exception {
 Map<String, Object> sensitiveFields = Maps.newHashMap();
 sensitiveFields.put("key", "keycontents");
 AddServicesRequest addRequest = new AddServicesRequest(sensitiveFields, ImmutableSet.of(service2.getName()));
 ClusterOperationRequest opRequest = new ClusterOperationRequest(sensitiveFields);
 Cluster cluster = createActiveCluster();
 clusterService.requestAddServices(cluster.getId(), account, addRequest);
 testSensitiveFieldsAdded(cluster, sensitiveFields);
 clusterStore.deleteCluster(cluster.getId());
 cluster = createActiveCluster();
 clusterService.requestClusterDelete(cluster.getId(), account, opRequest);
 testSensitiveFieldsAdded(cluster, sensitiveFields);
 clusterStore.deleteCluster(cluster.getId());
 cluster = createActiveCluster();
 clusterService.requestServiceRuntimeAction(cluster.getId(), account, ClusterAction.RESTART_SERVICES,
                       service1.getName(), opRequest);
 testSensitiveFieldsAdded(cluster, sensitiveFields);
 clusterStore.deleteCluster(cluster.getId());
}
co.cask.coopr.http.requestClusterOperationRequest

Javadoc

Request to perform some cluster operation that needs to communicate with a provider. These requests may include provider fields for things like credentials that may be needed to access cluster nodes, or things of that nature.

Most used methods

  • <init>
  • equals
  • getProviderFields
    Get an immutable copy of the provider fields.
  • hashCode

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Join (org.hibernate.mapping)
  • Option (scala)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now