Package cascading.lingual.catalog

Examples of cascading.lingual.catalog.SchemaCatalogManager


    getSchemaDefChecked( catalog, schemaName, true );

    LOG.info( "loading ddl from: {}", getOptions().getDDL() );

    SchemaCatalogManager catalogManager = platformBroker.getCatalogManager();

    DDLParser parser = new DDLParser( catalogManager, schemaName, protocolName, formatName );

    try
      {
View Full Code Here


        return asList( schemaName );

      return null;
      }

    SchemaCatalogManager catalogManager = platformBroker.getCatalogManager();

    return asList( catalogManager.createSchemaDefAndTableDefsFor( schemaName, protocol, format, addURI, false ) );
    }
View Full Code Here

    Protocol protocol = Protocol.getProtocol( getOptions().getProtocolName() );
    Format format = Format.getFormat( getOptions().getFormatName() );

    String stereotypeName = getOptions().getStereotypeName();

    SchemaCatalogManager catalogManager = platformBroker.getCatalogManager();

    getSchemaDefChecked( catalogManager.getSchemaCatalog(), getOptions().getSchemaName(), true );

    return asList( catalogManager.createTableDefFor( schemaName, tableName, addURI, stereotypeName, protocol, format ) );
    }
View Full Code Here

    boolean performInit = catalog == null;

    if( catalog == null )
      catalog = getCatalogService().createSchemaCatalog( getDefaultProtocol(), getDefaultFormat() );

    SchemaCatalogManager catalogManager = new SchemaCatalogManager( catalog );

    catalogManager.setPlatformBroker( this );

    if( performInit )
      catalogManager.initializeNew(); // initialize defaults for a new catalog and root schema

    if( !getName().equals( catalog.getPlatformName() ) )
      throw new IllegalStateException( "catalog was initialized for: " + catalog.getPlatformName() + ", current running on platform: " + getName() );

    // schema and tables beyond here are not persisted in the catalog
View Full Code Here

    PlatformBroker platformBroker = getPlatformBroker();

    if( platformBroker == null )
      return super.getRows();

    SchemaCatalogManager catalog = platformBroker.getCatalogManager();

    if( catalog == null )
      return super.getRows();

    TableDef tableDef = getTapTable().getTableDef();

    try
      {
      Tap tap = catalog.createTapFor( tableDef, SinkMode.KEEP );

      if( tap != null )
        {
        if( !tap.resourceExists( platformBroker.getSystemConfig() ) )
          return 0.0;
View Full Code Here

    initCatalog();

    catalog( "--schema", DDL_TEST_SCHEMA, "--add", getSchemaPath( DDL_TEST_SCHEMA ) );

    SchemaCatalog catalog = getSchemaCatalog();
    SchemaCatalogManager schemaCatalogManager = platformBroker.getCatalogManager();

    Protocol defaultProtocol = catalog.getSchemaDef( DDL_TEST_SCHEMA ).findDefaultProtocol();

    DDLParser parser = new DDLParser( schemaCatalogManager, DDL_TEST_SCHEMA, defaultProtocol.toString(), "csv" );
View Full Code Here

  protected void addTable( String schemaName, String tableName, String identifier, Fields fields, String protocolName, String formatName ) throws Exception
    {
    LingualConnection connection = (LingualConnection) getConnection();

    SchemaCatalogManager catalogManager = connection.getPlatformBroker().getCatalogManager();
    SchemaCatalog schemaCatalog = catalogManager.getSchemaCatalog();

    if( !schemaCatalog.schemaExists( schemaName ) )
      schemaCatalog.addSchemaDef( schemaName, Protocol.getProtocol( protocolName ), Format.getFormat( formatName ), null );

    catalogManager.createTableDefFor( schemaName, tableName, identifier, fields, protocolName, formatName );

    catalogManager.addSchemasTo( connection );
    }
View Full Code Here

    Properties properties = platformBroker.getProperties();

    Optiq.writeSQLPlan( properties, Misc.createUniqueName(), getVolcanoPlanner() );

    FlowProcess flowProcess = platformBroker.getFlowProcess();
    SchemaCatalogManager schemaCatalog = platformBroker.getCatalogManager();

    Tap tap = schemaCatalog.createTapFor( getTableDef(), SinkMode.KEEP );
    int size = tap.getSourceFields().size();

    Type[] types = new Type[ size ];

    for( int i = 0; i < size; i++ )
View Full Code Here

    return platformBroker.getCatalogManager().createTempTableDef( head.name );
    }

  private void writeValuesTuple( PlatformBroker platformBroker, Ref head ) throws IOException
    {
    SchemaCatalogManager catalog = platformBroker.getCatalogManager();
    String identifier = getIdentifierFor( platformBroker, head );

    TableDef tableDef = createTableFor( catalog, head, identifier );

    TupleEntryCollector collector = catalog.createTapFor( tableDef, SinkMode.KEEP ).openForWrite( platformBroker.getFlowProcess() );

    for( List<RexLiteral> values : head.tuples )
      collector.add( EnumerableUtil.createTupleFrom( values ) );

    collector.close();
View Full Code Here

    if( jarLoader != null )
      Thread.currentThread().setContextClassLoader( jarLoader );

    FlowProcess flowProcess = platformBroker.getFlowProcess();
    SchemaCatalogManager schemaCatalog = platformBroker.getCatalogManager();
    Map<String, TupleEntryCollector> cache = platformBroker.getCollectorCache();

    TupleEntryCollector collector;

    try
      {
      String identifier = tableDef.getIdentifier();

      if( cache != null && cache.containsKey( identifier ) )
        {
        LOG.debug( "inserting into (cached): {}", identifier );
        collector = cache.get( identifier );
        }
      else
        {
        LOG.debug( "inserting into: {}", identifier );
        collector = schemaCatalog.createTapFor( tableDef, SinkMode.KEEP ).openForWrite( flowProcess );
        }

      if( cache != null )
        cache.put( identifier, collector );
      }
View Full Code Here

TOP

Related Classes of cascading.lingual.catalog.SchemaCatalogManager

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.