Tabnine Logo
LineageClient
Code IndexAdd Tabnine to your IDE (free)

How to use
LineageClient
in
co.cask.cdap.client

Best Java code snippets using co.cask.cdap.client.LineageClient (Showing top 7 results out of 315)

origin: caskdata/cdap

/**
 * Retrieves Lineage for a given dataset.
 *
 * @param datasetInstance the dataset for which to retrieve lineage
 * @param startTime start time for the query, in seconds, or in 'now - xs' format
 * @param endTime end time for the query, in seconds, or in 'now - xs' format
 * @param levels number of levels to compute lineage for, or {@code null} to use the LineageHandler's default value
 * @return {@link LineageRecord} for the specified dataset.
 */
public LineageRecord getLineage(DatasetId datasetInstance, String startTime, String endTime,
                @Nullable Integer levels)
 throws IOException, UnauthenticatedException, NotFoundException, BadRequestException, UnauthorizedException {
 return getLineage(datasetInstance, startTime, endTime, Collections.<CollapseType>emptySet(), levels);
}
origin: caskdata/cdap

/**
 * Retrieves Lineage for a given dataset.
 *
 * @param datasetInstance the dataset for which to retrieve lineage
 * @param startTime start time for the query, in seconds
 * @param endTime end time for the query, in seconds
 * @param levels number of levels to compute lineage for, or {@code null} to use the LineageHandler's default value
 * @return {@link LineageRecord} for the specified dataset.
 */
public LineageRecord getLineage(DatasetId datasetInstance, long startTime, long endTime,
                @Nullable Integer levels)
 throws IOException, UnauthenticatedException, NotFoundException, BadRequestException, UnauthorizedException {
 return getLineage(datasetInstance, Long.toString(startTime), Long.toString(endTime), levels);
}
origin: caskdata/cdap

/**
 * Retrieves Lineage for a given dataset.
 *
 * @param datasetInstance the dataset for which to retrieve lineage
 * @param startTime start time for the query, in seconds
 * @param endTime end time for the query, in seconds
 * @param collapseTypes fields on which lineage relations can be collapsed on
 * @param levels number of levels to compute lineage for, or {@code null} to use the LineageHandler's default value
 * @return {@link LineageRecord} for the specified dataset.
 */
public LineageRecord getLineage(DatasetId datasetInstance, long startTime, long endTime,
                Set<CollapseType> collapseTypes, @Nullable Integer levels)
 throws IOException, UnauthenticatedException, NotFoundException, BadRequestException, UnauthorizedException {
 return getLineage(datasetInstance, Long.toString(startTime), Long.toString(endTime), collapseTypes, levels);
}
origin: caskdata/cdap

/**
 * Retrieves Lineage for a given dataset.
 *
 * @param datasetInstance the dataset for which to retrieve lineage
 * @param startTime start time for the query, in seconds, or in 'now - xs' format
 * @param endTime end time for the query, in seconds, or in 'now - xs' format
 * @param collapseTypes fields on which lineage relations can be collapsed on
 * @param levels number of levels to compute lineage for, or {@code null} to use the LineageHandler's default value
 * @return {@link LineageRecord} for the specified dataset.
 */
public LineageRecord getLineage(DatasetId datasetInstance, String startTime, String endTime,
                Set<CollapseType> collapseTypes, @Nullable Integer levels)
 throws IOException, UnauthenticatedException, NotFoundException, BadRequestException, UnauthorizedException {
 String path = String.format("datasets/%s/lineage?start=%s&end=%s", datasetInstance.getDataset(),
               URLEncoder.encode(startTime, "UTF-8"), URLEncoder.encode(endTime, "UTF-8"));
 for (CollapseType collapseType : collapseTypes) {
  path = String.format("%s&collapse=%s", path, collapseType);
 }
 if (levels != null) {
  path = String.format("%s&levels=%d", path, levels);
 }
 return getLineage(datasetInstance, path);
}
origin: caskdata/cdap

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 long currentTime = System.currentTimeMillis();
 DatasetId dataset = cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
 long start = getTimestamp(arguments.getOptional("start", "min"), currentTime);
 long end = getTimestamp(arguments.getOptional("end", "max"), currentTime);
 Integer levels = arguments.getIntOptional("levels", null);
 LineageRecord lineage = client.getLineage(dataset, start, end, levels);
 Table table = Table.builder()
  .setHeader("start", "end", "relations", "programs", "data")
  .setRows(
   Collections.<List<String>>singletonList(
    Lists.newArrayList(
     Long.toString(lineage.getStart()), Long.toString(lineage.getEnd()), GSON.toJson(lineage.getRelations()),
     GSON.toJson(lineage.getPrograms()), GSON.toJson(lineage.getData()))
   )
  ).build();
 cliConfig.getTableRenderer().render(cliConfig, output, table);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 long currentTime = System.currentTimeMillis();
 DatasetId dataset = cliConfig.getCurrentNamespace().dataset(arguments.get(ArgumentName.DATASET.toString()));
 long start = getTimestamp(arguments.getOptional("start", "min"), currentTime);
 long end = getTimestamp(arguments.getOptional("end", "max"), currentTime);
 Integer levels = arguments.getIntOptional("levels", null);
 LineageRecord lineage = client.getLineage(dataset, start, end, levels);
 Table table = Table.builder()
  .setHeader("start", "end", "relations", "programs", "data")
  .setRows(
   Collections.<List<String>>singletonList(
    Lists.newArrayList(
     Long.toString(lineage.getStart()), Long.toString(lineage.getEnd()), GSON.toJson(lineage.getRelations()),
     GSON.toJson(lineage.getPrograms()), GSON.toJson(lineage.getData()))
   )
  ).build();
 cliConfig.getTableRenderer().render(cliConfig, output, table);
}
origin: co.cask.cdap/cdap-cli

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
 long currentTime = System.currentTimeMillis();
 StreamId stream = cliConfig.getCurrentNamespace().stream(arguments.get(ArgumentName.STREAM.toString()));
 long start = getTimestamp(arguments.getOptional("start", "min"), currentTime);
 long end = getTimestamp(arguments.getOptional("end", "max"), currentTime);
 Integer levels = arguments.getIntOptional("levels", null);
 LineageRecord lineage = client.getLineage(stream, start, end, levels);
 Table table = Table.builder()
  .setHeader("start", "end", "relations", "programs", "data")
  .setRows(
   Collections.<List<String>>singletonList(
    Lists.newArrayList(
     Long.toString(lineage.getStart()), Long.toString(lineage.getEnd()), GSON.toJson(lineage.getRelations()),
     GSON.toJson(lineage.getPrograms()), GSON.toJson(lineage.getData()))
   )
  ).build();
 cliConfig.getTableRenderer().render(cliConfig, output, table);
}
co.cask.cdap.clientLineageClient

Javadoc

Provides ways to interact with CDAP Lineage.

Most used methods

  • getLineage

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for Android Studio
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