Package org.apache.flink.configuration

Examples of org.apache.flink.configuration.Configuration


    dataFileWriter.close();
  }
 
  @Test
  public void testDeserialisation() throws IOException {
    Configuration parameters = new Configuration();
   
    AvroInputFormat<User> format = new AvroInputFormat<User>(new Path(testFile.getAbsolutePath()), User.class);
   
    format.configure(parameters);
    FileInputSplit[] splits = format.createInputSplits(1);
View Full Code Here


                  "123|abc|456|def|\n"+
                  "987|xyz|654|pqr|\n";
     
      final FileInputSplit split = createTempFile(fileContent);
   
      final Configuration parameters = new Configuration();

      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, StringValue.class, IntValue.class, StringValue.class);
      format.setSkipFirstLineAsHeader(true);
     
View Full Code Here

                  "colname-1|colname-2|some name 3|column four|\n" // repeated header in the middle
                  "987|xyz|654|pqr|\n";
     
      final FileInputSplit split = createTempFile(fileContent);
   
      final Configuration parameters = new Configuration();

      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, StringValue.class, IntValue.class, StringValue.class);
      format.setSkipFirstLineAsHeader(true);
     
View Full Code Here

  // --------------------------------------------------------------------------------------------

  @Before
  public void setup() {
    this.format.setFilePath(new Path("file:///some/file/that/will/not/be/read"));
    this.config = new Configuration();
  }
View Full Code Here

  @Test
  public void testRead() throws IOException {
    final String myString = "my key|my val$$$my key2\n$$ctd.$$|my value2";
    final FileInputSplit split = createTempFile(myString);
   
    final Configuration parameters = new Configuration();
   
    format.setDelimiter("$$$");
    format.configure(parameters);
    format.open(split);
   
View Full Code Here

  public void testRead2() throws IOException {
    // 2. test case
    final String myString = "my key|my val$$$my key2\n$$ctd.$$|my value2";
    final FileInputSplit split = createTempFile(myString);
   
    final Configuration parameters = new Configuration();
    // default delimiter = '\n'
   
    format.configure(parameters);
    format.open(split);
View Full Code Here

 
  @Test
  public void testNumSamplesOneFile() {
    try {
      final String tempFile = TestFileUtils.createTempFile(TEST_DATA1);
      final Configuration conf = new Configuration();
     
      final TestDelimitedInputFormat format = new TestDelimitedInputFormat();
      format.setFilePath(tempFile.replace("file", "test"));
      format.configure(conf);
     
View Full Code Here

 
  @Test
  public void testNumSamplesMultipleFiles() {
    try {
      final String tempFile = TestFileUtils.createTempFileDir(TEST_DATA1, TEST_DATA1, TEST_DATA1, TEST_DATA1);
      final Configuration conf = new Configuration();
     
      final TestDelimitedInputFormat format = new TestDelimitedInputFormat();
      format.setFilePath(tempFile.replace("file", "test"));
      format.configure(conf);
     
View Full Code Here

 
  @Test
  public void testSamplingOneFile() {
    try {
      final String tempFile = TestFileUtils.createTempFile(TEST_DATA1);
      final Configuration conf = new Configuration();
     
      final TestDelimitedInputFormat format = new TestDelimitedInputFormat();
      format.setFilePath(tempFile);
      format.configure(conf);
      BaseStatistics stats = format.getStatistics(null);
View Full Code Here

 
  @Test
  public void testSamplingDirectory() {
    try {
      final String tempFile = TestFileUtils.createTempFileDir(TEST_DATA1, TEST_DATA2);
      final Configuration conf = new Configuration();
     
      final TestDelimitedInputFormat format = new TestDelimitedInputFormat();
      format.setFilePath(tempFile);
      format.configure(conf);
      BaseStatistics stats = format.getStatistics(null);
View Full Code Here

TOP

Related Classes of org.apache.flink.configuration.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.