Examples of PlatformInfo


Examples of cascading.flow.planner.PlatformInfo

  private static PlatformInfo getPlatformInfoInternal()
    {
    URL url = JobConf.class.getResource( JobConf.class.getSimpleName() + ".class" );

    if( url == null || !url.toString().startsWith( "jar" ) )
      return new PlatformInfo( "Hadoop", null, null );

    String path = url.toString();
    String manifestPath = path.substring( 0, path.lastIndexOf( "!" ) + 1 ) + "/META-INF/MANIFEST.MF";

    Manifest manifest;

    try
      {
      manifest = new Manifest( new URL( manifestPath ).openStream() );
      }
    catch( IOException exception )
      {
      LOG.warn( "unable to get manifest from {}", manifestPath, exception );

      return new PlatformInfo( "Hadoop", null, null );
      }

    Attributes attributes = manifest.getAttributes( "org/apache/hadoop" );

    if( attributes == null )
      {
      LOG.debug( "unable to get Hadoop manifest attributes" );
      return new PlatformInfo( "Hadoop", null, null );
      }

    String vendor = attributes.getValue( "Implementation-Vendor" );
    String version = attributes.getValue( "Implementation-Version" );

    return new PlatformInfo( "Hadoop", vendor, version );
    }
View Full Code Here

Examples of cascading.flow.planner.PlatformInfo

    }

  @Override
  public PlatformInfo getPlatformInfo()
    {
    return new PlatformInfo( "local", "Concurrent, Inc.", Version.getRelease() );
    }
View Full Code Here

Examples of cascading.flow.planner.PlatformInfo

  @Override
  public String getDatabaseProductName() throws SQLException
    {
    PlatformBroker platformBroker = connection.getPlatformBroker();
    PlatformInfo platformInfo = platformBroker.getPlatformInfo();

    return String.format( "%s [%s %s]",
      Version.getProductName(),
      platformInfo.name,
      platformInfo.vendor
View Full Code Here

Examples of cascading.flow.planner.PlatformInfo

  @Override
  public String getDatabaseProductVersion() throws SQLException
    {
    PlatformBroker platformBroker = connection.getPlatformBroker();
    PlatformInfo platformInfo = platformBroker.getPlatformInfo();

    return String.format( "%s [%s]",
      Version.getProductVersion(),
      platformInfo.version
    );
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

     * @param caseSensitive Whether the comparison is case sensitive
     * @return The model comparator
     */
    protected ModelComparator createModelComparator(boolean caseSensitive)
    {
        PlatformInfo platformInfo = new PlatformInfo();

        platformInfo.setHasSize(Types.DECIMAL, true);
        platformInfo.setHasSize(Types.NUMERIC, true);
        platformInfo.setHasSize(Types.CHAR, true);
        platformInfo.setHasSize(Types.VARCHAR, true);
        return new ModelComparator(platformInfo, caseSensitive);
    }
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

    /**
     * Creates a new Firebird platform instance.
     */
    public FirebirdPlatform()
    {
        PlatformInfo info = getPlatformInfo();

        info.setMaxIdentifierLength(31);
        info.setSystemForeignKeyIndicesAlwaysNonUnique(true);
        info.setCommentPrefix("/*");
        info.setCommentSuffix("*/");

        info.addNativeTypeMapping(Types.ARRAY,         "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BINARY,        "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BIT,           "SMALLINT",           Types.SMALLINT);
        info.addNativeTypeMapping(Types.CLOB,          "BLOB SUB_TYPE TEXT", Types.LONGVARCHAR);
        info.addNativeTypeMapping(Types.DISTINCT,      "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BLOB,          "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.DOUBLE,        "DOUBLE PRECISION");
        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION",   Types.DOUBLE);
        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.LONGVARBINARY, "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.LONGVARCHAR,   "BLOB SUB_TYPE TEXT");
        info.addNativeTypeMapping(Types.NULL,          "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.OTHER,         "BLOB",               Types.LONGVARBINARY);
        // This is back-mapped to REAL in the model reader
        info.addNativeTypeMapping(Types.REAL,          "FLOAT");
        info.addNativeTypeMapping(Types.REF,           "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.STRUCT,        "BLOB",               Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT",           Types.SMALLINT);
        info.addNativeTypeMapping(Types.VARBINARY,     "BLOB",               Types.LONGVARBINARY);
       
        info.addNativeTypeMapping("BOOLEAN""SMALLINT", "SMALLINT");
        info.addNativeTypeMapping("DATALINK", "BLOB",     "LONGVARBINARY");

        info.setDefaultSize(Types.VARCHAR, 254);
        info.setDefaultSize(Types.CHAR,    254);

        setSqlBuilder(new FirebirdBuilder(this));
        setModelReader(new FirebirdModelReader(this));
    }
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

    /**
     * Creates a new platform instance.
     */
    public PostgreSqlPlatform()
    {
        PlatformInfo info = getPlatformInfo();

        // this is the default length though it might be changed when building PostgreSQL
        // in file src/include/postgres_ext.h
        info.setMaxIdentifierLength(31);

        info.addNativeTypeMapping(Types.ARRAY,         "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BINARY,        "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BIT,           "BOOLEAN");
        info.addNativeTypeMapping(Types.BLOB,          "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.CLOB,          "TEXT",             Types.LONGVARCHAR);
        info.addNativeTypeMapping(Types.DECIMAL,       "NUMERIC",          Types.NUMERIC);
        info.addNativeTypeMapping(Types.DISTINCT,      "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.DOUBLE,        "DOUBLE PRECISION");
        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION", Types.DOUBLE);
        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.LONGVARBINARY, "BYTEA");
        info.addNativeTypeMapping(Types.LONGVARCHAR,   "TEXT",             Types.LONGVARCHAR);
        info.addNativeTypeMapping(Types.NULL,          "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.OTHER,         "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.REF,           "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.STRUCT,        "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT",         Types.SMALLINT);
        info.addNativeTypeMapping(Types.VARBINARY,     "BYTEA",            Types.LONGVARBINARY);
        info.addNativeTypeMapping("BOOLEAN""BOOLEAN", "BIT");
        info.addNativeTypeMapping("DATALINK", "BYTEA",   "LONGVARBINARY");

        info.setDefaultSize(Types.CHAR,    254);
        info.setDefaultSize(Types.VARCHAR, 254);

        // no support for specifying the size for these types (because they are mapped
        // to BYTEA which back-maps to BLOB)
        info.setHasSize(Types.BINARY,    false);
        info.setHasSize(Types.VARBINARY, false);

        setSqlBuilder(new PostgreSqlBuilder(this));
        setModelReader(new PostgreSqlModelReader(this));
    }
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

    /**
     * Creates a new instance of the Hsqldb platform.
     */
    public HsqlDbPlatform()
    {
        PlatformInfo info = getPlatformInfo();

        info.setNonPKIdentityColumnsSupported(false);
        info.setIdentityOverrideAllowed(false);
        info.setSystemForeignKeyIndicesAlwaysNonUnique(true);

        info.addNativeTypeMapping(Types.ARRAY,       "LONGVARBINARY", Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.BLOB,        "LONGVARBINARY", Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.CLOB,        "LONGVARCHAR",   Types.LONGVARCHAR);
        info.addNativeTypeMapping(Types.DISTINCT,    "LONGVARBINARY", Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.FLOAT,       "DOUBLE",        Types.DOUBLE);
        info.addNativeTypeMapping(Types.JAVA_OBJECT, "OBJECT");
        info.addNativeTypeMapping(Types.NULL,        "LONGVARBINARY", Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.REF,         "LONGVARBINARY", Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.STRUCT,      "LONGVARBINARY", Types.LONGVARBINARY);
        // JDBC's TINYINT requires a value range of -255 to 255, but HsqlDb's is only -128 to 127
        info.addNativeTypeMapping(Types.TINYINT,     "SMALLINT",      Types.SMALLINT);

        info.addNativeTypeMapping("BIT",      "BOOLEAN",       "BOOLEAN");
        info.addNativeTypeMapping("DATALINK", "LONGVARBINARY", "LONGVARBINARY");

        info.setDefaultSize(Types.CHAR,      Integer.MAX_VALUE);
        info.setDefaultSize(Types.VARCHAR,   Integer.MAX_VALUE);
        info.setDefaultSize(Types.BINARY,    Integer.MAX_VALUE);
        info.setDefaultSize(Types.VARBINARY, Integer.MAX_VALUE);

        setSqlBuilder(new HsqlDbBuilder(this));
        setModelReader(new HsqlDbModelReader(this));
    }
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

    /**
     * Creates a new platform instance.
     */
    public MSSqlPlatform()
    {
        PlatformInfo info = getPlatformInfo();

        info.setMaxIdentifierLength(128);

        info.addNativeTypeMapping(Types.ARRAY,         "IMAGE",         Types.LONGVARBINARY);
        // BIGINT will be mapped back to BIGINT by the model reader
        info.addNativeTypeMapping(Types.BIGINT,        "DECIMAL(19,0)");
        info.addNativeTypeMapping(Types.BLOB,          "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.CLOB,          "TEXT",          Types.LONGVARCHAR);
        info.addNativeTypeMapping(Types.DATE,          "DATETIME",      Types.TIMESTAMP);
        info.addNativeTypeMapping(Types.DISTINCT,      "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.DOUBLE,        "FLOAT",         Types.FLOAT);
        info.addNativeTypeMapping(Types.INTEGER,       "INT");
        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.LONGVARBINARY, "IMAGE");
        info.addNativeTypeMapping(Types.LONGVARCHAR,   "TEXT");
        info.addNativeTypeMapping(Types.NULL,          "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.OTHER,         "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.REF,           "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.STRUCT,        "IMAGE",         Types.LONGVARBINARY);
        info.addNativeTypeMapping(Types.TIME,          "DATETIME",      Types.TIMESTAMP);
        info.addNativeTypeMapping(Types.TIMESTAMP,     "DATETIME");
        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT",      Types.SMALLINT);
        info.addNativeTypeMapping("BOOLEAN""BIT",   "BIT");
        info.addNativeTypeMapping("DATALINK", "IMAGE", "LONGVARBINARY");

        info.setDefaultSize(Types.CHAR,       254);
        info.setDefaultSize(Types.VARCHAR,    254);
        info.setDefaultSize(Types.BINARY,     254);
        info.setDefaultSize(Types.VARBINARY,  254);

        setSqlBuilder(new MSSqlBuilder(this));
        setModelReader(new MSSqlModelReader(this));
    }
View Full Code Here

Examples of org.apache.ddlutils.PlatformInfo

    /**
     * Creates a new platform instance.
     */
    public MckoiPlatform()
    {
        PlatformInfo info = getPlatformInfo();

        info.setIndicesSupported(false);
        info.setIndicesEmbedded(true);
        info.setDefaultValueUsedForIdentitySpec(true);
        info.setAutoCommitModeForLastIdentityValueReading(false);

        info.addNativeTypeMapping(Types.ARRAY,    "BLOB",   Types.BLOB);
        info.addNativeTypeMapping(Types.DISTINCT, "BLOB",   Types.BLOB);
        info.addNativeTypeMapping(Types.FLOAT,    "DOUBLE", Types.DOUBLE);
        info.addNativeTypeMapping(Types.NULL,     "BLOB",   Types.BLOB);
        info.addNativeTypeMapping(Types.OTHER,    "BLOB",   Types.BLOB);
        info.addNativeTypeMapping(Types.REF,      "BLOB",   Types.BLOB);
        info.addNativeTypeMapping(Types.STRUCT,   "BLOB",   Types.BLOB);
        info.addNativeTypeMapping("BIT",      "BOOLEAN", "BOOLEAN");
        info.addNativeTypeMapping("DATALINK", "BLOB",    "BLOB");

        info.setDefaultSize(Types.CHAR,      1024);
        info.setDefaultSize(Types.VARCHAR,   1024);
        info.setDefaultSize(Types.BINARY,    1024);
        info.setDefaultSize(Types.VARBINARY, 1024);
       
        setSqlBuilder(new MckoiBuilder(this));
        setModelReader(new MckoiModelReader(this));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.