Package cascading.tap

Examples of cascading.tap.TapException


  }

  @Override
  public void sinkConfInit(FlowProcess<JobConf> prcs,
      Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf) {
    throw new TapException("cannot use as a sink");
  }
View Full Code Here


  }

  @Override
  public void sink(FlowProcess<JobConf> prcs, SinkCall<Object[], OutputCollector> sc)
      throws IOException {
    throw new TapException("cannot use as a sink");
  }
View Full Code Here

      getScheme().sourceConfInit(process, this, conf);
      makeLocal(conf, getQualifiedPath(conf), "forcing job to local mode, via source: ");
      TupleSerialization.setSerializations(conf);
    } catch (IOException e) {
      throw new TapException(e);
    }
  }
View Full Code Here

  }

  @Override
  public void sinkConfInit(FlowProcess<JobConf> process, JobConf conf) {
    if (_options.attrs != null && _options.attrs.length > 0) {
      throw new TapException("can't declare attributes in a sink");
    }

    super.sinkConfInit(process, conf);
  }
View Full Code Here

        Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf) {
      Pail p;
      try {
        p = new Pail(_pailRoot, conf); //make sure it exists
      } catch (IOException e) {
        throw new TapException(e);
      }
      conf.setInputFormat(p.getFormat().getInputFormatClass());
      PailFormatFactory.setPailPathLister(conf, _options.lister);
    }
View Full Code Here

      conf.setOutputFormat(PailOutputFormat.class);
      Utils.setObject(conf, PailOutputFormat.SPEC_ARG, getSpec());
      try {
        Pail.create(getFileSystem(conf), _pailRoot, getSpec(), true);
      } catch (IOException e) {
        throw new TapException(e);
      }
    }
View Full Code Here

    }

  public void sinkInit( Tap tap, JobConf conf ) throws IOException
    {
    if( selectQuery != null )
      throw new TapException( "cannot sink to this Scheme" );

    String tableName = ( (JDBCTap) tap ).getTableName();
    int batchSize = ( (JDBCTap) tap ).getBatchSize();
    DBOutputFormat.setOutput( conf, DBOutputFormat.class, tableName, columns, updateBy, batchSize );
View Full Code Here

    }

  public TupleEntryCollector openForWrite( JobConf conf ) throws IOException
    {
    if( !isSink() )
      throw new TapException( "this tap may not be used as a sink, no TableDesc defined" );

    return new TapCollector( this, conf );
    }
View Full Code Here

    if( !isSink() )
      return;

    // do not delete if initialized from within a task
    if( isReplace() && conf.get( "mapred.task.partition" ) == null && !deletePath( conf ) )
      throw new TapException( "unable to drop table: " + tableDesc.getTableName() );

    if( !makeDirs( conf ) )
      throw new TapException( "unable to create table: " + tableDesc.getTableName() );

    if( username == null )
      DBConfiguration.configureDB( conf, driverClassName, connectionUrl );
    else
      DBConfiguration.configureDB( conf, driverClassName, connectionUrl, username, password );
View Full Code Here

      return connection;
      }
    catch( ClassNotFoundException exception )
      {
      throw new TapException( "unable to load driver class: " + driverClassName, exception );
      }
    catch( SQLException exception )
      {
      throw new TapException( "unable to open connection: " + connectionUrl, exception );
      }
    }
View Full Code Here

TOP

Related Classes of cascading.tap.TapException

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.