congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
co.cask.wrangler.api
Code IndexAdd Tabnine to your IDE (free)

How to use co.cask.wrangler.api

Best Java code snippets using co.cask.wrangler.api (Showing top 20 results out of 315)

origin: co.cask.wrangler/wrangler-core

public CompositeRegistryIterator() {
 this.count = registries.length;
 this.idx = 0;
 this.iterator = registries[idx].iterator();
}
origin: co.cask.wrangler/wrangler-core

@Override
public void reload() throws DirectiveLoadException {
 for(int idx = 0; idx < registries.length; ++idx) {
  registries[idx].reload();
 }
}
origin: co.cask.wrangler/wrangler-api

/**
 * This method provides a way to add a <code>Token</code> to the <code>TokenGroup</code>.
 *
 * @param token to be added to the token group.
 */
public void addToken(Token token) {
 group.add(token);
}
origin: co.cask.wrangler/wrangler-api

/**
 * Adds or sets the value.
 *
 * @param name of the field to be either set or added to record.
 * @param value to be added.
 */
public void addOrSet(String name, Object value) {
 int idx = find(name);
 if (idx != -1) {
  setValue(idx, value);
 } else {
  add(name, value);
 }
}
origin: co.cask.wrangler/wrangler-core

/**
 * Constructor that extracts the {@link ExecutorContext} internals and turns them into variables.
 * This method extracts the trasient variables, runtime arguments, environment it's running in and
 * the context in which it is running as identifiers that can be used within JEXL expression.
 *
 * @param context to be examined to be extracted into JEXL expression variables.
 */
public ELContext(ExecutorContext context) {
 if (context == null) {
  return;
 }
 // Adds the transient store variables.
 for (String variable : context.getTransientStore().getVariables()) {
  values.put(variable, context.getTransientStore().get(variable));
 }
 values.put("runtime", context.getProperties());
 values.put("environment", context.getEnvironment().name());
 values.put("context", context.getContextName());
}
origin: co.cask.wrangler/wrangler-core

@Override
public void initialize(Arguments args) throws DirectiveParseException {
 this.col = ((ColumnName) args.value("column")).value();
 if (args.contains("depth")) {
  this.depth = ((Numeric) args.value("depth")).value().intValue();
 } else {
  this.depth = Integer.MAX_VALUE;
 }
}
origin: co.cask.wrangler/wrangler-core

/**
 * Configures the pipeline based on the directives. It parses the recipe,
 * converting it into executable directives.
 *
 * @param parser Wrangle directives parser.
 */
@Override
public void initialize(RecipeParser parser, ExecutorContext context) throws RecipeException {
 this.context = context;
 try {
  this.directives = parser.parse();
 } catch (DirectiveParseException e) {
  throw new RecipeException(e.getMessage());
 } catch (DirectiveNotFoundException | DirectiveLoadException e) {
  throw new RecipeException(e.getMessage(), e);
 }
}
origin: co.cask.wrangler/wrangler-core

 @Override
 public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException {
  for (Row row : rows) {
   int idx = 0;
   for (Pair<String, Object> v : row.getFields()) {
    if (!keep.contains(v.getFirst())) {
     row.remove(idx);
    } else {
     ++idx;
    }
   }
  }
  return rows;
 }
}
origin: co.cask.wrangler/wrangler-core

/**
 * Given a row, finds the length of the row.
 *
 * @param row length needs to be determined.
 * @return length of the row.
 */
public static int columns(Row row) {
 return row.length();
}
origin: co.cask.wrangler/wrangler-core

@Override
public void initialize(Arguments args) throws DirectiveParseException {
 source = args.value("source");
 if (args.contains("target")) {
  target = args.value("target");
 }
}
origin: co.cask.wrangler/wrangler-core

/**
 * Finds if the row has a column.
 *
 * @param row in which a column needs to be checked.
 * @param column name of the column to be checked.
 * @return true if column is not null and exists, false otherwise.
 */
public static boolean hascolumn(Row row, String column) {
 if (column == null) {
  return false;
 }
 return row.find(column) != -1 ? true : false;
}
origin: co.cask.wrangler/wrangler-core

@Override
public void initialize(Arguments args) throws DirectiveParseException {
 left = ((ColumnName) args.value("left")).value();
 right = ((ColumnName) args.value("right")).value();
}
origin: co.cask.wrangler/wrangler-core

/**
 * Checks if the directive is being excluded from being used.
 *
 * @param directive to be checked for exclusion.
 * @return true if excluded, false otherwise.
 */
@Override
public boolean isExcluded(String directive) {
 return config.isExcluded(directive);
}
origin: co.cask.wrangler/wrangler-core

/**
 * Returns the root directive aliasee
 * @param directive
 * @return
 */
@Override
public String getAlias(String directive) {
 return config.getAliasName(directive);
}
origin: co.cask.wrangler/wrangler-core

/**
 * Returns a <code>RecipeSymbol</code> for the recipe being parsed. This
 * object has all the tokens that were successfully parsed along with source
 * information for each directive in the recipe.
 *
 * @return An compiled object after parsing the recipe.
 */
public RecipeSymbol getCompiledUnit() {
 return builder.build();
}
origin: co.cask.wrangler/wrangler-core

/**
 * Checks if the directive is aliased.
 *
 * @param directive to be checked for aliasing.
 * @return true if the directive has an alias, false otherwise.
 */
@Override
public boolean hasAlias(String directive) {
 return config.hasAlias(directive);
}
origin: co.cask.wrangler/wrangler-core

/**
 * Closes any resources acquired during initialization or otherwise.
 */
@Override
public void close() throws IOException {
 for(int idx = 0; idx < registries.length; ++idx) {
  registries[idx].close();
 }
}
origin: co.cask.wrangler/wrangler-api

/**
 * Static method for creating an instance of the {@code RecipeSymbol.Builder}.
 *
 * @return a instance of builder.
 */
public static RecipeSymbol.Builder builder() {
 return new RecipeSymbol.Builder();
}
origin: co.cask.wrangler/wrangler-core

@Override
public void initialize(Arguments args) throws DirectiveParseException {
 this.column = ((ColumnName) args.value("column")).value();
 if (args.contains("depth")) {
  this.depth = ((Numeric) args.value("depth")).value().intValue();
 } else {
  this.depth = Integer.MAX_VALUE;
 }
}
origin: co.cask.wrangler/wrangler-core

@Override
public void initialize(Arguments args) throws DirectiveParseException {
 this.col = ((ColumnName) args.value("source")).value();
 this.start = ((Numeric) args.value("start")).value().intValue();
 this.end = ((Numeric) args.value("end")).value().intValue();
 this.dest = ((ColumnName) args.value("destination")).value();
 this.start = this.start - 1;
 this.end = this.end - 1;
}
co.cask.wrangler.api

Most used classes

  • Row
    Row defines the schema and data on which the wrangler will operate upon.
  • Directive
    Directive is a user defined directive. DIE - Define, Initialize & Execute - Pattern Following is a s
  • ExecutorContext
    Pipeline Context for passing contextual information to the pipeline being executed.
  • Pair
    A pair consisting of two elements - first & second. This class provides immutable access to elements
  • RecipeParser
    A specification for how RecipePipeline will process.
  • RecipeSymbol,
  • TokenGroup,
  • Categories,
  • Public,
  • PublicEvolving,
  • SyntaxError,
  • Token,
  • TokenDefinition,
  • TokenType,
  • UsageDefinition$Builder,
  • UsageDefinition,
  • Arguments,
  • CompileException,
  • CompileStatus
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