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

How to use
ProgramOptions
in
org.apache.flink.client.cli

Best Java code snippets using org.apache.flink.client.cli.ProgramOptions (Showing top 7 results out of 315)

origin: apache/flink

/**
 * Creates a Packaged program from the given command line options.
 *
 * @return A PackagedProgram (upon success)
 */
PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {
  String[] programArgs = options.getProgramArgs();
  String jarFilePath = options.getJarFilePath();
  List<URL> classpaths = options.getClasspaths();
  if (jarFilePath == null) {
    throw new IllegalArgumentException("The program JAR file was not specified.");
  }
  File jarFile = new File(jarFilePath);
  // Check if JAR file exists
  if (!jarFile.exists()) {
    throw new FileNotFoundException("JAR file does not exist: " + jarFile);
  }
  else if (!jarFile.isFile()) {
    throw new FileNotFoundException("JAR file is not a file: " + jarFile);
  }
  // Get assembler class
  String entryPointClass = options.getEntryPointClassName();
  PackagedProgram program = entryPointClass == null ?
      new PackagedProgram(jarFile, classpaths, programArgs) :
      new PackagedProgram(jarFile, classpaths, entryPointClass, programArgs);
  program.setSavepointRestoreSettings(options.getSavepointRestoreSettings());
  return program;
}
origin: com.alibaba.blink/flink-clients

String[] programArgs = options.getProgramArgs();
String jarFilePath = options.getJarFilePath();
List<URL> classpaths = options.getClasspaths();
final List<URI> libjars = options.getLibjars();
final List<URI> files = options.getFiles();
String entryPointClass = options.getEntryPointClassName();
    new PackagedProgram(jarFile, classpaths, entryPointClass, libjars, files, programArgs);
program.setSavepointRestoreSettings(options.getSavepointRestoreSettings());
origin: apache/flink

@Test
public void testNonExistingJarFile() throws Exception {
  ProgramOptions options = mock(ProgramOptions.class);
  when(options.getJarFilePath()).thenReturn("/some/none/existing/path");
  try {
    frontend.buildProgram(options);
    fail("should throw an exception");
  }
  catch (FileNotFoundException e) {
    // that's what we want
  }
}
origin: com.alibaba.blink/flink-clients

libjars = extractMultipleURIOption(LIBJARS_OPTION.getLongOpt(), line);
files = extractMultipleURIOption(FILES_OPTION.getLongOpt(), line);
origin: apache/flink

@Test
public void testFileNotJarFile() throws Exception {
  ProgramOptions options = mock(ProgramOptions.class);
  when(options.getJarFilePath()).thenReturn(getNonJarFilePath());
  try {
    frontend.buildProgram(options);
    fail("should throw an exception");
  }
  catch (ProgramInvocationException e) {
    // that's what we want
  }
}
origin: org.apache.flink/flink-clients_2.11

/**
 * Creates a Packaged program from the given command line options.
 *
 * @return A PackagedProgram (upon success)
 */
PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {
  String[] programArgs = options.getProgramArgs();
  String jarFilePath = options.getJarFilePath();
  List<URL> classpaths = options.getClasspaths();
  if (jarFilePath == null) {
    throw new IllegalArgumentException("The program JAR file was not specified.");
  }
  File jarFile = new File(jarFilePath);
  // Check if JAR file exists
  if (!jarFile.exists()) {
    throw new FileNotFoundException("JAR file does not exist: " + jarFile);
  }
  else if (!jarFile.isFile()) {
    throw new FileNotFoundException("JAR file is not a file: " + jarFile);
  }
  // Get assembler class
  String entryPointClass = options.getEntryPointClassName();
  PackagedProgram program = entryPointClass == null ?
      new PackagedProgram(jarFile, classpaths, programArgs) :
      new PackagedProgram(jarFile, classpaths, entryPointClass, programArgs);
  program.setSavepointRestoreSettings(options.getSavepointRestoreSettings());
  return program;
}
origin: org.apache.flink/flink-clients_2.10

  throws FileNotFoundException, ProgramInvocationException
String[] programArgs = options.getProgramArgs();
String jarFilePath = options.getJarFilePath();
List<URL> classpaths = options.getClasspaths();
String entryPointClass = options.getEntryPointClassName();
    new PackagedProgram(jarFile, classpaths, entryPointClass, programArgs);
program.setSavepointRestoreSettings(options.getSavepointRestoreSettings());
org.apache.flink.client.cliProgramOptions

Javadoc

Base class for command line options that refer to a JAR file program.

Most used methods

  • getJarFilePath
  • getClasspaths
  • getEntryPointClassName
  • getProgramArgs
  • getSavepointRestoreSettings
  • extractMultipleURIOption
  • getFiles
  • getLibjars

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • startActivity (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JTable (javax.swing)
  • Join (org.hibernate.mapping)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 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