Package org.apache.flink.configuration

Examples of org.apache.flink.configuration.Configuration


  public void testReadNoPosFirstN() throws IOException {
    try {
      final String fileContent = "111|222|333|444|555|\n666|777|888|999|000|";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();
     
      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, IntValue.class);
     
      format.configure(parameters);
View Full Code Here


  public void testSparseParse() {
    try {
      final String fileContent = "111|222|333|444|555|666|777|888|999|000|\n000|999|888|777|666|555|444|333|222|111|";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();
     
      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, null, null, IntValue.class, null, null, null, IntValue.class);
     
      format.configure(parameters);
View Full Code Here

  public void testLongLongLong() {
    try {
      final String fileContent = "1,2,3\n3,2,1";
      final FileInputSplit split = createTempFile(fileContent);

      final Configuration parameters = new Configuration();

      format.setFieldDelimiter(',');
      format.setFieldTypesGeneric(LongValue.class, LongValue.class, LongValue.class);
      format.configure(parameters);
      format.open(split);
View Full Code Here

  public void testSparseParseWithIndices() {
    try {
      final String fileContent = "111|222|333|444|555|666|777|888|999|000|\n000|999|888|777|666|555|444|333|222|111|";
      final FileInputSplit split = createTempFile(fileContent);

      final Configuration parameters = new Configuration();

      format.setFieldDelimiter('|');
      format.setFieldsGeneric(new int[] { 0, 3, 7 },
        (Class<? extends Value>[]) new Class[] { IntValue.class, IntValue.class, IntValue.class });
      format.configure(parameters);
View Full Code Here

  public void testReadTooShortInput() throws IOException {
    try {
      final String fileContent = "111|222|333|444\n666|777|888|999";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();
      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, IntValue.class, IntValue.class, IntValue.class, IntValue.class);
     
      format.configure(parameters);
      format.open(split);
View Full Code Here

  public void testReadTooShortInputLenient() throws IOException {
    try {
      final String fileContent = "666|777|888|999|555\n111|222|333|444\n666|777|888|999|555";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();
      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(IntValue.class, IntValue.class, IntValue.class, IntValue.class, IntValue.class);
      format.setLenient(true);
     
      format.configure(parameters);
View Full Code Here

  public void testReadInvalidContents() throws IOException {
    try {
      final String fileContent = "abc|222|def|444\nkkz|777|888|hhg";
      final FileInputSplit split = createTempFile(fileContent);
   
      final Configuration parameters = new Configuration();

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

  public void testReadInvalidContentsLenient() {
    try {
      final String fileContent = "abc|222|def|444\nkkz|777|888|hhg";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();

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

                  "kkz|777|foobar|hhg\n" // wrong data type in field
                  "kkz|777foobarhhg  \n" // too short, a skipped field never ends
                  "xyx|ignored|42|\n";      // another good line
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();

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

  public void readWithEmptyField() {
    try {
      final String fileContent = "abc|def|ghijk\nabc||hhg\n|||";
      final FileInputSplit split = createTempFile(fileContent)
   
      final Configuration parameters = new Configuration();

      format.setFieldDelimiter('|');
      format.setFieldTypesGeneric(StringValue.class, StringValue.class, StringValue.class);
     
      format.configure(parameters);
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.