congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MetadataEntity$KeyValue.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
co.cask.cdap.api.metadata.MetadataEntity$KeyValue

Best Java code snippets using co.cask.cdap.api.metadata.MetadataEntity$KeyValue.getValue (Showing top 13 results out of 315)

origin: co.cask.cdap/cdap-common

private String constructPath(MetadataEntity metadataEntity) {
 StringBuilder builder = new StringBuilder();
 metadataEntity.iterator().forEachRemaining(keyValue -> {
  if (ENTITY_TYPE_TO_API_PART.containsKey(keyValue.getKey())) {
   builder.append(ENTITY_TYPE_TO_API_PART.get(keyValue.getKey()));
  } else {
   builder.append(keyValue.getKey());
  }
  builder.append("/");
  builder.append(keyValue.getValue());
  builder.append("/");
 });
 // remove the last /
 builder.replace(builder.length() - 1, builder.length(), "");
 return builder.toString();
}
origin: caskdata/cdap

private String constructPath(MetadataEntity metadataEntity) {
 StringBuilder builder = new StringBuilder();
 metadataEntity.iterator().forEachRemaining(keyValue -> {
  if (ENTITY_TYPE_TO_API_PART.containsKey(keyValue.getKey())) {
   builder.append(ENTITY_TYPE_TO_API_PART.get(keyValue.getKey()));
  } else {
   builder.append(keyValue.getKey());
  }
  builder.append("/");
  builder.append(keyValue.getValue());
  builder.append("/");
 });
 // remove the last /
 builder.replace(builder.length() - 1, builder.length(), "");
 return builder.toString();
}
origin: caskdata/cdap

/**
 * Returns a CLI friendly representation of MetadataEntity.
 * For a dataset ds1 in ns1 the EntityId representation will be
 * <pre>dataset:ns1.ds1</pre>
 * It's equivalent MetadataEntity representation will be
 * <pre>MetadataEntity{details={namespace=ns1, dataset=ds1}, type='dataset'}</pre>
 * The CLI friendly representation will be
 * <pre>namespace=ns1,dataset=ds1,type=dataset</pre>
 *
 * Note: It is not necessary to give a type, if a type is not provided the
 * last key-value pair's key in the hierarchy will be considered as the type.
 */
public static String toCliString(MetadataEntity metadataEntity) {
 StringBuilder builder = new StringBuilder();
 for (MetadataEntity.KeyValue keyValue : metadataEntity) {
  builder.append(keyValue.getKey());
  builder.append(METADATA_ENTITY_KV_SEPARATOR);
  builder.append(keyValue.getValue());
  builder.append(METADATA_ENTITY_PARTS_SEPARATOR);
 }
 builder.append(METADATA_ENTITY_TYPE);
 builder.append(METADATA_ENTITY_KV_SEPARATOR);
 builder.append(metadataEntity.getType());
 return builder.toString();
}
origin: cdapio/cdap

builder.append(keyValue.getKey());
builder.append("=");
builder.append(keyValue.getValue());
builder.append(",");
origin: co.cask.cdap/cdap-proto

 extractedParts = metadataEntity.head(MetadataEntity.VERSION);
extractedParts.iterator().forEachRemaining(keyValue -> values.add(keyValue.getValue()));
return entityType.fromIdParts(values);
origin: caskdata/cdap

 extractedParts = metadataEntity.head(MetadataEntity.VERSION);
extractedParts.iterator().forEachRemaining(keyValue -> values.add(keyValue.getValue()));
return entityType.fromIdParts(values);
origin: co.cask.cdap/cdap-app-fabric

/**
 * If the MetadataEntity Builder key-value represent an application or artifact which is versioned in CDAP i.e. their
 * metadata entity representation ends with 'version' rather than 'application' or 'artifact' and the type is also
 * set to 'version' then for backward compatibility of rest end points return an updated builder which has the
 * correct type. This is only needed in 5.0 for backward compatibility of the rest endpoint.
 * From 5.0 and later the rest end point must be called with a query parameter which specify the type of the
 * metadata entity if the type is not the last key. (CDAP-13678)
 */
@VisibleForTesting
static MetadataEntity.Builder makeBackwardCompatible(MetadataEntity.Builder builder) {
 MetadataEntity entity = builder.build();
 List<MetadataEntity.KeyValue> entityKeyValues = StreamSupport.stream(entity.spliterator(), false)
  .collect(Collectors.toList());
 if (entityKeyValues.size() == 3 && entity.getType().equals(MetadataEntity.VERSION) &&
  (entityKeyValues.get(1).getKey().equals(MetadataEntity.ARTIFACT) ||
   entityKeyValues.get(1).getKey().equals(MetadataEntity.APPLICATION))) {
  // this is artifact or application so update the builder
  MetadataEntity.Builder actualEntityBuilder = MetadataEntity.builder();
  // namespace
  actualEntityBuilder.append(entityKeyValues.get(0).getKey(), entityKeyValues.get(0).getValue());
  // application or artifact (so append as type)
  actualEntityBuilder.appendAsType(entityKeyValues.get(1).getKey(), entityKeyValues.get(1).getValue());
  // version detail
  actualEntityBuilder.append(entityKeyValues.get(2).getKey(), entityKeyValues.get(2).getValue());
  return actualEntityBuilder;
 }
 return builder;
}
origin: cdapio/cdap

/**
 * If the MetadataEntity Builder key-value represent an application or artifact which is versioned in CDAP i.e. their
 * metadata entity representation ends with 'version' rather than 'application' or 'artifact' and the type is also
 * set to 'version' then for backward compatibility of rest end points return an updated builder which has the
 * correct type. This is only needed in 5.0 for backward compatibility of the rest endpoint.
 * From 5.0 and later the rest end point must be called with a query parameter which specify the type of the
 * metadata entity if the type is not the last key. (CDAP-13678)
 */
@VisibleForTesting
static MetadataEntity.Builder makeBackwardCompatible(MetadataEntity.Builder builder) {
 MetadataEntity entity = builder.build();
 List<MetadataEntity.KeyValue> entityKeyValues = StreamSupport.stream(entity.spliterator(), false)
  .collect(Collectors.toList());
 if (entityKeyValues.size() == 3 && entity.getType().equals(MetadataEntity.VERSION) &&
  (entityKeyValues.get(1).getKey().equals(MetadataEntity.ARTIFACT) ||
   entityKeyValues.get(1).getKey().equals(MetadataEntity.APPLICATION))) {
  // this is artifact or application so update the builder
  MetadataEntity.Builder actualEntityBuilder = MetadataEntity.builder();
  // namespace
  actualEntityBuilder.append(entityKeyValues.get(0).getKey(), entityKeyValues.get(0).getValue());
  // application or artifact (so append as type)
  actualEntityBuilder.appendAsType(entityKeyValues.get(1).getKey(), entityKeyValues.get(1).getValue());
  // version detail
  actualEntityBuilder.append(entityKeyValues.get(2).getKey(), entityKeyValues.get(2).getValue());
  return actualEntityBuilder;
 }
 return builder;
}
origin: co.cask.cdap/cdap-cli

/**
 * Returns a CLI friendly representation of MetadataEntity.
 * For a dataset ds1 in ns1 the EntityId representation will be
 * <pre>dataset:ns1.ds1</pre>
 * It's equivalent MetadataEntity representation will be
 * <pre>MetadataEntity{details={namespace=ns1, dataset=ds1}, type='dataset'}</pre>
 * The CLI friendly representation will be
 * <pre>namespace=ns1,dataset=ds1,type=dataset</pre>
 *
 * Note: It is not necessary to give a type, if a type is not provided the
 * last key-value pair's key in the hierarchy will be considered as the type.
 */
public static String toCliString(MetadataEntity metadataEntity) {
 StringBuilder builder = new StringBuilder();
 for (MetadataEntity.KeyValue keyValue : metadataEntity) {
  builder.append(keyValue.getKey());
  builder.append(METADATA_ENTITY_KV_SEPARATOR);
  builder.append(keyValue.getValue());
  builder.append(METADATA_ENTITY_PARTS_SEPARATOR);
 }
 builder.append(METADATA_ENTITY_TYPE);
 builder.append(METADATA_ENTITY_KV_SEPARATOR);
 builder.append(metadataEntity.getType());
 return builder.toString();
}
origin: cdapio/cdap

private static MDSKey.Builder getMDSKeyPrefix(MetadataEntity metadataEntity, byte[] rowPrefix) {
 MDSKey.Builder builder = new MDSKey.Builder();
 builder.add(rowPrefix);
 builder.add(metadataEntity.getType());
 // add all the key value pairs from the metadata entity this is the targetId
 for (MetadataEntity.KeyValue keyValue : metadataEntity) {
  // CDAP-13597 for versioned entities like application, schedule and programs their metadata is not versioned
  if (VERSIONED_ENTITIES.contains(metadataEntity.getType()) &&
   keyValue.getKey().equalsIgnoreCase(MetadataEntity.VERSION)) {
   continue;
  }
  builder.add(keyValue.getKey());
  builder.add(keyValue.getValue());
 }
 return builder;
}
private MetadataKey() {
origin: co.cask.cdap/cdap-data-fabric

private static MDSKey.Builder getMDSKeyPrefix(MetadataEntity metadataEntity, byte[] rowPrefix) {
 MDSKey.Builder builder = new MDSKey.Builder();
 builder.add(rowPrefix);
 builder.add(metadataEntity.getType());
 // add all the key value pairs from the metadata entity this is the targetId
 for (MetadataEntity.KeyValue keyValue : metadataEntity) {
  // CDAP-13597 for versioned entities like application, schedule and programs their metadata is not versioned
  if (VERSIONED_ENTITIES.contains(metadataEntity.getType()) &&
   keyValue.getKey().equalsIgnoreCase(MetadataEntity.VERSION)) {
   continue;
  }
  builder.add(keyValue.getKey());
  builder.add(keyValue.getValue());
 }
 return builder;
}
private MetadataKey() {
origin: co.cask.cdap/cdap-data-fabric

 private static MDSKey.Builder getKeyPart(MetadataEntity metadataEntity) {
  MDSKey.Builder builder = new MDSKey.Builder();
  builder.add(ROW_PREFIX);
  builder.add(metadataEntity.getType());
  for (MetadataEntity.KeyValue keyValue : metadataEntity) {
   builder.add(keyValue.getKey());
   builder.add(keyValue.getValue());
  }
  return builder;
 }
}
origin: cdapio/cdap

 private static MDSKey.Builder getKeyPart(MetadataEntity metadataEntity) {
  MDSKey.Builder builder = new MDSKey.Builder();
  builder.add(ROW_PREFIX);
  builder.add(metadataEntity.getType());
  for (MetadataEntity.KeyValue keyValue : metadataEntity) {
   builder.add(keyValue.getKey());
   builder.add(keyValue.getValue());
  }
  return builder;
 }
}
co.cask.cdap.api.metadataMetadataEntity$KeyValuegetValue

Popular methods of MetadataEntity$KeyValue

  • getKey
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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